From ae59910bb7a852b6b1d2b07acc900da577dc250f Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Fri, 12 Nov 2021 20:54:20 +0100 Subject: [PATCH] Best template --- app/website/templates/layouts/base.html | 6 +++--- app/website/templates/pages/about.html | 2 +- app/website/templates/pages/talks.html | 23 +++++++++++++++++------ app/website/views.py | 1 + scripts/create_talks.py | 4 +--- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/app/website/templates/layouts/base.html b/app/website/templates/layouts/base.html index 81382d9..9414ac2 100644 --- a/app/website/templates/layouts/base.html +++ b/app/website/templates/layouts/base.html @@ -4,7 +4,7 @@ htmx demo - + @@ -17,7 +17,7 @@ -
+
-
+
diff --git a/app/website/templates/pages/about.html b/app/website/templates/pages/about.html index 48f4855..d830039 100644 --- a/app/website/templates/pages/about.html +++ b/app/website/templates/pages/about.html @@ -1,3 +1,3 @@ -
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis dignissimos dolor inventore laudantium libero optio quo reprehenderit repudiandae sapiente similique. Delectus dolorum enim fuga fugiat ipsam nam recusandae sequi sint.
diff --git a/app/website/templates/pages/talks.html b/app/website/templates/pages/talks.html index 6bd08c1..40f6857 100644 --- a/app/website/templates/pages/talks.html +++ b/app/website/templates/pages/talks.html @@ -1,9 +1,20 @@ -
+
{% for talk in talks %} -
-
{{ talk.title }}
-

-
Author {{ talk.author.full_name }} - {{ talk.category.name }}
-
+ +
+
+
+

+ +

+

{{ talk.title }}

+
+
+

+ {{ talk.content|truncatechars:100 }} +

+
Author {{ talk.author.full_name }} - {{ talk.category.name }}
+
+
{% endfor %}
diff --git a/app/website/views.py b/app/website/views.py index 4efcaf4..b44a262 100644 --- a/app/website/views.py +++ b/app/website/views.py @@ -13,6 +13,7 @@ def index(request): "DOMAIN": settings.DOMAIN, }) + def page_talks(): return render_to_string("pages/talks.html", { "talks": Talk.objects.order_by("title")[:5] diff --git a/scripts/create_talks.py b/scripts/create_talks.py index 8366c38..8f5e745 100644 --- a/scripts/create_talks.py +++ b/scripts/create_talks.py @@ -19,9 +19,7 @@ def run(): category=Category.objects.order_by("?")[0], author=Profile.objects.order_by("?")[0], is_draft=False, - content="

" - + "

".join(fake.paragraph(nb_sentences=randint(5, 10))) - + "

", + content=fake.paragraph(nb_sentences=randint(20, 100)), ) my_talk.save()