mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 07:23:40 +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({
|
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user