1. Cédric Bonhomme
  2. find-a-bike

Commits

Cédric Bonhomme  committed 32d1557

Displays the name of a station.

  • Participants
  • Parent commits 8c2d374
  • Branches default

Comments (0)

Files changed (1)

File index.py

View file
  • Ignore whitespace
 
         if station["available_bikes"] == 0:
             html += """
-                        popupContentHTML = "<p>No bikes available.<br />Payment terminal: %s<br />Last update: %s</p>";""" % \
-                            ([station["banking"]==True and "yes" or "no"][0], \
+                        popupContentHTML = "<p><b>%s</b><hr />No bikes available.<br />Payment terminal: %s<br />Last update: %s</p>";""" % \
+                            (station["name"], [station["banking"]==True and "yes" or "no"][0], \
                                 datetime.datetime.fromtimestamp(station['last_update']/1000).strftime('%Y-%m-%d %H:%M:%S'))
             html += """
                         addMarker(station%s, popupClass, popupContentHTML, true, true, "./marker-red.png", stations_location);""" % \
                             (idx,)
         else:
             html += """
-                        popupContentHTML = "<p>Available bikes: %s<br />Payment terminal: %s<br />Last update: %s</p>";""" % \
-                            (station["available_bikes"], [station["banking"]==True and "yes" or "no"][0], \
+                        popupContentHTML = "<p><b>%s</b><hr />Available bikes: %s<br />Payment terminal: %s<br />Last update: %s</p>";""" % \
+                            (station["name"], station["available_bikes"], [station["banking"]==True and "yes" or "no"][0], \
                                 datetime.datetime.fromtimestamp(station['last_update']/1000).strftime('%Y-%m-%d %H:%M:%S'))
             html += """
                         addMarker(station%s, popupClass, popupContentHTML, true, true, "./marker-green.png", stations_location);""" % \