diff --git a/artists/templates/artists/index.html b/artists/templates/artists/index.html index 9584ed9..e3b5cf7 100644 --- a/artists/templates/artists/index.html +++ b/artists/templates/artists/index.html @@ -4,9 +4,24 @@ {% block content %}

Artists

- +
+
+ + +
+
+ + + + + + {% for artist in artists %} + + + + {% endfor %} + +
Artist
+ {{ artist.romanized_name }} +
{% endblock %} \ No newline at end of file diff --git a/artists/views.py b/artists/views.py index aa55d7e..bce78ee 100644 --- a/artists/views.py +++ b/artists/views.py @@ -6,7 +6,13 @@ from songs.models import OutsideSong def artist_index(request): artists = Artist.objects.all() - return render(request,'artists/index.html',{'artists':artists}) + objs = {} + if "q" in request.GET: + q = request.GET['q'] + artists = Artist.objects.filter(name__contains=q) | Artist.objects.filter(romanized_name__contains=q) + objs['q'] = q + objs['artists'] = artists + return render(request,'artists/index.html',objs) def artist_show(request, slug): artist = Artist.objects.filter(slug=slug)[0] diff --git a/songs/templates/songs/index.html b/songs/templates/songs/index.html index 0ff0d2c..d88aa03 100644 --- a/songs/templates/songs/index.html +++ b/songs/templates/songs/index.html @@ -4,6 +4,12 @@ {% block content %}

Songs

+
+
+ + +
+
{% include 'components/song-table.html' with songs=page_obj %}