Skip to content

Commit

Permalink
Show all teams button
Browse files Browse the repository at this point in the history
  • Loading branch information
captn3m0 committed May 13, 2024
1 parent d4a5c07 commit 94b3f71
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
5 changes: 4 additions & 1 deletion _data/aliases.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ siddy-s-fanclub,siddy-s-fan-club
siddy-s-fan-club-no-more,siddy-s-fan-club
siddy-s-fan-club-returns,siddy-s-fan-club
siddy-s-fan-club-again,siddy-s-fan-club
siddy-s-fan-club-4eva,siddy-s-fan-club
siddy-s-fan-club-4eva,siddy-s-fan-club
the-bong-bros,bong-bros
wellfed-workers,well-fed-workers
snakeoil-salespeople,snake-oil-sales-people
2 changes: 1 addition & 1 deletion _layouts/team.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h2 role="heading" class="color-{{page.team.color_index}}-wide">{{page.team.name
{% if aliases.size > 0 %}
The team is known by the following aliases:
{% for i in aliases %}
{{i.name}}
<br>- {{i.name}}
{% endfor %}
{% endif %}
</small>
Expand Down
16 changes: 13 additions & 3 deletions all-teams.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ <h2 role="heading">Teams</h2>
{% for row in site.data.teams %}
{% if row.results.size >= 2 %}
<tr>
<!-- <td>{{idx}}</td> -->
{%else %}
<tr style="display:none">
{%endif%}

<td class="team color-{{row.color_index}}" data-slug="{{row.slug}}">
<a href="/teams/{{row.slug}}/">{{row.name}}</a>
Expand All @@ -40,14 +42,22 @@ <h2 role="heading">Teams</h2>
<td>{{row.results.size}}</td>

</tr>
{% endif %}


{% endfor %}

<!-- </tbody> -->
</table>
</div>
</div>
<script>
function showAll(){
var x = document.querySelectorAll("tr[style='display:none']");
for (var i = 0; i < x.length; i++) {
x[i].style.display = "table-row";
}
}
</script>
<a class="button button-default" href='#' role="button" onclick="showAll()">Show All Teams</a><br>
</div>

<small>All teams with 2 or more appearances are shown</small>

0 comments on commit 94b3f71

Please sign in to comment.