Browse Source

dalsi upravy

master
Lukáš Helcl 4 years ago
parent
commit
198c8ef252
  1. 2
      festival/settings/base.py
  2. 30
      festival/static/css/festival.css
  3. 25
      festival/templates/base.html
  4. 0
      galerie/__init__.py
  5. 3
      galerie/admin.py
  6. 5
      galerie/apps.py
  7. 44
      galerie/migrations/0001_initial.py
  8. 37
      galerie/migrations/0002_auto_20201204_2156.py
  9. 0
      galerie/migrations/__init__.py
  10. 38
      galerie/models.py
  11. 23
      galerie/templates/galerie/galery_items.html
  12. 3
      galerie/tests.py
  13. 3
      galerie/views.py
  14. 17
      home/templates/home/home_page.html
  15. BIN
      media/images/babovresky.2e16d0ba.fill-400x200.jpg
  16. BIN
      media/images/babovresky.max-165x165.jpg
  17. BIN
      media/images/letni_kino1.2e16d0ba.fill-320x240.jpg
  18. BIN
      media/images/letni_kino1.max-165x165.jpg
  19. BIN
      media/images/letni_kino3.2e16d0ba.fill-320x240.jpg
  20. BIN
      media/images/letni_kino3.max-165x165.jpg
  21. BIN
      media/images/letnikino2.2e16d0ba.fill-320x240.jpg
  22. BIN
      media/images/letnikino2.max-165x165.jpg
  23. BIN
      media/images/plus.max-165x165.png
  24. BIN
      media/images/rychle.2e16d0ba.fill-400x200.jpg
  25. BIN
      media/images/rychle.max-165x165.jpg
  26. BIN
      media/original_images/babovresky.jpg
  27. BIN
      media/original_images/letni_kino1.jpg
  28. BIN
      media/original_images/letni_kino3.jpg
  29. BIN
      media/original_images/letnikino2.jpg
  30. BIN
      media/original_images/plus.png
  31. BIN
      media/original_images/rychle.jpg
  32. 0
      program/__init__.py
  33. 3
      program/admin.py
  34. 5
      program/apps.py
  35. 36
      program/migrations/0001_initial.py
  36. 67
      program/migrations/0002_auto_20201204_2156.py
  37. 0
      program/migrations/__init__.py
  38. 39
      program/models.py
  39. 34
      program/templates/program/program_page.html
  40. 3
      program/tests.py
  41. 3
      program/views.py

2
festival/settings/base.py

@ -48,6 +48,8 @@ INSTALLED_APPS = [
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'program',
'galerie',
] ]
MIDDLEWARE = [ MIDDLEWARE = [

30
festival/static/css/festival.css

@ -0,0 +1,30 @@
body {
background-color: #8c8c8c !important;
}
.left-menu {
background-color: #444444;
padding-top: 15px;
height: 100vh;
box-shadow: 0px 0px 20px #ffffff;
}
.left-menu a {
color: #ffffff;
}
.content h3 {
color: #ffffff;
padding: 15px;
margin-bottom: 10px;
background-color: #444444 ;
box-shadow: 0px 0px 20px #ffffff;
}
.content h2 {
color: #ffffff;
margin-bottom: 10px;
background-color: #444444;
font-size: 12px;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
}

25
festival/templates/base.html

@ -19,22 +19,25 @@
{# Global stylesheets #} {# Global stylesheets #}
<link rel="stylesheet" type="text/css" href="{% static 'css/festival.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'css/festival.css' %}">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
{% block extra_css %} {% block extra_css %}
{# Override this in templates to add extra stylesheets #} {# Override this in templates to add extra stylesheets #}
{% endblock %} {% endblock %}
</head> </head>
<body class="{% block body_class %}{% endblock %}">
{% wagtailuserbar %}
{% block content %}{% endblock %}
{# Global javascript #}
<script type="text/javascript" src="{% static 'js/festival.js' %}"></script>
{% block extra_js %}
{# Override this in templates to add extra javascript #}
{% endblock %}
<body>
<div class="row">
<div class="col-2 left-menu">
<ul>
<li><a href="/"> Home </a></li>
<li><a href="/program/"> Program </a></li>
<li><a href="/galerie"> Galerie </a></li>
</ul>
</div>
<div class="col-10 content">
{% block content %}{% endblock %}
</div>
</div>
</body> </body>
</html> </html>

0
galerie/__init__.py

3
galerie/admin.py

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
galerie/apps.py

@ -0,0 +1,5 @@
from django.apps import AppConfig
class GalerieConfig(AppConfig):
name = 'galerie'

44
galerie/migrations/0001_initial.py

@ -0,0 +1,44 @@
# Generated by Django 3.1.4 on 2020-12-04 20:38
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import wagtail.core.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailcore', '0059_apply_collection_ordering'),
('wagtailimages', '0022_uploadedimage'),
]
operations = [
migrations.CreateModel(
name='GaleryPage',
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')),
('body', wagtail.core.fields.RichTextField(blank=True)),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
),
migrations.CreateModel(
name='StrankaPageGalleryImage',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
('caption', models.CharField(blank=True, max_length=250)),
('image', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailimages.image')),
('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='gallery_images', to='galerie.galerypage')),
],
options={
'ordering': ['sort_order'],
'abstract': False,
},
),
]

37
galerie/migrations/0002_auto_20201204_2156.py

@ -0,0 +1,37 @@
# Generated by Django 3.1.4 on 2020-12-04 20:56
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0059_apply_collection_ordering'),
('galerie', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='GaleryItems',
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')),
('body', wagtail.core.fields.RichTextField(blank=True)),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
),
migrations.RemoveField(
model_name='galerypage',
name='body',
),
migrations.AlterField(
model_name='strankapagegalleryimage',
name='page',
field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='gallery_images', to='galerie.galeryitems'),
),
]

0
galerie/migrations/__init__.py

38
galerie/models.py

@ -0,0 +1,38 @@
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 GaleryPage(Page):
pass
class GaleryItems(Page):
body = RichTextField(blank=True)
search_fields = Page.search_fields + [
index.SearchField('body'),
]
content_panels = Page.content_panels + [
FieldPanel('body', classname="full"),
InlinePanel('gallery_images', label="Obrázky"),
]
class StrankaPageGalleryImage(Orderable):
page = ParentalKey(GaleryItems, on_delete=models.CASCADE, related_name='gallery_images')
image = models.ForeignKey(
'wagtailimages.Image', on_delete=models.CASCADE, related_name='+'
)
caption = models.CharField(blank=True, max_length=250)
panels = [
ImageChooserPanel('image'),
FieldPanel('caption'),
]

23
galerie/templates/galerie/galery_items.html

@ -0,0 +1,23 @@
{% extends "base.html" %}
{% load wagtailcore_tags static wagtailimages_tags wagtailimages_tags %}
{% block body_class %}template-homepage{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{% static 'css/welcome_page.css' %}">
{% endblock extra_css %}
{% block content %}
<div class="row">
<div class="col-12">
<h3 style="margin-bottom: 0px;"> {{ page.title|richtext }} </h3>
<div class="row">
<div class="col-12">
<h2> {{ page.body|richtext }} </h2>
</div>
{% for item in page.gallery_images.all %}
<div class="col-6" style="padding: 10px">
{% image item.image fill-320x240 %}
</div>
{% endfor %}
</div>
</div>
</div>
{% endblock content %}

3
galerie/tests.py

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
galerie/views.py

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

17
home/templates/home/home_page.html

@ -5,17 +5,20 @@
{% block extra_css %} {% block extra_css %}
{% comment %}
Delete the line below if you're just getting started and want to remove the welcome screen!
{% endcomment %}
<link rel="stylesheet" href="{% static 'css/welcome_page.css' %}"> <link rel="stylesheet" href="{% static 'css/welcome_page.css' %}">
{% endblock extra_css %} {% endblock extra_css %}
{% block content %} {% block content %}
{% comment %}
Delete the line below if you're just getting started and want to remove the welcome screen!
{% endcomment %}
{% include 'home/welcome_page.html' %}
<div class="row">
<div class="col-12">
<h3> Seznam filmů a promítaní </h3>
<div class="row">
<div class="col-12">
</div>
</div>
</div>
</div>
{% endblock content %} {% endblock content %}

BIN
media/images/babovresky.2e16d0ba.fill-400x200.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
media/images/babovresky.max-165x165.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
media/images/letni_kino1.2e16d0ba.fill-320x240.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
media/images/letni_kino1.max-165x165.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
media/images/letni_kino3.2e16d0ba.fill-320x240.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
media/images/letni_kino3.max-165x165.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
media/images/letnikino2.2e16d0ba.fill-320x240.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
media/images/letnikino2.max-165x165.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
media/images/plus.max-165x165.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
media/images/rychle.2e16d0ba.fill-400x200.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
media/images/rychle.max-165x165.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
media/original_images/babovresky.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
media/original_images/letni_kino1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
media/original_images/letni_kino3.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 KiB

BIN
media/original_images/letnikino2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
media/original_images/plus.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
media/original_images/rychle.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 KiB

0
program/__init__.py

3
program/admin.py

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
program/apps.py

@ -0,0 +1,5 @@
from django.apps import AppConfig
class ProgramConfig(AppConfig):
name = 'program'

36
program/migrations/0001_initial.py

@ -0,0 +1,36 @@
# Generated by Django 3.1.4 on 2020-12-04 20:38
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'),
('wagtailimages', '0022_uploadedimage'),
]
operations = [
migrations.CreateModel(
name='ProgramPage',
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.DateTimeField(verbose_name='Datum a čas projekce')),
('place', models.CharField(max_length=64)),
('release_date', models.DateField(verbose_name='Datum vydání filmu')),
('year', models.PositiveIntegerField(blank=True)),
('autor', models.CharField(max_length=64)),
('country', models.CharField(max_length=64)),
('annotation', wagtail.core.fields.RichTextField(blank=True)),
('image', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='wagtailimages.image')),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
),
]

67
program/migrations/0002_auto_20201204_2156.py

@ -0,0 +1,67 @@
# Generated by Django 3.1.4 on 2020-12-04 20:56
from django.db import migrations, models
import django.db.models.deletion
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0059_apply_collection_ordering'),
('wagtailimages', '0022_uploadedimage'),
('program', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='programpage',
name='annotation',
),
migrations.RemoveField(
model_name='programpage',
name='autor',
),
migrations.RemoveField(
model_name='programpage',
name='country',
),
migrations.RemoveField(
model_name='programpage',
name='date',
),
migrations.RemoveField(
model_name='programpage',
name='image',
),
migrations.RemoveField(
model_name='programpage',
name='place',
),
migrations.RemoveField(
model_name='programpage',
name='release_date',
),
migrations.RemoveField(
model_name='programpage',
name='year',
),
migrations.CreateModel(
name='ProgramItems',
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.DateTimeField(verbose_name='Datum a čas projekce')),
('place', models.CharField(max_length=64)),
('release_date', models.DateField(verbose_name='Datum vydání filmu')),
('year', models.PositiveIntegerField(blank=True)),
('autor', models.CharField(max_length=64)),
('country', models.CharField(max_length=64)),
('annotation', wagtail.core.fields.RichTextField(blank=True)),
('image', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='wagtailimages.image')),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
),
]

