Browse Source

Založení projektu

master
Vít Tlustý 4 years ago
parent
commit
63e19a5e75
  1. 1
      .gitignore
  2. 8
      .idea/.gitignore
  3. 19
      .idea/dataSources.xml
  4. 6
      .idea/inspectionProfiles/profiles_settings.xml
  5. 31
      .idea/kinoostrov.iml
  6. 4
      .idea/misc.xml
  7. 8
      .idea/modules.xml
  8. 6
      .idea/vcs.xml
  9. 0
      akce/__init__.py
  10. 10
      akce/admin.py
  11. 6
      akce/apps.py
  12. 0
      akce/migrations/__init__.py
  13. 12
      akce/models.py
  14. 3
      akce/tests.py
  15. 5
      akce/views.py
  16. 0
      galerie/__init__.py
  17. 3
      galerie/admin.py
  18. 6
      galerie/apps.py
  19. 0
      galerie/migrations/__init__.py
  20. 3
      galerie/models.py
  21. 3
      galerie/tests.py
  22. 3
      galerie/views.py
  23. 0
      kinoostrov/__init__.py
  24. 16
      kinoostrov/asgi.py
  25. 133
      kinoostrov/settings.py
  26. 10819
      kinoostrov/static/kinoostrov/css/bootstrap.css
  27. 1
      kinoostrov/static/kinoostrov/css/bootstrap.css.map
  28. 7
      kinoostrov/static/kinoostrov/css/bootstrap.min.css
  29. 1
      kinoostrov/static/kinoostrov/css/bootstrap.min.css.map
  30. 16
      kinoostrov/static/kinoostrov/css/style.css
  31. 1
      kinoostrov/static/kinoostrov/img/arrow-right.svg
  32. BIN
      kinoostrov/static/kinoostrov/img/logo1.png
  33. 1
      kinoostrov/static/kinoostrov/img/search.svg
  34. 4993
      kinoostrov/static/kinoostrov/js/bootstrap.js
  35. 1
      kinoostrov/static/kinoostrov/js/bootstrap.js.map
  36. 7
      kinoostrov/static/kinoostrov/js/bootstrap.min.js
  37. 1
      kinoostrov/static/kinoostrov/js/bootstrap.min.js.map
  38. 72
      kinoostrov/templates/kinoostrov/base.html
  39. 5
      kinoostrov/templates/kinoostrov/index.html
  40. 27
      kinoostrov/urls.py
  41. 5
      kinoostrov/views.py
  42. 16
      kinoostrov/wsgi.py
  43. 0
      kolotoc/__init__.py
  44. 7
      kolotoc/admin.py
  45. 6
      kolotoc/apps.py
  46. 20
      kolotoc/migrations/0001_initial.py
  47. 25
      kolotoc/migrations/0002_auto_20210511_1944.py
  48. 18
      kolotoc/migrations/0003_alter_kolotoc_popisek.py
  49. 21
      kolotoc/migrations/0004_auto_20210511_2002.py
  50. 20
      kolotoc/migrations/0005_kolotoc_popisek.py
  51. 18
      kolotoc/migrations/0006_kolotoc_obrazek.py
  52. 0
      kolotoc/migrations/__init__.py
  53. 6
      kolotoc/models.py
  54. 34
      kolotoc/templates/kolotoc/kolotoc.html
  55. 0
      kolotoc/templatetags/__init__.py
  56. 14
      kolotoc/templatetags/kolotoc.py
  57. 3
      kolotoc/tests.py
  58. 3
      kolotoc/views.py
  59. 22
      manage.py
  60. 0
      stranky/__init__.py
  61. 3
      stranky/admin.py
  62. 6
      stranky/apps.py
  63. 0
      stranky/migrations/__init__.py
  64. 3
      stranky/models.py
  65. 3
      stranky/tests.py
  66. 3
      stranky/views.py

1
.gitignore

@ -129,3 +129,4 @@ dmypy.json
# Pyre type checker # Pyre type checker
.pyre/ .pyre/
uploads/

8
.idea/.gitignore

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

19
.idea/dataSources.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="db" uuid="6a180ecf-35e8-4c4b-b6fc-ddb607c918e4">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:C:\Users\Vitek-game\Desktop\kinoostrov\db.sqlite3</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
<data-source source="LOCAL" name="SQLite - db.sqlite3" uuid="bd07c148-4679-4937-a3f9-a1e9d2b58224">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/db.sqlite3</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

