mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 00:58:33 +08:00
Small code tidy up for user/activity menu
This commit is contained in:
parent
8cd0026cde
commit
54db283e31
|
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user