Skip to content

Commit

Permalink
Added filter for owned games.
Browse files Browse the repository at this point in the history
Fixed curator build status image.
  • Loading branch information
Bilge committed Jun 30, 2024
1 parent 869fd38 commit 64f543d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions assets/css/250.less
Original file line number Diff line number Diff line change
Expand Up @@ -505,13 +505,13 @@ span.filtered {

background: #1b2838;

>legend + * {
>legend + p {
margin: 0 auto .8em;
}
}
}
.ranking > .filter > form.open {
max-height: 210px;
max-height: 300px;
}
.ranking label {
white-space: nowrap;
Expand Down
7 changes: 6 additions & 1 deletion assets/js/Filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ new class {

private filterApps() {
const ranks = document.querySelectorAll('#body .ranking > div[id]'),
checkedChecks = this.checks.filter(check => check.checked);
platformChecks = this.checks.filter(check => this.form.querySelector('fieldset')!.contains(check)),
checkedChecks = platformChecks.filter(check => check.checked);

let kept = 0;

Expand All @@ -53,6 +54,10 @@ new class {
ranks.forEach(rank => {
let keep = checkedChecks.some(check => !!rank.querySelector('.platforms > .' + check.name));

if (this.form['owned'].checked) {
keep &&= !rank.querySelector('a.owned');
}

rank.classList.toggle('filtered', !keep);

if (keep) {
Expand Down
7 changes: 7 additions & 0 deletions template/layout/ranking.twig
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@
{{ include('@components/checkbox.twig', {caption_on: 'Linux', name: 'nix'}) }}
{{ include('@components/checkbox.twig', {caption_on: 'Steam Deck', name: 'deck'}) }}
</fieldset>
<fieldset>
<legend>Owned games</legend>
Show {{ include(
'@components/checkbox.twig',
{negative: 1, checked: 0, caption_on: 'Hide', name: 'owned'})
}}
</fieldset>
<button class="button ok">OK</button>
<button class="button cancel">Cancel</button>
<button class="button reset" type="reset">Reset</button>
Expand Down
2 changes: 1 addition & 1 deletion template/layout/template.twig
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
</a>
<td>
<a href="https://github.com/250/Steam-curator/actions/workflows/Curator%20sync.yml">
<img src="https://github.com/250/Steam-curator/workflows/Sync/badge.svg"
<img src="https://github.com/250/Steam-curator/actions/workflows/Curator%20sync.yml/badge.svg"
alt="Curator sync status">
</a>
</table>
Expand Down

0 comments on commit 64f543d

Please sign in to comment.