6
.idea/inspectionProfiles/profiles_settings.xml

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

31
.idea/kinoostrov.iml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="FacetManager">
<facet type="django" name="Django">
<configuration>
<option name="rootFolder" value="$MODULE_DIR$" />
<option name="settingsModule" value="kinoostrov/settings.py" />
<option name="manageScript" value="$MODULE_DIR$/manage.py" />
<option name="environment" value="&lt;map/&gt;" />
<option name="doNotUseTestRunner" value="false" />
<option name="trackFilePattern" value="migrations" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Django" />
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/kinoostrov/templates" />
<option value="$MODULE_DIR$/akce/tempates" />
</list>
</option>
</component>
</module>

4
.idea/misc.xml

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (kinoostrov) (2)" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/kinoostrov.iml" filepath="$PROJECT_DIR$/.idea/kinoostrov.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

0
akce/__init__.py

10
akce/admin.py

@ -0,0 +1,10 @@
from django.contrib import admin
from kolotoc.models import Kolotoc
# Register your models here.
#@admin.register(Kolotoc)
#class KolotocAdmin(admin.ModelAdmin):
# pass
#TODO: dodelat admina pro akce

6
akce/apps.py

@ -0,0 +1,6 @@
from django.apps import AppConfig
class AkceConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'akce'

0
akce/migrations/__init__.py

12
akce/models.py

@ -0,0 +1,12 @@
from django.db import models
# Create your models here.
# model Akce
# - název
# - popis
# - den konání + čas (models.DateTimeField)
# - o filmu (CharField)
# - režie
# - obrázek

3
akce/tests.py

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

5
akce/views.py

@ -0,0 +1,5 @@
from django.shortcuts import render
# Create your views here.
def akce(request):
return render(request, "akce/akce.html")

0
galerie/__init__.py

3
galerie/admin.py

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

6
galerie/apps.py

@ -0,0 +1,6 @@
from django.apps import AppConfig
class GalerieConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'galerie'

0
galerie/migrations/__init__.py

3
galerie/models.py

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

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.

0
kinoostrov/__init__.py

16
kinoostrov/asgi.py

@ -0,0 +1,16 @@
"""
ASGI config for kinoostrov project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kinoostrov.settings')
application = get_asgi_application()

133
kinoostrov/settings.py

@ -0,0 +1,133 @@
"""
Django settings for kinoostrov project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-#dqm^*@#9g5r4mqkp82d$(mfv0#=-l_b6u4_#0y8q0==qi(u$o'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'kinoostrov',
'kolotoc',
'akce',
'galerie',
'stranky',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'kinoostrov.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'kinoostrov.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
# AUTH_PASSWORD_VALIDATORS = [
# {
# 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
# },
# {
# 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
# },
# {
# 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
# },
# {
# 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
# },
# ]
# Internationalization
# https://docs.djangopro,,ject.com/en/3.2/topics/i18n/
LANGUAGE_CODE = 'cs'
TIME_ZONE = 'Europe/Prague'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/
STATIC_URL = '/static/'
MEDIA_URL = '/uploads/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads')
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

10819
kinoostrov/static/kinoostrov/css/bootstrap.css

File diff suppressed because it is too large

1
kinoostrov/static/kinoostrov/css/bootstrap.css.map

File diff suppressed because one or more lines are too long

7
kinoostrov/static/kinoostrov/css/bootstrap.min.css

File diff suppressed because one or more lines are too long

1
kinoostrov/static/kinoostrov/css/bootstrap.min.css.map

File diff suppressed because one or more lines are too long

16
kinoostrov/static/kinoostrov/css/style.css

@ -0,0 +1,16 @@
.container{
margin-top: 2%;
}
h4{
float: left;
}
.navbar:hover{
cursor: pointer;
}
footer {
display: flex;
justify-content: center;
padding: 5px;
}

1
kinoostrov/static/kinoostrov/img/arrow-right.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>

After

Width:  |  Height:  |  Size: 314 B

BIN
kinoostrov/static/kinoostrov/img/logo1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

1
kinoostrov/static/kinoostrov/img/search.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>

After

Width:  |  Height:  |  Size: 308 B

4993
kinoostrov/static/kinoostrov/js/bootstrap.js

File diff suppressed because it is too large

1
kinoostrov/static/kinoostrov/js/bootstrap.js.map

File diff suppressed because one or more lines are too long

7
kinoostrov/static/kinoostrov/js/bootstrap.min.js

File diff suppressed because one or more lines are too long

1
kinoostrov/static/kinoostrov/js/bootstrap.min.js.map

File diff suppressed because one or more lines are too long

72
kinoostrov/templates/kinoostrov/base.html

@ -0,0 +1,72 @@
{% load static %}
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="UTF-8">
<title>Kinoostrov</title>
<link rel="stylesheet" href="{%static "kinoostrov/css/bootstrap.min.css" %}">
<link rel="stylesheet" href="{%static "kinoostrov/css/style.css" %}">
</head>
<body>
<div class="container">
<header>
<div class="row">
<div class="col-6">
<a href="{% url "index" %}"><img src="{%static "kinoostrov/img/logo1.png" %}" alt=""></a>
</div>
<div class="col-3">
<div class="d-flex flex-column bd-highlight mb-3">
<div class="d-flex justify-content-between">
<form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3">
<input type="search" name="s" class="form-control-sm" placeholder="Hledat" aria-label="Prohledat stránky:">
</form>
</div>
<div class="d-flex justify-content-between"><h3>FB</h3></div>
<div class="d-flex justify-content-between"><h3>FB festival</h3></div>
</div>
</div>
<div class="col-3">
<div class="d-flex flex-column-reverse bd-highlight">
<div class="p-2 bd-highlight"><img src="{%static "kinoostrov/img/search.svg" %}" alt=""></div>
<div class="p-2 bd-highlight"><img src="{%static "kinoostrov/img/arrow-right.svg" %}" alt=""></div>
<div class="p-2 bd-highlight"><img src="{%static "kinoostrov/img/arrow-right.svg" %}" alt=""></div>
</div>
</div>
</div>
</header>
<hr>
<nav class="navbar navbar-light ">
<div class="container-fluid">
<a href="{% url "akce" %}"><h3><b>Letní kino</b></h3></a>
<a href="#"><h3><b>Filmový festival</b></h3></a>
<a href="#"><h3><b>Filmový klub</b></h3></a>
<a href="#"><h3><b>Akce</b></h3></a>
<a href="#"><h3><b>Galerie</b></h3></a>
<a href="#"><h3><b>ELBE DOCK 2020</b></h3></a>
<a href="#"><h3><b>Kontakt</b></h3></a>
</div>
</nav>
<hr>
{% block content %}
zatim zadny obsah...
{% endblock %}
<footer>
<p>© Kinoostrov</p>
</footer>
</div>
<script src="{%static "kinoostrov/js/bootstrap.js" %}">
var myCarousel = document.querySelector('#myCarousel')
var carousel = new bootstrap.Carousel(myCarousel)
</script>
</div>
</header>
</body>
</html>

5
kinoostrov/templates/kinoostrov/index.html

@ -0,0 +1,5 @@
{%extends "kinoostrov/base.html" %}
{%load kolotoc %}
{% block content %}
{% kolotoc %}
{% endblock %}

27
kinoostrov/urls.py

@ -0,0 +1,27 @@
"""kinoostrov URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from kinoostrov import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('akce/', include('akce.urls')),
path("",views.index, name="index"),
]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

5
kinoostrov/views.py

@ -0,0 +1,5 @@
from django.shortcuts import render
def index(request):
return render(request,"kinoostrov/index.html")

16
kinoostrov/wsgi.py

@ -0,0 +1,16 @@
"""
WSGI config for kinoostrov project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kinoostrov.settings')
application = get_wsgi_application()

0
kolotoc/__init__.py

7
kolotoc/admin.py

@ -0,0 +1,7 @@
from django.contrib import admin
from kolotoc.models import Kolotoc
# Register your models here.
@admin.register(Kolotoc)
class KolotocAdmin(admin.ModelAdmin):
pass

6
kolotoc/apps.py

@ -0,0 +1,6 @@
from django.apps import AppConfig
class KolotocConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'kolotoc'

20
kolotoc/migrations/0001_initial.py

@ -0,0 +1,20 @@
# Generated by Django 3.2 on 2021-05-10 08:51
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Kolotoc',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
]

25
kolotoc/migrations/0002_auto_20210511_1944.py

