From c7383bfffb745d75e11e47e0d309097e7fc83384 Mon Sep 17 00:00:00 2001 From: Naomi Eliasar Date: Sat, 5 Oct 2024 23:44:48 +0200 Subject: [PATCH 1/5] add subsribe button to author page --- src/blog/templates/blog/author_page.html | 8 ++++++-- src/blog/templates/blog/blog_page.html | 2 +- .../blog/includes/subscribe-author.html | 11 ++++++++++- .../static/css/brazil_blog_compiled.css | 16 ++++++++++++++++ 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/blog/templates/blog/author_page.html b/src/blog/templates/blog/author_page.html index d37565b..901c247 100644 --- a/src/blog/templates/blog/author_page.html +++ b/src/blog/templates/blog/author_page.html @@ -4,8 +4,12 @@ {% block content %}
-

{{ page.title }}

- +
+

{{ page.title }}

+ {% include "blog/includes/subscribe-author.html" with author=page.user user=user class="h-10 w-10" %} +
+ +
{% user_avatar page.user %} diff --git a/src/blog/templates/blog/blog_page.html b/src/blog/templates/blog/blog_page.html index 1319db9..2879910 100644 --- a/src/blog/templates/blog/blog_page.html +++ b/src/blog/templates/blog/blog_page.html @@ -43,7 +43,7 @@

{% if page.hero_text %}
diff --git a/src/blog/templates/blog/includes/subscribe-author.html b/src/blog/templates/blog/includes/subscribe-author.html index 4bcfc31..57ce2ec 100644 --- a/src/blog/templates/blog/includes/subscribe-author.html +++ b/src/blog/templates/blog/includes/subscribe-author.html @@ -1,6 +1,15 @@ {% if user.is_authenticated %} - +
+ {% include "blog/includes/subscribe-author.html" with author=page.author user=user class="h-10 w-10" %} +

+
+ +
-

{{ page.title }}

-
{{ page.specific.date | date:"d-m-Y H:i" }}
-
- +

{{ page.title }}

+
+
+
{{ page.specific.date | date:"d-m-Y H:i" }}
+
+ {% for location in page.location.all %} + 📍{{location.name}} + {% endfor %} +
+
+ {% if page.author.author_page %} + + + {% post_user_avatar page 'w-10 h-10 rounded-full object-cover sm:w-12 sm:h-12' %} + + {% else %} +
+ + {% post_user_avatar page %} +
+ {% endif %}
- {% if page.author.author_page %} - - - {% post_user_avatar page 'w-10 h-10 rounded-full object-cover sm:w-16 sm:h-16' %} - - {% else %} -
- - {% post_user_avatar page %} -
- {% endif %} - {% include "blog/includes/subscribe-author.html" with author=page.author user=user %} +
{% if page.hero_text %}
@@ -121,9 +137,9 @@

-
+

{{ page.title }}

diff --git a/src/blog/templates/blog/author_page.html b/src/blog/templates/blog/author_page.html index 901c247..b815978 100644 --- a/src/blog/templates/blog/author_page.html +++ b/src/blog/templates/blog/author_page.html @@ -3,7 +3,7 @@ {% block content %}
-
+

{{ page.title }}

{% include "blog/includes/subscribe-author.html" with author=page.user user=user class="h-10 w-10" %} diff --git a/src/blog/templates/blog/blog_index_page.html b/src/blog/templates/blog/blog_index_page.html index 4e730a8..cf75f68 100644 --- a/src/blog/templates/blog/blog_index_page.html +++ b/src/blog/templates/blog/blog_index_page.html @@ -4,7 +4,7 @@ {% block content %} {% include "blog/includes/timeline.html" with grouped_blog_posts=grouped_blog_posts itinerary=itinerary %} -
+
{% include "blog/includes/filter-bar.html" %} {% include "blog/includes/blogpost-grid.html" with blogposts=blogpages only %}
diff --git a/src/blog/templates/blog/includes/blogpost-grid.html b/src/blog/templates/blog/includes/blogpost-grid.html index cf09dd7..710306e 100644 --- a/src/blog/templates/blog/includes/blogpost-grid.html +++ b/src/blog/templates/blog/includes/blogpost-grid.html @@ -1,6 +1,6 @@ {% load i18n static wagtailcore_tags wagtailimages_tags custom_image_tags user_tags %} -
+
{% for post in blogposts %} +
diff --git a/src/brazil_blog/static/css/brazil_blog_compiled.css b/src/brazil_blog/static/css/brazil_blog_compiled.css index 1ef76e7..5c45e5f 100644 --- a/src/brazil_blog/static/css/brazil_blog_compiled.css +++ b/src/brazil_blog/static/css/brazil_blog_compiled.css @@ -1471,6 +1471,10 @@ select { z-index: 30; } +.col-auto { + grid-column: auto; +} + .float-left { float: left; } @@ -1758,6 +1762,10 @@ select { max-width: 20rem; } +.max-w-5xl { + max-width: 64rem; +} + .flex-1 { flex: 1 1 0%; } @@ -1831,6 +1839,10 @@ select { list-style-type: none; } +.grid-flow-col { + grid-auto-flow: column; +} + .flex-row { flex-direction: row; } @@ -2774,6 +2786,11 @@ select { padding: 3rem; } + .md\:px-0 { + padding-left: 0px; + padding-right: 0px; + } + .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; @@ -2796,6 +2813,14 @@ select { } @media (min-width: 1024px) { + .lg\:max-w-6xl { + max-width: 72rem; + } + + .lg\:max-w-7xl { + max-width: 80rem; + } + .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } @@ -2803,4 +2828,53 @@ select { .lg\:p-24 { padding: 6rem; } + + .lg\:px-0 { + padding-left: 0px; + padding-right: 0px; + } +} + +@media (min-width: 1280px) { + .xl\:max-w-full { + max-width: 100%; + } + + .xl\:max-w-7xl { + max-width: 80rem; + } + + .xl\:max-w-\[1600px\] { + max-width: 1600px; + } + + .xl\:max-w-\[1500px\] { + max-width: 1500px; + } + + .xl\:max-w-\[1800px\] { + max-width: 1800px; + } + + .xl\:grid-cols-4 { + grid-template-columns: repeat(4, minmax(0, 1fr)); + } + + .xl\:grid-cols-5 { + grid-template-columns: repeat(5, minmax(0, 1fr)); + } +} + +@media (min-width: 1536px) { + .\32xl\:max-w-full { + max-width: 100%; + } + + .\32xl\:max-w-\[full\] { + max-width: full; + } + + .\32xl\:grid-cols-5 { + grid-template-columns: repeat(5, minmax(0, 1fr)); + } } \ No newline at end of file diff --git a/src/brazil_blog/templates/includes/footer.html b/src/brazil_blog/templates/includes/footer.html index eb26335..a200ff6 100644 --- a/src/brazil_blog/templates/includes/footer.html +++ b/src/brazil_blog/templates/includes/footer.html @@ -1,7 +1,7 @@ {% load cache %} {% cache 500 footer %}
-
+

Built with Wagtail

diff --git a/src/brazil_blog/templates/includes/header.html b/src/brazil_blog/templates/includes/header.html index 4ef7de8..a5fa13b 100644 --- a/src/brazil_blog/templates/includes/header.html +++ b/src/brazil_blog/templates/includes/header.html @@ -4,7 +4,7 @@ {% get_site_root as site_root %} {% with site_name=settings.base.NavigationSettings.site_name site_logo=settings.base.NavigationSettings.site_logo %}
-
+
{% cache 500 static_header %}
diff --git a/src/home/templates/home/home_page.html b/src/home/templates/home/home_page.html index d72250e..45e2605 100644 --- a/src/home/templates/home/home_page.html +++ b/src/home/templates/home/home_page.html @@ -14,7 +14,7 @@ {% block content %}
-
+
{% if page.image %} diff --git a/src/locations/templates/itinerary_overview.html b/src/locations/templates/itinerary_overview.html index 22195a6..8312e87 100644 --- a/src/locations/templates/itinerary_overview.html +++ b/src/locations/templates/itinerary_overview.html @@ -3,7 +3,7 @@ {% block content %}
-
+

{{ itinerary.name }}

{{ itinerary.description }}

From ea5ccbabfc1b2756eb558c7e407aef2705b27302 Mon Sep 17 00:00:00 2001 From: Naomi Eliasar Date: Sun, 6 Oct 2024 01:08:06 +0200 Subject: [PATCH 4/5] like and comment counter to top --- .../templates/blog/includes/blogpost-grid.html | 14 ++++++++------ .../static/css/brazil_blog_compiled.css | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/blog/templates/blog/includes/blogpost-grid.html b/src/blog/templates/blog/includes/blogpost-grid.html index 710306e..73b527c 100644 --- a/src/blog/templates/blog/includes/blogpost-grid.html +++ b/src/blog/templates/blog/includes/blogpost-grid.html @@ -16,18 +16,20 @@ {% else %}
{% endif %} +
+
+ 😻 + {{ post.specific.like_count }} + 💬 + {{ post.specific.comments.count }} +
+

{{ post.title }}

{% post_user_avatar post 'w-8 h-8 rounded-full object-cover' %} {{ post.specific.date | date:"d-m-Y H:i" }} -
- 😻 - {{ post.specific.like_count }} - 💬 - {{ post.specific.comments.count }} -
{% if post.specific.intro %} diff --git a/src/brazil_blog/static/css/brazil_blog_compiled.css b/src/brazil_blog/static/css/brazil_blog_compiled.css index 5c45e5f..7648ebc 100644 --- a/src/brazil_blog/static/css/brazil_blog_compiled.css +++ b/src/brazil_blog/static/css/brazil_blog_compiled.css @@ -2129,6 +2129,14 @@ select { background-color: rgb(202 138 4 / var(--tw-bg-opacity)); } +.bg-opacity-80 { + --tw-bg-opacity: 0.8; +} + +.bg-opacity-60 { + --tw-bg-opacity: 0.6; +} + .bg-gradient-to-t { background-image: linear-gradient(to top, var(--tw-gradient-stops)); } @@ -2427,6 +2435,14 @@ select { opacity: 0.5; } +.opacity-80 { + opacity: 0.8; +} + +.opacity-20 { + opacity: 0.2; +} + .shadow-lg { --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); From 62571b33eaf101f61a8e3947d49f42083dda4c2c Mon Sep 17 00:00:00 2001 From: Naomi Eliasar Date: Sun, 6 Oct 2024 01:24:41 +0200 Subject: [PATCH 5/5] location in bloggrid --- .../blog/includes/blogpost-grid.html | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/blog/templates/blog/includes/blogpost-grid.html b/src/blog/templates/blog/includes/blogpost-grid.html index 73b527c..0897e07 100644 --- a/src/blog/templates/blog/includes/blogpost-grid.html +++ b/src/blog/templates/blog/includes/blogpost-grid.html @@ -27,17 +27,24 @@

{{ post.title }}

-
+
{% post_user_avatar post 'w-8 h-8 rounded-full object-cover' %} - {{ post.specific.date | date:"d-m-Y H:i" }} -
-
- {% if post.specific.intro %} -
{{ post.specific.intro }}
- {% else %} - {{ post.specific.body|richtext|slice:":500" }} - {% endif %} +
+
+ {{ post.specific.date | date:"d-m-Y H:i" }} +
+
+ {% for location in post.location.all %} + 📍{{location.name}} + {% endfor %} +
+
+ {% if post.specific.intro %} +
{{ post.specific.intro }}
+ {% else %} + {{ post.specific.body|richtext|slice:":500" }} + {% endif %}