Small code tidy up for user/activity menu

This commit is contained in:
Robin Ward 2017-11-16 11:49:14 -05:00
parent 8cd0026cde
commit 54db283e31
2 changed files with 6 additions and 12 deletions

View File

@ -3,11 +3,9 @@ import { exportUserArchive } from 'discourse/lib/export-csv';
export default Ember.Controller.extend({
application: Ember.inject.controller(),
user: Ember.inject.controller(),
userActionType: null,
currentPath: Ember.computed.alias('application.currentPath'),
viewingSelf: Ember.computed.alias("user.viewingSelf"),
showBookmarks: Ember.computed.alias("user.showBookmarks"),
canDownloadPosts: Ember.computed.alias('user.viewingSelf'),
_showFooter: function() {
var showFooter;
@ -26,11 +24,7 @@ export default Ember.Controller.extend({
I18n.t("user.download_archive.confirm"),
I18n.t("no_value"),
I18n.t("yes_value"),
function(confirmed) {
if (confirmed) {
exportUserArchive();
}
}
confirmed => confirmed ? exportUserArchive() : null
);
}
}

View File

@ -1,5 +1,5 @@
{{#d-section pageClass="user-activity" class="user-navigation" scrollTop="false"}}
{{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=currentPath}}
{{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=application.currentPath}}
<li>
{{#link-to 'userActivity.index'}}{{i18n 'user.filters.all'}}{{/link-to}}
</li>
@ -12,7 +12,7 @@
<li>
{{#link-to 'userActivity.likesGiven'}}{{i18n 'user_action_groups.1'}}{{/link-to}}
</li>
{{#if showBookmarks}}
{{#if user.showBookmarks}}
<li>
{{#link-to 'userActivity.bookmarks'}}{{i18n 'user_action_groups.3'}}{{/link-to}}
</li>
@ -22,7 +22,7 @@
args=(hash model=model)}}
{{/mobile-nav}}
{{#if viewingSelf}}
{{#if canDownloadPosts}}
<div class='user-archive'>
{{d-button action="exportUserArchive" label="user.download_archive.button_text" icon="download"}}
</div>