0
program/migrations/__init__.py

39
program/models.py

@ -0,0 +1,39 @@
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 ProgramPage(Page):
pass
class ProgramItems(Page):
date = models.DateTimeField("Datum a čas projekce")
place = models.CharField(max_length=64)
release_date = models.DateField("Datum vydání filmu")
year = models.PositiveIntegerField(blank=True)
autor = models.CharField(max_length=64)
country = models.CharField(max_length=64)
annotation = RichTextField(blank=True)
image = models.ForeignKey(
'wagtailimages.Image', on_delete=models.PROTECT, related_name='+'
)
search_fields = Page.search_fields + [
index.SearchField('annotation'),
]
content_panels = Page.content_panels + [
FieldPanel('date'),
FieldPanel('place'),
FieldPanel('release_date'),
FieldPanel('year'),
FieldPanel('autor'),
FieldPanel('country'),
FieldPanel('annotation', classname="full"),
ImageChooserPanel('image'),
]

34
program/templates/program/program_page.html

@ -0,0 +1,34 @@
{% extends "base.html" %}
{% load wagtailcore_tags static wagtailimages_tags wagtailimages_tags %}
{% block body_class %}template-homepage{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{% static 'css/welcome_page.css' %}">
{% endblock extra_css %}
{% block content %}
<div class="row">
<div class="col-12">
<h3> Seznam filmů a promítaní </h3>
<div class="row">
{% for item in page.get_children %}
<div class="col-4">
<div class="card" style="width: 100%;">
{% image item.specific.image class="img-fluid" fill-400x200 %}
<div class="card-body">
<h5 class="card-title"> {{ item.title }} </h5>
<p class="card-text"> {{ item.annotation }} </p>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">{{ item.specific.annotation|richtext }}</li>
<li class="list-group-item">{{ item.specific.date }}</li>
<li class="list-group-item">{{ item.specific.place }}</li>
<li class="list-group-item">{{ item.specific.release_date }}</li>
<li class="list-group-item">{{ item.specific.autor }}</li>
<li class="list-group-item">{{ item.specific.country }}</li>
</ul>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
{% endblock content %}

3
program/tests.py

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
program/views.py

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.
Loading…
Cancel
Save