@ -0,0 +1,3 @@ |
|||
from django.contrib import admin |
|||
|
|||
# Register your models here. |
@ -0,0 +1,5 @@ |
|||
from django.apps import AppConfig |
|||
|
|||
|
|||
class AktualityConfig(AppConfig): |
|||
name = 'aktuality' |
@ -0,0 +1,29 @@ |
|||
# Generated by Django 3.1.3 on 2020-11-27 10:54 |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
import wagtail.core.fields |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
initial = True |
|||
|
|||
dependencies = [ |
|||
('wagtailcore', '0059_apply_collection_ordering'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='Aktualita', |
|||
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')), |
|||
('date', models.DateField(verbose_name='Post date')), |
|||
('body', wagtail.core.fields.RichTextField(blank=True)), |
|||
], |
|||
options={ |
|||
'abstract': False, |
|||
}, |
|||
bases=('wagtailcore.page',), |
|||
), |
|||
] |
@ -0,0 +1,25 @@ |
|||
# Generated by Django 3.1.3 on 2020-11-27 10:58 |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('wagtailcore', '0059_apply_collection_ordering'), |
|||
('aktuality', '0001_initial'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='AktualityIndexPage', |
|||
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')), |
|||
], |
|||
options={ |
|||
'abstract': False, |
|||
}, |
|||
bases=('wagtailcore.page',), |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# Generated by Django 3.1.3 on 2020-12-04 10:26 |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('wagtailimages', '0022_uploadedimage'), |
|||
('aktuality', '0002_aktualityindexpage'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='aktualita', |
|||
name='image', |
|||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailimages.image'), |
|||
), |
|||
] |
@ -0,0 +1,32 @@ |
|||
from django.db import models |
|||
|
|||
from modelcluster.fields import ParentalKey |
|||
|
|||
from wagtail.core.models import Page, Orderable |
|||
from wagtail.core.fields import RichTextField |
|||
from wagtail.admin.edit_handlers import FieldPanel, InlinePanel |
|||
from wagtail.images.edit_handlers import ImageChooserPanel |
|||
from wagtail.search import index |
|||
|
|||
|
|||
class AktualityIndexPage(Page): |
|||
subpage_types = ["aktuality.Aktualita"] |
|||
pass |
|||
|
|||
|
|||
class Aktualita(Page): |
|||
date = models.DateField("Post date") |
|||
body = RichTextField(blank=True) |
|||
image = models.ForeignKey( |
|||
'wagtailimages.Image', null=True, on_delete=models.CASCADE, related_name='+' |
|||
) |
|||
|
|||
search_fields = Page.search_fields + [ |
|||
index.SearchField('body'), |
|||
] |
|||
|
|||
content_panels = Page.content_panels + [ |
|||
FieldPanel('date'), |
|||
FieldPanel('body', classname="full"), |
|||
ImageChooserPanel('image'), |
|||
] |
@ -0,0 +1,38 @@ |
|||
{% load wagtailcore_tags static wagtailimages_tags %} |
|||
|
|||
{% for item in items %} |
|||
<div class="grid clasik"> |
|||
<div class="grid-title"> |
|||
<h4> {{ item.title }} </h4> |
|||
</div> |
|||
<div class="grid-body"> |
|||
<div class="row"> |
|||
<div class="col-{% if item.specific.image %}8{% else %}12{% endif %}"> |
|||
<div class="row"> |
|||
<div class="col-8"> |
|||
<label> Datum </label> |
|||
<div class="datum"> |
|||
{{ item.date }} |
|||
</div> |
|||
</div> |
|||
<div class="col-12"> |
|||
<label> Text </label> |
|||
<div class="text"> |
|||
{{ item.body|richtext }} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{% if item.specific.image %} |
|||
<div class="col-4"> |
|||
<label> Obrázek </label> |
|||
<div class="img"> |
|||
{% image item.specific.image class="img-fluid" fill-400x200 %} |
|||
</div> |
|||
</div> |
|||
{% endif %} |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
{% endfor %} |
@ -0,0 +1,10 @@ |
|||
from django import template |
|||
from aktuality.models import Aktualita |
|||
|
|||
register = template.Library() |
|||
|
|||
@register.inclusion_tag("aktuality/home_aktualne.html") |
|||
def home_aktualne(): |
|||
return { |
|||
"items": Aktualita.objects.all().order_by("-date"), |
|||
} |
@ -0,0 +1,3 @@ |
|||
from django.test import TestCase |
|||
|
|||
# Create your tests here. |
@ -0,0 +1,3 @@ |
|||
from django.shortcuts import render |
|||
|
|||
# Create your views here. |
@ -0,0 +1,23 @@ |
|||
# Generated by Django 3.1.3 on 2020-12-04 10:09 |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('wagtailimages', '0022_uploadedimage'), |
|||
('diskuze', '0001_initial'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='blogpage', |
|||
name='image', |
|||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailimages.image'), |
|||
), |
|||
migrations.DeleteModel( |
|||
name='BlogPageGalleryImage', |
|||
), |
|||
] |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 9.6 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 118 KiB |
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 120 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 95 KiB |
@ -0,0 +1,3 @@ |
|||
from django.contrib import admin |
|||
|
|||
# Register your models here. |
@ -0,0 +1,5 @@ |
|||
from django.apps import AppConfig |
|||
|
|||
|
|||
class SluzbyConfig(AppConfig): |
|||
name = 'sluzby' |
@ -0,0 +1,30 @@ |
|||
# Generated by Django 3.1.3 on 2020-12-02 10:15 |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
import wagtail.core.fields |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
initial = True |
|||
|
|||
dependencies = [ |
|||
('wagtailcore', '0059_apply_collection_ordering'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='SluzbyItems', |
|||
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')), |
|||
('objednani', models.BooleanField(default=True)), |
|||
('mozne_koplikace', wagtail.core.fields.RichTextField(blank=True)), |
|||
('cena', models.CharField(blank=True, max_length=200)), |
|||
], |
|||
options={ |
|||
'abstract': False, |
|||
}, |
|||
bases=('wagtailcore.page',), |
|||
), |
|||
] |
@ -0,0 +1,18 @@ |
|||
# Generated by Django 3.1.3 on 2020-12-02 10:19 |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('sluzby', '0001_initial'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='sluzbyitems', |
|||
name='nazev_sluzby', |
|||
field=models.CharField(blank=True, max_length=200), |
|||
), |
|||
] |
@ -0,0 +1,31 @@ |
|||
from django.db import models |
|||
|
|||
from modelcluster.fields import ParentalKey |
|||
|
|||
from wagtail.core.models import Page, Orderable |
|||
from wagtail.core.fields import RichTextField |
|||
from wagtail.admin.edit_handlers import FieldPanel, InlinePanel |
|||
from wagtail.images.edit_handlers import ImageChooserPanel |
|||
from wagtail.search import index |
|||
|
|||
|
|||
class SluzbyItems(Page): |
|||
nazev_sluzby = models.CharField(blank=True, max_length=200) |
|||
objednani = models.BooleanField(default=True) |
|||
mozne_koplikace = RichTextField(blank=True) |
|||
cena = models.CharField(blank=True, max_length=200) |
|||
|
|||
|
|||
search_fields = Page.search_fields + [ |
|||
index.SearchField('nazev_sluzby'), |
|||
] |
|||
search_fields = Page.search_fields + [ |
|||
index.SearchField('mozne_koplikace'), |
|||
] |
|||
|
|||
content_panels = Page.content_panels + [ |
|||
FieldPanel('nazev_sluzby'), |
|||
FieldPanel('objednani'), |
|||
FieldPanel('mozne_koplikace'), |
|||
FieldPanel('cena'), |
|||
] |
@ -0,0 +1,3 @@ |
|||
from django.test import TestCase |
|||
|
|||
# Create your tests here. |
@ -0,0 +1,3 @@ |
|||
from django.shortcuts import render |
|||
|
|||
# Create your views here. |