Skip to content
Snippets Groups Projects
Commit 3395a2c5 authored by Dan Nepejchal's avatar Dan Nepejchal
Browse files

Fix:

- update navbar logo
- update FAQ
- update MEPS
- create text carousel
- add align text to content
parent 33f1071a
Branches
No related tags found
2 merge requests!157Sync,!156Fix:
Pipeline #1784 passed
Showing with 965 additions and 32 deletions
# Generated by Django 3.1.1 on 2020-12-12 18:37
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("regulace_konopi", "0003_auto_20201129_1705"),
]
operations = [
migrations.AlterField(
model_name="regkonhomepage",
name="content",
field=wagtail.core.fields.StreamField(
[
(
"title",
wagtail.core.blocks.CharBlock(icon="title", label="nadpis"),
),
(
"text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text",
),
),
(
"text_centered",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text-center",
),
),
(
"text_justify",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text-justify",
),
),
(
"carousel",
wagtail.core.blocks.ListBlock(
wagtail.images.blocks.ImageChooserBlock(label="obrázek"),
icon="image",
label="carousel",
),
),
],
blank=True,
verbose_name="obsah stránky",
),
),
migrations.AlterField(
model_name="regkonsubpage",
name="content",
field=wagtail.core.fields.StreamField(
[
(
"title",
wagtail.core.blocks.CharBlock(icon="title", label="nadpis"),
),
(
"text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text",
),
),
(
"text_centered",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text-center",
),
),
(
"text_justify",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text-justify",
),
),
(
"carousel",
wagtail.core.blocks.ListBlock(
wagtail.images.blocks.ImageChooserBlock(label="obrázek"),
icon="image",
label="carousel",
),
),
(
"FAQ",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.StructBlock(
[
("question", wagtail.core.blocks.TextBlock()),
("answer", wagtail.core.blocks.RichTextBlock()),
],
template="regulace_konopi/blocks/faq.html",
),
label="faq",
),
),
(
"meps",
wagtail.core.blocks.StructBlock(
[
("name", wagtail.core.blocks.CharBlock(label="název")),
(
"mep",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.StructBlock(
[
(
"name",
wagtail.core.blocks.CharBlock(
label="jméno"
),
),
(
"approved",
wagtail.core.blocks.ChoiceBlock(
choices=[
(1, "Pro"),
(0, "Proti"),
(-1, "Nevíme"),
],
label="hlasoval",
),
),
]
)
),
),
],
template="regulace_konopi/blocks/party.html",
),
),
],
blank=True,
verbose_name="obsah stránky",
),
),
]
# Generated by Django 3.1.1 on 2020-12-12 18:48
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("regulace_konopi", "0004_auto_20201212_1937"),
]
operations = [
migrations.AlterField(
model_name="regkonhomepage",
name="content",
field=wagtail.core.fields.StreamField(
[
(
"title",
wagtail.core.blocks.CharBlock(icon="title", label="nadpis"),
),
(
"text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text",
),
),
(
"text_centered",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text-center",
),
),
(
"text_justify",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text-justify",
),
),
(
"carousel",
wagtail.core.blocks.ListBlock(
wagtail.images.blocks.ImageChooserBlock(label="obrázek"),
icon="image",
label="carousel",
),
),
(
"carousel_text",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.TextBlock(),
icon="paragraph",
label="carousel-text",
),
),
],
blank=True,
verbose_name="obsah stránky",
),
),
]
# Generated by Django 3.1.1 on 2020-12-12 18:49
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("regulace_konopi", "0005_auto_20201212_1948"),
]
operations = [
migrations.AlterField(
model_name="regkonhomepage",
name="content",
field=wagtail.core.fields.StreamField(
[
(
"title",
wagtail.core.blocks.CharBlock(icon="title", label="nadpis"),
),
(
"text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text",
),
),
(
"text_centered",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text-center",
),
),
(
"text_justify",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text-justify",
),
),
(
"carousel",
wagtail.core.blocks.ListBlock(
wagtail.images.blocks.ImageChooserBlock(label="obrázek"),
icon="image",
label="carousel",
),
),
(
"carousel_text",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.RichTextBlock(),
icon="paragraph",
label="carousel-text",
),
),
],
blank=True,
verbose_name="obsah stránky",
),
),
]
# Generated by Django 3.1.1 on 2020-12-14 12:46
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("regulace_konopi", "0006_auto_20201212_1949"),
]
operations = [
migrations.AlterField(
model_name="regkonhomepage",
name="content",
field=wagtail.core.fields.StreamField(
[
(
"title",
wagtail.core.blocks.CharBlock(icon="title", label="nadpis"),
),
(
"text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text",
),
),
(
"text_centered",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text-center",
),
),
(
"text_justify",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text-justify",
),
),
(
"carousel",
wagtail.core.blocks.ListBlock(
wagtail.images.blocks.ImageChooserBlock(label="obrázek"),
icon="image",
label="carousel",
),
),
(
"carousel_text",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
]
),
icon="paragraph",
label="carousel-text",
),
),
],
blank=True,
verbose_name="obsah stránky",
),
),
migrations.AlterField(
model_name="regkonsubpage",
name="content",
field=wagtail.core.fields.StreamField(
[
(
"title",
wagtail.core.blocks.CharBlock(icon="title", label="nadpis"),
),
(
"text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text",
),
),
(
"text_centered",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text-center",
),
),
(
"text_justify",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text-justify",
),
),
(
"carousel",
wagtail.core.blocks.ListBlock(
wagtail.images.blocks.ImageChooserBlock(label="obrázek"),
icon="image",
label="carousel",
),
),
(
"carousel_text",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
]
),
icon="paragraph",
label="carousel-text",
),
),
(
"FAQ",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.StructBlock(
[
("question", wagtail.core.blocks.TextBlock()),
("answer", wagtail.core.blocks.RichTextBlock()),
],
template="regulace_konopi/blocks/faq.html",
),
label="faq",
),
),
(
"meps",
wagtail.core.blocks.StructBlock(
[
("name", wagtail.core.blocks.CharBlock(label="název")),
(
"mep",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.StructBlock(
[
(
"name",
wagtail.core.blocks.CharBlock(
label="jméno"
),
),
(
"approved",
wagtail.core.blocks.ChoiceBlock(
choices=[
(1, "Pro"),
(0, "Proti"),
(-1, "Nevíme"),
],
label="hlasoval",
),
),
]
)
),
),
],
template="regulace_konopi/blocks/party.html",
),
),
],
blank=True,
verbose_name="obsah stránky",
),
),
]
......@@ -75,12 +75,28 @@ class RegkonHomePage(MetadataPageMixin, Page):
[
("title", blocks.CharBlock(label="nadpis", icon="title")),
("text", blocks.RichTextBlock(label="text", features=RICH_TEXT_FEATURES)),
(
"text_centered",
blocks.RichTextBlock(label="text-center", features=RICH_TEXT_FEATURES),
),
(
"text_justify",
blocks.RichTextBlock(label="text-justify", features=RICH_TEXT_FEATURES),
),
(
"carousel",
blocks.ListBlock(
ImageChooserBlock(label="obrázek"), label="carousel", icon="image"
),
),
(
"carousel_text",
blocks.ListBlock(
blocks.RichTextBlock(features=RICH_TEXT_FEATURES),
label="carousel-text",
icon="paragraph",
),
),
],
verbose_name="obsah stránky",
blank=True,
......@@ -141,12 +157,28 @@ class RegkonSubPage(Page, MetadataPageMixin):
[
("title", blocks.CharBlock(label="nadpis", icon="title")),
("text", blocks.RichTextBlock(label="text", features=RICH_TEXT_FEATURES)),
(
"text_centered",
blocks.RichTextBlock(label="text-center", features=RICH_TEXT_FEATURES),
),
(
"text_justify",
blocks.RichTextBlock(label="text-justify", features=RICH_TEXT_FEATURES),
),
(
"carousel",
blocks.ListBlock(
ImageChooserBlock(label="obrázek"), label="carousel", icon="image"
),
),
(
"carousel_text",
blocks.ListBlock(
blocks.RichTextBlock(features=RICH_TEXT_FEATURES),
label="carousel-text",
icon="paragraph",
),
),
(
"FAQ",
blocks.ListBlock(
......
.mep-status {
max-width: 1.5rem;
float: left;
margin-right: 0.5rem;
}
......@@ -11,3 +10,63 @@
.nav-link {
color: white !important;
}
.navbar-brand--logo {
margin: auto 1rem;
}
.party--wrapper {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.card-header button {
min-width: 100%;
}
.card-header h2 {
color: black;
text-transform: uppercase;
}
.card-body a {
text-decoration: underline;
}
.card {
min-height: 100%;
}
.card-header {
min-height: 100%;
background-color: transparent;
border-bottom: none;
}
.carousel--text {
padding: 1rem;
height: 20rem;
}
.carousel--text .carousel-item.active{
display: flex;
align-items: center;
justify-content: center;
}
.carousel--text .carousel-item.carousel-item-next {
display: flex;
}
.carousel--text .carousel-item {
display: none;
}
.carousel--text p {
max-width: 80%;
margin: auto;
}
.full-width {
width: 100%;
}
......@@ -39,7 +39,7 @@
<div class="container">
<div class="brand-wrapper">
<a class="navbar-brand" href="/"><img src="{% static "styleguide18/assets/images/logo-round-white.svg" %}"
class="d-inline-block m-auto"/>{{ page.root_page.seo_title }}</a>
class="d-inline-block navbar-brand--logo"/>{{ page.root_page.seo_title }}</a>
</div>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
......
<div class="col-sm-6 mb-1">
<div class="card">
<div class="card-header" id="headingOne">
<h2 class="mb-0">
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse"
<div class="card-header my-auto" id="headingOne">
<button class="btn btn-link btn-block text-justify" type="button" data-toggle="collapse"
data-target="#faq{{ forloop.counter }}" aria-expanded="true" aria-controls="faq{{ forloop.counter }}">
<h2>
<b>
{{ value.question }}
</button>
</b>
</h2>
</button>
</div>
<div id="faq{{ forloop.counter }}" class="collapse " aria-labelledby="headingOne" data-parent="#faqAccordion">
......@@ -14,3 +17,5 @@
</div>
</div>
</div>
</div>
......@@ -2,8 +2,9 @@
<div class="content-block my-4 clearfix{% if forloop.first %} mt-8 lg:mt-12{% endif %}">
<h2>{{ value.name }}</h2>
<div class="party--wrapper">
{% for mep in value.mep %}
<button type="button" class="btn " data-container="body" data-toggle="popover" data-placement="top"
<button type="button" class="btn party--member" data-container="body" data-toggle="popover" data-placement="top"
data-content="{{ mep.name }}">
<img class="mep-status" src=
{% if mep.approved == '1' %}
......@@ -17,9 +18,17 @@
</button>
{% endfor %}
</div>
</div>
<script>
$(function () {
$('[data-toggle="popover"]').popover()
})
});
{#$('body').on('click', function (e) {#}
{# //only buttons#}
{# if ($(e.target).data('toggle') !== 'popover'#}
{# && $(e.target).parents('.popover.in').length === 0) {#}
{# $('[data-toggle="popover"]').popover('hide');#}
{# }#}
{#});#}
</script>
......@@ -14,6 +14,18 @@
</div>
{% endif %}
{% if block.block_type == "text_centered" %}
<div class="content-block my-4 clearfix{% if forloop.first %} mt-8 lg:mt-12{% endif %} text-center">
{{ block.value|richtext }}
</div>
{% endif %}
{% if block.block_type == "text_justify" %}
<div class="content-block my-4 clearfix{% if forloop.first %} mt-8 lg:mt-12{% endif %} text-justify">
{{ block.value|richtext }}
</div>
{% endif %}
{% if block.block_type == "carousel" %}
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
......@@ -35,13 +47,35 @@
</div>
{% endif %}
{% if block.block_type == "carousel_text" %}
<div id="carouselExampleControls" class="carousel slide carousel--text" data-ride="carousel">
<div class="carousel-inner h-100">
{% for picture in block.value %}
<div class="carousel-item {% if forloop.first %}active{% endif %} text-center h-100">
{{ picture|richtext }}
</div>
{% endfor %}
</div>
<a class="carousel-control-prev " href="#carouselExampleControls" role="button" data-slide="prev">
<span class="carousel-control-prev-icon bg-black" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
<span class="carousel-control-next-icon bg-black" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
{% endif %}
{% if block.block_type == "FAQ" %}
<div class="faq" id="faqAccordion">
<div class="row">
{% for faq in block.value %}
{% include_block faq %}
{% endfor %}
</div>
</div>
{% endif %}
{% if block.block_type == "meps" %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment