Browse Source

Add an entry for the mailing list server to the IspDatabase model

Baptiste Jonglez 10 years ago
parent
commit
a85d8bb788

+ 1 - 1
coin/isp_database/admin.py

@@ -72,7 +72,7 @@ class ISPInfoAdmin(SingleInstanceAdminMixin, admin.ModelAdmin):
             ('email', 'mainMailingList'),
             ('email', 'mainMailingList'),
             'website')}),
             'website')}),
         ('Extras', {
         ('Extras', {
-            'fields': ('administrative_email', 'support_email'),
+            'fields': ('administrative_email', 'support_email', 'lists_url'),
             'description':
             'description':
                 'Ces champs ne font pas partie de la spécification db.ffdn.org mais sont utilisés sur le site'
                 'Ces champs ne font pas partie de la spécification db.ffdn.org mais sont utilisés sur le site'
         }),
         }),

+ 20 - 0
coin/isp_database/migrations/0008_ispinfo_lists_url.py

@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('isp_database', '0007_auto_20141112_2353'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='ispinfo',
+            name='lists_url',
+            field=models.URLField(default='', help_text='URL du serveur de listes de discussions/diffusion', verbose_name='serveur de listes', blank=True),
+            preserve_default=False,
+        ),
+    ]

+ 4 - 4
coin/isp_database/models.py

@@ -84,6 +84,10 @@ class ISPInfo(SingleInstanceMixin, models.Model):
         max_length=254, blank=True, verbose_name="contact de support",
         max_length=254, blank=True, verbose_name="contact de support",
         help_text="Adresse email pour les demandes de support technique")
         help_text="Adresse email pour les demandes de support technique")
 
 
+    lists_url = models.URLField(
+        verbose_name="serveur de listes", blank=True,
+        help_text="URL du serveur de listes de discussions/diffusion")
+
     @property
     @property
     def memberCount(self):
     def memberCount(self):
         """Number of members"""
         """Number of members"""
@@ -100,10 +104,6 @@ class ISPInfo(SingleInstanceMixin, models.Model):
         return API_VERSION
         return API_VERSION
 
 
     @property
     @property
-    def lists_url(self):
-        return self.otherwebsite_set.filter(name__iexact='listes.url')
-
-    @property
     def main_chat_verbose(self):
     def main_chat_verbose(self):
         m = utils.re_chat_url.match(self.chatroom_set.first().url)
         m = utils.re_chat_url.match(self.chatroom_set.first().url)
         return '{channel} sur {server}'.format(**(m.groupdict()))
         return '{channel} sur {server}'.format(**(m.groupdict()))

+ 4 - 0
coin/members/templates/members/contact.html

@@ -11,6 +11,10 @@
               <a href="mailto:{{ branding.administrative_email }}">{{ branding.administrative_email }}</a> (questions administratives)<br />
               <a href="mailto:{{ branding.administrative_email }}">{{ branding.administrative_email }}</a> (questions administratives)<br />
               <a href="mailto:{{ branding.support_email }}">{{ branding.support_email }}</a> (support technique)
               <a href="mailto:{{ branding.support_email }}">{{ branding.support_email }}</a> (support technique)
             </p>
             </p>
+            {% if branding.lists_url %}
+            <h3>Listes de discussion</h3>
+            <p>Gérer ses abonnements aux listes de discussion et diffusion : <a href="{{ branding.lists_url }}">{{ branding.lists_url }}</a></p>
+            {% endif %}
             <h3>IRC</h3>
             <h3>IRC</h3>
             <p><a href="{{ branding.chatroom_set.first.url }}">{{ branding.main_chat_verbose }}</a></p>
             <p><a href="{{ branding.chatroom_set.first.url }}">{{ branding.main_chat_verbose }}</a></p>
         </div>
         </div>

+ 2 - 0
coin/members/templates/members/emails/welcome_email.html

@@ -17,9 +17,11 @@ https://{{ domain }}{% url 'home' %}</p>
 étant entièrement développé par nos soins.  Tu peux le faire par exemple
 étant entièrement développé par nos soins.  Tu peux le faire par exemple
 en répondant à ce courriel.</p>
 en répondant à ce courriel.</p>
 
 
+{% if branding.lists_url %}
 <p>Par ailleurs, {{ branding.shortname|capfirst }} dispose de plusieurs listes de discussions dont tu
 <p>Par ailleurs, {{ branding.shortname|capfirst }} dispose de plusieurs listes de discussions dont tu
 peux gérer tes abonnements depuis cette interface :<br />
 peux gérer tes abonnements depuis cette interface :<br />
 {{ branding.lists_url }}</p>
 {{ branding.lists_url }}</p>
+{% endif %}
 
 
 
 
 <p>L'équipe de l'association {{ branding.shortname|capfirst }}</p>
 <p>L'équipe de l'association {{ branding.shortname|capfirst }}</p>