Show name before mmsi
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sat, 13 Nov 2010 00:07:02 +0000 (00:07 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sat, 13 Nov 2010 00:07:02 +0000 (00:07 +0000)
bin/djais/views.py
html_templates/fleet_vessels.html
html_templates/vessels.html

index af3b566ee17b2ee3a56fab2950bde4dab3250914..82b0d2e413087f9c47a80526132003a75b0d5488 100644 (file)
@@ -65,9 +65,9 @@ class VesselSearchForm(forms.Form):
         choices = sorted(choices, key=operator.itemgetter(1))
         return [(u'', u'Any')] + choices
 
-    mmsi = forms.CharField(max_length=9, required=False)
     name = forms.CharField(max_length=20, required=False)
-    imo = forms.IntegerField(required=False)
+    mmsi = forms.CharField(help_text=u'Maritime Mobile Service Identity', min_length=9, max_length=9, required=False)
+    imo = forms.IntegerField(help_text=u'International Maritime Organization identifier assigned by Llyod', required=False)
     callsign = forms.CharField(max_length=7, required=False)
     flag = forms.ChoiceField(choices=country_choices(), required=False)
     destination = forms.CharField(max_length=20, required=False)
index d13fdb95c94513847228caba680679031e1c79ae..817cc78ccebd99e3b820113b130726ec889d54c1 100644 (file)
@@ -12,8 +12,8 @@
 {% if vessels %}
 <table>
 <tr>
-  <th>MMSI
   <th>Name
+  <th>MMSI
   <th>IMO
   <th>Callsign
   <th>Type
@@ -21,8 +21,8 @@
 {% for vessel in vessels %}
 {% with vessel.get_last_nmea as nmea %}
 <tr>
-  <td><a href='/vessel/{{nmea.strmmsi}}/'>{{ nmea.get_mmsi_public }}</a>
   <td><a href='/vessel/{{nmea.strmmsi}}/'>{{ nmea.get_name }}</a>
+  <td><a href='/vessel/{{nmea.strmmsi}}/'>{{ nmea.get_mmsi_public }}</a>
   <td>{{ vessel.imo|default_if_none:""}}
   <td>{{ nmea.get_callsign }}
   <td>{{ nmea.get_shiptype }}
index 279df559cd02bd11fe3dcf59dd1c99d6c912f7f4..1f9ca85bce5322abc7263c6657c3102b12d60da9 100644 (file)
 {% if vessels %}
 <table>
 <tr>
-  <th>MMSI
   <th>Name
+  <th>MMSI
   <th>IMO
   <th>Callsign
 {% for vessel in vessels %}
 <tr>
-  <td><a href='/vessel/{{vessel.mmsi|sqlmmsi_to_strmmsi}}/'>{{ vessel.mmsi|sqlmmsi_to_strmmsi }}</a>
   <td><a href='/vessel/{{vessel.mmsi|sqlmmsi_to_strmmsi}}/'>{{ vessel.name }}</a>
+  <td><a href='/vessel/{{vessel.mmsi|sqlmmsi_to_strmmsi}}/'>{{ vessel.mmsi|sqlmmsi_to_strmmsi }}</a>
   <td>{{ vessel.imo|default_if_none:""}}
   <td>{{ vessel.callsign }}
 {% endfor %}