diff --git a/app/item/tasks.py b/app/item/tasks.py index bf4f7aa..a906307 100644 --- a/app/item/tasks.py +++ b/app/item/tasks.py @@ -41,7 +41,7 @@ def announce_items(): preview_description=description, ) if getattr(settings, "TELEGRAM_ANNOUNCE_CHANNEL"): - message = f'{item.title}' + message = f'{item.title}
{link}' r = telegram_rpc.send( message, channel=settings.TELEGRAM_ANNOUNCE_CHANNEL, diff --git a/app/item/views.py b/app/item/views.py index fb8aa52..e35ca27 100644 --- a/app/item/views.py +++ b/app/item/views.py @@ -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() diff --git a/app/static/css/site.scss b/app/static/css/site.scss index 851b116..0a473cb 100644 --- a/app/static/css/site.scss +++ b/app/static/css/site.scss @@ -116,3 +116,7 @@ nav.overlay { padding: 8px; opacity: 0.8; } + +h2.week { + text-align: center; +} diff --git a/app/templates/archive.html b/app/templates/archive.html index d1a1884..d003b5b 100644 --- a/app/templates/archive.html +++ b/app/templates/archive.html @@ -1,10 +1,17 @@ {% extends "base.html" %} {% block content %} +
{% for item in items %} {% ifchanged item.week %} -

{{ item.year }} week {{ item.week }}

+

{{ item.year }} week {{ item.week }}

{% endifchanged %} {% include "listitem.html" with item=item %} {% endfor %} + {% if archive %} +
+ previous weeks +
+ {% endif %} +
{% endblock %} diff --git a/app/templates/index.html b/app/templates/index.html index 12b71c8..1a2e5f0 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -4,8 +4,6 @@ {{ settings.SITENAME }} {% endblock %} {% block content %} -
{% for item in items %} {% include "listitem.html" with item=item %}