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
  • feat-more-blocks
  • feat-rework-election-page
  • feat/custom-css
  • feat/dary-improvements
  • feat/geo-feature-collections
  • feat/hideable-tweets
  • feat/instagram-feed
  • feat/people-octopus-imports
  • feat/pirstan-changes
  • feat/redesign-fixes-3
  • feat/redesign-improvements-10
  • feat/redesign-improvements-8
  • feat/separate-import-thread
  • feature/crypto-widget
  • features/add-custom-numbering-for-candidates
  • features/add-dynamic-candidate-numbers
  • features/add-embed-to-articles
  • features/add-feature-enlarging-sub-block
  • features/add-link-to-images
  • features/add-pdf-page
  • features/add-redirects
  • features/add-thumbnail-principle-to-uniweb-and-senate
  • features/add-timeline
  • features/add-typed-table
  • features/create-collapsible-extra-legal-info
  • features/create-mastodon-feed-block
  • features/create-wordcloud-from-article-page
  • features/donation-panel-should-be-optional
  • features/extend-hero-banner
  • features/fix-broken-calendar-categories
  • master
  • nakopneme
  • test
33 results

Target

Select target project
  • to/majak
  • b1242/majak
2 results
Select Git revision
  • fix1
  • localwebs
  • master
  • pdp
  • seo1
  • target-groups
  • test
