Skip to content

Commit 851a73f

Browse files
bors-voyager[bot]moore3071carols10cents
committed
Merge #1264
1264: Recently updated sort r=carols10cents a=moore3071 Allow sorting by which crates were most recently updated as mentioned in #1210. The option is called 'recent-updates' in order to match the naming convention of 'recent-downloads' Co-authored-by: Brandon Moore <[email protected]> Co-authored-by: Carol (Nichols || Goulding) <[email protected]>
2 parents 448b044 + 3891810 commit 851a73f

File tree

17 files changed

+182
-7
lines changed

17 files changed

+182
-7
lines changed

app/controllers/category/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export default Controller.extend(PaginationMixin, {
1919
return 'All-Time Downloads';
2020
} else if (this.sort === 'alpha') {
2121
return 'Alphabetical';
22+
} else if (this.get('sort') === 'recent-updates') {
23+
return 'Recent Updates';
2224
} else {
2325
return 'Recent Downloads';
2426
}

app/controllers/crates.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export default Controller.extend(PaginationMixin, {
1919
return 'All-Time Downloads';
2020
} else if (this.sort === 'recent-downloads') {
2121
return 'Recent Downloads';
22+
} else if (this.get('sort') === 'recent-updates') {
23+
return 'Recent Updates';
2224
} else {
2325
return 'Alphabetical';
2426
}

app/controllers/keyword/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export default Controller.extend(PaginationMixin, {
1717
return 'All-Time Downloads';
1818
} else if (this.sort === 'alpha') {
1919
return 'Alphabetical';
20+
} else if (this.get('sort') === 'recent-updates') {
21+
return 'Recent Updates';
2022
} else {
2123
return 'Recent Downloads';
2224
}

app/controllers/me/crates.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export default Controller.extend(PaginationMixin, {
1919
return 'All-Time Downloads';
2020
} else if (this.sort === 'recent-downloads') {
2121
return 'Recent Downloads';
22+
} else if (this.get('sort') === 'recent-updates') {
23+
return 'Recent Updates';
2224
} else {
2325
return 'Alphabetical';
2426
}

app/controllers/search.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ export default Controller.extend(PaginationMixin, {
3131
return 'All-Time Downloads';
3232
} else if (this.sort === 'recent-downloads') {
3333
return 'Recent Downloads';
34+
} else if (this.get('sort') === 'recent-updates') {
35+
return 'Recent Updates';
3436
} else {
3537
return 'Relevance';
3638
}

app/controllers/team.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export default Controller.extend(PaginationMixin, {
1717
return 'All-Time Downloads';
1818
} else if (this.sort === 'recent-downloads') {
1919
return 'Recent Downloads';
20+
} else if (this.get('sort') === 'recent-updates') {
21+
return 'Recent Updates';
2022
} else {
2123
return 'Alphabetical';
2224
}

app/controllers/user.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export default Controller.extend(PaginationMixin, {
1818
return 'All-Time Downloads';
1919
} else if (this.sort === 'recent-downloads') {
2020
return 'Recent Downloads';
21+
} else if (this.get('sort') === 'recent-updates') {
22+
return 'Recent Updates';
2123
} else {
2224
return 'Alphabetical';
2325
}

app/templates/category/index.hbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@
6969
Recent Downloads
7070
{{/link-to}}
7171
</li>
72+
<li>
73+
{{#link-to (query-params sort="recent-updates")}}
74+
Recent Updates
75+
{{/link-to}}
76+
</li>
7277
{{/rl-dropdown}}
7378
{{/rl-dropdown-container}}
7479
</div>

app/templates/crates.hbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
Recent Downloads
6161
{{/link-to}}
6262
</li>
63+
<li>
64+
{{#link-to (query-params page=1 sort="recent-updates")}}
65+
Recent Updates
66+
{{/link-to}}
67+
</li>
6368
{{/rl-dropdown}}
6469
{{/rl-dropdown-container}}
6570
</div>

app/templates/keyword/index.hbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
Recent Downloads
4141
{{/link-to}}
4242
</li>
43+
<li>
44+
{{#link-to (query-params sort="recent-updates")}}
45+
Recent Updates
46+
{{/link-to}}
47+
</li>
4348
{{/rl-dropdown}}
4449
{{/rl-dropdown-container}}
4550
</div>

0 commit comments

Comments
 (0)