From 0dc6b09a305816c1ed87aa30ad461553f75beb85 Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Thu, 29 Jun 2023 21:16:04 +0200 Subject: [PATCH] Add spotify to nav and remove tobacco, add spotify url to settings --- .../0025_setting_spotify_playlist_url.py | 18 ++++++++++++++++++ clubhaus/homepage/models.py | 2 ++ clubhaus/homepage/templates/homepage/base.html | 6 ++++-- .../homepage/templates/homepage/events.html | 3 +-- .../homepage/templates/homepage/index.html | 6 ++++-- clubhaus/homepage/templatetags/__init__.py | 0 .../homepage/templatetags/settings_tags.py | 10 ++++++++++ clubhaus/homepage/views.py | 11 +++++++---- clubhaus/requirements.txt | 2 +- 9 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 clubhaus/homepage/migrations/0025_setting_spotify_playlist_url.py create mode 100644 clubhaus/homepage/templatetags/__init__.py create mode 100644 clubhaus/homepage/templatetags/settings_tags.py diff --git a/clubhaus/homepage/migrations/0025_setting_spotify_playlist_url.py b/clubhaus/homepage/migrations/0025_setting_spotify_playlist_url.py new file mode 100644 index 0000000..e922d0e --- /dev/null +++ b/clubhaus/homepage/migrations/0025_setting_spotify_playlist_url.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.2 on 2023-06-29 18:18 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('homepage', '0024_eventbackground_clubhausevent_background_picture'), + ] + + operations = [ + migrations.AddField( + model_name='setting', + name='spotify_playlist_url', + field=models.CharField(blank=True, help_text='The link to the Spotify playlist', max_length=500), + ), + ] diff --git a/clubhaus/homepage/models.py b/clubhaus/homepage/models.py index 12842a5..364ed27 100644 --- a/clubhaus/homepage/models.py +++ b/clubhaus/homepage/models.py @@ -85,6 +85,8 @@ class Setting(models.Model): intro_text = models.TextField(blank=True) intro_text_classes = models.CharField(max_length=500, default="text-center fs-5", blank=True, help_text="Extra CSS classes for the div for the intro text like text size") + spotify_playlist_url = models.CharField(max_length=500, blank=True, + help_text="The link to the Spotify playlist") class Meta: constraints = [ diff --git a/clubhaus/homepage/templates/homepage/base.html b/clubhaus/homepage/templates/homepage/base.html index 10aa43f..83e8c91 100644 --- a/clubhaus/homepage/templates/homepage/base.html +++ b/clubhaus/homepage/templates/homepage/base.html @@ -1,4 +1,6 @@ {% load static %} +{% load settings_tags %} +{% get_active_settings as settings %} @@ -41,8 +43,8 @@ href="{% url 'index' %}">Home Event - Tobacco + Spotify diff --git a/clubhaus/homepage/templates/homepage/events.html b/clubhaus/homepage/templates/homepage/events.html index 501da16..c34b82b 100644 --- a/clubhaus/homepage/templates/homepage/events.html +++ b/clubhaus/homepage/templates/homepage/events.html @@ -72,8 +72,7 @@
diff --git a/clubhaus/homepage/templates/homepage/index.html b/clubhaus/homepage/templates/homepage/index.html index 0a56b9e..fabe404 100644 --- a/clubhaus/homepage/templates/homepage/index.html +++ b/clubhaus/homepage/templates/homepage/index.html @@ -1,5 +1,6 @@ {% extends 'homepage/base.html' %} {% load static %} +{% load settings_tags %} {% block extra_header_block %}