7 results
Show changes
Showing
with 1768 additions and 239 deletions
# Generated by Django 4.1.10 on 2023-09-13 20:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("donate", "0032_remove_donateprojectindexpage_support_position"),
]
operations = [
migrations.AddField(
model_name="donateprojectindexpage",
name="support_position",
field=models.IntegerField(
default=0,
help_text="Čím nižší číslo, tím výš se seznam projektů zobrazí.",
verbose_name="Podpoř projekt pozice",
),
),
]
# Generated by Django 4.1.10 on 2023-09-22 08:24
import wagtail.blocks
import wagtail.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("donate", "0033_donateprojectindexpage_support_position"),
]
operations = [
migrations.AddField(
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
),
),
]
),
)
],
blank=True,
use_json_field=True,
verbose_name="Menu",
),
),
]
# Generated by Django 4.1.10 on 2023-10-18 17:48
import wagtail.blocks
import wagtail.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("donate", "0034_donatehomepage_menu"),
]
operations = [
migrations.RemoveField(
model_name="donatehomepage",
name="project_body",
),
migrations.RemoveField(
model_name="donatehomepage",
name="project_title",
),
migrations.AddField(
model_name="donatehomepage",
name="content_blocks",
field=wagtail.fields.StreamField(
[
(
"project_index",
wagtail.blocks.StructBlock(
[
(
"page",
wagtail.blocks.PageChooserBlock(
page_type=["donate.DonateProjectIndexPage"]
),
)
]
),
)
],
blank=True,
use_json_field=True,
verbose_name="Obsah",
),
),
]
# Generated by Django 4.1.10 on 2023-10-18 19:40
import wagtail.blocks
import wagtail.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("donate", "0035_remove_donatehomepage_project_body_and_more"),
]
operations = [
migrations.RemoveField(
model_name="donateprojectindexpage",
name="support_position",
),
migrations.AlterField(
model_name="donatehomepage",
name="content_blocks",
field=wagtail.fields.StreamField(
[
(
"project_index",
wagtail.blocks.StructBlock(
[
(
"page",
wagtail.blocks.PageChooserBlock(
page_type=["donate.DonateProjectIndexPage"]
),
)
]
),
),
("district_donation", wagtail.blocks.StructBlock([])),
],
blank=True,
use_json_field=True,
verbose_name="Obsah",
),
),
]
# Generated by Django 4.1.10 on 2023-10-19 14:16
import wagtail.blocks
import wagtail.fields
import wagtail.images.blocks
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("donate", "0036_remove_donateprojectindexpage_support_position_and_more"),
]
operations = [
migrations.RemoveField(
model_name="donatehomepage",
name="region_body",
),
migrations.RemoveField(
model_name="donatehomepage",
name="region_title",
),
migrations.RemoveField(
model_name="donatehomepage",
name="support_body",
),
migrations.RemoveField(
model_name="donatehomepage",
name="support_title",
),
migrations.AlterField(
model_name="donatehomepage",
name="content_blocks",
field=wagtail.fields.StreamField(
[
(
"project_index",
wagtail.blocks.StructBlock(
[
(
"page",
wagtail.blocks.PageChooserBlock(
page_type=["donate.DonateProjectIndexPage"]
),
)
]
),
),
(
"district_donation",
wagtail.blocks.StructBlock(
[
("heading", wagtail.blocks.CharBlock(label="Nadpis")),
(
"description",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
"embed",
"font_color_#4ca971",
"font_color_#fde119",
"font_color_#027da8",
"font_color_#004958",
"font_color_#670047",
"font_color_#d60d53",
"font_color_#262626",
],
label="Obsah",
),
),
]
),
),
(
"party_support_form",
wagtail.blocks.StructBlock(
[
("heading", wagtail.blocks.CharBlock(label="Nadpis")),
(
"description",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
"embed",
"font_color_#4ca971",
"font_color_#fde119",
"font_color_#027da8",
"font_color_#004958",
"font_color_#670047",
"font_color_#d60d53",
"font_color_#262626",
],
label="Obsah",
),
),
(
"image",
wagtail.images.blocks.ImageChooserBlock(
label="Obrázek"
),
),
]
),
),
],
blank=True,
use_json_field=True,
verbose_name="Obsah",
),
),
]
# Generated by Django 4.1.10 on 2023-10-19 14:18
import wagtail.blocks
import wagtail.fields
import wagtail.images.blocks
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("donate", "0037_remove_donatehomepage_region_body_and_more"),
]
operations = [
migrations.AlterField(
model_name="donatehomepage",
name="content_blocks",
field=wagtail.fields.StreamField(
[
(
"project_index",
wagtail.blocks.StructBlock(
[
(
"page",
wagtail.blocks.PageChooserBlock(
label="Stránka se seznamem",
page_type=["donate.DonateProjectIndexPage"],
),
)
]
),
),
(
"district_donation",
wagtail.blocks.StructBlock(
[
("heading", wagtail.blocks.CharBlock(label="Nadpis")),
(
"description",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
"embed",
"font_color_#4ca971",
"font_color_#fde119",
"font_color_#027da8",
"font_color_#004958",
"font_color_#670047",
"font_color_#d60d53",
"font_color_#262626",
],
label="Obsah",
),
),
]
),
),
(
"party_support_form",
wagtail.blocks.StructBlock(
[
("heading", wagtail.blocks.CharBlock(label="Nadpis")),
(
"description",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
"embed",
"font_color_#4ca971",
"font_color_#fde119",
"font_color_#027da8",
"font_color_#004958",
"font_color_#670047",
"font_color_#d60d53",
"font_color_#262626",
],
label="Obsah",
),
),
(
"image",
wagtail.images.blocks.ImageChooserBlock(
label="Obrázek"
),
),
]
),
),
],
blank=True,
use_json_field=True,
verbose_name="Obsah",
),
),
]
# Generated by Django 4.1.10 on 2023-10-19 14:31
import wagtail.blocks
import wagtail.fields
import wagtail.images.blocks
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("donate", "0038_alter_donatehomepage_content_blocks"),
]
operations = [
migrations.RemoveField(
model_name="donatehomepage",
name="custom_blocks",
),
migrations.RemoveField(
model_name="donatehomepage",
name="support_image",
),
migrations.AlterField(
model_name="donatehomepage",
name="content_blocks",
field=wagtail.fields.StreamField(
[
(
"project_index",
wagtail.blocks.StructBlock(
[
(
"page",
wagtail.blocks.PageChooserBlock(
label="Stránka se seznamem",
page_type=["donate.DonateProjectIndexPage"],
),
)
]
),
),
(
"district_donation",
wagtail.blocks.StructBlock(
[
("heading", wagtail.blocks.CharBlock(label="Nadpis")),
(
"description",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
"embed",
"font_color_#4ca971",
"font_color_#fde119",
"font_color_#027da8",
"font_color_#004958",
"font_color_#670047",
"font_color_#d60d53",
"font_color_#262626",
],
label="Obsah",
),
),
]
),
),
(
"party_support_form",
wagtail.blocks.StructBlock(
[
("heading", wagtail.blocks.CharBlock(label="Nadpis")),
(
"description",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
"embed",
"font_color_#4ca971",
"font_color_#fde119",
"font_color_#027da8",
"font_color_#004958",
"font_color_#670047",
"font_color_#d60d53",
"font_color_#262626",
],
label="Obsah",
),
),
(
"image",
wagtail.images.blocks.ImageChooserBlock(
label="Obrázek"
),
),
]
),
),
(
"custom",
wagtail.blocks.StructBlock(
[
("title", wagtail.blocks.CharBlock(label="Nadpis")),
(
"content",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
"embed",
"font_color_#4ca971",
"font_color_#fde119",
"font_color_#027da8",
"font_color_#004958",
"font_color_#670047",
"font_color_#d60d53",
"font_color_#262626",
],
label="Obsah",
),
),
("link", wagtail.blocks.URLBlock(label="Odkaz")),
]
),
),
],
blank=True,
use_json_field=True,
verbose_name="Obsah",
),
),
]
# Generated by Django 4.1.10 on 2024-01-30 13:15
import wagtail.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("donate", "0039_remove_donatehomepage_custom_blocks_and_more"),
]
operations = [
migrations.AlterField(
model_name="donatehomepage",
name="lead_body",
field=wagtail.fields.RichTextField(blank=True, verbose_name="hlavní popis"),
),
]
# 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,37 +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"),
......@@ -155,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 = [
......@@ -179,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()
......@@ -202,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 = []
......@@ -238,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ů"
......@@ -247,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)
......@@ -257,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"]
......@@ -288,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
......@@ -328,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ů"
......@@ -351,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,
......@@ -381,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
......@@ -499,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
......@@ -607,7 +777,12 @@ class TargetedDonation(Orderable):
class DonateTargetedDonationsPage(
DonateFormMixin, Page, SubpageMixin, MetadataPageMixin
DonateFormMixin,
DonateFormAmountsMixin,
Page,
ExtendedMetadataPageMixin,
SubpageMixin,
MetadataPageMixin,
):
### FIELDS
......@@ -620,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"]
......@@ -642,6 +823,9 @@ class DonateTargetedDonationsPage(
### OTHERS
# flag for rendering anchor links in menu
is_home = False
class Meta:
verbose_name = "Adresné dary"
......@@ -675,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