include timelines

This commit is contained in:
j 2021-09-30 19:33:47 +01:00
parent 0232f6fe87
commit a3bac4c3dd
4 changed files with 55 additions and 5 deletions

View file

@ -1,2 +1,36 @@
.films {
width: 100vw;
.film {
width: 100vw;
display: flex;
flex-direction: row;
.left, .right {
width: 50%;
img {
max-width: 100%;
}
}
h1 {
font-weight: bold;
font-size: 20px;
}
}
@media screen and (max-width: 799px) {
.film {
margin-bottom: 16px;
flex-direction: column;
.left, .right {
width: 100%;
img {
max-width: 100%;
}
}
h2 {
margin-bottom: 8px;
}
}
}
}

View file

@ -3,6 +3,7 @@
<video src="{{ settings.TIMELINE_PREFIX }}{{ film.padma_id }}/loop.mp4" autoplay loop muted></video> <video src="{{ settings.TIMELINE_PREFIX }}{{ film.padma_id }}/loop.mp4" autoplay loop muted></video>
<h1>{{ film.data.title | safe }}</h1> <h1>{{ film.data.title | safe }}</h1>
<h2>{{ film.data.director|join:", "|safe }}</h2> <h2>{{ film.data.director|join:", "|safe }}</h2>
<p>{{ film.data.summary|safe }}</p> <p>{{ film.data.summary|safe }}</p>

View file

@ -1,9 +1,18 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block main %} {% block main %}
<div class="films">
{% for film in films %} {% for film in films %}
<div class="film"> <div class="film">
<a href="{% url 'film' film.slug %}">{{ film.data.title | safe }}</a> <div class="left">
<span>{{ film.data.director|join:", "|safe }}</span> <h1><a href="{% url 'film' film.slug %}">{{ film.data.title | safe }}</a></h1>
</div> <h2>{{ film.data.director|join:", "|safe }}</h2>
</div>
<div class="right">
<a href="{% url 'film' film.slug %}">
<img src="{{ settings.TIMELINE_PREFIX }}{{ film.padma_id }}/timeline.jpg">
</a>
</div>
</div>
{% endfor %} {% endfor %}
</div>
{% endblock %} {% endblock %}

View file

@ -1,23 +1,26 @@
from django.shortcuts import render, redirect, get_object_or_404 from django.shortcuts import render, redirect, get_object_or_404
from django.views.decorators.csrf import csrf_exempt from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
from . import models from . import models
def films(request): def films(request):
context = {} context = {}
context['films'] = models.Film.objects.filter(public=True).order_by('data__title') context['films'] = models.Film.objects.filter(public=True).order_by('data__title')
context['settings'] = settings
return render(request, 'films.html', context) return render(request, 'films.html', context)
def film(request, slug): def film(request, slug):
context = {} context = {}
context['film'] = get_object_or_404(models.Film, slug=slug) context['film'] = get_object_or_404(models.Film, slug=slug)
context['settings'] = settings
return render(request, 'film.html', context) return render(request, 'film.html', context)
def film_play(request, slug, lang): def film_play(request, slug, lang):
context = {} context = {}
context['film'] = get_object_or_404(models.Film, slug=slug) context['film'] = get_object_or_404(models.Film, slug=slug)
context['lang'] = lang context['lang'] = lang
context['settings'] = settings
return render(request, 'film_play.html', context) return render(request, 'film_play.html', context)
def edits(request): def edits(request):
@ -28,16 +31,19 @@ def edits(request):
def edit(request, slug): def edit(request, slug):
context = {} context = {}
context['edit'] = get_object_or_404(models.Edit, slug=slug) context['edit'] = get_object_or_404(models.Edit, slug=slug)
context['settings'] = settings
return render(request, 'edit.html', context) return render(request, 'edit.html', context)
def edit_play(request, slug, lang): def edit_play(request, slug, lang):
context = {} context = {}
context['edit'] = get_object_or_404(models.Edit, slug=slug) context['edit'] = get_object_or_404(models.Edit, slug=slug)
context['lang'] = lang context['lang'] = lang
context['settings'] = settings
return render(request, 'edit_play.html', context) return render(request, 'edit_play.html', context)
def tv(request): def tv(request):
context = {} context = {}
context['settings'] = settings
return render(request, 'tv.html', context) return render(request, 'tv.html', context)