Parcourir la source

Add third role 'Technical Help'

Mathieu il y a 6 ans
Parent
commit
10ac1ecbd3

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

@@ -33,6 +33,7 @@ class ContribQuerySet(models.query.QuerySet):
 class Contrib(models.Model):
     CONTRIB_CONNECT = 'connect'
     CONTRIB_SHARE = 'share'
+    CONTRIB_HELP_TECH = 'help_tech'
 
     id = models.AutoField(primary_key=True, blank=False, null=False)
     name = models.CharField(
@@ -42,7 +43,8 @@ class Contrib(models.Model):
         'Type de contribution',
         max_length=10, choices=(
             (CONTRIB_CONNECT, 'Me raccorder à internet'),
-            (CONTRIB_SHARE, 'Partager une partie de ma connexion')
+            (CONTRIB_SHARE, 'Partager une partie de ma connexion'),
+            (CONTRIB_HELP_TECH, 'Apporter mon aide technique')
         ), default=None)
     latitude = models.FloatField()
     longitude = models.FloatField()

+ 1 - 0
wifiwithme/apps/contribmap/templates/contribmap/map.html

@@ -15,6 +15,7 @@
 <script src="{% static 'map.js' %}" type="text/javascript"></script>
 <p>Légende : <br />
   <img src="{% static 'leaflet/images/marker-icon-red.png' %}" /> Personne souhaitant partager sa connexion Internet<br />
+  <img src="{% static 'leaflet/images/marker-icon-green.png' %}" /> Personne souhaitant apporter son aide technique<br />
   <img src="{% static 'leaflet/images/marker-icon.png' %}" /> Personne souhaitant se connecter au réseau radio
 </p>
 <p>

+ 9 - 0
wifiwithme/static/map.js

@@ -23,6 +23,13 @@ $( document ).ready(function() {
         popupAnchor: [0, -28]
     });
 
+    var helperIcon = L.icon({
+    iconUrl: '../assets/leaflet/images/marker-icon-green.png',
+        iconSize: [25, 41],
+        iconAnchor: [12, 41],
+        popupAnchor: [0, -28]
+    });
+
 
     // Create map
     var map = L.map('map', {scrollWheelZoom: false}).setView([defaults.lat,defaults.lng], defaults.zoom);
@@ -107,6 +114,8 @@ $( document ).ready(function() {
                 var icon;
                 if (feature.properties.contrib_type == 'connect') {
                     icon = leecherIcon;
+                } else if (feature.properties.contrib_type == 'help_tech') {
+                    icon = helperIcon;
                 } else {
                     icon = seederIcon;
                 }