phantasmobile/app/templates/archive.html

50 lines
1.6 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-07-15 07:30:36 +00:00
{% for item in items %}
2023-08-16 15:58:28 +00:00
{% ifchanged item.week %}
{% comment %}
2023-08-20 19:14:23 +00:00
<h2 class="week">{{ item.year }} week {{ item.week }}</h2>
{% endcomment %}
2023-08-16 15:58:28 +00:00
{% endifchanged %}
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">
<div>
{% for week in weeks %}
{% ifchanged week.year %}
</div>
<h1>{{ week.year }}</h1>
<div class="year-details-{{ week.year }}" {% if week.year != this_year %} style="display: none"{% endif %}>
{% endifchanged %}
{% if week.date == this_week %}
<b>{{ week.title }}</b><br>
{% else %}
<a href="/_{{ week.date }}/">{{ week.title }}</a><br>
{% endif %}
{% endfor %}
</div>
<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 %}