Compare commits

...

3 commits

Author SHA1 Message Date
j
c063e7cebc center week title 2023-08-20 21:14:23 +02:00
j
acf4764ca0 fix archive style 2023-08-20 21:12:51 +02:00
j
c2988c0b2f show link in telegram 2023-08-20 21:10:19 +02:00
5 changed files with 14 additions and 5 deletions

View file

@ -41,7 +41,7 @@ def announce_items():
preview_description=description,
)
if getattr(settings, "TELEGRAM_ANNOUNCE_CHANNEL"):
message = f'<a href="{link}">{item.title}</a>'
message = f'{item.title}<br><a href="{link}">{link}</a>'
r = telegram_rpc.send(
message,
channel=settings.TELEGRAM_ANNOUNCE_CHANNEL,

View file

@ -43,7 +43,7 @@ def index(request):
return render(request, 'index.html', context)
def archive(request):
def archive(request, week=None):
context = default_context(request)
qs = models.Item.public()
week, archive = models.Item.public()

View file

@ -116,3 +116,7 @@ nav.overlay {
padding: 8px;
opacity: 0.8;
}
h2.week {
text-align: center;
}

View file

@ -1,10 +1,17 @@
{% extends "base.html" %}
{% block content %}
<div class="index">
{% for item in items %}
{% ifchanged item.week %}
<h2>{{ item.year }} week {{ item.week }}</h2>
<h2 class="week">{{ item.year }} week {{ item.week }}</h2>
{% endifchanged %}
{% include "listitem.html" with item=item %}
{% endfor %}
{% if archive %}
<div class="archive">
<a href="{{ archive }}">previous weeks</a>
</div>
{% endif %}
</div>
{% endblock %}

View file

@ -4,8 +4,6 @@
<title>{{ settings.SITENAME }}</title>
{% endblock %}
{% block content %}
<style>
</style>
<div class="index">
{% for item in items %}
{% include "listitem.html" with item=item %}