+
+ {{#if category}}
+ {{discourse-breadcrumbs category=category categories=categories}}
+ {{/if}}
+
{{each availableNavItems itemViewClass="Discourse.NavItemView"}}
diff --git a/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars b/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars
index 81d25ea5e7a..a1f65f4cfe8 100644
--- a/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars
@@ -41,9 +41,11 @@
{{/if}}
+{{#unless controller.category}}
{{categoryLink category}}
|
+{{/unless}}
{{#each posters}}
diff --git a/app/assets/javascripts/discourse/templates/list/topics.js.handlebars b/app/assets/javascripts/discourse/templates/list/topics.js.handlebars
index c5d8ad3faf8..9753fda8580 100644
--- a/app/assets/javascripts/discourse/templates/list/topics.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/list/topics.js.handlebars
@@ -10,10 +10,6 @@
{{/if}}
- {{#if category}}
- {{discourse-breadcrumbs title=Discourse.SiteSettings.title category=category categories=categories}}
- {{/if}}
-
@@ -23,7 +19,9 @@
{{i18n topic.title}}
|
+ {{#unless category}}
{{i18n category_title}} |
+ {{/unless}}
{{i18n top_contributors}} |
{{i18n posts}} |
{{i18n likes}} |
diff --git a/app/assets/javascripts/discourse/templates/list/wide_categories.js.handlebars b/app/assets/javascripts/discourse/templates/list/wide_categories.js.handlebars
index 444d63133ec..d76e8549591 100644
--- a/app/assets/javascripts/discourse/templates/list/wide_categories.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/list/wide_categories.js.handlebars
@@ -22,10 +22,10 @@
{{/if}}
{{categoryLink this allowUncategorized=true}}
{{#if unreadTopics}}
- {{unbound unreadTopics}}
+ {{unbound unreadTopics}}
{{/if}}
{{#if newTopics}}
- {{unbound newTopics}}
+ {{unbound newTopics}}
{{/if}}
{{#each featured_users}}
diff --git a/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars b/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars
index e8bb4fd1522..55e43efad11 100644
--- a/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars
@@ -21,6 +21,11 @@
{{textField value=name placeholderKey="category.name_placeholder" maxlength="50"}}
+
+
+ {{categoryChooser valueAttribute="id" value=parent_category_id categories=parentCategories}}
+
+
{{#unless isUncategorized}}
diff --git a/app/assets/javascripts/discourse/templates/popup_input_tip.js.handlebars b/app/assets/javascripts/discourse/templates/popup_input_tip.js.handlebars
index 8fa9bc38f55..763b7b99f98 100644
--- a/app/assets/javascripts/discourse/templates/popup_input_tip.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/popup_input_tip.js.handlebars
@@ -1,2 +1,2 @@
-
+
{{view.validation.reason}}
\ No newline at end of file
diff --git a/app/assets/javascripts/discourse/templates/static.js.handlebars b/app/assets/javascripts/discourse/templates/static.js.handlebars
index 5e32255134b..37f0750b6fa 100644
--- a/app/assets/javascripts/discourse/templates/static.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/static.js.handlebars
@@ -2,6 +2,10 @@
{{#if content}}
{{{content}}}
+
+ {{#if showLoginButton}}
+
+ {{/if}}
{{else}}
{{i18n loading}}
{{/if}}
diff --git a/app/assets/javascripts/discourse/templates/user/user.js.handlebars b/app/assets/javascripts/discourse/templates/user/user.js.handlebars
index e4bc1ded5a9..bcbbaf307ff 100644
--- a/app/assets/javascripts/discourse/templates/user/user.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/user/user.js.handlebars
@@ -73,7 +73,7 @@
{{#if can_send_private_message_to_user}}
-
diff --git a/app/assets/javascripts/discourse/views/category_chooser_view.js b/app/assets/javascripts/discourse/views/category_chooser_view.js
index c7448842620..005ff0c642a 100644
--- a/app/assets/javascripts/discourse/views/category_chooser_view.js
+++ b/app/assets/javascripts/discourse/views/category_chooser_view.js
@@ -12,14 +12,16 @@ Discourse.CategoryChooserView = Discourse.ComboboxView.extend({
dataAttributes: ['name', 'color', 'text_color', 'description_text', 'topic_count'],
valueBinding: Ember.Binding.oneWay('source'),
+ content: Em.computed.filter('categories', function(c) {
+ var uncategorized_id = Discourse.Site.currentProp("uncategorized_category_id");
+ return c.get('permission') === Discourse.PermissionType.FULL && c.get('id') !== uncategorized_id;
+ }),
+
init: function() {
this._super();
- // TODO perhaps allow passing a param in to select if we need full or not
-
- var uncategorized_id = Discourse.Site.currentProp("uncategorized_category_id");
- this.set('content', _.filter(Discourse.Category.list(), function(c){
- return c.permission === Discourse.PermissionType.FULL && c.id !== uncategorized_id;
- }));
+ if (!this.get('categories')) {
+ this.set('categories', Discourse.Category.list());
+ }
},
none: function() {
diff --git a/app/assets/javascripts/discourse/views/modal/modal_body_view.js b/app/assets/javascripts/discourse/views/modal/modal_body_view.js
index 77b8b6dfa6c..bfaceb5c586 100644
--- a/app/assets/javascripts/discourse/views/modal/modal_body_view.js
+++ b/app/assets/javascripts/discourse/views/modal/modal_body_view.js
@@ -27,12 +27,6 @@ Discourse.ModalBodyView = Discourse.View.extend({
}
},
- // Pass the errors to our errors view
- displayErrors: function(errors, callback) {
- this.set('parentView.parentView.modalErrorsView.errors', errors);
- if (typeof callback === "function") callback();
- },
-
flashMessageChanged: function() {
var flashMessage = this.get('controller.flashMessage');
if (flashMessage) {
diff --git a/app/assets/javascripts/discourse/views/nav_item_view.js b/app/assets/javascripts/discourse/views/nav_item_view.js
index e0c73c383d7..065219acd09 100644
--- a/app/assets/javascripts/discourse/views/nav_item_view.js
+++ b/app/assets/javascripts/discourse/views/nav_item_view.js
@@ -14,7 +14,7 @@ Discourse.NavItemView = Discourse.View.extend({
hidden: Em.computed.not('content.visible'),
count: Ember.computed.alias('content.count'),
shouldRerender: Discourse.View.renderIfChanged('count'),
- active: Discourse.computed.propertyEqual('contentNameSlug', 'controller.filterMode'),
+ active: Discourse.computed.propertyEqual('content.filterMode', 'controller.filterMode'),
title: function() {
var categoryName, extra, name;
@@ -27,13 +27,6 @@ Discourse.NavItemView = Discourse.View.extend({
return I18n.t("filters." + name + ".help", extra);
}.property("content.filter"),
- contentNameSlug: function() {
- return this.get("content.name").toLowerCase().replace(' ','-');
- }.property('content.name'),
-
- // active: function() {
- // return (this.get("contentNameSlug") === this.get("controller.filterMode"));
- // }.property("contentNameSlug", "controller.filterMode"),
name: function() {
var categoryName, extra, name;
diff --git a/app/assets/javascripts/discourse/views/popup_input_tip_view.js b/app/assets/javascripts/discourse/views/popup_input_tip_view.js
index a1a7ad1c216..c17467a9383 100644
--- a/app/assets/javascripts/discourse/views/popup_input_tip_view.js
+++ b/app/assets/javascripts/discourse/views/popup_input_tip_view.js
@@ -17,6 +17,10 @@ Discourse.PopupInputTipView = Discourse.View.extend({
bouncePixels: 6,
bounceDelay: 100,
+ click: function(e) {
+ this.set('shownAt', false);
+ },
+
good: function() {
return !this.get('validation.failed');
}.property('validation'),
@@ -25,10 +29,6 @@ Discourse.PopupInputTipView = Discourse.View.extend({
return this.get('validation.failed');
}.property('validation'),
- hide: function() {
- this.set('shownAt', false);
- },
-
bounce: function() {
if( this.get('shownAt') ) {
var $elem = this.$();
diff --git a/app/assets/javascripts/discourse/views/quote_button_view.js b/app/assets/javascripts/discourse/views/quote_button_view.js
index e85f5ac7d10..9c6d02949dc 100644
--- a/app/assets/javascripts/discourse/views/quote_button_view.js
+++ b/app/assets/javascripts/discourse/views/quote_button_view.js
@@ -46,7 +46,8 @@ Discourse.QuoteButtonView = Discourse.View.extend({
$(document)
.on("mousedown.quote-button", function(e) {
view.set('isMouseDown', true);
- if ($(e.target).hasClass('quote-button') || $(e.target).hasClass('create')) return;
+ // we don't want to deselect when we click on the quote button or the reply button
+ if ($(e.target).hasClass('quote-button') || $(e.target).closest('.create').length > 0) return;
// deselects only when the user left click
// (allows anyone to `extend` their selection using shift+click)
if (e.which === 1 && !e.shiftKey) controller.deselectText();
diff --git a/app/assets/javascripts/discourse/views/topic_view.js b/app/assets/javascripts/discourse/views/topic_view.js
index 0a39045b5d4..2d4f8e88a71 100644
--- a/app/assets/javascripts/discourse/views/topic_view.js
+++ b/app/assets/javascripts/discourse/views/topic_view.js
@@ -330,7 +330,7 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
var category = this.get('controller.content.category');
if (category) {
- opts.catLink = Discourse.Utilities.categoryLink(category);
+ opts.catLink = Discourse.HTML.categoryLink(category);
} else {
opts.catLink = " " + (I18n.t("topic.browse_all_categories")) + "";
}
diff --git a/app/assets/javascripts/main_include.js b/app/assets/javascripts/main_include.js
index 6b93ef4e6c3..5d02310384a 100644
--- a/app/assets/javascripts/main_include.js
+++ b/app/assets/javascripts/main_include.js
@@ -43,11 +43,11 @@
// Stuff we need to load first
//= require ./discourse/mixins/scrolling
//= require_tree ./discourse/mixins
-//= require ./discourse/components/markdown
-//= require ./discourse/components/computed
+//= require ./discourse/lib/markdown
+//= require ./discourse/lib/computed
//= require ./discourse/views/view
//= require ./discourse/views/container_view
-//= require ./discourse/components/debounce
+//= require ./discourse/lib/debounce
//= require ./discourse/models/model
//= require ./discourse/models/user_action
//= require ./discourse/models/composer
@@ -63,9 +63,10 @@
//= require ./discourse/dialects/dialect
//= require_tree ./discourse/dialects
//= require_tree ./discourse/controllers
-//= require_tree ./discourse/components
+//= require_tree ./discourse/lib
//= require_tree ./discourse/models
//= require_tree ./discourse/views
+//= require_tree ./discourse/components
//= require_tree ./discourse/helpers
//= require_tree ./discourse/templates
//= require_tree ./discourse/routes
diff --git a/app/assets/stylesheets/common/admin/admin_base.scss b/app/assets/stylesheets/common/admin/admin_base.scss
index 01e1c933da9..19c86a13e14 100644
--- a/app/assets/stylesheets/common/admin/admin_base.scss
+++ b/app/assets/stylesheets/common/admin/admin_base.scss
@@ -752,6 +752,14 @@ table.api-keys {
}
}
+.screened-ip-address-form {
+ margin-left: 6px;
+ .combobox {
+ width: 130px;
+ top: 10px;
+ }
+}
+
.screened-emails, .screened-urls {
.ip_address {
width: 110px;
diff --git a/app/assets/stylesheets/common/components/badges.css.scss b/app/assets/stylesheets/common/components/badges.css.scss
index afd2d4df3fc..6a84b3eead3 100644
--- a/app/assets/stylesheets/common/components/badges.css.scss
+++ b/app/assets/stylesheets/common/components/badges.css.scss
@@ -30,6 +30,7 @@
}
}
+
// Notification badge
// --------------------------------------------------
diff --git a/app/assets/stylesheets/desktop/input_tip.scss b/app/assets/stylesheets/common/input_tip.scss
similarity index 79%
rename from app/assets/stylesheets/desktop/input_tip.scss
rename to app/assets/stylesheets/common/input_tip.scss
index e87ff9d49a7..41389bd60aa 100644
--- a/app/assets/stylesheets/desktop/input_tip.scss
+++ b/app/assets/stylesheets/common/input_tip.scss
@@ -1,5 +1,5 @@
-@import "common/foundation/variables";
-@import "common/foundation/mixins";
+@import "foundation/variables";
+@import "foundation/mixins";
.popup-tip {
position: absolute;
@@ -16,14 +16,15 @@
&.hide, &.good {
display: none;
}
- a.close {
+ .close {
float: right;
color: $black;
opacity: 0.5;
font-size: 15px;
margin-left: 4px;
+ cursor: pointer;
}
- a.close:hover {
+ .close:hover {
opacity: 1.0;
}
}
\ No newline at end of file
diff --git a/app/assets/stylesheets/desktop/.gitkeep b/app/assets/stylesheets/desktop/.gitkeep
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/app/assets/stylesheets/desktop/modal.scss b/app/assets/stylesheets/desktop/modal.scss
index a4999ad6034..03faf9ca6f8 100644
--- a/app/assets/stylesheets/desktop/modal.scss
+++ b/app/assets/stylesheets/desktop/modal.scss
@@ -164,6 +164,19 @@
border-bottom: 1px solid #bbb;
}
+
+ .category-combobox {
+ width: 430px;
+
+ .chzn-drop {
+ left: -9000px;
+ width: 428px;
+ }
+ .chzn-search input {
+ width: 378px;
+ }
+ }
+
&.hidden {
display: none;
}
diff --git a/app/assets/stylesheets/desktop/topic-list.scss b/app/assets/stylesheets/desktop/topic-list.scss
index cb2ff8dd3fd..fe69a38318a 100644
--- a/app/assets/stylesheets/desktop/topic-list.scss
+++ b/app/assets/stylesheets/desktop/topic-list.scss
@@ -8,7 +8,7 @@
// List controls
// --------------------------------------------------
-#list-controls {
+.list-controls {
.nav {
float: left;
margin-bottom: 15px;
@@ -340,52 +340,102 @@
// Misc. stuff
// --------------------------------------------------
-#main {
- #list-controls {
- .badge-category {
- display: inline-block;
- background-color: yellow;
- margin: 8px 0 0 8px;
- float: left;
- }
- clear: both;
+.list-controls {
+ .home {
+ font-size: 20px;
+ font-weight: normal;
}
- #list-area {
- margin-bottom: 300px;
+
+ .badge-category {
+ padding: 4px 10px;
+ display: inline-block;
+ line-height: 24px;
+ float: left;
+ }
+ .category-dropdown-button {
+ padding: 4px 10px 3px 8px;
+ border-left: 1px solid rgba(0, 0, 0, 0.15);
+ font-size: 16px;
+ width: 10px;
+ text-align: center;
+
+ &:hover {
+ opacity: 0.8;
+ }
+ }
+ clear: both;
+}
+#list-area {
+ margin-bottom: 300px;
.topic-statuses .topic-status i {font-size: 15px;}
-
-
- .empty-topic-list {
- padding: 10px;
- }
- .unseen {
- background-color: transparent;
- padding: 0;
- border: 0;
- color: lighten($red, 10%);
- font-size: 13px;
- cursor: default;
- }
+ .empty-topic-list {
+ padding: 10px;
}
- #topic-list {
- .alert {
- margin-bottom: 0;
- font-size: 14px;
- }
- .spinner {
- margin-top: 40px;
- }
- }
- span.posted {
- display: inline-block;
- text-indent: -9999em;
- width: 15px;
- height: 15px;
- background: {
- image: image-url("posted.png");
- };
+ .unseen {
+ background-color: transparent;
+ padding: 0;
+ border: 0;
+ color: lighten($red, 10%);
+ font-size: 13px;
+ cursor: default;
}
}
+#topic-list {
+ .alert {
+ margin-bottom: 0;
+ font-size: 14px;
+ }
+ .spinner {
+ margin-top: 40px;
+ }
+}
+span.posted {
+ display: inline-block;
+ text-indent: -9999em;
+ width: 15px;
+ height: 15px;
+ background: {
+ image: image-url("posted.png");
+ };
+}
+
+ol.category-breadcrumb {
+ display: block;
+ float: left;
+ list-style: none;
+ margin: 0 10px 0 0;
+ padding: 0;
+
+ li {
+ float: left;
+ margin-right: 5px;
+ }
+}
+
+.category-dropdown-menu {
+ overflow-x: hidden;
+ overflow-y: scroll;
+ position: absolute;
+ border: 1px solid #ccc;
+ background-color: white;
+ width: 200px;
+ height: 200px;
+ padding: 8px 5px 0 7px;
+ z-index: 100;
+ margin-top: 31px;
+
+ .badge-category {
+ font-size: 13px;
+ line-height: 26px;
+ padding: 0px 8px;
+ float: none;
+ }
+
+ div {
+ margin-bottom: 10px;
+ }
+}
+
diff --git a/app/assets/stylesheets/desktop/topic.scss b/app/assets/stylesheets/desktop/topic.scss
index 3f156d29161..72579c75f85 100644
--- a/app/assets/stylesheets/desktop/topic.scss
+++ b/app/assets/stylesheets/desktop/topic.scss
@@ -198,45 +198,4 @@ i {background: #e4f2f8;
z-index: 495
}
-ol.category-breadcrumb {
- list-style: none;
- margin: 0 0 10px 0;
- padding: 0;
- .first-caret {
- margin: 0 3px 0 3px;
- color: #666;
- font-size: 13px;
- }
-
- li {
- float: left;
- margin-right: 5px;
- border: 1px solid transparent;
- height: 21px;
- padding-top: 2px;
-
- button {
- background: none;
- border: 1px solid transparent;
- padding: 0px 4px;
- margin: 0;
- color: #666;
- }
-
- &.has-drop:hover {
- background-color: #eee;
- border: 1px solid #bbb;
-
- button {
- color: black;
- }
- }
- }
-
- .clear {
- clear: both;
- }
-
-
-}
diff --git a/app/assets/stylesheets/desktop/user.scss b/app/assets/stylesheets/desktop/user.scss
index 73e2c993d00..505f543edc6 100644
--- a/app/assets/stylesheets/desktop/user.scss
+++ b/app/assets/stylesheets/desktop/user.scss
@@ -205,9 +205,47 @@
background-color: #ddd;
margin-top: 10px;
padding: 5px;
+ height: 32px;
.right {
float: right;
+ margin-left: 5px;
+ }
+ }
+ }
+
+ .about.collapsed-info {
+ .controls {
+ margin-top: 0;
+ }
+
+ .details {
+ .secondary { display: none; }
+ .bio { display: none; }
+
+ .primary {
+ width: 100%;
+ text-align: left;
+ margin-top: 0;
+
+ .avatar {
+ float: left;
+ margin-right: 10px;
+ border: 2px solid white;
+ width: 45px;
+ height: 45px;
+ }
+
+ h1 {
+ font-size: 20px;
+ line-height: 22px;
+ }
+
+ h2 {
+ font-size: 17px;
+ line-height: 20px;
+ margin-top: 4px;
+ }
}
}
}
diff --git a/app/assets/stylesheets/mobile/.gitkeep b/app/assets/stylesheets/mobile/.gitkeep
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/app/assets/stylesheets/mobile/compose.scss b/app/assets/stylesheets/mobile/compose.scss
index 2da6d56ca30..f57a0ac0c3e 100644
--- a/app/assets/stylesheets/mobile/compose.scss
+++ b/app/assets/stylesheets/mobile/compose.scss
@@ -279,14 +279,15 @@ display: none;
display: inline;
}
.title-input .popup-tip {
- width: 300px;
- left: -8px;
- margin-top: 8px;
+ width: 240px;
+ right: 5px;
}
.category-input .popup-tip {
width: 240px;
- left: 432px;
- top: -7px;
+ right: 5px;
+ }
+ .textarea-wrapper .popup-tip {
+ top: 28px;
}
button.btn.no-text {
margin: 7px 0 0 5px;
diff --git a/app/assets/stylesheets/mobile/faqs.scss b/app/assets/stylesheets/mobile/faqs.scss
index 2d03411239a..87b508a68d9 100644
--- a/app/assets/stylesheets/mobile/faqs.scss
+++ b/app/assets/stylesheets/mobile/faqs.scss
@@ -14,6 +14,7 @@
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 22px;
+ margin: 20px 15px;
// Consistent vertical spacing
blockquote,
diff --git a/app/assets/stylesheets/mobile/input_tip.scss b/app/assets/stylesheets/mobile/input_tip.scss
deleted file mode 100644
index a1eae29b6f8..00000000000
--- a/app/assets/stylesheets/mobile/input_tip.scss
+++ /dev/null
@@ -1,29 +0,0 @@
-@import "../common/foundation/variables";
-@import "../common/foundation/mixins";
-
-.popup-tip {
- position: absolute;
- display: block;
- padding: 5px 10px;
- z-index: 101;
- @include border-radius-all(2px);
- border: solid 1px #955;
- &.bad {
- background-color: #b66;
- color: white;
- box-shadow: 1px 1px 5px #777, inset 0 0 9px #b55;
- }
- &.hide, &.good {
- display: none;
- }
- a.close {
- float: right;
- color: $black;
- opacity: 0.5;
- font-size: 15px;
- margin-left: 4px;
- }
- a.close:hover {
- opacity: 1.0;
- }
-}
\ No newline at end of file
diff --git a/app/assets/stylesheets/mobile/topic-list.scss b/app/assets/stylesheets/mobile/topic-list.scss
index 85bd40d1f3d..591499c24bc 100644
--- a/app/assets/stylesheets/mobile/topic-list.scss
+++ b/app/assets/stylesheets/mobile/topic-list.scss
@@ -8,7 +8,7 @@
// List controls
// --------------------------------------------------
-#list-controls {
+.list-controls {
margin: 5px;
.nav {
float: left;
@@ -239,48 +239,64 @@
// Misc. stuff
// --------------------------------------------------
-#main {
- #list-controls {
- .badge-category {
- display: inline-block;
- background-color: yellow;
- margin: 8px 0 0 8px;
- float: left;
- }
- clear: both;
+.list-controls {
+ .home {
+ font-size: 20px;
+ font-weight: normal;
}
- #list-area {
- margin-bottom: 300px;
- .empty-topic-list {
- padding: 10px;
- }
- .unseen {
- background-color: transparent;
- padding: 0;
- border: 0;
- color: lighten($red, 10%);
- font-size: 13px;
- cursor: default;
- }
- }
- #topic-list {
- .alert {
- margin-bottom: 0;
- font-size: 14px;
- }
- .spinner {
- margin-top: 40px;
- }
- }
- span.posted {
+
+ .badge-category {
+ margin-top: 6px;
+ padding: 4px 10px;
display: inline-block;
- text-indent: -9999em;
- width: 15px;
- height: 15px;
- background: {
- image: image-url("posted.png");
- };
+ line-height: 24px;
+ float: left;
}
+ .category-dropdown-button {
+ padding: 4px 10px 3px 8px;
+ border-left: 1px solid rgba(0, 0, 0, 0.15);
+ font-size: 16px;
+ width: 10px;
+ text-align: center;
+
+ &:hover {
+ opacity: 0.8;
+ }
+ }
+ clear: both;
+}
+
+#list-area {
+ margin-bottom: 300px;
+ .empty-topic-list {
+ padding: 10px;
+ }
+ .unseen {
+ background-color: transparent;
+ padding: 0;
+ border: 0;
+ color: lighten($red, 10%);
+ font-size: 13px;
+ cursor: default;
+ }
+}
+#topic-list {
+ .alert {
+ margin-bottom: 0;
+ font-size: 14px;
+ }
+ .spinner {
+ margin-top: 40px;
+ }
+}
+span.posted {
+ display: inline-block;
+ text-indent: -9999em;
+ width: 15px;
+ height: 15px;
+ background: {
+ image: image-url("posted.png");
+ };
}
@@ -364,3 +380,40 @@ clear: both;
opacity: 1;
}
+ol.category-breadcrumb {
+ display: block;
+ float: left;
+ list-style: none;
+ margin: 0 10px 0 0;
+ padding: 0;
+
+ li {
+ float: left;
+ margin-right: 5px;
+ }
+}
+
+.category-dropdown-menu {
+ overflow-x: hidden;
+ overflow-y: scroll;
+ position: absolute;
+ border: 1px solid #ccc;
+ background-color: white;
+ width: 200px;
+ height: 200px;
+ padding: 8px 5px 0 7px;
+ z-index: 100;
+ margin-top: 31px;
+
+ .badge-category {
+ font-size: 13px;
+ line-height: 26px;
+ padding: 0px 8px;
+ float: none;
+ }
+
+ div {
+ margin-bottom: 10px;
+ }
+}
+
diff --git a/app/controllers/admin/screened_ip_addresses_controller.rb b/app/controllers/admin/screened_ip_addresses_controller.rb
index 974cf4c727d..00b5acb27ff 100644
--- a/app/controllers/admin/screened_ip_addresses_controller.rb
+++ b/app/controllers/admin/screened_ip_addresses_controller.rb
@@ -7,6 +7,15 @@ class Admin::ScreenedIpAddressesController < Admin::AdminController
render_serialized(screened_ip_addresses, ScreenedIpAddressSerializer)
end
+ def create
+ screened_ip_address = ScreenedIpAddress.new(allowed_params)
+ if screened_ip_address.save
+ render_serialized(screened_ip_address, ScreenedIpAddressSerializer)
+ else
+ render_json_error(screened_ip_address)
+ end
+ end
+
def update
if @screened_ip_address.update_attributes(allowed_params)
render json: success_json
diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb
index 5110dc6d57b..6b0853a09b1 100644
--- a/app/controllers/categories_controller.rb
+++ b/app/controllers/categories_controller.rb
@@ -90,7 +90,7 @@ class CategoriesController < ApplicationController
end
end
- params.permit(*required_param_keys, :position, :hotness, :auto_close_days, :permissions => [*p.try(:keys)])
+ params.permit(*required_param_keys, :position, :hotness, :parent_category_id, :auto_close_days, :permissions => [*p.try(:keys)])
end
end
diff --git a/app/controllers/session_controller.rb b/app/controllers/session_controller.rb
index 908eba5013c..1badedee94c 100644
--- a/app/controllers/session_controller.rb
+++ b/app/controllers/session_controller.rb
@@ -10,14 +10,11 @@ class SessionController < ApplicationController
params.require(:login)
params.require(:password)
- login = params[:login].strip
- login = login[1..-1] if login[0] == "@"
+ login = params[:login].strip
+ password = params[:password]
+ login = login[1..-1] if login[0] == "@"
- if login =~ /@/
- @user = User.where(email: Email.downcase(login)).first
- else
- @user = User.where(username_lower: login.downcase).first
- end
+ @user = User.find_by_username_or_email(login)
if @user.present?
@@ -28,7 +25,7 @@ class SessionController < ApplicationController
end
# If their password is correct
- if @user.confirm_password?(params[:password])
+ if @user.confirm_password?(password)
if @user.is_banned?
render json: { error: I18n.t("login.banned", {date: I18n.l(@user.banned_till, format: :date_only)}) }
@@ -57,7 +54,7 @@ class SessionController < ApplicationController
def forgot_password
params.require(:login)
- user = User.where('username_lower = :username or email = :email', username: params[:login].downcase, email: Email.downcase(params[:login])).first
+ user = User.find_by_username_or_email(params[:login])
if user.present?
email_token = user.email_tokens.create(email: user.email)
Jobs.enqueue(:user_email, type: :forgot_password, user_id: user.id, email_token: email_token.token)
diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb
index 3a682334e05..acff18a4365 100644
--- a/app/controllers/topics_controller.rb
+++ b/app/controllers/topics_controller.rb
@@ -29,8 +29,9 @@ class TopicsController < ApplicationController
return wordpress if params[:best].present?
opts = params.slice(:username_filters, :filter, :page, :post_number)
+ username_filters = opts[:username_filters]
- opts[:username_filters] = [opts[:username_filters]] if opts[:username_filters].is_a?(String)
+ opts[:username_filters] = [username_filters] if username_filters.is_a?(String)
begin
@topic_view = TopicView.new(params[:id] || params[:topic_id], current_user, opts)
@@ -46,7 +47,7 @@ class TopicsController < ApplicationController
# render workaround pseudo-static HTML page for old crawlers which ignores |