capitalize types

This commit is contained in:
j 2022-01-28 16:08:31 +00:00
parent f9578af0e4
commit e27bd125ac
2 changed files with 2 additions and 2 deletions

View file

@ -33,7 +33,7 @@ function filterChanged() {
const filterValue = document.getElementById('filter-select').value
options.filter = filterValue
document.querySelectorAll('.film').forEach(film => {
if (!options.filter || film.dataset.type.split(',').indexOf(options.filter) > -1) {
if (!options.filter || film.dataset.type.toLowerCase().split(',').indexOf(options.filter.toLowerCase()) > -1) {
console.log(film.dataset.type.split(','), film.dataset.type.split(',').indexOf(options.filter))
film.style.display = ''
} else {

View file

@ -59,7 +59,7 @@ def films(request):
context['films'] = models.Film.objects.filter(public=True).order_by('position', 'data__title')
types = []
for f in context['films']:
types += f.data['type']
types += [t.capitalize() for t in f.data['type']]
types = Counter(types)
context['types'] = []
for t in sorted(types):