FIX: only profile owner can see links to watched/tracked/muted topics (#7083)
This commit is contained in:
parent
883a18547e
commit
bb5119b88f
|
@ -20,12 +20,12 @@ export default Ember.Controller.extend(PreferencesTabController, {
|
||||||
return [].concat(watched, watchedFirst, tracked, muted).filter(t => t);
|
return [].concat(watched, watchedFirst, tracked, muted).filter(t => t);
|
||||||
},
|
},
|
||||||
|
|
||||||
canSave: function() {
|
@computed
|
||||||
return (
|
canSee() {
|
||||||
this.get("currentUser.id") === this.get("model.id") ||
|
return this.get("currentUser.id") === this.get("model.id");
|
||||||
this.get("currentUser.admin")
|
},
|
||||||
);
|
|
||||||
}.property(),
|
canSave: Ember.computed.or("canSee", "currentUser.admin"),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
save() {
|
save() {
|
||||||
|
|
|
@ -6,18 +6,22 @@
|
||||||
{{category-selector categories=model.watchedCategories blacklist=selectedCategories}}
|
{{category-selector categories=model.watchedCategories blacklist=selectedCategories}}
|
||||||
</div>
|
</div>
|
||||||
<div class="instructions">{{i18n 'user.watched_categories_instructions'}}</div>
|
<div class="instructions">{{i18n 'user.watched_categories_instructions'}}</div>
|
||||||
|
{{#if canSee}}
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<a href="{{unbound model.watchingTopicsPath}}">{{i18n 'user.watched_topics_link'}}</a>
|
<a href="{{unbound model.watchingTopicsPath}}">{{i18n 'user.watched_topics_link'}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div class="controls category-controls">
|
<div class="controls category-controls">
|
||||||
<label>{{d-icon "d-tracking"}} {{i18n 'user.tracked_categories'}}</label>
|
<label>{{d-icon "d-tracking"}} {{i18n 'user.tracked_categories'}}</label>
|
||||||
{{category-selector categories=model.trackedCategories blacklist=selectedCategories}}
|
{{category-selector categories=model.trackedCategories blacklist=selectedCategories}}
|
||||||
</div>
|
</div>
|
||||||
<div class="instructions">{{i18n 'user.tracked_categories_instructions'}}</div>
|
<div class="instructions">{{i18n 'user.tracked_categories_instructions'}}</div>
|
||||||
|
{{#if canSee}}
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<a href="{{unbound model.trackingTopicsPath}}">{{i18n 'user.tracked_topics_link'}}</a>
|
<a href="{{unbound model.trackingTopicsPath}}">{{i18n 'user.tracked_topics_link'}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div class="controls category-controls">
|
<div class="controls category-controls">
|
||||||
<label>{{d-icon "d-watching-first"}} {{i18n 'user.watched_first_post_categories'}}</label>
|
<label>{{d-icon "d-watching-first"}} {{i18n 'user.watched_first_post_categories'}}</label>
|
||||||
|
@ -30,10 +34,11 @@
|
||||||
{{category-selector categories=model.mutedCategories blacklist=selectedCategories}}
|
{{category-selector categories=model.mutedCategories blacklist=selectedCategories}}
|
||||||
</div>
|
</div>
|
||||||
<div class="instructions">{{i18n 'user.muted_categories_instructions'}}</div>
|
<div class="instructions">{{i18n 'user.muted_categories_instructions'}}</div>
|
||||||
|
{{#if canSee}}
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<a href="{{unbound model.mutedTopicsPath}}">{{i18n 'user.muted_topics_link'}}</a>
|
<a href="{{unbound model.mutedTopicsPath}}">{{i18n 'user.muted_topics_link'}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{plugin-outlet name="user-preferences-categories" args=(hash model=model save=(action "save"))}}
|
{{plugin-outlet name="user-preferences-categories" args=(hash model=model save=(action "save"))}}
|
||||||
|
|
Loading…
Reference in New Issue