From e27bd125acd9344b837bbcc81b2ed0b35d0e42e2 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 28 Jan 2022 16:08:31 +0000 Subject: [PATCH] capitalize types --- app/static/js/films.js | 2 +- app/video/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/static/js/films.js b/app/static/js/films.js index 6f0d2cb..d835402 100644 --- a/app/static/js/films.js +++ b/app/static/js/films.js @@ -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 { diff --git a/app/video/views.py b/app/video/views.py index 0d4432c..b99dd9b 100644 --- a/app/video/views.py +++ b/app/video/views.py @@ -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):