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({ export default Ember.Controller.extend({
application: Ember.inject.controller(), application: Ember.inject.controller(),
user: Ember.inject.controller(), user: Ember.inject.controller(),
userActionType: null, userActionType: null,
currentPath: Ember.computed.alias('application.currentPath'),
viewingSelf: Ember.computed.alias("user.viewingSelf"), canDownloadPosts: Ember.computed.alias('user.viewingSelf'),
showBookmarks: Ember.computed.alias("user.showBookmarks"),
_showFooter: function() { _showFooter: function() {
var showFooter; var showFooter;
@ -26,11 +24,7 @@ export default Ember.Controller.extend({
I18n.t("user.download_archive.confirm"), I18n.t("user.download_archive.confirm"),
I18n.t("no_value"), I18n.t("no_value"),
I18n.t("yes_value"), I18n.t("yes_value"),
function(confirmed) { confirmed => confirmed ? exportUserArchive() : null
if (confirmed) {
exportUserArchive();
}
}
); );
} }
} }

View File

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