@ -0,0 +1,25 @@
# Generated by Django 3.2 on 2021-05-11 17:44
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('kolotoc', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='kolotoc',
name='obrazek',
field=models.ImageField(blank=True, null=True, upload_to='img', verbose_name='Obrázek'),
),
migrations.AddField(
model_name='kolotoc',
name='popisek',
field=models.CharField(default=django.utils.timezone.now, max_length=50, verbose_name='Název'),
preserve_default=False,
),
]

18
kolotoc/migrations/0003_alter_kolotoc_popisek.py

@ -0,0 +1,18 @@
# Generated by Django 3.2 on 2021-05-11 17:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kolotoc', '0002_auto_20210511_1944'),
]
operations = [
migrations.AlterField(
model_name='kolotoc',
name='popisek',
field=models.CharField(max_length=50, verbose_name='Popisek'),
),
]

21
kolotoc/migrations/0004_auto_20210511_2002.py

@ -0,0 +1,21 @@
# Generated by Django 3.2 on 2021-05-11 18:02
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('kolotoc', '0003_alter_kolotoc_popisek'),
]
operations = [
migrations.RemoveField(
model_name='kolotoc',
name='obrazek',
),
migrations.RemoveField(
model_name='kolotoc',
name='popisek',
),
]

20
kolotoc/migrations/0005_kolotoc_popisek.py

@ -0,0 +1,20 @@
# Generated by Django 3.2 on 2021-05-11 18:15
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('kolotoc', '0004_auto_20210511_2002'),
]
operations = [
migrations.AddField(
model_name='kolotoc',
name='popisek',
field=models.CharField(default=django.utils.timezone.now, max_length=64, verbose_name='Popisek'),
preserve_default=False,
),
]

18
kolotoc/migrations/0006_kolotoc_obrazek.py

@ -0,0 +1,18 @@
# Generated by Django 3.2 on 2021-05-12 18:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kolotoc', '0005_kolotoc_popisek'),
]
operations = [
migrations.AddField(
model_name='kolotoc',
name='obrazek',
field=models.ImageField(blank=True, null=True, upload_to='kinoostrov/img', verbose_name='Obrázek'),
),
]

0
kolotoc/migrations/__init__.py

6
kolotoc/models.py

@ -0,0 +1,6 @@
from django.db import models
# Create your models here.
class Kolotoc(models.Model):
popisek =models.CharField(max_length=64,null=False, blank=False,verbose_name="Popisek")
obrazek =models.ImageField(upload_to="kolotoc", verbose_name="Obrázek")

34
kolotoc/templates/kolotoc/kolotoc.html

@ -0,0 +1,34 @@
{% load static %}
<div id="carouselExampleCaptions" class="carousel carousel-dark slide" data-bs-ride="carousel">
<div class="carousel-indicators">
{% for p in polozky %}
<button
type="button"
data-bs-target="#carouselExampleCaptions"
data-bs-slide-to="{{ forloop.counter0 }}"
class="{% if forloop.first %}active{% endif %}"
aria-current="true" aria-label="{{ p.popisek }}">
</button>
{% endfor %}
</div>
<div class="carousel-inner">
{% for p in polozky %}
<div class="carousel-item {% if forloop.first %}active{% endif %}">
<img src="{{ p.obrazek.url }}" alt="{{ p.popisek }}" class="d-block w-100">
<div class="carousel-caption d-none d-md-block">
<h5>{{ p.popisek }}</h5>
</div>
</div>
{% endfor %}
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>

0
kolotoc/templatetags/__init__.py

14
kolotoc/templatetags/kolotoc.py

@ -0,0 +1,14 @@
from django import template
from kolotoc.models import Kolotoc
register = template.Library()
@register.inclusion_tag("kolotoc/kolotoc.html")
def kolotoc():
polozky = Kolotoc.objects.all()
return {
"polozky":polozky
}

3
kolotoc/tests.py

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

3
kolotoc/views.py

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

22
manage.py

@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kinoostrov.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()

0
stranky/__init__.py

3
stranky/admin.py

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

6
stranky/apps.py

@ -0,0 +1,6 @@
from django.apps import AppConfig
class StrankyConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'stranky'

0
stranky/migrations/__init__.py

3
stranky/models.py

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
stranky/tests.py

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

3
stranky/views.py

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