From c2988c0b2fc1c350ff01cff371ede7927fd41086 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 20 Aug 2023 21:10:19 +0200 Subject: [PATCH 1/3] show link in telegram --- app/item/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, From acf4764ca06bec84864f1b61309912e2acb9563e Mon Sep 17 00:00:00 2001 From: j Date: Sun, 20 Aug 2023 21:12:51 +0200 Subject: [PATCH 2/3] fix archive style --- app/item/views.py | 2 +- app/templates/archive.html | 7 +++++++ app/templates/index.html | 2 -- 3 files changed, 8 insertions(+), 3 deletions(-) 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/templates/archive.html b/app/templates/archive.html index d1a1884..3aee3fd 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 }}

{% endifchanged %} {% include "listitem.html" with item=item %} {% endfor %} + {% if archive %} + + {% 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 %} From c063e7cebc40032364dfa3363090c2de3a9d0b79 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 20 Aug 2023 21:14:23 +0200 Subject: [PATCH 3/3] center week title --- app/static/css/site.scss | 4 ++++ app/templates/archive.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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 3aee3fd..d003b5b 100644 --- a/app/templates/archive.html +++ b/app/templates/archive.html @@ -3,7 +3,7 @@
{% 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 %}