Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions _data/trusted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file lists the trusted mods, which have been manually reviewed
# If you're a reviewer and you want to add one, simply add an entry under the relevant collection,
# where the key is the mod's filename *without extension*, and the value is the date you reviewed
# it, in YYYY-MM-DD format (don't worry about timezones).

oak_mods:
# Empty for now

oak2_mods:
# Empty for now

willow1_mods:
# Empty for now

willow2_mods:
# Empty for now

23 changes: 15 additions & 8 deletions _includes/components/nav/links.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
{%- comment -%}
This is copied from the standard links.html, as of version 0.12.0.

We change it for the game selector, for each mod, we add "game-xyz" classes to its list item.
We change it for the game selector, for each mod, we add "game-xyz" classes to its list item,
and if it's not a trusted mod we add "untrusted" and hide it.
{%- endcomment -%}

<ul class="nav-list">
{%- for node in include.pages -%}
{%- if include.all == true or node.nav_exclude != true -%}

{%- assign extra_classes = "" | split: "" -%}
{%- if site.game_selector.collection and node.collection == site.game_selector.collection -%}
{%- assign game_select_classes = "game-any" -%}
{%- assign extra_classes = extra_classes | push: "game-any" -%}
{%- include filter_games.html page=node -%}
{%- for game in filtered_games -%}
{%- assign game_class = " game-" | append: game | downcase -%}
{%- assign game_select_classes = game_select_classes | append: game_class -%}
{%- assign game_class = "game-" | append: game | downcase -%}
{%- assign extra_classes = extra_classes | push: game_class -%}
{%- endfor -%}
{%- else -%}
{%- assign game_select_classes = "" -%}
{%- endif -%}
{%- assign untrusted_hidden = "" -%}
{%- if site.data.trusted[node.collection] -%}
{%- unless site.data.trusted[node.collection][node.slug] -%}
{%- assign extra_classes = extra_classes | push: "untrusted" -%}
{%- assign untrusted_hidden = "hidden" -%}
{%- endunless -%}
{%- endif -%}

{%- if include.ancestors contains node.title -%}

<li class="nav-list-item {{ game_select_classes }}">
<li class="nav-list-item {{ extra_classes | join: " " }}" {{ untrusted_hidden }}>
<a href="{{ node.url | relative_url }}" class="nav-list-link"> ∞ </a>
</li>
{%- capture nav_error_report -%}
Expand All @@ -36,7 +43,7 @@

{%- include components/nav/children.html node=node ancestors=include.ancestors all=include.all -%}

<li class="nav-list-item {{ game_select_classes }}">
<li class="nav-list-item {{ extra_classes | join: " " }}" {{ untrusted_hidden }}>
{%- if nav_children.size >= 1 -%}
<button class="nav-list-expander btn-reset" aria-label="{{ node.title }} submenu" aria-expanded="false">
<svg viewBox="0 0 24 24" aria-hidden="true"><use xlink:href="#svg-arrow-right"></use></svg>
Expand Down
19 changes: 13 additions & 6 deletions _includes/nav_game_selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@
Creates the game selector combo box.
{%- endcomment -%}
{%- if site.game_selector.collection -%}
<div class="nav-game-selector">
<select onchange=" {{-''-}}
h=(t,v)=>document.querySelectorAll(t).forEach(x=>x.hidden=v); {{-''-}}
h('.game-any',1); {{-''-}}
h(event.target.value,0); {{-''-}}
">
<div class="nav-mod-filter">
<select id="nav-game-select" onchange="nav_mod_filter()">
<option selected value=".game-any">All Games</option>
{%- for game in site.game_selector.games -%}
<option value=".game-{{ game | downcase }}">{{ game }}</option>
{%- endfor -%}
</select>
<input id="nav-trusted-check"type="checkbox" checked onchange="nav_mod_filter()"/>
{%- comment -%}(strip whitespace){%- endcomment -%}
<label for="nav-trusted-check">Only Show Trusted</label>
<script>
function nav_mod_filter(){ {{-""-}}
const i=x=>document.getElementById(x); {{-""-}}
const h=(t,v)=>document.querySelectorAll(t).forEach(x=>x.hidden=v); {{-""-}}
h('.game-any',1); {{-""-}}
h(i`nav-game-select`.value+(i`nav-trusted-check`.checked?":not(.untrusted)":""),0); {{-""-}}
} {{-""-}}
</script>
</div>
{%- endif -%}
8 changes: 8 additions & 0 deletions _layouts/mod.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ <h1 id="title">{{ page.title }}</h1>
{%- endif -%}
</dd>

{%- assign trusted = site.data.trusted[page.collection][page.slug] -%}
{%- if trusted -%}
<dt>Last Review</dt>
<dd>
{{- trusted | date: "%Y-%m-%d" -}}
</dd>
{%- endif -%}

{%- assign dependencies = page.dependencies | default: page.pyproject.project.dependencies -%}
{%- if dependencies.size > 0 -%}
<dt class="requirement">Requires</dt>
Expand Down
46 changes: 39 additions & 7 deletions _sass/custom/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ div.video-16-9 {

dl.mod-desc {
// Make the description list header shorter
grid-template-columns: 5em 1fr;
grid-template-columns: 6em 1fr;

// Make coop support expand into a description on hover
dd.coop {
Expand Down Expand Up @@ -107,19 +107,51 @@ span.mod-update-notification {
}
}

// Make the game selector have the same sort of padding as other nav items
div.nav-game-selector {
div.nav-mod-filter {
// Make the filter have the same sort of padding as other nav items
padding: $sp-2 $nav-list-item-height-sm $sp-1 $gutter-spacing-sm;
@include fs-5;

@include mq(md) {
padding-right: $nav-list-item-height;
padding-left: $gutter-spacing;
@include fs-3;
}

>select {
// And make the actual box full width
// Make the game selector box full width
width: 100%;

// And mess with its font size
@include fs-5;
@include mq(md) {
@include fs-3;
}
}

// Add some padding to the trusted checkbox. This is not quite the same as other items.
>input[type=checkbox] {
min-height: 0;
margin-top: $sp-2;

&+label {
padding-left: $sp-2;

// Also mess with its font size, but a little differently
@include fs-4;
@include mq(md) {
@include fs-3;
}
}
}

}

// Grey out untrusted mods a little
.nav-list .nav-list-item.untrusted .nav-list-link {
& {
color: darken($link-color, 15%);
}
&:hover, &.active {
// Normal hover is 5% darker already
color: darken($link-color, 20%);
}
}

Loading