From 546bbd83f93c6b76f5a7efffa9b3766cb49e9c1a Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 13 Jan 2018 18:42:08 -0500 Subject: [PATCH 1/2] Add UI for sorting my crates by recent downloads This fixes #1231, and renames "Downloads" to "All-Time Downloads" to be consistent with the sort dropdowns on other listings. --- app/templates/me/crates.hbs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/templates/me/crates.hbs b/app/templates/me/crates.hbs index 141c12afa69..494e56eef54 100644 --- a/app/templates/me/crates.hbs +++ b/app/templates/me/crates.hbs @@ -33,7 +33,12 @@
  • {{#link-to (query-params sort="downloads")}} - Downloads + All-Time Downloads + {{/link-to}} +
  • +
  • + {{#link-to (query-params sort="recent-downloads")}} + Recent Downloads {{/link-to}}
  • {{/rl-dropdown}} From a1eacf4db52840396713822c185ea4e42c107b7a Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 14 Jan 2018 14:36:37 -0500 Subject: [PATCH 2/2] Ensure active sorting is correctly identified --- app/controllers/me/crates.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/me/crates.js b/app/controllers/me/crates.js index 50d33ee0845..7c3c8e2ac3c 100644 --- a/app/controllers/me/crates.js +++ b/app/controllers/me/crates.js @@ -15,6 +15,12 @@ export default Controller.extend(PaginationMixin, { totalItems: readOnly('model.meta.total'), currentSortBy: computed('sort', function() { - return (this.get('sort') === 'downloads') ? 'Downloads' : 'Alphabetical'; + if (this.get('sort') === 'downloads') { + return 'All-Time Downloads'; + } else if (this.get('sort') === 'recent-downloads') { + return 'Recent Downloads'; + } else { + return 'Alphabetical'; + } }), });