dual title, director

This commit is contained in:
j 2021-10-11 19:03:23 +01:00
parent 1516b7349a
commit 85b4a0b7d6
4 changed files with 40 additions and 8 deletions

View file

@ -32,10 +32,16 @@ main > .film {
.info { .info {
margin: 8px; margin: 8px;
margin-bottom: 32px; margin-bottom: 32px;
text-overflow: ellipsis;
overflow: hidden;
h1 { h1 {
font-size: 24px; font-size: 24px;
margin: 24px 0; margin: 24px 0;
} }
h2 {
margin: 24px 0;
}
} }
video { video {
width: 100%; width: 100%;
@ -45,5 +51,20 @@ main > .film {
margin: 8px; margin: 8px;
margin-top: 16px; margin-top: 16px;
margin-bottom: 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;
}
}
} }
} }

View file

@ -3,10 +3,15 @@
<div class="film"> <div class="film">
<div class="info"> <div class="info">
<h1>{{ film.data.title | safe }}</h1> <h1>
{% comment %} <span>{{ film.data.title | safe }}</span>
<h2>{{ film.data.director|join:", "|safe }}</h2> <span>{{ film.data.title_zh | safe }}</span>
{% endcomment %} </h1>
<h2>
{% for director in film.data.director %}
{{ director|safe }}<br>
{% endfor %}
</h2>
<p>{{ film.data.summary|safe }}</p> <p>{{ film.data.summary|safe }}</p>
<div class="details"> <div class="details">
Runtime: {{ film.duration }}, Runtime: {{ film.duration }},

View file

@ -3,8 +3,12 @@
<div class="films"> <div class="films">
{% for film in films %} {% for film in films %}
<div class="film"> <div class="film">
<h1><a href="{{ film.get_absolute_url }}">{{ film.data.title | safe }}</a></h1> <h1><a href="{{ film.get_absolute_url }}">
<h2>{{ film.data.director|join:", "|safe }}</h2> {{ film.data.title | safe }}
{{ film.data.title_zh | safe }}
</a></h1>
<h2>{{ film.data.director|join:" "|safe }}</h2>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>

View file

@ -18,7 +18,7 @@ class Command(BaseCommand):
}, },
'keys': [ 'keys': [
'id', 'title', 'director', 'summary', 'source', 'sourcedescription', 'date', 'location', 'id', 'title', 'director', 'summary', 'source', 'sourcedescription', 'date', 'location',
'duration' 'duration', 'featuring', 'cinematographer'
], ],
'range': [0, 1000] 'range': [0, 1000]
} }
@ -26,7 +26,9 @@ class Command(BaseCommand):
print(item) print(item)
f, c = models.Film.objects.get_or_create(padma_id=item['id']) f, c = models.Film.objects.get_or_create(padma_id=item['id'])
for key, value in item.items(): 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[{ f.data[{
'sourcedescription': 'bio' 'sourcedescription': 'bio'
}.get(key, key)] = value }.get(key, key)] = value