phantasmobile/app/templates/archive.html
2024-01-26 12:53:41 +01:00

47 lines
1.5 KiB
HTML

{% extends "base.html" %}
{% block head %}
<title>{{ settings.SITENAME }}</title>
{% endblock %}
{% block content %}
<div class="index archive">
{% if week_title %}
<h2 class="week">{{ week_title }}</h2>
{% endif %}
{% for item in items %}
{% include "listitem.html" with item=item %}
{% endfor %}
{% if archive %}
<div class="archive">
<a href="{{ archive }}">previous weeks</a>
</div>
{% endif %}
</div>
{% if weeks %}
<div class="weeks">
{% for year in years %}
<div class="year">
<h1>{{ year.year }}</h1>
<div class="year-details-{{ year.year }}">
{% for week in year.weeks %}
{% if week.date == this_week %}
<b>{{ week.title }}</b><br>
{% else %}
<a href="/_{{ week.date }}/">{{ week.title }}</a><br>
{% endif %}
{% endfor %}
</div>
</div>
{% endfor %}
<script>
document.querySelectorAll('.weeks h1').forEach(h1 => {
h1.addEventListener('click', event => {
var year = event.target.innerText
var details = document.querySelector('.year-details-' + year)
details.style.display = details.style.display == 'none' ? '' : 'none'
})
})
</script>
</div>
{% endif %}
{% endblock %}