Parcourir la source

Remove connect_local and connect_internet fields

Cause everyone wants internet :-) and local services is a rare case.

fix #4
Jocelyn Delande il y a 9 ans
Parent
commit
26dfd49620

+ 2 - 2
wifiwithme/apps/contribmap/fixtures/bottle_data.yaml

@@ -1,14 +1,14 @@
 - model: contribmap.contrib
   pk: 1
   fields: {name: Bill, contrib_type: share, latitude: 47.218371, longitude: -1.553621,
-    phone: '', email: a@example.com, access_type: fiber, connect_local: false, connect_internet: false,
+    phone: '', email: a@example.com, access_type: fiber,
      floor: null, floor_total: null, orientations: 'N,NO,O,SO,S,SE,E,NE',
     roof: false, comment: '', privacy_name: false, privacy_email: false, privacy_coordinates: true,
     privacy_place_details: true, privacy_comment: false, date: ! '2016-03-03 12:26:39+00:00'}
 - model: contribmap.contrib
   pk: 2
   fields: {name: veau, contrib_type: connect, latitude: 47.2195681123155, longitude: -1.5398025512695312,
-    phone: '0101010101', email: '', access_type: vdsl, connect_local: true, connect_internet: false,
+    phone: '0101010101', email: '', access_type: vdsl,
     floor: 1, floor_total: 2, orientations: 'N,NO',
     roof: false, comment: '', privacy_name: false, privacy_email: false, privacy_coordinates: false,
     privacy_place_details: false, privacy_comment: false, date: ! '2016-03-03 12:27:24+00:00'}

+ 0 - 3
wifiwithme/apps/contribmap/forms.py

@@ -25,7 +25,6 @@ class PublicContribForm(forms.ModelForm):
             'phone', 'email',
             'comment',
             'access_type',
-            'connect_local', 'connect_internet',
             'floor', 'floor_total', 'orientations', 'roof',
             'comment',
             'privacy_name', 'privacy_email', 'privacy_coordinates',
@@ -36,8 +35,6 @@ class PublicContribForm(forms.ModelForm):
             'latitude': forms.HiddenInput,
             'longitude': forms.HiddenInput,
             'access_type': forms.RadioSelect,
-            'connect_local': forms.CheckboxInput,
-            'connect_internet': forms.CheckboxInput,
             'comment': forms.Textarea({'rows': 3}),
             'floor': forms.TextInput(
                 attrs={'placeholder': "Étage (0 pour RDC)"}),

+ 28 - 0
wifiwithme/apps/contribmap/migrations/0014_auto_20160515_1050.py

@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.3 on 2016-05-15 10:50
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('contribmap', '0013_auto_20160515_1036'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='contrib',
+            name='connect_internet',
+        ),
+        migrations.RemoveField(
+            model_name='contrib',
+            name='connect_local',
+        ),
+        migrations.AlterField(
+            model_name='contrib',
+            name='contrib_type',
+            field=models.CharField(choices=[('connect', 'Me raccorder à internet'), ('share', 'Partager une partie de ma connexion')], default=None, max_length=10, verbose_name='Type de contribution'),
+        ),
+    ]

+ 1 - 7
wifiwithme/apps/contribmap/models.py

@@ -19,7 +19,7 @@ class Contrib(models.Model):
     contrib_type = models.CharField(
         'Type de contribution',
         max_length=10, choices=(
-            (CONTRIB_CONNECT, 'Me raccorder au réseau expérimental'),
+            (CONTRIB_CONNECT, 'Me raccorder à internet'),
             (CONTRIB_SHARE, 'Partager une partie de ma connexion')
         ), default=None)
     latitude = models.FloatField()
@@ -36,12 +36,6 @@ class Contrib(models.Model):
             ('fiber', 'Fibre optique'),
             ('cable', 'Coaxial (FTTLA)'),
         ))
-    connect_local = models.NullBooleanField(
-        'Accès internet',
-        default=False, null=True)
-    connect_internet = models.NullBooleanField(
-        'Services locaux',
-        default=False, null=True)
     floor = models.PositiveIntegerField(
         'étage',
         blank=True, null=True)

+ 0 - 4
wifiwithme/static/form.js

@@ -103,14 +103,10 @@ $( document ).ready(function() {
     // Contrib share dynamic form
     if ($('[name="contrib_type"]:checked').val() == 'share') { $('#contrib-type-share').show(); }
     else { $('#contrib-type-share').hide(); }
-    if ($('[name="contrib_type"]:checked').val() == 'connect') { $('#contrib-type-connect').show(); }
-    else { $('#contrib-type-connect').hide(); }
     // On change
     $('[name="contrib_type"]').change(function(e){
         $('#contrib-type-share').slideUp();
-        $('#contrib-type-connect').slideUp();
         if ($(this).val() == 'share') { $('#contrib-type-share').slideDown(); }
-        if ($(this).val() == 'connect') { $('#contrib-type-connect').slideDown(); }
     });
 
     // select/deselect all checkbox