mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
FIX: non-admin users were not able to see invite tabs
This commit is contained in:
parent
bbf9ca2e14
commit
e5e0071cb7
2 changed files with 35 additions and 0 deletions
22
app/assets/javascripts/discourse/components/nav-item.js.es6
Normal file
22
app/assets/javascripts/discourse/components/nav-item.js.es6
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
export default Ember.Component.extend({
|
||||||
|
tagName: 'li',
|
||||||
|
classNameBindings: ['active'],
|
||||||
|
|
||||||
|
router: function() {
|
||||||
|
return this.container.lookup('router:main');
|
||||||
|
}.property(),
|
||||||
|
|
||||||
|
fullPath: function() {
|
||||||
|
return Discourse.getURL(this.get('path'));
|
||||||
|
}.property('path'),
|
||||||
|
|
||||||
|
active: function() {
|
||||||
|
const route = this.get('route');
|
||||||
|
if (!route) { return; }
|
||||||
|
|
||||||
|
const routeParam = this.get('routeParam'),
|
||||||
|
router = this.get('router');
|
||||||
|
|
||||||
|
return routeParam ? router.isActive(route, routeParam) : router.isActive(route);
|
||||||
|
}.property('router.url', 'route')
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
{{#if routeParam}}
|
||||||
|
{{#link-to route routeParam}}{{i18n label}}{{/link-to}}
|
||||||
|
{{else}}
|
||||||
|
{{#if route}}
|
||||||
|
{{#link-to route}}{{i18n label}}{{/link-to}}
|
||||||
|
{{else}}
|
||||||
|
{{#if path}}
|
||||||
|
<a href="{{unbound fullPath}}" data-auto-route="true">{{i18n label}}</a>
|
||||||
|
{{else}}
|
||||||
|
<a href="{{unbound href}}" data-auto-route="true">{{i18n label}}</a>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
Loading…
Reference in a new issue