From c0ef6ca01c2f3528008e947246a1037d2d6a6291 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 7 Feb 2018 11:35:00 -0500 Subject: [PATCH] UX: Show the footer on the user summary and preferences pages --- app/assets/javascripts/discourse/routes/discourse.js.es6 | 8 ++++++++ .../javascripts/discourse/routes/preferences-about.js.es6 | 2 ++ .../discourse/routes/preferences-account.js.es6 | 2 ++ .../discourse/routes/preferences-badge-title.js.es6 | 2 ++ .../discourse/routes/preferences-card-badge.js.es6 | 2 ++ .../discourse/routes/preferences-categories.js.es6 | 5 +++++ .../javascripts/discourse/routes/preferences-email.js.es6 | 2 ++ .../javascripts/discourse/routes/preferences-index.js.es6 | 2 ++ .../discourse/routes/preferences-interface.js.es6 | 2 ++ .../discourse/routes/preferences-notifications.js.es6 | 5 +++++ .../discourse/routes/preferences-username.js.es6 | 2 ++ .../javascripts/discourse/routes/preferences.js.es6 | 1 + .../javascripts/discourse/routes/user-summary.js.es6 | 2 ++ 13 files changed, 37 insertions(+) create mode 100644 app/assets/javascripts/discourse/routes/preferences-categories.js.es6 create mode 100644 app/assets/javascripts/discourse/routes/preferences-notifications.js.es6 diff --git a/app/assets/javascripts/discourse/routes/discourse.js.es6 b/app/assets/javascripts/discourse/routes/discourse.js.es6 index 8b3d3bbc310..169d50cd948 100644 --- a/app/assets/javascripts/discourse/routes/discourse.js.es6 +++ b/app/assets/javascripts/discourse/routes/discourse.js.es6 @@ -1,11 +1,19 @@ import Composer from 'discourse/models/composer'; const DiscourseRoute = Ember.Route.extend({ + showFooter: false, // Set to true to refresh a model without a transition if a query param // changes resfreshQueryWithoutTransition: false, + activate() { + this._super(); + if (this.get('showFooter')) { + this.controllerFor('application').set('showFooter', true); + } + }, + refresh() { if (!this.refreshQueryWithoutTransition) { return this._super(); } diff --git a/app/assets/javascripts/discourse/routes/preferences-about.js.es6 b/app/assets/javascripts/discourse/routes/preferences-about.js.es6 index 12e819af59a..e5c86f6fdb4 100644 --- a/app/assets/javascripts/discourse/routes/preferences-about.js.es6 +++ b/app/assets/javascripts/discourse/routes/preferences-about.js.es6 @@ -1,6 +1,8 @@ import RestrictedUserRoute from "discourse/routes/restricted-user"; export default RestrictedUserRoute.extend({ + showFooter: true, + model: function() { return this.modelFor('user'); }, diff --git a/app/assets/javascripts/discourse/routes/preferences-account.js.es6 b/app/assets/javascripts/discourse/routes/preferences-account.js.es6 index 2c34c9df2f0..bde67c6ce9d 100644 --- a/app/assets/javascripts/discourse/routes/preferences-account.js.es6 +++ b/app/assets/javascripts/discourse/routes/preferences-account.js.es6 @@ -1,6 +1,8 @@ import RestrictedUserRoute from "discourse/routes/restricted-user"; export default RestrictedUserRoute.extend({ + showFooter: true, + setupController(controller, user) { controller.reset(); controller.setProperties({ diff --git a/app/assets/javascripts/discourse/routes/preferences-badge-title.js.es6 b/app/assets/javascripts/discourse/routes/preferences-badge-title.js.es6 index 4491aff2543..358159f452e 100644 --- a/app/assets/javascripts/discourse/routes/preferences-badge-title.js.es6 +++ b/app/assets/javascripts/discourse/routes/preferences-badge-title.js.es6 @@ -2,6 +2,8 @@ import UserBadge from 'discourse/models/user-badge'; import RestrictedUserRoute from "discourse/routes/restricted-user"; export default RestrictedUserRoute.extend({ + showFooter: true, + model: function() { return UserBadge.findByUsername(this.modelFor('user').get('username')); }, diff --git a/app/assets/javascripts/discourse/routes/preferences-card-badge.js.es6 b/app/assets/javascripts/discourse/routes/preferences-card-badge.js.es6 index 8ec81a95d1c..b8acd6d729a 100644 --- a/app/assets/javascripts/discourse/routes/preferences-card-badge.js.es6 +++ b/app/assets/javascripts/discourse/routes/preferences-card-badge.js.es6 @@ -2,6 +2,8 @@ import UserBadge from 'discourse/models/user-badge'; import RestrictedUserRoute from "discourse/routes/restricted-user"; export default RestrictedUserRoute.extend({ + showFooter: true, + model: function() { return UserBadge.findByUsername(this.modelFor('user').get('username')); }, diff --git a/app/assets/javascripts/discourse/routes/preferences-categories.js.es6 b/app/assets/javascripts/discourse/routes/preferences-categories.js.es6 new file mode 100644 index 00000000000..713d79e4207 --- /dev/null +++ b/app/assets/javascripts/discourse/routes/preferences-categories.js.es6 @@ -0,0 +1,5 @@ +import RestrictedUserRoute from "discourse/routes/restricted-user"; + +export default RestrictedUserRoute.extend({ + showFooter: true +}); diff --git a/app/assets/javascripts/discourse/routes/preferences-email.js.es6 b/app/assets/javascripts/discourse/routes/preferences-email.js.es6 index b9c02c3a850..77e80e75764 100644 --- a/app/assets/javascripts/discourse/routes/preferences-email.js.es6 +++ b/app/assets/javascripts/discourse/routes/preferences-email.js.es6 @@ -1,6 +1,8 @@ import RestrictedUserRoute from "discourse/routes/restricted-user"; export default RestrictedUserRoute.extend({ + showFooter: true, + model: function() { return this.modelFor('user'); }, diff --git a/app/assets/javascripts/discourse/routes/preferences-index.js.es6 b/app/assets/javascripts/discourse/routes/preferences-index.js.es6 index 3006f4b8533..49964f42cc2 100644 --- a/app/assets/javascripts/discourse/routes/preferences-index.js.es6 +++ b/app/assets/javascripts/discourse/routes/preferences-index.js.es6 @@ -1,6 +1,8 @@ import RestrictedUserRoute from "discourse/routes/restricted-user"; export default RestrictedUserRoute.extend({ + showFooter: true, + redirect() { this.transitionTo('preferences.account'); } diff --git a/app/assets/javascripts/discourse/routes/preferences-interface.js.es6 b/app/assets/javascripts/discourse/routes/preferences-interface.js.es6 index f58658956fc..729e79dedd9 100644 --- a/app/assets/javascripts/discourse/routes/preferences-interface.js.es6 +++ b/app/assets/javascripts/discourse/routes/preferences-interface.js.es6 @@ -1,6 +1,8 @@ import RestrictedUserRoute from "discourse/routes/restricted-user"; export default RestrictedUserRoute.extend({ + showFooter: true, + setupController(controller, user) { controller.setProperties({ model: user diff --git a/app/assets/javascripts/discourse/routes/preferences-notifications.js.es6 b/app/assets/javascripts/discourse/routes/preferences-notifications.js.es6 new file mode 100644 index 00000000000..713d79e4207 --- /dev/null +++ b/app/assets/javascripts/discourse/routes/preferences-notifications.js.es6 @@ -0,0 +1,5 @@ +import RestrictedUserRoute from "discourse/routes/restricted-user"; + +export default RestrictedUserRoute.extend({ + showFooter: true +}); diff --git a/app/assets/javascripts/discourse/routes/preferences-username.js.es6 b/app/assets/javascripts/discourse/routes/preferences-username.js.es6 index 09fbc0ec6b0..6737345bcd0 100644 --- a/app/assets/javascripts/discourse/routes/preferences-username.js.es6 +++ b/app/assets/javascripts/discourse/routes/preferences-username.js.es6 @@ -1,6 +1,8 @@ import RestrictedUserRoute from "discourse/routes/restricted-user"; export default RestrictedUserRoute.extend({ + showFooter: true, + model: function() { return this.modelFor('user'); }, diff --git a/app/assets/javascripts/discourse/routes/preferences.js.es6 b/app/assets/javascripts/discourse/routes/preferences.js.es6 index e1cc50fc5cc..1eb3d4b3e17 100644 --- a/app/assets/javascripts/discourse/routes/preferences.js.es6 +++ b/app/assets/javascripts/discourse/routes/preferences.js.es6 @@ -3,6 +3,7 @@ import showModal from 'discourse/lib/show-modal'; import { popupAjaxError } from 'discourse/lib/ajax-error'; export default RestrictedUserRoute.extend({ + model() { return this.modelFor('user'); }, diff --git a/app/assets/javascripts/discourse/routes/user-summary.js.es6 b/app/assets/javascripts/discourse/routes/user-summary.js.es6 index a191c418722..39d4571973d 100644 --- a/app/assets/javascripts/discourse/routes/user-summary.js.es6 +++ b/app/assets/javascripts/discourse/routes/user-summary.js.es6 @@ -1,4 +1,6 @@ export default Discourse.Route.extend({ + showFooter: true, + model() { return this.modelFor("user").summary(); },