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

czech inspirational: Website almost done

parent a24d1d2c
No related branches found
No related tags found
2 merge requests!200release,!198Kniha
Pipeline #2779 passed
Showing
with 645 additions and 0 deletions
from django.apps import AppConfig
class CzechInspirationalConfig(AppConfig):
name = "czech_inspirational"
# Generated by Django 3.1.7 on 2021-03-22 21:37
import django.db.models.deletion
import wagtailmetadata.models
from django.db import migrations, models
import shared.models
class Migration(migrations.Migration):
initial = True
dependencies = [
("wagtailcore", "0060_fix_workflow_unique_constraint"),
("wagtailimages", "0023_add_choose_permissions"),
]
operations = [
migrations.CreateModel(
name="CzechInspirationalHomePage",
fields=[
(
"page_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="wagtailcore.page",
),
),
(
"matomo_id",
models.IntegerField(
blank=True,
null=True,
verbose_name="Matomo ID pro sledování návštěvnosti",
),
),
(
"search_image",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="wagtailimages.image",
verbose_name="Search image",
),
),
],
options={
"verbose_name": "Česko inspirativní",
},
bases=(
"wagtailcore.page",
wagtailmetadata.models.WagtailImageMetadataMixin,
models.Model,
),
),
migrations.CreateModel(
name="CzechInspirationalDownloadPage",
fields=[
(
"page_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="wagtailcore.page",
),
),
(
"search_image",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="wagtailimages.image",
verbose_name="Search image",
),
),
],
options={
"verbose_name": "Download",
},
bases=(
"wagtailcore.page",
shared.models.SubpageMixin,
wagtailmetadata.models.WagtailImageMetadataMixin,
models.Model,
),
),
migrations.CreateModel(
name="CzechInspirationalChaptersPage",
fields=[
(
"page_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="wagtailcore.page",
),
),
(
"search_image",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="wagtailimages.image",
verbose_name="Search image",
),
),
],
options={
"verbose_name": "Přehled kapitol",
},
bases=(
"wagtailcore.page",
shared.models.SubpageMixin,
wagtailmetadata.models.WagtailImageMetadataMixin,
models.Model,
),
),
migrations.CreateModel(
name="CzechInspirationalChapterPage",
fields=[
(
"page_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="wagtailcore.page",
),
),
(
"search_image",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="wagtailimages.image",
verbose_name="Search image",
),
),
],
options={
"verbose_name": "Kapitola",
},
bases=(
"wagtailcore.page",
shared.models.SubpageMixin,
wagtailmetadata.models.WagtailImageMetadataMixin,
models.Model,
),
),
]
# Generated by Django 3.1.7 on 2021-03-23 01:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("czech_inspirational", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="czechinspirationalchapterpage",
name="number",
field=models.IntegerField(default=0, verbose_name="číslo kapitoly"),
),
]
# Generated by Django 3.1.7 on 2021-03-23 02:12
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtaildocs", "0012_uploadeddocument"),
("czech_inspirational", "0002_czechinspirationalchapterpage_number"),
]
operations = [
migrations.AddField(
model_name="czechinspirationaldownloadpage",
name="book_file",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="wagtaildocs.document",
),
),
]
# Generated by Django 3.1.7 on 2021-03-23 02:52
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtaildocs", "0012_uploadeddocument"),
("czech_inspirational", "0003_czechinspirationaldownloadpage_book_file"),
]
operations = [
migrations.AddField(
model_name="czechinspirationalhomepage",
name="buy_book_url",
field=models.URLField(
blank=True, null=True, verbose_name="URL pro nákup knihy"
),
),
migrations.AlterField(
model_name="czechinspirationaldownloadpage",
name="book_file",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="wagtaildocs.document",
verbose_name="ebook",
),
),
]
# Generated by Django 3.1.7 on 2021-03-23 04:36
import django.db.models.deletion
import wagtail.core.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtailimages", "0023_add_choose_permissions"),
("czech_inspirational", "0004_auto_20210323_0352"),
]
operations = [
migrations.AddField(
model_name="czechinspirationalchapterpage",
name="author",
field=models.CharField(
blank=True, max_length=250, null=True, verbose_name="autor"
),
),
migrations.AddField(
model_name="czechinspirationalchapterpage",
name="image",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="wagtailimages.image",
verbose_name="obrázek",
),
),
migrations.AddField(
model_name="czechinspirationalchapterpage",
name="text",
field=wagtail.core.fields.RichTextField(blank=True, verbose_name="text"),
),
]
# Generated by Django 3.1.7 on 2021-03-23 05:31
import wagtail.core.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.core.fields.RichTextField(
blank=True, verbose_name="extra modrý blok"
),
),
]
from django.db import models
from django.utils.translation import gettext_lazy
from wagtail.admin.edit_handlers import FieldPanel, HelpPanel, MultiFieldPanel
from wagtail.core.fields import RichTextField
from wagtail.core.models import Page
from wagtail.documents.edit_handlers import DocumentChooserPanel
from wagtail.images.edit_handlers import ImageChooserPanel
from wagtailmetadata.models import MetadataPageMixin
from shared.models import SubpageMixin
from tuning import help
from uniweb.constants import RICH_TEXT_FEATURES
class CzechInspirationalHomePage(Page, 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"),
ImageChooserPanel("search_image"),
HelpPanel(help.build(help.IMPORTANT_TITLE)),
],
gettext_lazy("Common page configuration"),
),
]
settings_panels = [
MultiFieldPanel(
[
FieldPanel("matomo_id"),
],
"nastavení webu",
),
]
### 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, SubpageMixin, MetadataPageMixin):
### FIELDS
### 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"),
),
]
settings_panels = []
### 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, SubpageMixin, MetadataPageMixin):
### FIELDS
number = models.IntegerField("číslo kapitoly", default=0)
text = RichTextField("text", blank=True, features=RICH_TEXT_FEATURES)
extra_text = RichTextField(
"extra modrý blok", blank=True, features=RICH_TEXT_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"),
ImageChooserPanel("image"),
FieldPanel("text"),
FieldPanel("extra_text"),
]
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"),
),
]
settings_panels = []
### 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, 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 + [
DocumentChooserPanel("book_file"),
]
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"),
),
]
settings_panels = []
### RELATIONS
parent_page_types = ["czech_inspirational.CzechInspirationalHomePage"]
subpage_types = []
### OTHERS
class Meta:
verbose_name = "Download"
.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}
This diff is collapsed.
File added
This diff is collapsed.
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

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment