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 from this item
|
||||||
href: function() {
|
href: function() {
|
||||||
var name = this.get('name'),
|
var name = this.get('name'),
|
||||||
href = Discourse.getURL("/") + name;
|
href = Discourse.getURL("/") + name.replace(' ', '-');
|
||||||
if (name === 'category') href += "/" + this.get('categoryName');
|
if (name === 'category') href += "/" + this.get('categoryName');
|
||||||
return href;
|
return href;
|
||||||
}.property('name')
|
}.property('name')
|
||||||
|
|
|
@ -25,7 +25,7 @@ Discourse.NavItemView = Discourse.View.extend({
|
||||||
}).property("content.filter"),
|
}).property("content.filter"),
|
||||||
|
|
||||||
isActive: (function() {
|
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 "";
|
return "";
|
||||||
}).property("content.name", "controller.filterMode"),
|
}).property("content.name", "controller.filterMode"),
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ Discourse.NavItemView = Discourse.View.extend({
|
||||||
};
|
};
|
||||||
if (categoryName) {
|
if (categoryName) {
|
||||||
name = 'category';
|
name = 'category';
|
||||||
extra.categoryName = categoryName.capitalize();
|
extra.categoryName = categoryName.titleize();
|
||||||
}
|
}
|
||||||
return I18n.t("js.filters." + name + ".title", extra);
|
return I18n.t("js.filters." + name + ".title", extra);
|
||||||
}).property('count'),
|
}).property('count'),
|
||||||
|
|
|
@ -216,11 +216,13 @@ class SiteSetting < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.homepage
|
def self.homepage
|
||||||
top_menu.split('|')[0]
|
# TODO objectify this
|
||||||
|
x = top_menu.split('|')[0].split(',')[0]
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.anonymous_homepage
|
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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue