]> git.0d.be Git - panikweb.git/commitdiff
put radio name into settings
authorFrédéric Péters <fpeters@0d.be>
Sat, 21 Sep 2019 14:15:17 +0000 (16:15 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sat, 21 Sep 2019 14:15:17 +0000 (16:15 +0200)
panikweb/context_processors.py
panikweb/settings.py
panikweb/views.py
panikweb_templates/templates/base.html

index bfdf94d6e3dbe80d6cb42fa99e222fbcdaafa930..5952bd0dc62c3eccf3ce835478d4bd435f1326c6 100644 (file)
@@ -1,2 +1,8 @@
-def site_url(request):
-    return {'site_url': request.build_absolute_uri('/').strip('/')}
+from django.conf import settings
+
+def panikweb(request):
+    return {
+        'site_url': request.build_absolute_uri('/').strip('/'),
+        'radio_name': settings.RADIO_NAME,
+        'radio_long_name': settings.RADIO_LONG_NAME,
+    }
index 5cc31ff8c6b5166d91d6697f51a2e794012d74d6..3ac26a93acef33e07aa1762b682060fd47cfeac1 100644 (file)
@@ -124,7 +124,7 @@ TEMPLATES = [
                 'django.template.context_processors.request',
                 'django.template.context_processors.static',
                 'django.template.context_processors.tz',
                 'django.template.context_processors.request',
                 'django.template.context_processors.static',
                 'django.template.context_processors.tz',
-                'panikweb.context_processors.site_url',
+                'panikweb.context_processors.panikweb',
             ],
         },
     },
             ],
         },
     },
@@ -237,6 +237,8 @@ TEMPLATE_VARS = {}
 COMBO_DASHBOARD_ENABLED = False
 JSON_CELL_TYPES = {}
 
 COMBO_DASHBOARD_ENABLED = False
 JSON_CELL_TYPES = {}
 
+RADIO_NAME = 'Radio Panik'
+RADIO_LONG_NAME = 'Radio Panik - 105.4 FM'
 WEBSITE_BASE_URL = 'http://www.radiopanik.org/'
 
 COMBO_INITIAL_LOGIN_PAGE_PATH = '/'
 WEBSITE_BASE_URL = 'http://www.radiopanik.org/'
 
 COMBO_INITIAL_LOGIN_PAGE_PATH = '/'
index e694c90366910f598e6870313fe829913230fa64..29579f80ce27b4e00cc31be2c135875ba4ca29cd 100644 (file)
@@ -674,7 +674,7 @@ class RssCustomPodcastsFeed(Rss201rev2Feed):
         if emission:
             handler.addQuickElement('title', emission.title)
         else:
         if emission:
             handler.addQuickElement('title', emission.title)
         else:
-            handler.addQuickElement('title', 'Radio Panik')
+            handler.addQuickElement('title', settings.RADIO_NAME)
         handler.addQuickElement('url', image_url)
         handler.endElement('image')
         handler.addQuickElement('itunes:explicit', 'no')  # invidividual items will get their own value
         handler.addQuickElement('url', image_url)
         handler.endElement('image')
         handler.addQuickElement('itunes:explicit', 'no')  # invidividual items will get their own value
@@ -693,10 +693,10 @@ class RssCustomPodcastsFeed(Rss201rev2Feed):
             handler.addQuickElement('itunes:name', emission.title)
             handler.endElement('itunes:owner')
         else:
             handler.addQuickElement('itunes:name', emission.title)
             handler.endElement('itunes:owner')
         else:
-            handler.addQuickElement('itunes:author', 'Radio Panik')
+            handler.addQuickElement('itunes:author', settings.RADIO_NAME)
             handler.startElement('itunes:owner', {})
             handler.addQuickElement('itunes:email', 'info@radiopanik.org')
             handler.startElement('itunes:owner', {})
             handler.addQuickElement('itunes:email', 'info@radiopanik.org')
-            handler.addQuickElement('itunes:name', 'Radio Panik')
+            handler.addQuickElement('itunes:name', settings.RADIO_NAME)
             handler.endElement('itunes:owner')
 
     def root_attributes(self):
             handler.endElement('itunes:owner')
 
     def root_attributes(self):
@@ -728,7 +728,7 @@ class RssCustomPodcastsFeed(Rss201rev2Feed):
 
 
 class PodcastsFeed(Feed):
 
 
 class PodcastsFeed(Feed):
-    title = 'Radio Panik - Podcasts'
+    title = '%s - Podcasts' % settings.RADIO_NAME
     link = '/'
     description_template = 'feed/soundfile.html'
     feed_type = RssCustomPodcastsFeed
     link = '/'
     description_template = 'feed/soundfile.html'
     feed_type = RssCustomPodcastsFeed
@@ -771,7 +771,7 @@ podcasts_feed = PodcastsFeed()
 
 
 class RssNewsFeed(Feed):
 
 
 class RssNewsFeed(Feed):
-    title = 'Radio Panik'
+    title = settings.RADIO_NAME
     link = '/news/'
     description_template = 'feed/newsitem.html'
 
     link = '/news/'
     description_template = 'feed/newsitem.html'
 
index bced04283d30498632a8099bdc95d4c3097a5209..4271bb7b8ff61d02efb9d3996fcaaa669066e4c6 100644 (file)
@@ -2,7 +2,7 @@
 <html>
 <head>
     <meta charset="UTF-8" />
 <html>
 <head>
     <meta charset="UTF-8" />
-    <title>Radio Panik - {% block title %}{% endblock %}</title>
+    <title>{{ radio_name }} - {% block title %}{% endblock %}</title>
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <link rel="icon" href="{{ STATIC_URL }}img/favicon-16.png" type="image/png" sizes="16x16">
     <link rel="icon" href="{{ STATIC_URL }}img/favicon-32.png" type="image/png" sizes="32x32">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <link rel="icon" href="{{ STATIC_URL }}img/favicon-16.png" type="image/png" sizes="16x16">
     <link rel="icon" href="{{ STATIC_URL }}img/favicon-32.png" type="image/png" sizes="32x32">
     <link rel="apple-touch-icon" href="{{ STATIC_URL}}img/logo-panik-500-invert.png">
     <link rel="canonical" href="{{ request.build_absolute_uri }}" />
 
     <link rel="apple-touch-icon" href="{{ STATIC_URL}}img/logo-panik-500-invert.png">
     <link rel="canonical" href="{{ request.build_absolute_uri }}" />
 
-    <meta name="og:site_name" content="Radio Panik"/>
+    <meta name="og:site_name" content="{{ radio_name }}"/>
     {% block head %}
     <meta name="description" content="En vous branchant sur le 105.4 FM, vous pénétrerez plus avant dans l'œil du cyclone…" />
 
     {% block head %}
     <meta name="description" content="En vous branchant sur le 105.4 FM, vous pénétrerez plus avant dans l'œil du cyclone…" />
 
-    <meta property="og:title" content="Radio Panik - 105.4 FM" />
+    <meta property="og:title" content="{{ radio_long_name }}" />
     <meta property="og:image" content="{{ site_url }}{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
     <meta property="og:description" content="En vous branchant sur le 105.4 FM, vous pénétrerez plus avant dans l'œil du cyclone…" />
 
     <meta name="twitter:card" content="summary" />
     <meta property="og:image" content="{{ site_url }}{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
     <meta property="og:description" content="En vous branchant sur le 105.4 FM, vous pénétrerez plus avant dans l'œil du cyclone…" />
 
     <meta name="twitter:card" content="summary" />
-    <meta name="twitter:title" content="Radio Panik - 105.4 FM" />
+    <meta name="twitter:title" content="{{ radio_long_name }}" />
     <meta name="twitter:image" content="{{ site_url }}{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
     <meta name="twitter:description" content="En vous branchant sur le 105.4 FM, vous pénétrerez plus avant dans l'œil du cyclone…" />
 
     <meta name="twitter:image" content="{{ site_url }}{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
     <meta name="twitter:description" content="En vous branchant sur le 105.4 FM, vous pénétrerez plus avant dans l'œil du cyclone…" />
 
@@ -28,7 +28,7 @@
 <link rel="alternate" type="application/rss+xml"  href="{% url 'rss-feed' %}" title="News rss feed">
 <link rel="alternate" type="application/rss+xml"  href="{% url 'atom-feed' %}" title="News atom feed">
 {% block podcasts-feed %}
 <link rel="alternate" type="application/rss+xml"  href="{% url 'rss-feed' %}" title="News rss feed">
 <link rel="alternate" type="application/rss+xml"  href="{% url 'atom-feed' %}" title="News atom feed">
 {% block podcasts-feed %}
-<link rel="alternate" type="application/rss+xml"  href="{% url 'podcasts-feed' %}" title="Radio Panik Podcasts">
+<link rel="alternate" type="application/rss+xml"  href="{% url 'podcasts-feed' %}" title="{{ radio_name }} Podcasts">
 {% endblock %}
 
     <link rel="stylesheet" href="{{ STATIC_URL }}css/style.css" type="text/css" />
 {% endblock %}
 
     <link rel="stylesheet" href="{{ STATIC_URL }}css/style.css" type="text/css" />
@@ -52,7 +52,7 @@
             <div class="wrapper sided" >
                 <div id="backgroundBox" class="cf">
                                <a href="{% url 'home' %}" id="mainHeader"><div>
             <div class="wrapper sided" >
                 <div id="backgroundBox" class="cf">
                                <a href="{% url 'home' %}" id="mainHeader"><div>
-                                       <h1 class="top" id="radiopanik">Radio Panik - 105.4 FM</h1>
+                                       <h1 class="top" id="radiopanik">{{ radio_long_name }}</h1>
                                </div></a>
                                <div id="Player" class="withoutPlaylist">
                                        {% block listen %}{% player %}{% endblock %}
                                </div></a>
                                <div id="Player" class="withoutPlaylist">
                                        {% block listen %}{% player %}{% endblock %}