From e362046a004bca689caa0300d899e1851a437053 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Thu, 31 Aug 2023 10:04:42 -0400 Subject: add prefix() to context_processor and hardcoded urls --- newspipe/bootstrap.py | 4 +++- newspipe/templates/article.html | 2 +- newspipe/templates/duplicates.html | 6 +++--- newspipe/templates/history.html | 2 +- newspipe/templates/home.html | 10 +++++----- newspipe/templates/layout.html | 2 +- newspipe/templates/login.html | 2 +- newspipe/templates/management.html | 2 +- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/newspipe/bootstrap.py b/newspipe/bootstrap.py index f28c353f..9c7630ab 100644 --- a/newspipe/bootstrap.py +++ b/newspipe/bootstrap.py @@ -124,4 +124,6 @@ def utility_processor(): # _uf = str(prefix) + _uf print(f"DEBUG: generating url_for {endpoint}, of {_uf}") return _uf - return dict(url_for=url_for) + def prefix(): + return prefix.rstrip("/") + return dict(url_for=url_for,prefix=prefix) diff --git a/newspipe/templates/article.html b/newspipe/templates/article.html index 5eff64e7..ef70d2df 100644 --- a/newspipe/templates/article.html +++ b/newspipe/templates/article.html @@ -4,7 +4,7 @@

{{ article.title|safe }}

-

{{ _('from') }} {{ article.source.title }}

+

{{ _('from') }} {{ article.source.title }}

{% if article.like %} diff --git a/newspipe/templates/duplicates.html b/newspipe/templates/duplicates.html index 38dc52b1..02fe83c0 100644 --- a/newspipe/templates/duplicates.html +++ b/newspipe/templates/duplicates.html @@ -1,7 +1,7 @@ {% extends "layout.html" %} {% block content %}
-

{{ _('Duplicates in the feed') }} {{ feed.title }}.

+

{{ _('Duplicates in the feed') }} {{ feed.title }}.

@@ -19,8 +19,8 @@ {% for pair in duplicates %} - - + + {% endfor %} diff --git a/newspipe/templates/history.html b/newspipe/templates/history.html index 153c2f11..c2da83d5 100644 --- a/newspipe/templates/history.html +++ b/newspipe/templates/history.html @@ -43,7 +43,7 @@ diff --git a/newspipe/templates/home.html b/newspipe/templates/home.html index 631b769c..aa2b1889 100644 --- a/newspipe/templates/home.html +++ b/newspipe/templates/home.html @@ -42,7 +42,7 @@ {% if feed_id == feed.id %}{% endif %} {% endif %} diff --git a/newspipe/templates/layout.html b/newspipe/templates/layout.html index 2464040c..29efd623 100644 --- a/newspipe/templates/layout.html +++ b/newspipe/templates/layout.html @@ -21,7 +21,7 @@ {% block menu %}
{{ loop.index }} {{ pair[0].title }} ({{ pair[0].retrieved_date }}) {{ pair[1].title }} ({{ pair[1].retrieved_date }}) {{ pair[0].title }} ({{ pair[0].retrieved_date }}) {{ pair[1].title }} ({{ pair[1].retrieved_date }})
- {{ article.source.title | safe }} + {{ article.source.title | safe }} - {{ article.title | truncate(100, False, '...') }} + {{ article.title | truncate(100, False, '...') }} {{ article.date | datetime(format='short') }}