Browse Source

information de contact pour chaque type de service

Émile 6 years ago
parent
commit
7e22c0ae3a

+ 1 - 1
services/admin.py

@@ -570,7 +570,7 @@ class TunnelAdmin(admin.ModelAdmin):
 
 
 class ServiceTypeAdmin(admin.ModelAdmin):
-    fields = ('name',)
+    fields = ('name', 'contact')
 
     def get_actions(self, request):
         actions = super().get_actions(request)

+ 22 - 0
services/migrations/0051_auto_20180602_1346.py

@@ -0,0 +1,22 @@
+# Generated by Django 2.0.2 on 2018-06-02 11:46
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('services', '0050_auto_20180216_0016'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='route',
+            options={'ordering': ['name']},
+        ),
+        migrations.AddField(
+            model_name='servicetype',
+            name='contact',
+            field=models.CharField(blank=True, default='', max_length=64, verbose_name='Contact en cas de problème'),
+        ),
+    ]

+ 1 - 0
services/models.py

@@ -130,6 +130,7 @@ class IPResource(models.Model):
 
 class ServiceType(models.Model):
     name = models.CharField(max_length=64, verbose_name='Nom', unique=True)
+    contact = models.CharField(max_length=64, verbose_name='Contact en cas de problème', blank=True, default='')
 
     class Meta:
         ordering = ['name']

+ 3 - 0
services/templates/services/service_detail.html

@@ -41,6 +41,9 @@
             {% endfor %}
         </p>
         {% endif %}
+        {% if service.service_type.contact %}
+        <p>En cas de problème, contactez {{ service.service_type.contact }}.</p>
+        {% endif %}
     </div>
 </div>
 {% endblock %}