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 497 additions and 0 deletions
# Generated by Django 3.1.7 on 2021-03-23 05:31
import wagtail.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("czech_inspirational", "0005_auto_20210323_0536"),
]
operations = [
migrations.AddField(
model_name="czechinspirationalchapterpage",
name="extra_text",
field=wagtail.fields.RichTextField(
blank=True, verbose_name="extra modrý blok"
),
),
]
# Generated by Django 4.0.3 on 2022-04-27 13:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("czech_inspirational", "0006_czechinspirationalchapterpage_extra_text"),
]
operations = [
migrations.AddField(
model_name="czechinspirationalhomepage",
name="title_suffix",
field=models.CharField(
blank=True,
help_text="Umožňuje přidat příponu k základnímu titulku stránky. Pokud je např. titulek stránky pojmenovaný 'Kontakt' a do přípony vyplníte 'MS Pardubice | Piráti', výsledný titulek bude 'Kontakt | MS Pardubice | Piráti'. Pokud příponu nevyplníte, použije se název webu.",
max_length=100,
null=True,
verbose_name="Přípona titulku stránky",
),
),
]
# Generated by Django 5.0.6 on 2024-06-13 10:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("czech_inspirational", "0007_czechinspirationalhomepage_title_suffix"),
]
operations = [
migrations.AlterField(
model_name="czechinspirationalhomepage",
name="title_suffix",
field=models.CharField(
blank=True,
help_text="Umožňuje přidat příponu k základnímu titulku stránky. Pokud je např. titulek stránky pojmenovaný 'Kontakt' a do přípony vyplníte 'MS Pardubice', výsledný titulek bude 'Kontakt | Piráti MS Pardubice'. Pokud příponu nevyplníte, použije se název domovské stránky a text 'Piráti', např. 'Kontakt | Piráti Pardubice'.",
max_length=100,
null=True,
verbose_name="Přípona titulku stránky",
),
),
]
# Generated by Django 5.0.6 on 2024-07-02 06:13
from django.db import migrations, models
def prefill_title_suffix(apps, schema_editor):
CzechInspirationalHomePage = apps.get_model(
"czech_inspirational", "CzechInspirationalHomePage"
)
for page in CzechInspirationalHomePage.objects.all():
page.meta_title_suffix = page.title_suffix
page.save()
class Migration(migrations.Migration):
dependencies = [
("czech_inspirational", "0008_alter_czechinspirationalhomepage_title_suffix"),
]
operations = [
migrations.AddField(
model_name="czechinspirationalhomepage",
name="meta_title_suffix",
field=models.CharField(
blank=True,
help_text='Umožňuje přidat příponu k titulku stránky běžně zobrazovanému na záložce s touto stránkou. Pokud vyplníš například "Piráti Pardubicko", záložka s kontakty bude nadepsaná "Kontakty | Piráti Pardubicko".',
max_length=100,
null=True,
verbose_name="Přípona meta titulku stránky",
),
),
migrations.AlterField(
model_name="czechinspirationalhomepage",
name="title_suffix",
field=models.CharField(
blank=True,
help_text='Umožňuje přidat příponu k názvu stránky. Pokud vyplníš například "Pardubicko", v levém horním rohu bude logo Pirátské strany a text "| Pardubicko".',
max_length=100,
null=True,
verbose_name="Přípona názvu stránky",
),
),
migrations.RunPython(prefill_title_suffix),
]
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.validators import validate_email
from django.db import models
from django.utils.translation import gettext_lazy
from wagtail.admin.panels import CommentPanel, FieldPanel, HelpPanel, MultiFieldPanel
from wagtail.fields import RichTextField
from wagtail.models import Page
from wagtailmetadata.models import MetadataPageMixin
from shared.const import RICH_TEXT_DEFAULT_FEATURES
from shared.models import (
ExtendedMetadataHomePageMixin,
ExtendedMetadataPageMixin,
SubpageMixin,
)
from shared.utils import subscribe_to_newsletter
from tuning import admin_help
class CzechInspirationalHomePage(
Page, ExtendedMetadataHomePageMixin, MetadataPageMixin
):
### FIELDS
buy_book_url = models.URLField("URL pro nákup knihy", blank=True, null=True)
# settings
matomo_id = models.IntegerField(
"Matomo ID pro sledování návštěvnosti", blank=True, null=True
)
### PANELS
content_panels = Page.content_panels + [
FieldPanel("buy_book_url"),
]
promote_panels = [
MultiFieldPanel(
[
FieldPanel("seo_title"),
FieldPanel("search_description"),
FieldPanel("search_image"),
HelpPanel(admin_help.build(admin_help.IMPORTANT_TITLE)),
],
gettext_lazy("Common page configuration"),
),
]
settings_panels = [
MultiFieldPanel(
[
FieldPanel("matomo_id"),
FieldPanel("title_suffix"),
FieldPanel("meta_title_suffix"),
],
"nastavení webu",
),
CommentPanel(),
]
### RELATIONS
subpage_types = [
"czech_inspirational.CzechInspirationalChaptersPage",
"czech_inspirational.CzechInspirationalDownloadPage",
]
### OTHERS
class Meta:
verbose_name = "Česko inspirativní"
@property
def root_page(self):
return self
@property
def chapters_page_url(self):
try:
return (
self.get_descendants()
.type(CzechInspirationalChaptersPage)
.live()
.get()
.get_url()
)
except Page.DoesNotExist:
return "#"
@property
def download_page_url(self):
try:
return (
self.get_descendants()
.type(CzechInspirationalDownloadPage)
.live()
.get()
.get_url()
)
except Page.DoesNotExist:
return "#"
def get_context(self, request):
context = super().get_context(request)
context["chapters"] = (
self.get_descendants()
.type(CzechInspirationalChapterPage)
.live()
.specific()
.order_by("czechinspirationalchapterpage__number")
)
return context
class CzechInspirationalChaptersPage(
Page, ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin
):
### FIELDS
### PANELS
promote_panels = [
MultiFieldPanel(
[
FieldPanel("slug"),
FieldPanel("seo_title"),
FieldPanel("search_description"),
FieldPanel("search_image"),
HelpPanel(
admin_help.build(
admin_help.NO_SEO_TITLE, admin_help.NO_SEARCH_IMAGE
)
),
],
gettext_lazy("Common page configuration"),
),
]
settings_panels = [CommentPanel()]
### RELATIONS
parent_page_types = ["czech_inspirational.CzechInspirationalHomePage"]
subpage_types = ["czech_inspirational.CzechInspirationalChapterPage"]
### OTHERS
class Meta:
verbose_name = "Přehled kapitol"
def get_context(self, request):
context = super().get_context(request)
context["chapters"] = (
self.get_children()
.live()
.specific()
.order_by("czechinspirationalchapterpage__number")
)
return context
class CzechInspirationalChapterPage(
Page, ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin
):
### FIELDS
number = models.IntegerField("číslo kapitoly", default=0)
text = RichTextField("text", blank=True, features=RICH_TEXT_DEFAULT_FEATURES)
extra_text = RichTextField(
"extra modrý blok", blank=True, features=RICH_TEXT_DEFAULT_FEATURES
)
author = models.CharField("autor", max_length=250, blank=True, null=True)
image = models.ForeignKey(
"wagtailimages.Image",
on_delete=models.PROTECT,
blank=True,
null=True,
verbose_name="obrázek",
)
### PANELS
content_panels = Page.content_panels + [
FieldPanel("number"),
FieldPanel("author"),
FieldPanel("image"),
FieldPanel("text"),
FieldPanel("extra_text"),
]
promote_panels = [
MultiFieldPanel(
[
FieldPanel("slug"),
FieldPanel("seo_title"),
FieldPanel("search_description"),
FieldPanel("search_image"),
HelpPanel(
admin_help.build(
admin_help.NO_SEO_TITLE, admin_help.NO_SEARCH_IMAGE
)
),
],
gettext_lazy("Common page configuration"),
),
]
settings_panels = [CommentPanel()]
### RELATIONS
parent_page_types = ["czech_inspirational.CzechInspirationalChaptersPage"]
subpage_types = []
### OTHERS
class Meta:
verbose_name = "Kapitola"
def get_context(self, request):
context = super().get_context(request)
context["chapters"] = (
self.get_siblings()
.live()
.specific()
.order_by("czechinspirationalchapterpage__number")
)
return context
class CzechInspirationalDownloadPage(
Page, ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin
):
### FIELDS
book_file = models.ForeignKey(
"wagtaildocs.Document",
verbose_name="ebook",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="+",
)
### PANELS
content_panels = Page.content_panels + [
FieldPanel("book_file"),
]
promote_panels = [
MultiFieldPanel(
[
FieldPanel("slug"),
FieldPanel("seo_title"),
FieldPanel("search_description"),
FieldPanel("search_image"),
HelpPanel(
admin_help.build(
admin_help.NO_SEO_TITLE, admin_help.NO_SEARCH_IMAGE
)
),
],
gettext_lazy("Common page configuration"),
),
]
settings_panels = [CommentPanel()]
### RELATIONS
parent_page_types = ["czech_inspirational.CzechInspirationalHomePage"]
subpage_types = []
### OTHERS
class Meta:
verbose_name = "Download"
def get_context(self, request):
context = super().get_context(request)
if "stahnout" in request.GET:
context["show"] = "download"
elif "diky" in request.GET:
context["show"] = "thanks"
else:
context["show"] = "info"
if "email" in request.POST:
context["show"] = "download"
if "subscribe" in request.POST:
email = request.POST.get("email", "")
try:
validate_email(email)
except ValidationError:
pass
else:
subscribe_to_newsletter(
email, settings.CZECH_INSPIRATIONAL_NEWSLETTER_CID
)
return context
.tha_heroimage{max-width:683px}.tha_underground{overflow:hidden;height:415px}.tha_underground.tha_underground_higher{overflow:hidden;height:510px}#tha_bottomcenter{max-width:556px}.tha_underground .tha_heroimage{box-shadow:0 24px 21px 3px rgba(0,0,0,.75)}.tha_underground .tha_bottomcenter .tha_heroimage{width:556px}#tha_leftwing{position:absolute;top:51px;left:-264px;width:278px;z-index:-1;transition:all ease-in .5s}#tha_rightwing{position:absolute;top:51px;right:-264px;width:278px;z-index:-1;transition:all ease-in .5s}@media only screen and (max-width:670px){#tha_bottomcenter,.tha_underground .tha_heroimage{max-width:302px}#tha_leftwing{top:51px;left:-69px;width:139px}#tha_rightwing{top:51px;right:-69px;width:139px}.tha_underground{overflow:hidden;height:230px!important}}.tha_logo_illustrated{width:140px}.tha_videocont_activated{padding:0 6.92%}@media only screen and (max-width:670px){.tha_videocont_activated{padding:0}}@media only screen and (max-width:1440px){#chaptertable{max-width:768px}}.tha_animations_container{position:absolute;top:0;left:50%;transform:translateX(-50%);width:100%;height:100%;min-width:1920px;z-index:-1}#tha_leftfloat1{position:absolute;top:312px;left:0;width:561px;transition:all ease-in .5s}#tha_leftfloat2{position:absolute;top:954px;left:116px;width:447px;z-index:-1;transition:all ease-in .5s}#tha_leftfloat_arrow{position:absolute;top:1697px;left:469px;width:109px;z-index:-1;transition:all ease-in .5s}#tha_rightfloat1{position:absolute;top:640px;right:0;width:561px}#tha_rightfloat2{position:absolute;top:1334px;right:73px;width:310px;z-index:-1}#tha_rightfloat_arrow1{position:absolute;top:204px;right:500px;width:107px}#tha_rightfloat_arrow2{position:absolute;top:345px;right:490px;width:48px}#tha_leftparalax{position:absolute;top:56px;left:0;width:359px;transition:all ease-in .5s}#tha_rightparalax{position:absolute;top:472px;right:0;width:359px;transition:all ease-in .5s}#tha_bottom_arrow{position:absolute;bottom:150px;left:calc(50% + 103px);width:244px;transition:all ease-in .5s}@media only screen and (max-width:1440px){#tha_animations_container2{min-width:1618px}}@media only screen and (max-width:768px){.tha_animations_container{position:static!important;transform:none;min-width:0;width:100%;max-width:100%}}.tha_underground.tha_underground_higher #tha_leftfloat1{top:0}.tha_underground.tha_underground_higher #tha_rightfloat1{top:185px}.tha_chapterhead picture{width:470px;max-width:90vw}#tha_stickysharebox{position:-webkit-sticky;position:sticky;top:32px}#tha_carousel_cont{max-width:1224px}.VueCarousel-navigation{text-align:center}.VueCarousel-dot-button{border-radius:0!important;width:24px!important;height:4px!important;position:relative;top:-4px}.VueCarousel-slide{padding:0 12px 16px 12px}.VueCarousel-navigation-prev{position:static!important;transform:translateY(-100%) translateX(-500%)!important}.VueCarousel-navigation-next{position:static!important;transform:translateY(-100%) translateX(500%)!important}@media only screen and (max-width:1024px){.VueCarousel-pagination{display:none}.VueCarousel-navigation-prev{position:absolute!important;transform:translateY(-50%) translateX(-50%)!important;font-size:40px}.VueCarousel-navigation-next{position:absolute!important;transform:translateY(-50%) translateX(50%)!important;font-size:40px}}.tha_cardnumber{position:relative;top:2px;left:-2px}.label{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.VueCarousel-slide{background:0 0;color:inherit}
File added
File added
File added
czech_inspirational/static/czech_inspirational/images/bookmockup.jpg

191 KiB

czech_inspirational/static/czech_inspirational/images/bookmockup.png

122 KiB

czech_inspirational/static/czech_inspirational/images/bookmockup.webp

25.4 KiB

czech_inspirational/static/czech_inspirational/images/bookmockup@2x.jpg

203 KiB

czech_inspirational/static/czech_inspirational/images/bookmockup@2x.png

415 KiB

czech_inspirational/static/czech_inspirational/images/bookmockup@2x.webp

59.6 KiB

czech_inspirational/static/czech_inspirational/images/bookmockup_sm.webp

21.3 KiB