Compare commits
3 commits
6c22fa70de
...
c063e7cebc
| Author | SHA1 | Date | |
|---|---|---|---|
| c063e7cebc | |||
| acf4764ca0 | |||
| c2988c0b2f |
5 changed files with 14 additions and 5 deletions
|
|
@ -41,7 +41,7 @@ def announce_items():
|
||||||
preview_description=description,
|
preview_description=description,
|
||||||
)
|
)
|
||||||
if getattr(settings, "TELEGRAM_ANNOUNCE_CHANNEL"):
|
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(
|
r = telegram_rpc.send(
|
||||||
message,
|
message,
|
||||||
channel=settings.TELEGRAM_ANNOUNCE_CHANNEL,
|
channel=settings.TELEGRAM_ANNOUNCE_CHANNEL,
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ def index(request):
|
||||||
return render(request, 'index.html', context)
|
return render(request, 'index.html', context)
|
||||||
|
|
||||||
|
|
||||||
def archive(request):
|
def archive(request, week=None):
|
||||||
context = default_context(request)
|
context = default_context(request)
|
||||||
qs = models.Item.public()
|
qs = models.Item.public()
|
||||||
week, archive = models.Item.public()
|
week, archive = models.Item.public()
|
||||||
|
|
|
||||||
|
|
@ -116,3 +116,7 @@ nav.overlay {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h2.week {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,17 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<div class="index">
|
||||||
{% for item in items %}
|
{% for item in items %}
|
||||||
{% ifchanged item.week %}
|
{% ifchanged item.week %}
|
||||||
<h2>{{ item.year }} week {{ item.week }}</h2>
|
<h2 class="week">{{ item.year }} week {{ item.week }}</h2>
|
||||||
{% endifchanged %}
|
{% endifchanged %}
|
||||||
{% include "listitem.html" with item=item %}
|
{% include "listitem.html" with item=item %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if archive %}
|
||||||
|
<div class="archive">
|
||||||
|
<a href="{{ archive }}">previous weeks</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@
|
||||||
<title>{{ settings.SITENAME }}</title>
|
<title>{{ settings.SITENAME }}</title>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<style>
|
|
||||||
</style>
|
|
||||||
<div class="index">
|
<div class="index">
|
||||||
{% for item in items %}
|
{% for item in items %}
|
||||||
{% include "listitem.html" with item=item %}
|
{% include "listitem.html" with item=item %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue