Chanka_Dod
Hi Folks
I found discourse solved plugin quite useful in my forum. Then I tried to add an Unsolved button to top menu. Since it was not straight forward I adopted this solution and altered it a bit.
Check out my changed code
<script>
Discourse.ExternalNavItem = Discourse.NavItem.extend({
href : function() {
return this.get('href');
}.property('href')
});
I18n.translations.en.js.filters.unresolved = { title: "Unresolved", help: "Unresolved Topics" };
Discourse.NavItem.reopenClass({
buildList : function(category, args) {
var list = this._super(category, args);
if(!category) {
list.push(Discourse.ExternalNavItem.create({href: '/latest?solved=no', name: 'unresolved'}));
} else {
list.push(Discourse.ExternalNavItem.create({href: '/c/'+category.slug+'?solved=no', name: 'unresolved'}));
}
return list;
}
});
</script>
I am a newbie here; I hope this will be useful to ppl like me.
Cheers