Skip to content
Snippets Groups Projects
Commit 9b394631 authored by jan.bednarik's avatar jan.bednarik
Browse files

senate: Microsite for list of senators and candidates

parent 3cae2b02
No related branches found
No related tags found
1 merge request!22senate: Microsite for list of senators and candidates
Pipeline #631 passed
Showing
with 5148 additions and 0 deletions
......@@ -27,6 +27,7 @@ jako přehled pluginů a rozšíření pro Wagtail.
.
├── home = app na web úvodní stránky Majáku
├── donate = app na web dary.pirati.cz
├── senate = app na web senat.pirati.cz
├── senat_campaign = app na weby kandidátů na senátory
...
├── majak = Django projekt s konfigurací Majáku
......
......@@ -31,6 +31,7 @@ DATABASES["default"]["ATOMIC_REQUESTS"] = True
# APPS
# ------------------------------------------------------------------------------
INSTALLED_APPS = [
"senate",
"donate",
"senat_campaign",
"home",
......
from django.apps import AppConfig
class SenateConfig(AppConfig):
name = "senate"
# Generated by Django 3.0.6 on 2020-05-29 22:26
import django.db.models.deletion
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("wagtailcore", "0045_assign_unlock_grouppagepermission"),
]
operations = [
migrations.CreateModel(
name="SenateHomePage",
fields=[
(
"page_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="wagtailcore.Page",
),
),
(
"senators",
wagtail.core.fields.StreamField(
[
(
"item",
wagtail.core.blocks.StructBlock(
[
(
"name",
wagtail.core.blocks.CharBlock(
label="jméno"
),
),
(
"district",
wagtail.core.blocks.CharBlock(
label="obvod"
),
),
(
"info",
wagtail.core.blocks.CharBlock(
label="info o nominaci"
),
),
(
"phone",
wagtail.core.blocks.CharBlock(
label="telefon", required=False
),
),
(
"email",
wagtail.core.blocks.EmailBlock(
label="email", required=False
),
),
(
"web",
wagtail.core.blocks.URLBlock(
label="web", required=False
),
),
(
"photo",
wagtail.images.blocks.ImageChooserBlock(
label="fotka"
),
),
]
),
)
],
blank=True,
verbose_name="naši senátoři",
),
),
(
"candidates",
wagtail.core.fields.StreamField(
[
(
"item",
wagtail.core.blocks.StructBlock(
[
(
"name",
wagtail.core.blocks.CharBlock(
label="jméno"
),
),
(
"district",
wagtail.core.blocks.CharBlock(
label="obvod"
),
),
(
"info",
wagtail.core.blocks.CharBlock(
label="info o nominaci"
),
),
(
"phone",
wagtail.core.blocks.CharBlock(
label="telefon", required=False
),
),
(
"email",
wagtail.core.blocks.EmailBlock(
label="email", required=False
),
),
(
"web",
wagtail.core.blocks.URLBlock(
label="web", required=False
),
),
(
"photo",
wagtail.images.blocks.ImageChooserBlock(
label="fotka"
),
),
]
),
)
],
blank=True,
verbose_name="kandidáti",
),
),
(
"matomo_id",
models.IntegerField(
blank=True,
null=True,
verbose_name="Matomo ID pro sledování návštěvnosti",
),
),
],
options={"verbose_name": "Senát",},
bases=("wagtailcore.page",),
),
]
from django.db import models
from django.utils.translation import gettext_lazy
from wagtail.admin.edit_handlers import FieldPanel, MultiFieldPanel, StreamFieldPanel
from wagtail.core import blocks
from wagtail.core.fields import StreamField
from wagtail.core.models import Page
from wagtail.images.blocks import ImageChooserBlock
class PersonBlock(blocks.StructBlock):
name = blocks.CharBlock(label="jméno")
district = blocks.CharBlock(label="obvod")
info = blocks.CharBlock(label="info o nominaci")
phone = blocks.CharBlock(label="telefon", required=False)
email = blocks.EmailBlock(label="email", required=False)
web = blocks.URLBlock(label="web", required=False)
photo = ImageChooserBlock(label="fotka")
class Meta:
icon = "person"
label = "osoba"
class SenateHomePage(Page):
senators = StreamField(
[("item", PersonBlock())], verbose_name="naši senátoři", blank=True
)
candidates = StreamField(
[("item", PersonBlock())], verbose_name="kandidáti", blank=True
)
matomo_id = models.IntegerField(
"Matomo ID pro sledování návštěvnosti", blank=True, null=True
)
content_panels = Page.content_panels + [
StreamFieldPanel("senators"),
StreamFieldPanel("candidates"),
]
promote_panels = [
MultiFieldPanel(
[FieldPanel("seo_title"), FieldPanel("search_description")],
gettext_lazy("Common page configuration"),
),
]
settings_panels = [
FieldPanel("matomo_id"),
]
subpage_types = []
class Meta:
verbose_name = "Senát"
.contact .profile .img {
width: 128px;
border: 1px solid #EEEEEE;
border-radius: 500px;
-webkit-border-radius: 500px;
-moz-border-radius: 500px;
}
.contact .profile .img img {
width: 126px;
border: 8px solid #FFFFFF;
border-radius: 500px;
-webkit-border-radius: 500px;
-moz-border-radius: 500px;
}
.contact .profile .info .position {
max-width: 400px;
}
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- Generator: Gravit.io --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="0 0 106 25" width="106pt" height="25pt"><defs><clipPath id="_clipPath_p4lwxZUQR5zrLjQErpyvbuCjY9v1RKdu"><rect width="106" height="25"/></clipPath></defs><g clip-path="url(#_clipPath_p4lwxZUQR5zrLjQErpyvbuCjY9v1RKdu)"><defs><linearGradient id="_lgradient_2" x1="0.4999999999999716" y1="-2.842170943040401e-14" x2="0.499999999999943" y2="0.9999999999999716"><stop offset="0%" style="stop-color:#555555"/><stop offset="26.56249999999632%" style="stop-color:#0D0D0D"/><stop offset="72.41847826087017%" style="stop-color:#0D0D0D"/><stop offset="100%" style="stop-color:#5B5B5B"/></linearGradient></defs><path d="M 5.5 1 L 5.5 1 C 7.984 1 10 3.081 10 5.644 L 10 19.356 C 10 21.919 7.984 24 5.5 24 L 5.5 24 C 3.016 24 1 21.919 1 19.356 L 1 5.644 C 1 3.081 3.016 1 5.5 1 Z" style="stroke:none;fill:url(#_lgradient_2);stroke-miterlimit:10;"/><path d="M 5.5 1 L 5.5 1 C 7.984 1 10 3.081 10 5.644 L 10 19.356 C 10 21.919 7.984 24 5.5 24 L 5.5 24 C 3.016 24 1 21.919 1 19.356 L 1 5.644 C 1 3.081 3.016 1 5.5 1 Z" style="fill:none;stroke:#4B4B4B;stroke-width:1;stroke-linecap:square;stroke-miterlimit:2;"/><defs><linearGradient id="_lgradient_3" x1="0.4999999999999716" y1="-2.842170943040401e-14" x2="0.499999999999943" y2="0.9999999999999716"><stop offset="0%" style="stop-color:#555555"/><stop offset="26.56249999999632%" style="stop-color:#0D0D0D"/><stop offset="72.41847826087017%" style="stop-color:#0D0D0D"/><stop offset="100%" style="stop-color:#5B5B5B"/></linearGradient></defs><path d="M 100.5 1 L 100.5 1 C 102.984 1 105 3.081 105 5.644 L 105 19.356 C 105 21.919 102.984 24 100.5 24 L 100.5 24 C 98.016 24 96 21.919 96 19.356 L 96 5.644 C 96 3.081 98.016 1 100.5 1 Z" style="stroke:none;fill:url(#_lgradient_3);stroke-linecap:square;stroke-miterlimit:2;"/><path d="M 100.5 1 L 100.5 1 C 102.984 1 105 3.081 105 5.644 L 105 19.356 C 105 21.919 102.984 24 100.5 24 L 100.5 24 C 98.016 24 96 21.919 96 19.356 L 96 5.644 C 96 3.081 98.016 1 100.5 1 Z" style="fill:none;stroke:#4B4B4B;stroke-width:1;stroke-linecap:square;stroke-miterlimit:2;"/></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="42" height="30" viewBox="0 0 42 30">
<g id="Group_27" data-name="Group 27" transform="translate(-677 -34)">
<rect id="Rectangle_30" data-name="Rectangle 30" width="42" height="6" transform="translate(677 34)" fill="#fff"/>
<rect id="Rectangle_32" data-name="Rectangle 32" width="42" height="6" transform="translate(677 46)" fill="#fff"/>
<rect id="Rectangle_34" data-name="Rectangle 34" width="42" height="6" transform="translate(677 58)" fill="#fff"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 467.6 480.7" style="enable-background:new 0 0 467.6 480.7;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<g id="Vrstva_2">
<g id="Capa_1">
<path class="st0" d="M251.9,342.2h128.3c8.6,0,15.6-7,15.6-15.6c0-2.2-0.5-4.4-1.4-6.4L251.9,0V342.2z"/>
<path class="st0" d="M98.3,342.2h122.2V111.6L85.2,317.9c-4.7,7.2-2.7,16.9,4.5,21.7C92.3,341.3,95.3,342.2,98.3,342.2z"/>
<path class="st0" d="M0,373.8c18.6,63.3,76.7,106.8,142.7,106.8H309c44.2,0.1,86.2-19.6,114.4-53.7l44.1-53.1L0,373.8z"/>
</g>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- Generator: Gravit.io --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="0 0 20.217 20.156" width="20.217pt" height="20.156pt"><defs><clipPath id="_clipPath_tR3ALwD3k6PT9ZS47lNZPyjlLQOtvovj"><rect width="20.217" height="20.156"/></clipPath></defs><g clip-path="url(#_clipPath_tR3ALwD3k6PT9ZS47lNZPyjlLQOtvovj)"><path d=" M 10.081 19.222 C 5.04 19.214 0.96 15.123 0.965 10.083 C 0.97 5.042 5.059 0.959 10.1 0.962 C 15.14 0.965 19.225 5.051 19.225 10.092 C 19.214 15.135 15.124 19.219 10.081 19.222 M 17.242 2.97 C 13.848 -0.384 8.558 -0.878 4.603 1.791 C 0.647 4.46 -0.877 9.549 0.963 13.953 C 2.802 18.356 7.493 20.849 12.172 19.911 C 16.85 18.973 20.217 14.864 20.217 10.092 C 20.212 7.417 19.142 4.854 17.242 2.97" fill="rgb(255,255,255)"/><path d=" M 9.888 9.432 C 9.588 10.889 7.988 11.659 7.051 12.292 L 7.051 4.892 C 8.065 5.051 8.96 5.643 9.505 6.513 C 10.049 7.384 10.189 8.447 9.888 9.429 M 7.051 4.094 L 7.051 2.694 L 6.17 2.694 L 6.17 4.316 C 5.564 4.508 5.233 4.701 5.289 4.811 C 5.578 4.746 5.875 4.727 6.17 4.756 L 6.17 13.256 C 5.261 15.016 6.556 17.711 6.556 17.711 C 6.556 17.711 5.592 14.824 7.74 13.449 C 9.723 12.184 16.609 12.789 16.581 8.912 C 16.581 3.412 10.219 3.44 7.051 4.1" fill="rgb(255,255,255)"/></g></svg>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment