new container

This commit is contained in:
Sanjay B 2021-10-28 22:03:47 +05:30
parent 220a34620f
commit c91f8767da
2 changed files with 24 additions and 22 deletions

View file

@ -7,9 +7,9 @@ function selectChanged() {
const bVal = b.dataset[sortValue]
return aVal < bVal ? -1 : 1
})
document.getElementById('films').innerHTML = ''
document.getElementById('films-list').innerHTML = ''
$films.forEach($film => {
document.getElementById('films').appendChild($film)
document.getElementById('films-list').appendChild($film)
})
}

View file

@ -2,7 +2,7 @@
{% block body_class%}animated animated-text{% endblock %}
{% block main %}
<div class="films" id="films">
<div class="films">
<div>
<strong>Sort:</strong>
<select id="sort-select">
@ -14,26 +14,28 @@
<option value="lightness">Lightness</option>
</select>
</div>
{% for film in films %}
<div class="film"
data-position="{{ film.position }}"
data-title="{{ film.data.title }}"
data-duration="{{ film.data.duration }}"
data-hue="{{ film.data.hue }}"
data-saturation="{{ film.data.saturation }}"
data-lightness="{{ film.data.lightness }}"
>
<h1><a href="{{ film.get_absolute_url }}">
<span>{{ film.data.title | safe }}</span>
<span>{{ film.data.title_zh | safe }}</span>
</a></h1>
<h2>
{% for director in film.data.director %}
<span>{{ director|safe }}</span>
{% endfor %}
</h2>
<div id="films-list">
{% for film in films %}
<div class="film"
data-position="{{ film.position }}"
data-title="{{ film.data.title }}"
data-duration="{{ film.data.duration }}"
data-hue="{{ film.data.hue }}"
data-saturation="{{ film.data.saturation }}"
data-lightness="{{ film.data.lightness }}"
>
<h1><a href="{{ film.get_absolute_url }}">
<span>{{ film.data.title | safe }}</span>
<span>{{ film.data.title_zh | safe }}</span>
</a></h1>
<h2>
{% for director in film.data.director %}
<span>{{ director|safe }}</span>
{% endfor %}
</h2>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
{% endblock %}