diff --git a/vrobbler/apps/music/context_processors.py b/vrobbler/apps/music/context_processors.py new file mode 100644 index 0000000..3db98e0 --- /dev/null +++ b/vrobbler/apps/music/context_processors.py @@ -0,0 +1,8 @@ +from music.models import Artist, Album + + +def music_lists(request): + return { + "artist_list": Artist.objects.all(), + "album_list": Album.objects.all(), + } diff --git a/vrobbler/apps/videos/context_processors.py b/vrobbler/apps/videos/context_processors.py new file mode 100644 index 0000000..34be4aa --- /dev/null +++ b/vrobbler/apps/videos/context_processors.py @@ -0,0 +1,8 @@ +from videos.models import Video, Series + + +def video_lists(request): + return { + "movie_list": Video.objects.filter(video_type=Video.VideoType.MOVIE), + "series_list": Series.objects.all(), + } diff --git a/vrobbler/settings.py b/vrobbler/settings.py index 6cd4db5..bb4f415 100644 --- a/vrobbler/settings.py +++ b/vrobbler/settings.py @@ -119,6 +119,8 @@ TEMPLATES = [ "django.template.context_processors.request", "django.contrib.auth.context_processors.auth", "django.contrib.messages.context_processors.messages", + "videos.context_processors.video_lists", + "music.context_processors.music_lists", ], }, }, diff --git a/vrobbler/templates/base.html b/vrobbler/templates/base.html index a487c74..59e6ad9 100644 --- a/vrobbler/templates/base.html +++ b/vrobbler/templates/base.html @@ -89,8 +89,8 @@ Movies
@@ -98,8 +98,8 @@ Shows