almost fixed the regression of not allowing top level filters
This commit is contained in:
parent
84fd366322
commit
fc3c93d237
|
@ -18,7 +18,7 @@ Discourse.NavItem = Discourse.Model.extend({
|
|||
// href from this item
|
||||
href: function() {
|
||||
var name = this.get('name'),
|
||||
href = Discourse.getURL("/") + name;
|
||||
href = Discourse.getURL("/") + name.replace(' ', '-');
|
||||
if (name === 'category') href += "/" + this.get('categoryName');
|
||||
return href;
|
||||
}.property('name')
|
||||
|
|
|
@ -25,7 +25,7 @@ Discourse.NavItemView = Discourse.View.extend({
|
|||
}).property("content.filter"),
|
||||
|
||||
isActive: (function() {
|
||||
if (this.get("content.name") === this.get("controller.filterMode")) return "active";
|
||||
if (this.get("content.name").replace(' ','-') === this.get("controller.filterMode")) return "active";
|
||||
return "";
|
||||
}).property("content.name", "controller.filterMode"),
|
||||
|
||||
|
@ -42,7 +42,7 @@ Discourse.NavItemView = Discourse.View.extend({
|
|||
};
|
||||
if (categoryName) {
|
||||
name = 'category';
|
||||
extra.categoryName = categoryName.capitalize();
|
||||
extra.categoryName = categoryName.titleize();
|
||||
}
|
||||
return I18n.t("js.filters." + name + ".title", extra);
|
||||
}).property('count'),
|
||||
|
|
|
@ -216,11 +216,13 @@ class SiteSetting < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.homepage
|
||||
top_menu.split('|')[0]
|
||||
# TODO objectify this
|
||||
x = top_menu.split('|')[0].split(',')[0]
|
||||
end
|
||||
|
||||
def self.anonymous_homepage
|
||||
top_menu.split('|').select{ |f| ['latest', 'hot', 'categories', 'category'].include? f }[0]
|
||||
# TODO objectify this
|
||||
top_menu.split('|').map{|f| f.split(',')[0] }.select{ |f| ['latest', 'hot', 'categories', 'category'].include? f}[0]
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue