Skip to content
Snippets Groups Projects
Commit e124e6fb authored by Štěpán Farka's avatar Štěpán Farka
Browse files

[ADD] dark theme for article preview

parent b1fdb299
No related branches found
No related tags found
2 merge requests!617Release,!616Feature/main misc enhancements 2
Pipeline #9731 passed
# Generated by Django 4.0.7 on 2022-09-06 11:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("main", "0029_mainhomepage_gdpr_and_cookies_page"),
]
operations = [
migrations.AddField(
model_name="mainarticlepage",
name="is_black",
field=models.BooleanField(default=False, verbose_name="Má tmavé pozadí?"),
),
]
...@@ -451,6 +451,7 @@ class MainArticlePage( ...@@ -451,6 +451,7 @@ class MainArticlePage(
article_type = models.PositiveSmallIntegerField( article_type = models.PositiveSmallIntegerField(
"Typ článku", choices=ARTICLE_TYPES.choices, default=ARTICLE_TYPES.PRESS_RELEASE "Typ článku", choices=ARTICLE_TYPES.choices, default=ARTICLE_TYPES.PRESS_RELEASE
) )
is_black = models.BooleanField("Má tmavé pozadí?", default=False)
content = StreamField( content = StreamField(
[ [
...@@ -485,6 +486,7 @@ class MainArticlePage( ...@@ -485,6 +486,7 @@ class MainArticlePage(
content_panels = ArticleMixin.content_panels + [ content_panels = ArticleMixin.content_panels + [
FieldPanel("article_type"), FieldPanel("article_type"),
FieldPanel("author_page"), FieldPanel("author_page"),
FieldPanel("is_black"),
FieldPanel("region"), FieldPanel("region"),
FieldPanel("tags"), FieldPanel("tags"),
] ]
......
<div class="p-7 flex flex-col max-w-xl border border-grey-150 mb-8"> <div class="article-box p-7 flex flex-col max-w-xl border border-grey-150 mb-8 {{ classes }}">
<a href="#"> <a href="#">
<img src="https://i.picsum.photos/id/689/576/281.jpg?hmac=yIwOFV185zFy4fwVE3lF1UDqLDAm_bpLr9LZprQ26eo" alt="" <img src="https://i.picsum.photos/id/689/576/281.jpg?hmac=yIwOFV185zFy4fwVE3lF1UDqLDAm_bpLr9LZprQ26eo" alt=""
class="mb-7 w-full"> class="mb-7 w-full">
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</div> </div>
</div> </div>
<div class="article-timeline-grid__right-article xl:pt-14"> <div class="article-timeline-grid__right-article xl:pt-14">
{{> molecules-work-article-preview }} {{> molecules-work-article-preview(classes: "dark-theme") }}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -200,6 +200,6 @@ p { ...@@ -200,6 +200,6 @@ p {
letter-spacing: -0.01em; letter-spacing: -0.01em;
} }
a { a {
@apply font-semibold; @apply font-bold;
} }
} }
.article-box {
&.dark-theme {
background-color: #4C4C4C;
color: white;
}
}
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
@import "./atoms/heading.pcss"; @import "./atoms/heading.pcss";
@import "./atoms/icons.pcss"; @import "./atoms/icons.pcss";
@import "./molecules/articles.pcss";
@import "./molecules/block-quote.pcss"; @import "./molecules/block-quote.pcss";
@import "./molecules/carousels.pcss"; @import "./molecules/carousels.pcss";
@import "./molecules/contact_box.pcss"; @import "./molecules/contact_box.pcss";
......
{% load wagtailimages_tags %} {% load wagtailimages_tags %}
<div class="p-7 flex flex-col max-w-xl border border-grey-150 mb-8"> <div class="article-box {% if article.is_black %}dark-theme {% endif %}p-7 flex flex-col max-w-xl border border-grey-150 mb-8">
{% image article_page.image max-500x500 as image %} {% image article_page.image max-500x500 as image %}
<a href="{{ article_page.url }}"> <a href="{{ article_page.url }}">
<img <img
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment