Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • to/majak
  • b1242/majak
2 results
Select Git revision
Show changes
Showing
with 1397 additions and 283 deletions
# Generated by Django 4.1.10 on 2024-01-30 13:32
import django.db.models.deletion
import wagtail.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtailimages", "0025_alter_image_file_alter_rendition_file"),
("donate", "0040_alter_donatehomepage_lead_body"),
]
operations = [
migrations.AddField(
model_name="donateprojectpage",
name="is_sticky",
field=models.BooleanField(
default=False,
help_text="Pokud je projekt připnutý, na domovské stránce se v seznamech projektů udrží na začátku.",
verbose_name="Je připnutý",
),
),
migrations.AlterField(
model_name="donateprojectpage",
name="allow_periodic_donations",
field=models.BooleanField(
default=False, verbose_name="Umožnit pravidelné dary"
),
),
migrations.AlterField(
model_name="donateprojectpage",
name="body",
field=wagtail.fields.RichTextField(verbose_name="Obsah"),
),
migrations.AlterField(
model_name="donateprojectpage",
name="coalition_design",
field=models.BooleanField(default=False, verbose_name="Koaliční design"),
),
migrations.AlterField(
model_name="donateprojectpage",
name="date",
field=models.DateField(verbose_name="Běží od"),
),
migrations.AlterField(
model_name="donateprojectpage",
name="donated_amount",
field=models.IntegerField(
blank=True, null=True, verbose_name="Vybraná částka"
),
),
migrations.AlterField(
model_name="donateprojectpage",
name="expected_amount",
field=models.IntegerField(
blank=True, null=True, verbose_name="Očekávaná částka"
),
),
migrations.AlterField(
model_name="donateprojectpage",
name="form_title",
field=models.CharField(
choices=[("project", "Podpoř projekt"), ("camapign", "Podpoř kampaň")],
default="project",
max_length=10,
verbose_name="Titulek formuláře",
),
),
migrations.AlterField(
model_name="donateprojectpage",
name="is_new",
field=models.BooleanField(
default=False, verbose_name='Označení "nový projekt"'
),
),
migrations.AlterField(
model_name="donateprojectpage",
name="perex",
field=models.TextField(verbose_name="Krátký popis"),
),
migrations.AlterField(
model_name="donateprojectpage",
name="photo",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="wagtailimages.image",
verbose_name="Fotka",
),
),
migrations.AlterField(
model_name="donateprojectpage",
name="until",
field=models.DateField(blank=True, null=True, verbose_name="Běží do"),
),
]
# Generated by Django 4.1.10 on 2024-01-30 16:54
import wagtail.blocks
import wagtail.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("donate", "0041_donateprojectpage_is_sticky_and_more"),
]
operations = [
migrations.RemoveField(
model_name="donatehomepage",
name="custom_url_1",
),
migrations.RemoveField(
model_name="donatehomepage",
name="custom_url_1_text",
),
migrations.RemoveField(
model_name="donatehomepage",
name="custom_url_2",
),
migrations.RemoveField(
model_name="donatehomepage",
name="custom_url_2_text",
),
migrations.AddField(
model_name="donatehomepage",
name="custom_links",
field=wagtail.fields.StreamField(
[
(
"custom_link",
wagtail.blocks.StructBlock(
[
("text", wagtail.blocks.CharBlock(label="Nadpis")),
("url", wagtail.blocks.URLBlock(label="Odkaz")),
],
label="Vlastní odkaz",
),
)
],
blank=True,
use_json_field=True,
verbose_name="Vlastní odkazy",
),
),
]
# Generated by Django 4.1.10 on 2024-02-03 10:28
from django.db import migrations, models
def reset_to_default(apps, schema_editor):
DonateProjectPage = apps.get_model("donate", "DonateProjectPage")
for project_page in DonateProjectPage.objects.all():
project_page.form_title = "Daruj na projekt"
project_page.save()
class Migration(migrations.Migration):
dependencies = [
("donate", "0042_remove_donatehomepage_custom_url_1_and_more"),
]
operations = [
migrations.AlterField(
model_name="donateprojectpage",
name="form_title",
field=models.CharField(
default="Daruj na projekt",
help_text="Např. 'Daruj na projekt', 'Daruj na kampaň', ...",
max_length=32,
verbose_name="Titulek formuláře",
),
),
migrations.RunPython(reset_to_default),
]
# Generated by Django 4.1.10 on 2024-02-10 15:52
import wagtail.blocks
import wagtail.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("donate", "0043_alter_donateprojectpage_form_title"),
]
operations = [
migrations.AlterField(
model_name="donatehomepage",
name="menu",
field=wagtail.fields.StreamField(
[
(
"menu_item",
wagtail.blocks.StructBlock(
[
(
"title",
wagtail.blocks.CharBlock(
label="Titulek", required=True
),
),
(
"page",
wagtail.blocks.PageChooserBlock(
label="Stránka", required=False
),
),
(
"link",
wagtail.blocks.URLBlock(
label="Odkaz", required=False
),
),
]
),
),
(
"menu_parent",
wagtail.blocks.StructBlock(
[
(
"title",
wagtail.blocks.CharBlock(
label="Titulek", required=True
),
),
(
"menu_items",
wagtail.blocks.ListBlock(
wagtail.blocks.StructBlock(
[
(
"title",
wagtail.blocks.CharBlock(
label="Titulek", required=True
),
),
(
"page",
wagtail.blocks.PageChooserBlock(
label="Stránka", required=False
),
),
(
"link",
wagtail.blocks.URLBlock(
label="Odkaz", required=False
),
),
]
),
label="Položky menu",
),
),
]
),
),
],
blank=True,
use_json_field=True,
verbose_name="Menu",
),
),
]
# Generated by Django 4.1.10 on 2024-02-20 09:19
import wagtail.blocks
import wagtail.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("donate", "0044_alter_donatehomepage_menu"),
]
operations = [
migrations.AlterField(
model_name="donatehomepage",
name="menu",
field=wagtail.fields.StreamField(
[
(
"menu_item",
wagtail.blocks.StructBlock(
[
(
"title",
wagtail.blocks.CharBlock(
label="Titulek", required=True
),
),
(
"page",
wagtail.blocks.PageChooserBlock(
label="Stránka", required=False
),
),
(
"link",
wagtail.blocks.URLBlock(
label="Odkaz", required=False
),
),
]
),
),
(
"menu_parent",
wagtail.blocks.StructBlock(
[
(
"title",
wagtail.blocks.CharBlock(
label="Titulek", required=True
),
),
(
"menu_items",
wagtail.blocks.ListBlock(
wagtail.blocks.StructBlock(
[
(
"title",
wagtail.blocks.CharBlock(
label="Titulek", required=True
),
),
(
"page",
wagtail.blocks.PageChooserBlock(
label="Stránka", required=False
),
),
(
"link",
wagtail.blocks.URLBlock(
label="Odkaz", required=False
),
),
]
),
label="Položky menu",
),
),
],
template="donate/blocks/navbar_submenu.html",
),
),
],
blank=True,
use_json_field=True,
verbose_name="Menu",
),
),
]
# Generated by Django 4.1.13 on 2024-04-29 09:08
import wagtail.blocks
import wagtail.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("donate", "0045_alter_donatehomepage_menu"),
]
operations = [
migrations.AddField(
model_name="donatehomepage",
name="transparency_footer_items",
field=wagtail.fields.StreamField(
[
(
"transparency_url",
wagtail.blocks.StructBlock(
[
("text", wagtail.blocks.CharBlock(label="Nadpis")),
("url", wagtail.blocks.URLBlock(label="Odkaz")),
],
label="Odkaz",
),
)
],
blank=True,
use_json_field=True,
verbose_name="Odkazy v patičkové sekci Otevřenost",
),
),
]
# Generated by Django 5.0.4 on 2024-06-05 10:41
import wagtail.blocks
import wagtail.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("donate", "0046_donatehomepage_transparency_footer_items"),
]
operations = [
migrations.AlterField(
model_name="donatehomepage",
name="menu",
field=wagtail.fields.StreamField(
[
(
"menu_item",
wagtail.blocks.StructBlock(
[
(
"title",
wagtail.blocks.CharBlock(
label="Titulek", required=True
),
),
(
"page",
wagtail.blocks.PageChooserBlock(
label="Stránka", required=False
),
),
(
"link",
wagtail.blocks.URLBlock(
label="Odkaz", required=False
),
),
]
),
),
(
"menu_parent",
wagtail.blocks.StructBlock(
[
(
"title",
wagtail.blocks.CharBlock(
label="Titulek", required=True
),
),
(
"menu_items",
wagtail.blocks.ListBlock(
wagtail.blocks.StructBlock(
[
(
"title",
wagtail.blocks.CharBlock(
label="Titulek", required=True
),
),
(
"page",
wagtail.blocks.PageChooserBlock(
label="Stránka", required=False
),
),
(
"link",
wagtail.blocks.URLBlock(
label="Odkaz", required=False
),
),
]
),
label="Položky menu",
),
),
]
),
),
],
blank=True,
verbose_name="Menu",
),
),
]
from functools import cached_property
from django.conf import settings
from django.core.cache import cache
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.db import models
from django.http import HttpResponseRedirect
from django.shortcuts import redirect
from django.utils.translation import gettext_lazy
from django.template.response import TemplateResponse
from modelcluster.fields import ParentalKey
from wagtail.admin.edit_handlers import (
from wagtail.admin.panels import (
FieldPanel,
HelpPanel,
InlinePanel,
MultiFieldPanel,
ObjectList,
PublishingPanel,
StreamFieldPanel,
TabbedInterface,
)
from wagtail.core import blocks
from wagtail.core.fields import RichTextField, StreamField
from wagtail.core.models import Orderable, Page
from wagtail.fields import RichTextField, StreamField
from wagtail.images.blocks import ImageChooserBlock
from wagtail.images.edit_handlers import ImageChooserPanel
from wagtail.models import Orderable, Page
from wagtailmetadata.models import MetadataPageMixin
from tuning import help
from shared_legacy.models import (
ExtendedMetadataHomePageMixin,
ExtendedMetadataPageMixin,
SubpageMixin,
)
from shared_legacy.utils import get_subpage_url, make_promote_panels
from tuning import admin_help
from .blocks import (
CrowdfundingRewardBlock,
CustomContentBlock,
CustomLinkBlock,
DistrictDonationBlock,
MenuItemBlock,
MenuParentBlock,
PartySupportFormBlock,
ProjectIndexBlock,
)
from .forms import DonateForm
from .utils import get_donated_amount_from_api
class SubpageMixin:
"""Must be used in class definition before MetadataPageMixin!"""
# flag for rendering anchor links in menu
is_home = False
@property
def root_page(self):
if not hasattr(self, "_root_page"):
self._root_page = self.get_ancestors().type(DonateHomePage).specific().get()
return self._root_page
def get_meta_image(self):
return self.search_image or self.root_page.get_meta_image()
class DonateFormMixin(models.Model):
"""Pages which has donate form. Must be in class definition before Page!"""
......@@ -52,32 +53,79 @@ class DonateFormMixin(models.Model):
class Meta:
abstract = True
def serve(self, request):
def serve(self, request, *args, **kwargs):
if request.method == "POST":
form = DonateForm(request.POST)
if form.is_valid():
url = form.get_redirect_url()
return redirect(url)
return super().serve(request)
return super().serve(request, *args, **kwargs)
@property
def show_donate_form(self):
return bool(self.portal_project_id)
def get_url(page, dest_page_type):
try:
return page.get_children().type(dest_page_type).live().first().get_url()
except (Page.DoesNotExist, AttributeError):
return "#"
class DonateFormAmountsMixin(models.Model):
"""Amounts setup for donate forms."""
FIRST = 1
SECOND = 2
THIRD = 3
FOURTH = 4
FORM_CHOICES = [
(FIRST, "první"),
(SECOND, "druhá"),
(THIRD, "třetí"),
(FOURTH, "čtvrtá"),
]
form_amount_1 = models.IntegerField("pevná částka 1", default=100)
form_amount_2 = models.IntegerField("pevná částka 2", default=200)
form_amount_3 = models.IntegerField("pevná částka 3", default=500)
form_amount_4 = models.IntegerField("pevná částka 4", default=1000)
form_preselected = models.IntegerField(
"výchozí částka", default=FIRST, choices=FORM_CHOICES
)
form_monthly_amount_1 = models.IntegerField("měsíční částka 1", default=100)
form_monthly_amount_2 = models.IntegerField("měsíční částka 2", default=200)
form_monthly_amount_3 = models.IntegerField("měsíční částka 3", default=500)
form_monthly_amount_4 = models.IntegerField("měsíční částka 4", default=1000)
form_monthly_preselected = models.IntegerField(
"výchozí měsíční částka", default=FIRST, choices=FORM_CHOICES
)
class Meta:
abstract = True
class DonateHomePage(DonateFormMixin, Page, MetadataPageMixin):
class DonateHomePage(
DonateFormMixin,
DonateFormAmountsMixin,
Page,
ExtendedMetadataHomePageMixin,
MetadataPageMixin,
):
### FIELDS
# menu
menu = StreamField(
[
("menu_item", MenuItemBlock()),
(
"menu_parent",
MenuParentBlock(),
),
], # , ("menu_parent", MenuParentBlock())
verbose_name="Menu",
blank=True,
use_json_field=True,
)
# lead section
lead_title = models.CharField("hlavní nadpis", max_length=250, blank=True)
lead_body = models.TextField("hlavní popis", blank=True)
lead_body = RichTextField("hlavní popis", blank=True)
lead_video = models.URLField("video na youtube", blank=True, null=True)
lead_preview = models.ForeignKey(
"wagtailimages.Image",
......@@ -86,18 +134,45 @@ class DonateHomePage(DonateFormMixin, Page, MetadataPageMixin):
null=True,
verbose_name="náhled videa",
)
# support section
support_title = models.CharField("podpoř stranu nadpis", max_length=250, blank=True)
support_body = models.TextField("podpoř stranu popis", blank=True)
# projects section
project_title = models.CharField(
"podpoř projekt nadpis", max_length=250, blank=True
# main section
content_blocks = StreamField(
[
("project_index", ProjectIndexBlock()),
("district_donation", DistrictDonationBlock()),
("party_support_form", PartySupportFormBlock()),
("custom", CustomContentBlock()),
],
blank=True,
use_json_field=True,
verbose_name="Obsah",
)
project_body = models.TextField("podpoř projekt popis", blank=True)
# regions section
region_title = models.CharField("podpoř kraj nadpis", max_length=250, blank=True)
region_body = models.TextField("podpoř kraj popis", blank=True)
# footer
transparency_footer_items = StreamField(
[("transparency_url", CustomLinkBlock(label="Odkaz"))],
blank=True,
use_json_field=True,
verbose_name="Odkazy v patičkové sekci Otevřenost",
)
# settings
faq_page = models.ForeignKey(
"donate.DonateTextPage",
on_delete=models.PROTECT,
blank=True,
null=True,
related_name="FAQ",
verbose_name="Stránka s FAQ",
)
custom_links = StreamField(
[("custom_link", CustomLinkBlock(label="Vlastní odkaz"))],
verbose_name="Vlastní odkazy",
blank=True,
use_json_field=True,
)
facebook = models.URLField("Facebook URL", blank=True, null=True)
instagram = models.URLField("Instagram URL", blank=True, null=True)
twitter = models.URLField("Twitter URL", blank=True, null=True)
......@@ -114,34 +189,30 @@ class DonateHomePage(DonateFormMixin, Page, MetadataPageMixin):
FieldPanel("lead_title"),
FieldPanel("lead_body"),
FieldPanel("lead_video"),
ImageChooserPanel("lead_preview"),
FieldPanel("lead_preview"),
],
"hlavní sekce",
),
MultiFieldPanel(
[FieldPanel("support_title"), FieldPanel("support_body")], "podpoř stranu",
),
MultiFieldPanel(
[FieldPanel("project_title"), FieldPanel("project_body")], "podpoř projekt",
),
MultiFieldPanel(
[FieldPanel("region_title"), FieldPanel("region_body")], "podpoř kraj",
),
FieldPanel("content_blocks"),
FieldPanel("transparency_footer_items"),
]
promote_panels = [
menu_panels = [
MultiFieldPanel(
[
FieldPanel("seo_title"),
FieldPanel("search_description"),
ImageChooserPanel("search_image"),
HelpPanel(help.build(help.IMPORTANT_TITLE)),
FieldPanel("menu"),
],
gettext_lazy("Common page configuration"),
heading="Nastavení menu",
),
]
promote_panels = make_promote_panels(admin_help.build(admin_help.IMPORTANT_TITLE))
settings_panels = [
MultiFieldPanel(
[FieldPanel("custom_links")],
"vlastní odkazy",
),
MultiFieldPanel(
[
FieldPanel("facebook"),
......@@ -152,9 +223,37 @@ class DonateHomePage(DonateFormMixin, Page, MetadataPageMixin):
"sociální sítě",
),
FieldPanel("matomo_id"),
FieldPanel("title_suffix"),
MultiFieldPanel(
[
FieldPanel("portal_project_id"),
FieldPanel("form_amount_1"),
FieldPanel("form_amount_2"),
FieldPanel("form_amount_3"),
FieldPanel("form_amount_4"),
FieldPanel("form_preselected"),
FieldPanel("form_monthly_amount_1"),
FieldPanel("form_monthly_amount_2"),
FieldPanel("form_monthly_amount_3"),
FieldPanel("form_monthly_amount_4"),
FieldPanel("form_monthly_preselected"),
],
"nastavení darů",
),
FieldPanel("faq_page"),
]
### EDIT HANDLERS
edit_handler = TabbedInterface(
[
ObjectList(content_panels, heading="Obsah"),
ObjectList(promote_panels, heading="Metadata"),
ObjectList(settings_panels, heading="Nastavení"),
ObjectList(menu_panels, heading="Menu"),
]
)
### RELATIONS
subpage_types = [
......@@ -176,19 +275,22 @@ class DonateHomePage(DonateFormMixin, Page, MetadataPageMixin):
def root_page(self):
return self
@property
def get_404_response(self, request):
return HttpResponseRedirect(self.full_url)
@cached_property
def info_page_url(self):
return get_url(self, DonateInfoPage)
return get_subpage_url(self, DonateInfoPage)
@property
def projects_page_url(self):
return get_url(self, DonateProjectIndexPage)
@cached_property
def project_indexes(self):
return DonateProjectIndexPage.objects.child_of(self).live()
@property
@cached_property
def regions_page_url(self):
return get_url(self, DonateRegionIndexPage)
return get_subpage_url(self, DonateRegionIndexPage)
@property
@cached_property
def has_projects(self):
return self.get_descendants().type(DonateProjectPage).live().exists()
......@@ -199,32 +301,15 @@ class DonateHomePage(DonateFormMixin, Page, MetadataPageMixin):
self.get_descendants().type(DonateRegionPage).live().specific()
)
context["projects"] = (
self.get_descendants()
.type(DonateProjectPage)
.live()
.specific()
.order_by("-donateprojectpage__date")[:3]
)
return context
class DonateRegionIndexPage(Page, SubpageMixin, MetadataPageMixin):
class DonateRegionIndexPage(
Page, ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin
):
### PANELS
promote_panels = [
MultiFieldPanel(
[
FieldPanel("slug"),
FieldPanel("seo_title"),
FieldPanel("search_description"),
ImageChooserPanel("search_image"),
HelpPanel(help.build(help.NO_SEO_TITLE, help.NO_SEARCH_IMAGE)),
],
gettext_lazy("Common page configuration"),
),
]
promote_panels = make_promote_panels()
settings_panels = []
......@@ -235,6 +320,9 @@ class DonateRegionIndexPage(Page, SubpageMixin, MetadataPageMixin):
### OTHERS
# flag for rendering anchor links in menu
is_home = False
class Meta:
verbose_name = "Přehled krajů"
......@@ -244,7 +332,14 @@ class DonateRegionIndexPage(Page, SubpageMixin, MetadataPageMixin):
return context
class DonateRegionPage(DonateFormMixin, Page, SubpageMixin, MetadataPageMixin):
class DonateRegionPage(
DonateFormMixin,
DonateFormAmountsMixin,
Page,
ExtendedMetadataPageMixin,
SubpageMixin,
MetadataPageMixin,
):
### FIELDS
main_title = models.CharField("hlavní nadpis na stránce", max_length=250)
......@@ -254,30 +349,36 @@ class DonateRegionPage(DonateFormMixin, Page, SubpageMixin, MetadataPageMixin):
content_panels = Page.content_panels + [
FieldPanel("main_title"),
FieldPanel("body", classname="full"),
FieldPanel("body"),
]
promote_panels = [
MultiFieldPanel(
[
FieldPanel("slug"),
FieldPanel("seo_title"),
FieldPanel("search_description"),
ImageChooserPanel("search_image"),
HelpPanel(
help.build(
promote_panels = make_promote_panels(
admin_help.build(
"Pokud není zadán <strong>Titulek stránky</strong>, použije "
"se <strong>Hlavní nadpis</strong> (tab obsah).",
help.NO_SEARCH_IMAGE,
admin_help.NO_SEARCH_IMAGE,
)
),
)
settings_panels = [
MultiFieldPanel(
[
FieldPanel("portal_project_id"),
FieldPanel("form_amount_1"),
FieldPanel("form_amount_2"),
FieldPanel("form_amount_3"),
FieldPanel("form_amount_4"),
FieldPanel("form_preselected"),
FieldPanel("form_monthly_amount_1"),
FieldPanel("form_monthly_amount_2"),
FieldPanel("form_monthly_amount_3"),
FieldPanel("form_monthly_amount_4"),
FieldPanel("form_monthly_preselected"),
],
gettext_lazy("Common page configuration"),
"nastavení darů",
),
]
settings_panels = [FieldPanel("portal_project_id")]
### RELATIONS
parent_page_types = ["donate.DonateRegionIndexPage"]
......@@ -285,37 +386,46 @@ class DonateRegionPage(DonateFormMixin, Page, SubpageMixin, MetadataPageMixin):
### OTHERS
# flag for rendering anchor links in menu
is_home = False
class Meta:
verbose_name = "Kraj"
def get_meta_title(self):
return self.seo_title or self.main_title
@property
@cached_property
def targeted_donations_page_url(self):
return get_url(self, DonateTargetedDonationsPage)
return get_subpage_url(self, DonateTargetedDonationsPage)
@property
@cached_property
def has_targeted_donations(self):
return self.get_descendants().type(DonateTargetedDonationsPage).live().exists()
class DonateProjectIndexPage(Page, SubpageMixin, MetadataPageMixin):
class DonateProjectIndexPage(
Page, ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin
):
### FIELDS
heading = models.CharField("Hlavní nadpis", max_length=32)
support_heading = models.CharField("Podpoř projekt nadpis", max_length=32)
support_description = RichTextField("Podpoř projekt popis")
### PANELS
promote_panels = [
content_panels = Page.content_panels + [
FieldPanel("heading"),
MultiFieldPanel(
[
FieldPanel("slug"),
FieldPanel("seo_title"),
FieldPanel("search_description"),
ImageChooserPanel("search_image"),
HelpPanel(help.build(help.NO_SEO_TITLE, help.NO_SEARCH_IMAGE)),
FieldPanel("support_heading"),
FieldPanel("support_description"),
],
gettext_lazy("Common page configuration"),
"Informace v sekci 'podpoř projekt' na homepage",
),
]
promote_panels = make_promote_panels()
settings_panels = []
### RELATIONS
......@@ -325,6 +435,19 @@ class DonateProjectIndexPage(Page, SubpageMixin, MetadataPageMixin):
### OTHERS
# flag for rendering anchor links in menu
is_home = False
@property
def projects(self):
return (
DonateProjectPage.objects.child_of(self)
.filter()
.distinct()
.order_by("-is_sticky", "-date")
.live()
)[:3]
class Meta:
verbose_name = "Přehled projektů"
......@@ -348,28 +471,37 @@ class DonateProjectIndexPage(Page, SubpageMixin, MetadataPageMixin):
return context
class DonateProjectPage(DonateFormMixin, Page, SubpageMixin, MetadataPageMixin):
FIRST = 1
SECOND = 2
THIRD = 3
FORM_CHOICES = [
(FIRST, "první"),
(SECOND, "druhá"),
(THIRD, "třetí"),
]
class DonateProjectPage(
DonateFormMixin,
DonateFormAmountsMixin,
Page,
ExtendedMetadataPageMixin,
SubpageMixin,
MetadataPageMixin,
):
TITLE_PROJECT = "Daruj na projekt"
### FIELDS
date = models.DateField("běží od")
perex = models.TextField("krátký popis")
body = RichTextField("obsah")
is_new = models.BooleanField('označení "nový projekt"', default=False)
date = models.DateField("Běží od")
until = models.DateField("Běží do", null=True, blank=True)
perex = models.TextField("Krátký popis")
body = RichTextField("Obsah")
is_new = models.BooleanField('Označení "nový projekt"', default=False)
is_sticky = models.BooleanField(
"Je připnutý",
help_text="Pokud je projekt připnutý, na domovské stránce se v seznamech projektů udrží na začátku.",
default=False,
)
allow_periodic_donations = models.BooleanField(
"umožnit pravidelné dary", default=False
"Umožnit pravidelné dary", default=False
)
photo = models.ForeignKey(
"wagtailimages.Image",
verbose_name="fotka",
verbose_name="Fotka",
on_delete=models.PROTECT,
null=True,
blank=True,
......@@ -378,81 +510,105 @@ class DonateProjectPage(DonateFormMixin, Page, SubpageMixin, MetadataPageMixin):
[("photo", ImageChooserBlock(label="fotka"))],
verbose_name="galerie fotek",
blank=True,
use_json_field=True,
)
expected_amount = models.IntegerField("očekávaná částka", blank=True, null=True)
donated_amount = models.IntegerField("vybraná částka", blank=True, null=True)
form_amount_1 = models.IntegerField("pevná částka 1", default=100)
form_amount_2 = models.IntegerField("pevná částka 2", default=200)
form_amount_3 = models.IntegerField("pevná částka 3", default=500)
form_preselected = models.IntegerField(
"výchozí částka", default=FIRST, choices=FORM_CHOICES
form_title = models.CharField(
"Titulek formuláře",
help_text="Např. 'Daruj na projekt', 'Daruj na kampaň', ...",
max_length=32,
default=TITLE_PROJECT,
)
expected_amount = models.IntegerField("Očekávaná částka", blank=True, null=True)
donated_amount = models.IntegerField("Vybraná částka", blank=True, null=True)
coalition_design = models.BooleanField("Koaliční design", default=False)
# we will use photo as search image
search_image = None
crowdfunding = StreamField(
[("reward_block", CrowdfundingRewardBlock())],
verbose_name="Crowdfunding bloky",
blank=True,
use_json_field=True,
)
### PANELS
content_panels = Page.content_panels + [
MultiFieldPanel(
[FieldPanel("is_new"), FieldPanel("perex"), ImageChooserPanel("photo")],
"info do přehledu projektů",
[
FieldPanel("is_new"),
FieldPanel("is_sticky"),
FieldPanel("perex"),
FieldPanel("photo"),
],
"Info do přehledu projektů",
),
MultiFieldPanel(
[
FieldPanel("date"),
FieldPanel("expected_amount"),
FieldPanel("body", classname="full"),
StreamFieldPanel("gallery"),
FieldPanel("until"),
],
"Časový interval projektu",
),
FieldPanel("body"),
FieldPanel("gallery"),
]
promote_panels = [
MultiFieldPanel(
[
FieldPanel("slug"),
FieldPanel("seo_title"),
FieldPanel("search_description"),
HelpPanel(
help.build(
promote_panels = make_promote_panels(
admin_help.build(
"Pokud není zadán <strong>Titulek stránky</strong>, použije "
"se „Podpoř projekt <strong>Název</strong>“ (tab obsah).",
"Pokud není zadán <strong>Popis vyhledávání</strong>, použije "
"se prvních 150 znaků <strong>Perexu</strong> (tab obsah).",
)
),
],
gettext_lazy("Common page configuration"),
admin_help.NO_DESCRIPTION_USE_PEREX,
),
]
search_image=False,
)
settings_panels = [
PublishingPanel(),
MultiFieldPanel(
[
FieldPanel("form_title"),
FieldPanel("expected_amount"),
FieldPanel("portal_project_id"),
FieldPanel("allow_periodic_donations"),
FieldPanel("form_amount_1"),
FieldPanel("form_amount_2"),
FieldPanel("form_amount_3"),
FieldPanel("form_amount_4"),
FieldPanel("form_preselected"),
FieldPanel("form_monthly_amount_1"),
FieldPanel("form_monthly_amount_2"),
FieldPanel("form_monthly_amount_3"),
FieldPanel("form_monthly_amount_4"),
FieldPanel("form_monthly_preselected"),
],
"nastavení darů",
),
MultiFieldPanel(
[
FieldPanel("crowdfunding"),
],
"Nastavení crowdfundingových odměn",
),
FieldPanel("coalition_design"),
]
### RELATIONS
parent_page_types = ["donate.DonateProjectIndexPage"]
subpage_types = []
subpage_types = ["donate.DonateSecretPreviewPage"]
### OTHERS
# flag for rendering anchor links in menu
is_home = False
class Meta:
verbose_name = "Projekt"
def get_meta_image(self):
return self.photo
def get_meta_title(self):
return self.seo_title or self.title
def get_meta_description(self):
if self.search_description:
return self.search_description
......@@ -496,82 +652,99 @@ class DonateProjectPage(DonateFormMixin, Page, SubpageMixin, MetadataPageMixin):
)
return context
def get_template(self, request, *args, **kwargs):
if self.coalition_design:
return "donate/donate_project_page_coalition.html"
return super().get_template(request, *args, **kwargs)
class DonateTextPage(Page, SubpageMixin, MetadataPageMixin):
class DonateTextPage(Page, ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin):
### FIELDS
body = RichTextField("obsah", blank=True)
### PANELS
content_panels = Page.content_panels + [
FieldPanel("body", classname="full"),
]
content_panels = Page.content_panels + [FieldPanel("body")]
promote_panels = [
MultiFieldPanel(
[
FieldPanel("slug"),
FieldPanel("seo_title"),
FieldPanel("search_description"),
ImageChooserPanel("search_image"),
HelpPanel(help.build(help.NO_SEO_TITLE, help.NO_SEARCH_IMAGE)),
],
gettext_lazy("Common page configuration"),
),
]
promote_panels = make_promote_panels()
settings_panels = []
### RELATIONS
parent_page_types = ["donate.DonateHomePage"]
subpage_types = []
parent_page_types = [
"donate.DonateHomePage",
"donate.DonateTextPage",
"donate.DonateInfoPage",
]
subpage_types = ["donate.DonateTextPage", "donate.DonateInfoPage"]
### OTHERS
# flag for rendering anchor links in menu
is_home = False
class Meta:
verbose_name = "Stránka s textem"
class DonateInfoPage(DonateFormMixin, Page, SubpageMixin, MetadataPageMixin):
class DonateInfoPage(
DonateFormMixin,
DonateFormAmountsMixin,
Page,
ExtendedMetadataPageMixin,
SubpageMixin,
MetadataPageMixin,
):
### FIELDS
body = RichTextField("obsah", blank=True)
### PANELS
content_panels = Page.content_panels + [
FieldPanel("body", classname="full"),
]
content_panels = Page.content_panels + [FieldPanel("body")]
promote_panels = make_promote_panels()
promote_panels = [
settings_panels = [
PublishingPanel(),
MultiFieldPanel(
[
FieldPanel("slug"),
FieldPanel("seo_title"),
FieldPanel("search_description"),
ImageChooserPanel("search_image"),
HelpPanel(help.build(help.NO_SEO_TITLE, help.NO_SEARCH_IMAGE)),
FieldPanel("form_amount_1"),
FieldPanel("form_amount_2"),
FieldPanel("form_amount_3"),
FieldPanel("form_amount_4"),
FieldPanel("form_preselected"),
FieldPanel("form_monthly_amount_1"),
FieldPanel("form_monthly_amount_2"),
FieldPanel("form_monthly_amount_3"),
FieldPanel("form_monthly_amount_4"),
FieldPanel("form_monthly_preselected"),
],
gettext_lazy("Common page configuration"),
"nastavení darů",
),
]
settings_panels = []
### RELATIONS
parent_page_types = ["donate.DonateHomePage"]
subpage_types = []
parent_page_types = [
"donate.DonateHomePage",
"donate.DonateTextPage",
"donate.DonateInfoPage",
]
subpage_types = ["donate.DonateTextPage", "donate.DonateInfoPage"]
### OTHERS
# flag for rendering anchor links in menu
is_home = False
class Meta:
verbose_name = "Infostránka s formulářem"
# use portal_project_id from home page
@property
@cached_property
def portal_project_id(self):
return self.get_parent().specific.portal_project_id
......@@ -604,7 +777,12 @@ class TargetedDonation(Orderable):
class DonateTargetedDonationsPage(
DonateFormMixin, Page, SubpageMixin, MetadataPageMixin
DonateFormMixin,
DonateFormAmountsMixin,
Page,
ExtendedMetadataPageMixin,
SubpageMixin,
MetadataPageMixin,
):
### FIELDS
......@@ -617,21 +795,27 @@ class DonateTargetedDonationsPage(
MultiFieldPanel([InlinePanel("targeted_donations")], "adresné dary"),
]
promote_panels = [
promote_panels = make_promote_panels()
settings_panels = [
PublishingPanel(),
MultiFieldPanel(
[
FieldPanel("slug"),
FieldPanel("seo_title"),
FieldPanel("search_description"),
ImageChooserPanel("search_image"),
HelpPanel(help.build(help.NO_SEO_TITLE, help.NO_SEARCH_IMAGE)),
FieldPanel("form_amount_1"),
FieldPanel("form_amount_2"),
FieldPanel("form_amount_3"),
FieldPanel("form_amount_4"),
FieldPanel("form_preselected"),
FieldPanel("form_monthly_amount_1"),
FieldPanel("form_monthly_amount_2"),
FieldPanel("form_monthly_amount_3"),
FieldPanel("form_monthly_amount_4"),
FieldPanel("form_monthly_preselected"),
],
gettext_lazy("Common page configuration"),
"nastavení darů",
),
]
settings_panels = []
### RELATIONS
parent_page_types = ["donate.DonateRegionPage"]
......@@ -639,6 +823,9 @@ class DonateTargetedDonationsPage(
### OTHERS
# flag for rendering anchor links in menu
is_home = False
class Meta:
verbose_name = "Adresné dary"
......@@ -672,3 +859,34 @@ class DonateTargetedDonationsPage(
context["initial_project_id"] = 0
return context
class DonateSecretPreviewPage(Page):
max_count_per_parent = 1
parent_page_types = [
"donate.DonateProjectPage",
]
subpage_types = []
class Meta:
verbose_name = "Skrytá stránka pro náhled konceptu"
def get_context(self, request, *args, **kwargs):
parent_page = self.get_parent().get_latest_revision_as_object()
context = parent_page.get_context(request=request)
context.update({"disable_robots": True})
return context
def get_template(self, request, *args, **kwargs):
parent_page = self.get_parent().get_latest_revision_as_object()
return parent_page.get_template(request, *args, **kwargs)
def serve(self, request, *args, **kwargs):
return TemplateResponse(
request,
self.get_template(request, *args, **kwargs),
self.get_context(request, *args, **kwargs),
)
......@@ -10,7 +10,7 @@
font-display: block;
}
i {
i[class^="icon"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icomoon' !important;
speak: none;
......@@ -55,6 +55,9 @@ i {
.icon-chevron-right:before {
content: "\f054";
}
.icon-chevron-down:before {
content: "\e925";
}
.icon-external-link:before {
content: "\f08e";
}
......
......@@ -71,6 +71,10 @@ h1.lead, h2.lead, h3.lead, h4.lead, h5.lead, h6.lead {
text-transform: uppercase;
}
.lead-small {
font-size: 1.1rem !important
}
h1.homepage-heading {
......@@ -213,6 +217,10 @@ h3.page-subheading {
color: #ffffff;
}
.section--custom {
display: flow-root;
}
/* SECTION SIZING */
section {
......@@ -220,7 +228,7 @@ section {
}
.section--lead {
padding: 6rem 0rem;
padding: 2rem 0rem;
}
.section--no-bottom-padding {
......@@ -592,6 +600,7 @@ footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 {
.project .card-body p {
color: #797676;
white-space: pre-line;
}
.project .card-footer p {
......@@ -641,8 +650,8 @@ footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 {
}
.project-images > div{
padding-right: 7.5px;
padding-left: 7.5px;
padding-right: 6.25px;
padding-left: 6.25px;
margin-bottom: 15px;
}
......@@ -698,20 +707,13 @@ footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 {
}
.donate-form__left {
background: #090A0B;
color: white;
padding: 1.8rem;
flex: 0 0 auto;
justify-content: space-between;
display: flex;
flex-direction: column;
}
.donate-form__icon {
max-width: 7rem;
margin-bottom: 4rem;
}
.donate-form__right {
width: 100%;
padding: 1.8rem;
......@@ -800,10 +802,9 @@ footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 {
align-items: center;
}
.donate-form__icon {
max-width: 2.5rem;
margin-bottom: 0rem;
max-width: 12rem;
order: 1;
margin-left: 1.8rem;
margin: 0 auto;
}
.donate-form__left-content {
order: 0;
......@@ -878,6 +879,12 @@ footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 {
padding: 1.8rem;
}
@media screen and (max-width: 991px) {
.project-donate-form__left {
display: none;
}
}
/* FOOTER */
.socials {
......@@ -1053,6 +1060,10 @@ footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 {
margin-bottom: 0.6rem;
}
.project__sharing-box-bottom {
display: none;
}
@media screen and (max-width: 991px) {
.article__sharing-box .card-body {
padding: 1.8rem;
......@@ -1072,6 +1083,15 @@ footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 {
margin-bottom: 0;
margin-right: 1.2rem;
}
.project__sharing-box-bottom {
display: block;
margin-top: 3rem;
}
.project__sharing-box-top {
display: none;
}
}
......@@ -1162,3 +1182,168 @@ img.full-width {
.btn-wide {
width: 250px;
}
.responsive-object {
position: relative;
}
.responsive-object.ratio-16-9 {
padding-bottom: calc(100% / 16 * 9);
}
.responsive-object iframe,
.responsive-object object,
.responsive-object embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
/* OVERRIDE RICHTEXT ITALICS STYLE <i> */
.richtext i:not([class^="icon-"])) {
font-family: "Roboto Condensed", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
font-style: italic;
font-weight: inherit;
}
/* OVERRIDE RICHTEXT IMAGES */
.richtext-image.left {
float: left;
margin-right: 1.5rem;
}
.richtext-image.right {
float: right;
margin-left: 1.5rem;
}
.text-grey-200 {
color: #adadad;
}
/* BEGIN TailwindCSS-based image formatting */
.mx-auto {
margin-left: auto;
margin-right: auto
}
.my-6 {
margin-top: 1.5rem;
margin-bottom: 1.5rem
}
.w-full {
width: 100%
}
.float-left{
float: left
}
.max-w-\[400px\]{
max-width: 400px
}
.sm\:max-w-full{
max-width: 100%
}
.float-right{
float: right
}
.ml-4 {
margin-left: 1rem
}
.mb-6{
margin-bottom: 1.5rem
}
.object-contain {
object-fit: contain;
-o-object-fit: contain
}
@media screen and (max-width: 991px) {
.lg\:h-max {
height: max-content;
}
.lg\:w-auto {
width: auto;
}
}
/* END TailwindCSS-based image formatting */
/* The container <div> - needed to position the dropdown content */
.dropdown {
position: relative;
cursor: pointer;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
z-index: 1;
}
@media screen and (max-width: 1200px) {
.dropdown-content {
display: block;
position: unset;
}
}
@media screen and (max-width: 1200px) {
.dropbtn {
display: none;
}
}
/* Links inside the dropdown */
.dropdown-content a {
display: block;
color: white;
}
@media screen and (min-width: 1200px) {
/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content,
.dropdown:focus .dropdown-content {
display: flex;
flex-direction: column;
gap: 0.75rem;
background: black;
padding: 0.8rem;
margin-left: -0.8rem;
width: 100%;
}
.dropdown-content li {
line-height: 1.4rem
}
.dropdown:hover,
.dropdown:focus {
background: black
}
}
.drop-arrow {
margin-left: 2px;
color: #8a8a8a;
position: relative;
top: -3px;
}
@media screen and (max-width: 1200px) {
.drop-arrow {
display: none;
}
}
......@@ -52,20 +52,38 @@
// On amount radio change
$("input[name='amount']").change(function() {
const $customAmount = $('#customamount')
$customAmount.attr('required', false);
$customAmount.val("");
});
// If custom amount is selected
if($(this).attr('id') == 'amount4') {
// Show custom amount input and set it required
$("#js-custom-amount-input").show(50);
$("input[name='custom_amount']").focus(function() {
$('#customamount').attr('required', true);
$('input[name=amount]:checked', '#js-donate-form').prop('checked', false);
})
// Function for handling switching between monthly and one-time prices
$("input[name='periodicity']").change(function () {
// periodicity 730 === monthly
if ($(this).attr('value') === '730') {
const $monthlyAmounts = $('#monthlyAmounts')
const selectRadio = $monthlyAmounts.data('default-selected')
$('input[name=amount]:checked', '#js-donate-form').prop('checked', false);
$(`#monthlyAmounts input[name=amount]:eq("${selectRadio - 1}")`).prop('checked', true);
$monthlyAmounts.show();
$('#oneTimeAmounts').hide();
} else {
const $oneTimeAmounts = $('#oneTimeAmounts')
// Hide custom amount and remove required field
$("#js-custom-amount-input").hide(50);
$('#customamount').attr('required', false);
const selectRadio = $oneTimeAmounts.data('default-selected')
$('input[name=amount]:checked', '#js-donate-form').prop('checked', false);
$(`#oneTimeAmounts input[name=amount]:eq("${selectRadio - 1}")`).prop('checked', true);
$oneTimeAmounts.show();
$('#monthlyAmounts').hide();
}
});
......@@ -92,7 +110,7 @@
});
$("#other_target_select").change(function () {
if ($(this).val() !== "-") {
if ($(this).val() !== "") {
$("#other_target").prop("checked", true);
updateLink($(this).val());
}
......
donate/static/donate/img/ivan.png

229 KiB

......@@ -2,27 +2,17 @@
<!doctype html>
<html lang="cs">
<head>
{% if request.in_preview_panel %}
<base target="_blank">
{% endif %}
<!-- Font loader -->
<script type="text/javascript">
WebFontConfig = {
google: { families: ['Roboto+Condensed:300,300i,400,400i,700,700i:latin-ext', 'Bebas+Neue'] }
};
(function () {
var wf = document.createElement('script');
wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
<link href="https://gfonts.pirati.cz/css2?family=Bebas+Neue&family=Roboto+Condensed:wght@300;400;700&family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
<!-- Meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{% meta_tags %}
{% if settings.MAJAK_ENV == "test" %}
{% if settings.MAJAK_ENV == "test" or disable_robots %}
<meta name="robots" content="noindex, nofollow">
{% endif %}
......@@ -37,6 +27,8 @@
<link href="{% static "donate/assets/css/style.css" %}" rel="stylesheet">
<link href="{% static "donate/assets/css/icons.css" %}" rel="stylesheet">
{% block extra_head %}{% endblock %}
{% if page.root_page.matomo_id %}
{% include "shared/matomo_snippet.html" with matomo_id=page.root_page.matomo_id %}
{% endif %}
......@@ -53,9 +45,20 @@
{% endif %}
<!-- HEADER -->
{% block header %}
<div class="pre-navbar d-none d-lg-flex" style="background:black;">
<div class="container d-flex justify-content-end">
<a href="https://www.pirati.cz/" class="header_link header_link--desktop mr-4 py-2" target="_blank" rel="noreferrer"><i class="icon-external-link mr-2" title="Ikona odkazu"></i>www.pirati.cz</a>
{% for custom_link in page.root_page.custom_links %}
<a
href="{{ custom_link.value.url }}"
class="header_link header_link--desktop mr-4 py-2"
target="_blank"
rel="noreferrer"
>
<i class="icon-external-link mr-2" title="Ikona odkazu"></i>
{{ custom_link.value.text }}
</a>
{% endfor %}
</div>
</div>
......@@ -65,7 +68,10 @@
<!-- Candidate name -->
<div class="brand-wrapper">
<a class="navbar-brand" href="/">
<img src="{% static "donate/img/logo_napis.svg" %}" alt="Logo podpoř piráty">
<img
src="{% static "styleguide2/images/logo-full-white.svg"%}"
alt="Logo"
>
</a>
</div>
......@@ -79,31 +85,32 @@
<!-- Navigation -->
<div class="collapse navbar-collapse" id="mainNavigation">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
{% if page.is_home %}
<a class="nav-link js-scroll-anchor" href="#strana">Podpoř Piráty</a>
{% else %}
<a class="nav-link" href="/#strana">Podpoř Piráty</a>
{% endif %}
</li>
{% if page.root_page.has_projects %}
<li class="nav-item">
<a class="nav-link" href="{{ page.root_page.projects_page_url }}">Projekty a kampaně</a>
</li>
{% endif %}
<li class="nav-item">
<a class="nav-link" href="{{ page.root_page.regions_page_url }}">Kraje</a>
</li>
{% for block in page.root_page.menu %}
{% include_block block %}
{% endfor %}
</ul>
<a href="https://www.pirati.cz/" class="d-block d-lg-none mb-3 header_link header_link--mobile" target="_blank" rel="noreferrer"><i class="icon-external-link mr-2" title="Ikona odkazu"></i>www.pirati.cz</a>
{% for custom_link in page.root_page.custom_links %}
<a
href="{{ custom_link.value.url }}"
class="d-block d-lg-none mb-3 header_link header_link--mobile"
target="_blank"
rel="noreferrer"
>
<i class="icon-external-link mr-2" title="Ikona odkazu"></i>
{{ custom_link.value.text }}
</a>
{% endfor %}
</div><!-- /navigation -->
</div><!-- /container -->
</nav>
{% endblock %}
<!-- /HEADER -->
{% block content %}{% endblock %}
<!-- FOOTER -->
{% block footer %}
<footer id="kontakt">
<div class="footer__top">
......@@ -115,6 +122,9 @@
<img src="{% static "donate/img/logo_napis_white.svg" %}" alt="Logo podpoř piráty">
</div>
<ul class="footer__menu mt-5">
{% if page.root_page.faq_page %}
<li><a href={{ page.root_page.faq_page.url }}>FAQ - pravidla pro přijímání darů</a></li>
{% endif %}
<li><a href="/osobni-udaje/">Zásady zpracování osobních údajů</a></li>
<li><a href="/obchodni-podminky/">Obchodní podmínky</a></li>
</ul>
......@@ -123,19 +133,25 @@
<div class="col-12 col-md-6 col-lg-3 mb-4 order-2 order-lg-1">
<h4 class="lead mb-3">Otevřenost</h4>
<ul class="footer__menu">
<li><a href="https://ucet.pirati.cz" title="Zvláštní účet ve smyslu § 17b zákona č. 424/1991 Sb. o sdružování v politických stranách">Účet dle §17b ZPS</a></li>
<li><a href="https://smlouvy.pirati.cz">Registr smluv</a></li>
<li><a href="https://piroplaceni.pirati.cz">Otevřené hospodaření</a></li>
<li><a href="https://wiki.pirati.cz/fo/start" title="Financování a hospodaření">Financování</a></li>
{% if page.root_page.transparency_footer_items %}
{% for block in page.root_page.transparency_footer_items %}
<li>
<a
href="{{ block.value.url }}"
target="_blank"
>{{ block.value.text }}</a>
</li>
{% endfor %}
{% endif %}
</ul>
</div><!-- /column -->
<div class="col-12 col-md-6 col-lg-3 order-3 order-lg-2">
<h4 class="lead mb-3">Kontakt</h4>
<h6 class="mb-0">Občané</h6>
<p class="mb-3"><a href="mailto:info@pirati.cz">info@pirati.cz</a></p>
<h6 class="mb-0">Média</h6>
<p class="mb-0"><a href="mailto:karolina.sadilkova@pirati.cz">karolina.sadilkova@pirati.cz</a></p>
<h6 class="mb-0">Napiš nám</h6>
<p class="mb-3"><a href="mailto:fundraising@pirati.cz">fundraising@pirati.cz</a></p>
<h6 class="mb-0">Zavolej nám</h6>
<p class="mb-0"><a href="tel: +420770189488">+420 770 189 488</a></p>
</div><!-- /column -->
<div class="col-12 col-md-6 col-lg-3 mb-4 mb-md-5 mb-lg-4 order-1 order-lg-3">
......@@ -155,7 +171,7 @@
{% endif %}
</div>
<div class="row">
<a href="https://nalodeni.pirati.cz" class="btn btn-success ml-2 my-3">Naloď se <i class="icon-chevron-right ml-2"></i></a>
<a href="https://nalodeni.pirati.cz" class="btn btn-success ml-2 my-3">Nalodit se <i class="icon-chevron-right ml-2"></i></a>
</div>
</div><!-- /column -->
</div> <!-- /row -->
......@@ -167,7 +183,14 @@
<div class="container">
<div class="row">
<div class="col-12 col-md-6 mb-3 mb-md-0">
<p class="mb-0">&copy; {% now "Y" %} Piráti. Všechna práva vyhlazena.<br/>Sdílejte a nechte ostatní sdílet za stejných podmínek.</p>
<p class="mb-0">
<span style="display:inline-block;transform:scale(-1, 1)">&copy;</span>
{% now "Y" %} Piráti. <a href="https://wiki.pirati.cz/rules/prah#licence" target="_blank" class="underline">CC-BY-SA 4.0</a>.
<br>
Všechna práva vyhlazena. Sdílejte a nechte ostatní sdílet za stejných podmínek.
<br>
Zadavatel | zpracovatel: Česká pirátská strana
</p>
</div><!-- /column -->
<div class="col-12 col-md-6 text-md-right">
<p class="mb-0">Tento web využívá soubory cookies - <a href="/soubory-cookies/">více informací</a></p>
......@@ -178,6 +201,7 @@
</footer>
<!-- /FOOTER -->
{% endblock %}
<!-- JavaScript libraries -->
<script src="{% static "shared/vendor/jquery/jquery-3.4.1.min.js" %}"></script>
......
{% load wagtailimages_tags %}
<div class="project-donate-form project-donate-form__right mb-3">
<form method="post">
{% csrf_token %}
<input type="hidden" name="portal_project_id" value="{{ page.portal_project_id }}">
<input type="hidden" name="periodicity" value="99999">
<input type="hidden" name="amount" value="{{ self.amount }}">
<input type="hidden" name="crowdfunding" value="{{ self.reward_id }}">
<h3 class="lead mb-3">{{ self.title }}</h3>
<div class="row">
<figure class="col-12 col-md-7">
{% image self.image fill-500x800 as img %}
<img src="{{ img.url }}" alt="{{ img.alt }}" class="w-100">
</figure>
<div class="col-12 col-md-5">
{{ self.description }}<br>
{% if self.variant_list %}
<small>Zvolte si varaintu:</small>
{% for variant in self.variant_list %}
<div class="custom-control form-control-md custom-radio">
<input type="radio" id="product-{{ forloop.counter }}" name="product"
value="{{ self.title }}-{{ variant }}"
class="custom-control-input form-control-md" required>
<label class="custom-control-label col-form-label-lg"
for="product-{{ forloop.counter }}">{{ variant }}</label>
</div>
{% endfor %}
{% else %}
<input name="product"
value="{{ self.title }}"
hidden
class="custom-control-input form-control-md"
required
>
{% endif %}
</div>
</div>
<div class="row mt-2">
<div class="col-7 mb-2 mb-md-0">
<button type="submit" class="btn btn-danger btn-md">Darovat {{ self.amount }}&nbsp;</button>
</div>
{% if self.delivery_date %}
<p class="col-12 col-md-5">
Dodání do: <br>
<time datetime="2019-06-18">{{ self.delivery_date|date:"d. m. Y" }}</time>
</p>
{% endif %}
</div>
</form>
</div>
{% load static wagtailimages_tags wagtailcore_tags donate_tags %}
<div class="container">
<h2 class="lead page-subheading mb-4">{{ self.title }}</h2>
<div class="mb-4 clearfix">
{{ self.content|richtext }}
</div>
<a href="{{ self.link }}" class="btn btn-dark btn-lg my-2">Chci vědět více <i class="icon-chevron-right ml-2"></i></a>
</div>
{% load static wagtailimages_tags wagtailcore_tags donate_tags %}
<div class="container" id="kraje">
<h2 class="lead page-subheading mb-4">{{ self.heading }}</h2>
<p class="mb-4">{{ self.description|richtext }}</p>
<div class="row mb-4">
<!-- TODO -->
{% include "donate/region_map_snippet.html" with index_url=page.regions_page_url %}
</div> <!-- /row -->
</div> <!-- /container -->
{% firstof self.page.url self.link as target %}
<a class="nav-link js-scroll-anchor" href="{{ target }}">{{ self.title }}</a>
</a>
<div
class="dropdown nav-link js-scroll-anchor"
tabindex="0"
>
<div class="dropbtn">
{{ self.title }}
<span class="drop-arrow">🞃</span>
</div>
<div class="dropdown-content">
{% for nested_item in self.menu_items %}
<li>
{% firstof nested_item.page.url nested_item.link as target %}
<a href="{{ target }}">
{{ nested_item.title }}
</a>
</li>
{% endfor %}
</div>
</div>
{% load static wagtailimages_tags wagtailcore_tags donate_tags %}
{% if page.show_donate_form %}
<div class="container" id="strana">
<h2 class="lead page-subheading mb-4">{{ self.heading }}</h2>
<p class="mb-4">{{ self.description|richtext }}</p>
<div class="donate-form">
{% if self.image %}
<div class="donate-form__left">
<div class="donate-form__icon">
{% image self.image fill-256x256 as img %}
<img data-src="{{ img.url }}" class="lazyload img-fluid" alt="{{ img.alt }}">
</div><!-- /donate-form__icon -->
</div><!-- /donate-form__left -->
{% endif %}
<div class="donate-form__right">
<form id="js-donate-form" method="post">
{% csrf_token %}
<input type="hidden" name="portal_project_id" value="{{ page.portal_project_id }}">
<div class="form-group row mb-4 align-items-center">
<legend class="col-form-label col-md-4 col-form-label-lg">Typ příspěvku</legend>
<div class="col-md-8">
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="periodicity1" name="periodicity" value="730" class="custom-control-input" checked required>
<label class="custom-control-label col-form-label-lg" for="periodicity1">Měsíční</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="periodicity2" name="periodicity" value="99999" class="custom-control-input">
<label class="custom-control-label col-form-label-lg" for="periodicity2">Jednorázový</label>
</div>
</div>
</div>
<div class="form-group row mb-4 align-items-center">
<legend class="col-form-label col-md-4 col-form-label-lg">Částka</legend>
<div class="col-md-8">
<div id="monthlyAmounts" data-default-selected="{{ page.form_monthly_preselected }}">
{% include "donate/form_monthly_amounts_snippet.html" %}
</div>
<div id="oneTimeAmounts" style="display: None" data-default-selected="{{ page.form_preselected }}">
{% include "donate/form_amounts_snippet.html" %}
</div>
</div>
</div>
<div class="form-group row mb-0 align-items-center" id="js-custom-amount-input">
<div class="col-md-4 order-md-0 order-1">
<button type="submit" class="btn btn-danger btn-lg">Darovat</button>
</div>
<div class="col-md-8 mb-4 mb-md-0">
<div class="input-group input-group-lg mb-0 custom-amount">
<input type="number" class="form-control" id="customamount" placeholder="Jiná částka" name="custom_amount" aria-describedby="customamount-currency">
<div class="input-group-append">
<span class="input-group-text" id="customamount-currency"></span>
</div>
</div>
</div>
</div>
</form>
</div><!-- /donate-form__right -->
</div><!-- /donate-form -->
</div> <!-- /container -->
{% endif %}
{% load static wagtailimages_tags wagtailcore_tags donate_tags %}
<div class="container" id="projekty-{{ self.page.id }}">
<h2 class="lead page-subheading mb-4">{{ self.page.support_heading }}</h2>
<p class="mb-4">{{ self.page.support_description|richtext }}</p>
<div class="row projects mb-4">
{% if self.page.projects|length != 0 %}
{% for project in self.page.projects %}
{% include "donate/project_snippet.html" %}
{% endfor %}
{% else %}
<span class="text-grey-200 ml-3">Žádné aktuální projekty.</span>
{% endif %}
</div> <!-- /row -->
{% if self.page.projects|length != 0 %}
<a href="{{ self.page.url }}" class="btn btn-dark btn-lg my-2">Všechny projekty a kampaně <i class="icon-chevron-right ml-2"></i></a>
{% endif %}
</div> <!-- /container -->