From 85b4a0b7d69692bc2af17b54b4632937ed6c61b5 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 11 Oct 2021 19:03:23 +0100 Subject: [PATCH] dual title, director --- app/static/css/partials/_film.scss | 21 ++++++++++++++++++++ app/templates/film.html | 13 ++++++++---- app/templates/films.html | 8 ++++++-- app/video/management/commands/load_titles.py | 6 ++++-- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/app/static/css/partials/_film.scss b/app/static/css/partials/_film.scss index cc8cc8f..ccedb3c 100644 --- a/app/static/css/partials/_film.scss +++ b/app/static/css/partials/_film.scss @@ -32,10 +32,16 @@ main > .film { .info { margin: 8px; margin-bottom: 32px; + text-overflow: ellipsis; + overflow: hidden; + h1 { font-size: 24px; margin: 24px 0; } + h2 { + margin: 24px 0; + } } video { width: 100%; @@ -45,5 +51,20 @@ main > .film { margin: 8px; margin-top: 16px; margin-bottom: 16px; + + .texts { + padding-top: 16px; + .text { + padding-bottom: 16px; + } + } + } + @media screen and (max-width: 799px) { + h1 { + span { + display: block; + margin-bottom: 8px; + } + } } } diff --git a/app/templates/film.html b/app/templates/film.html index a360bd1..5f6a0d8 100644 --- a/app/templates/film.html +++ b/app/templates/film.html @@ -3,10 +3,15 @@
-

{{ film.data.title | safe }}

- {% comment %} -

{{ film.data.director|join:", "|safe }}

- {% endcomment %} +

+ {{ film.data.title | safe }} + {{ film.data.title_zh | safe }} +

+

+ {% for director in film.data.director %} + {{ director|safe }}
+ {% endfor %} +

{{ film.data.summary|safe }}

Runtime: {{ film.duration }}, diff --git a/app/templates/films.html b/app/templates/films.html index 64eb72d..6e69f00 100644 --- a/app/templates/films.html +++ b/app/templates/films.html @@ -3,8 +3,12 @@
{% for film in films %}
-

{{ film.data.title | safe }}

-

{{ film.data.director|join:", "|safe }}

+

+ {{ film.data.title | safe }} + + {{ film.data.title_zh | safe }} +

+

{{ film.data.director|join:" "|safe }}

{% endfor %}
diff --git a/app/video/management/commands/load_titles.py b/app/video/management/commands/load_titles.py index 4641328..b3e5dbf 100644 --- a/app/video/management/commands/load_titles.py +++ b/app/video/management/commands/load_titles.py @@ -18,7 +18,7 @@ class Command(BaseCommand): }, 'keys': [ 'id', 'title', 'director', 'summary', 'source', 'sourcedescription', 'date', 'location', - 'duration' + 'duration', 'featuring', 'cinematographer' ], 'range': [0, 1000] } @@ -26,7 +26,9 @@ class Command(BaseCommand): print(item) f, c = models.Film.objects.get_or_create(padma_id=item['id']) for key, value in item.items(): - if key != 'id': + if key == 'title': + f.data['title'], f.data['title_zh'] = value.split(' / ', 1) + elif key != 'id': f.data[{ 'sourcedescription': 'bio' }.get(key, key)] = value