phantasmobile/app/templates/archive.html

48 lines
1.5 KiB
HTML
Raw Normal View History

2023-07-15 07:30:36 +00:00
{% extends "base.html" %}
2023-08-21 09:24:53 +00:00
{% block head %}
<title>{{ settings.SITENAME }}</title>
{% endblock %}
2023-07-15 07:30:36 +00:00
{% block content %}
2023-08-21 09:24:53 +00:00
<div class="index archive">
2023-08-31 17:24:52 +00:00
{% if week_title %}
<h2 class="week">{{ week_title }}</h2>
{% endif %}
2023-07-15 07:30:36 +00:00
{% for item in items %}
2023-07-16 05:56:14 +00:00
{% include "listitem.html" with item=item %}
2023-07-15 07:30:36 +00:00
{% endfor %}
2023-08-20 19:12:51 +00:00
{% if archive %}
<div class="archive">
<a href="{{ archive }}">previous weeks</a>
</div>
{% endif %}
</div>
2023-08-31 16:05:27 +00:00
{% if weeks %}
<div class="weeks">
{% for year in years %}
2024-01-26 11:53:41 +00:00
<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 %}
2023-08-31 16:05:27 +00:00
</div>
</div>
2023-08-31 16:05:27 +00:00
{% 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 %}
2023-07-15 07:30:36 +00:00
{% endblock %}