Skip to content
Snippets Groups Projects
Commit 449c1934 authored by OndraPetrzilka's avatar OndraPetrzilka
Browse files

Merge branch 'feature/pirati-cz' into feature/pirati-cz-ondra

parents a6fbbb4c f77d4fef
No related branches found
No related tags found
3 merge requests!607Pirati.cz,!586Feature/pirati cz ondra,!575Feature/pirati cz
Pipeline #9350 passed
......@@ -200,14 +200,44 @@ class MainWorkPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, P
class Meta:
verbose_name = "Piráti pracují"
def get_context(self, request, *args, **kwargs):
ctx = super().get_context(request, args, kwargs)
def get_article_data_list(self):
last_month = timezone.now().today().replace(day=1) - timedelta(days=1)
first_day_of_last_month = last_month.replace(day=1)
article_qs = MainArticlePage.objects.filter(date__gt=first_day_of_last_month)
# article_data_list =
sorted_article_qs = MainArticlePage.objects.filter(
date__gt=first_day_of_last_month
).order_by("-date")
article_data_list = []
current_month_data = self.get_empty_month_data(timezone.now().date())
for idx, article in enumerate(sorted_article_qs):
if article.date.month != current_month_data["month_text"]:
article_data_list.append(current_month_data) # append completed month
current_month_data = self.get_empty_month_data(article.date)
current_column = "left_column" if idx % 2 else "right_column"
current_month_data[current_column].append(article)
article_data_list.append(current_month_data) # last iteration
return article_data_list
def get_context(self, request, *args, **kwargs):
ctx = super().get_context(request, args, kwargs)
ctx["article_data_list"] = self.get_article_data_list()
return ctx
@staticmethod
def get_empty_month_data(date_obj):
return {
"month_number": date_obj.month,
"month_text": date_obj.strftime("%B"),
"left_column": [],
"right_column": [],
}
class MainArticleTag(TaggedItemBase):
content_object = ParentalKey("main.MainArticlePage", on_delete=models.CASCADE)
......
......
File changed. Contains only whitespace changes. Show whitespace changes.
......@@ -4,16 +4,19 @@
position: relative;
.header-carousel--text {
@apply font-alt text-2xl uppercase lg:text-7xl;
left: 10%;
@apply font-alt text-2xl sm:text-5xl uppercase lg:text-7xl;
max-width: 1200px;
position: absolute;
top: 20%;
top: 35%;
margin-left: 15%;
@screen sm {
top: 35%;
margin-left: 10%;
}
@screen lg {
top: 30%;
}
@screen 2xl {
top: 45%;
}
}
......@@ -34,21 +37,22 @@
}
.slick-active {
z-index: 1000;
img {
transform: scale(1, 1);
}
.header-carousel--text {
animation: right_to_left 500ms ease;
animation: right_to_left 1s ease;
}
}
@keyframes right_to_left {
from {
left: 15%;
margin-left: 20%;
}
to {
left: 10%;
margin-left: 10%;
}
}
......
......
.btn {
@apply font-alt inline-block h-11 leading-9 py-1;
@apply font-alt inline-flex justify-center items-center h-8 leading-9 py-1 xl:h-11;
}
.btn__slide__wrap {
......
......
......@@ -3,18 +3,50 @@
<vue-slick-carousel v-bind="settings">
<div class="xl:h-screen relative">
<img src="https://unsplash.it/792/387?image=4" draggable="false">
<div class="header-carousel--text">
<div class="header-carousel--text grid-container">
<div class="grid-content-with-right-side">
<h1 class="text-white">72% domácností bylo</h1>
<h1 class="text-orange-250">násilně digitalizováno</h1>
<a href="" class="btn btn__slide__wrap ">
<span class="btn text-sm bg-white w-32 lg:text-base">Zjistit více1</span>
<span class="btn text-sm bg-black text-white w-32 lg:text-base">Zjistit více1</span>
</a>
</div>
</div>
</div>
<div class="xl:h-screen relative">
<img src="https://unsplash.it/792/387?image=1" draggable="false">
<div class="header-carousel--text">
<img src="https://unsplash.it/792/387?image=4" draggable="false">
<div class="header-carousel--text grid-container">
<div class="grid-content-with-right-side">
<h1 class="text-white">72% domácností bylo</h1>
<h1 class="text-orange-250">násilně digitalizováno</h1>
<a href="" class="btn btn__slide__wrap ">
<span class="btn text-sm bg-white w-32 lg:text-base">Zjistit více2</span>
<span class="btn text-sm bg-black text-white w-32 lg:text-base">Zjistit více2</span>
</a>
</div>
</div>
</div>
<div class="xl:h-screen relative">
<img src="https://unsplash.it/792/387?image=4" draggable="false">
<div class="header-carousel--text grid-container">
<div class="grid-content-with-right-side">
<h1 class="text-white">72% domácností33 bylo</h1>
<h1 class="text-orange-250">násilně digitalizováno</h1>
<a href="" class="btn btn__slide__wrap ">
<span class="btn text-sm bg-white w-32 lg:text-base">Zjistit více3</span>
<span class="btn text-sm bg-black text-white w-32 lg:text-base">Zjistit více3</span>
</a>
</div>
</div>
</div>
<!-- <div class="xl:h-screen relative">-->
<!-- <img src="https://unsplash.it/792/387?image=1" draggable="false">-->
<!-- <div class="header-carousel&#45;&#45;text">-->
<!-- <h1 class="text-white">72% domácností bylo</h1>-->
<!-- <h1 class="text-orange-250">násilně digitalizováno</h1>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="homepage-item" style="background: url('https://placeimg.com/1920/1080/any?1') no-repeat center / cover">-->
<!-- <div class="container">-->
<!-- <h1 class="head-8xl">72% domácností bylo</h1>-->
......
......
{% extends "main/base.html" %}
{% load wagtailcore_tags wagtailimages_tags shared_filters %}
{% block content %}{% endblock content %}
{% block content %}
<main role="main">
<div class="grid-container mb-2 xl:mb-12">
<div class="grid-left-side">
TODO menu
</div>
<div class="grid-content leading-6">
<h2 class="head-xl mb-2">
{{ page.perex }}
</h2>
<h2 class="head-xl mb-2">
Projděte si archiv tiskových zpráv a souhrn našich nejvýraznějších aktivit
</h2>
</div>
</div>
<div class="grid-container article-section">
<div class="grid-full mb-8">
<div class="mb-4">
<h3 class="head-7xl mb-4 xl:hidden">Červenec</h3>
<div class="flex flex-col justify-between xl:flex-row">
<div class="xl:pt-8">
{{> molecules-work-article-preview }}
{{> molecules-work-article-preview }}
</div>
<div class="relative border border-violet-400 mx-8 hidden xl:block">
<div class="absolute bg-violet-400 p-1 text-white font-bold" style="transform: translateX(-50%); top: -1rem">
Červenec
</div>
</div>
<div class="xl:pt-14">
{{> molecules-work-article-preview }}
{{> molecules-work-article-preview }}
</div>
</div>
</div>
<div class="mb-4">
<h3 class="head-7xl mb-4 xl:hidden">Srpen</h3>
<div class="flex flex-col justify-between xl:flex-row">
<div class="xl:pt-8">
{{> molecules-work-article-preview }}
{{> molecules-work-article-preview }}
</div>
<div class="relative border border-violet-400 mx-8 hidden xl:block">
<div class="absolute bg-violet-400 p-1 text-white font-bold" style="transform: translateX(-50%); top: -1rem">
Srpen
</div>
</div>
<div class="xl:pt-14">
{{> molecules-work-article-preview }}
{{> molecules-work-article-preview }}
</div>
</div>
</div>
<div class="flex justify-center">
{{> atoms-button-animated(btn-text: "Zobrazit další", classes-btn-hidden: "bg-black") }}
</div>
</div>
</div>
</main>
{% for month_article_data in article_data_list %}
{{ month_article_data.month_text }}
{{ month_article_data.left_column }}
{{ month_article_data.right_column }}
{% endfor %}
{% endblock content %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment