From 2abeacccb68fb258b47aeca657c08853ea2d6a9c Mon Sep 17 00:00:00 2001 From: j Date: Mon, 11 Oct 2021 19:20:13 +0100 Subject: [PATCH] prepare for bio translations --- app/static/css/partials/_film.scss | 9 +++++++++ app/templates/film.html | 11 +++++++++-- app/video/management/commands/load_titles.py | 6 +++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/app/static/css/partials/_film.scss b/app/static/css/partials/_film.scss index ccedb3c..afaa48b 100644 --- a/app/static/css/partials/_film.scss +++ b/app/static/css/partials/_film.scss @@ -42,6 +42,15 @@ main > .film { h2 { margin: 24px 0; } + .details { + margin-top: 16px; + } + .bio { + margin-top: 16px; + div { + margin-top: 8px; + } + } } video { width: 100%; diff --git a/app/templates/film.html b/app/templates/film.html index 5f6a0d8..7756643 100644 --- a/app/templates/film.html +++ b/app/templates/film.html @@ -14,9 +14,16 @@

{{ film.data.summary|safe }}

- Runtime: {{ film.duration }}, Year: {{ film.data.date}}, - Artist Bio: {{ film.data.bio|safe }} + Runtime: {{ film.duration }} +
+
+
+ {{film.data.director.0}}: {{ film.data.bio|safe }} +
+
+ {{film.data.director.1}}: {{ film.data.bio_zh|safe }} +
diff --git a/app/video/management/commands/load_titles.py b/app/video/management/commands/load_titles.py index b3e5dbf..275a6bf 100644 --- a/app/video/management/commands/load_titles.py +++ b/app/video/management/commands/load_titles.py @@ -28,9 +28,13 @@ class Command(BaseCommand): for key, value in item.items(): if key == 'title': f.data['title'], f.data['title_zh'] = value.split(' / ', 1) + elif key == 'sourcedescription': + if '

' in value: + f.data['bio'], f.data['bio_zh'] = value.split('

', 1) + else: + f.data['bio'] = f.data['bio_zh'] = value elif key != 'id': f.data[{ - 'sourcedescription': 'bio' }.get(key, key)] = value f.public = True f.slug = item['id']