Skip to content

Commit fac6915

Browse files
Merge #1232
1232: Add UI for sorting my crates by recent downloads r=carols10cents This fixes #1231, and renames "Downloads" to "All-Time Downloads" to be consistent with the sort dropdowns on other listings.
2 parents a62c075 + a1eacf4 commit fac6915

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

app/controllers/me/crates.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ export default Controller.extend(PaginationMixin, {
1515
totalItems: readOnly('model.meta.total'),
1616

1717
currentSortBy: computed('sort', function() {
18-
return (this.get('sort') === 'downloads') ? 'Downloads' : 'Alphabetical';
18+
if (this.get('sort') === 'downloads') {
19+
return 'All-Time Downloads';
20+
} else if (this.get('sort') === 'recent-downloads') {
21+
return 'Recent Downloads';
22+
} else {
23+
return 'Alphabetical';
24+
}
1925
}),
2026
});

app/templates/me/crates.hbs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@
3333
</li>
3434
<li>
3535
{{#link-to (query-params sort="downloads")}}
36-
Downloads
36+
All-Time Downloads
37+
{{/link-to}}
38+
</li>
39+
<li>
40+
{{#link-to (query-params sort="recent-downloads")}}
41+
Recent Downloads
3742
{{/link-to}}
3843
</li>
3944
{{/rl-dropdown}}

0 commit comments

Comments
 (0)