shorter descriptions and icons for custom locations
This commit is contained in:
parent
508aa80576
commit
1c7c6543c8
5 changed files with 55 additions and 45 deletions
|
@ -7,8 +7,8 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2017-12-25 22:23+0100\n"
|
"POT-Creation-Date: 2017-12-26 01:50+0100\n"
|
||||||
"PO-Revision-Date: 2017-12-24 05:02+0100\n"
|
"PO-Revision-Date: 2017-12-26 01:51+0100\n"
|
||||||
"Last-Translator: Laura Klünder <laura@codingcatgirl.de>\n"
|
"Last-Translator: Laura Klünder <laura@codingcatgirl.de>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: de\n"
|
"Language: de\n"
|
||||||
|
@ -157,7 +157,7 @@ msgstr "Benutzer"
|
||||||
|
|
||||||
#: c3nav/control/templates/control/announcements.html:9
|
#: c3nav/control/templates/control/announcements.html:9
|
||||||
#: c3nav/control/templates/control/users.html:15
|
#: c3nav/control/templates/control/users.html:15
|
||||||
#: c3nav/mapdata/models/base.py:41 c3nav/mapdata/utils/locations.py:299
|
#: c3nav/mapdata/models/base.py:41 c3nav/mapdata/utils/locations.py:302
|
||||||
msgid "ID"
|
msgid "ID"
|
||||||
msgstr "ID"
|
msgstr "ID"
|
||||||
|
|
||||||
|
@ -542,7 +542,7 @@ msgstr "letzte Statusänderung"
|
||||||
|
|
||||||
#: c3nav/editor/models/changeset.py:48 c3nav/mapdata/models/base.py:59
|
#: c3nav/editor/models/changeset.py:48 c3nav/mapdata/models/base.py:59
|
||||||
#: c3nav/mapdata/models/graph.py:34 c3nav/mapdata/models/locations.py:183
|
#: c3nav/mapdata/models/graph.py:34 c3nav/mapdata/models/locations.py:183
|
||||||
#: c3nav/mapdata/utils/locations.py:334
|
#: c3nav/mapdata/utils/locations.py:337
|
||||||
msgid "Title"
|
msgid "Title"
|
||||||
msgstr "Titel"
|
msgstr "Titel"
|
||||||
|
|
||||||
|
@ -869,7 +869,7 @@ msgstr "Einstellungen für neue Kanten"
|
||||||
#: c3nav/editor/templates/editor/index.html:10
|
#: c3nav/editor/templates/editor/index.html:10
|
||||||
#: c3nav/editor/templates/editor/level.html:16
|
#: c3nav/editor/templates/editor/level.html:16
|
||||||
#: c3nav/mapdata/models/geometry/level.py:55 c3nav/mapdata/models/level.py:29
|
#: c3nav/mapdata/models/geometry/level.py:55 c3nav/mapdata/models/level.py:29
|
||||||
#: c3nav/mapdata/utils/locations.py:301
|
#: c3nav/mapdata/utils/locations.py:304
|
||||||
msgid "Level"
|
msgid "Level"
|
||||||
msgstr "Etage"
|
msgstr "Etage"
|
||||||
|
|
||||||
|
@ -901,7 +901,7 @@ msgstr "Details anzeigen"
|
||||||
#: c3nav/editor/templates/editor/space.html:9
|
#: c3nav/editor/templates/editor/space.html:9
|
||||||
#: c3nav/mapdata/models/geometry/level.py:119
|
#: c3nav/mapdata/models/geometry/level.py:119
|
||||||
#: c3nav/mapdata/models/geometry/space.py:79
|
#: c3nav/mapdata/models/geometry/space.py:79
|
||||||
#: c3nav/mapdata/utils/locations.py:307
|
#: c3nav/mapdata/utils/locations.py:310
|
||||||
msgid "Space"
|
msgid "Space"
|
||||||
msgstr "Raum"
|
msgstr "Raum"
|
||||||
|
|
||||||
|
@ -1389,7 +1389,7 @@ msgstr "Zugangserlaubnis-Token"
|
||||||
msgid "Access Permission"
|
msgid "Access Permission"
|
||||||
msgstr "Zugangserlaubnis"
|
msgstr "Zugangserlaubnis"
|
||||||
|
|
||||||
#: c3nav/mapdata/models/base.py:40 c3nav/mapdata/utils/locations.py:298
|
#: c3nav/mapdata/models/base.py:40 c3nav/mapdata/utils/locations.py:301
|
||||||
msgid "Type"
|
msgid "Type"
|
||||||
msgstr "Typ"
|
msgstr "Typ"
|
||||||
|
|
||||||
|
@ -1534,7 +1534,7 @@ msgid "Area"
|
||||||
msgstr "Bereich"
|
msgstr "Bereich"
|
||||||
|
|
||||||
#: c3nav/mapdata/models/geometry/space.py:121
|
#: c3nav/mapdata/models/geometry/space.py:121
|
||||||
#: c3nav/mapdata/utils/locations.py:313
|
#: c3nav/mapdata/utils/locations.py:316
|
||||||
msgid "Areas"
|
msgid "Areas"
|
||||||
msgstr "Bereiche"
|
msgstr "Bereiche"
|
||||||
|
|
||||||
|
@ -1749,7 +1749,7 @@ msgid "default height"
|
||||||
msgstr "Standarddeckenhöhe"
|
msgstr "Standarddeckenhöhe"
|
||||||
|
|
||||||
#: c3nav/mapdata/models/locations.py:45 c3nav/mapdata/models/locations.py:65
|
#: c3nav/mapdata/models/locations.py:45 c3nav/mapdata/models/locations.py:65
|
||||||
#: c3nav/mapdata/utils/locations.py:300
|
#: c3nav/mapdata/utils/locations.py:303
|
||||||
msgid "Slug"
|
msgid "Slug"
|
||||||
msgstr "Slug"
|
msgstr "Slug"
|
||||||
|
|
||||||
|
@ -1881,63 +1881,63 @@ msgstr[1] "%d Kartenupdates verarbeitet."
|
||||||
msgid "Last processed update: %(date)s (#%(id)d)"
|
msgid "Last processed update: %(date)s (#%(id)d)"
|
||||||
msgstr "Letztes verarbeitetes Update: %(date)s (#%(id)d)"
|
msgstr "Letztes verarbeitetes Update: %(date)s (#%(id)d)"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/locations.py:298
|
#: c3nav/mapdata/utils/locations.py:301
|
||||||
msgid "Coordinates"
|
msgid "Coordinates"
|
||||||
msgstr "Koordinaten"
|
msgstr "Koordinaten"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/locations.py:319
|
#: c3nav/mapdata/utils/locations.py:322
|
||||||
msgid "Near Area"
|
msgid "Near Area"
|
||||||
msgstr "Naher Bereich"
|
msgstr "Naher Bereich"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/locations.py:325
|
#: c3nav/mapdata/utils/locations.py:328
|
||||||
msgid "Near POI"
|
msgid "Near POI"
|
||||||
msgstr "Naher POI"
|
msgstr "Naher POI"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/locations.py:331
|
#: c3nav/mapdata/utils/locations.py:334
|
||||||
msgid "X Coordinate"
|
msgid "X Coordinate"
|
||||||
msgstr "X-Koordinate"
|
msgstr "X-Koordinate"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/locations.py:332
|
#: c3nav/mapdata/utils/locations.py:335
|
||||||
msgid "Y Coordinate"
|
msgid "Y Coordinate"
|
||||||
msgstr "Y-Koordinate"
|
msgstr "Y-Koordinate"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/locations.py:333
|
#: c3nav/mapdata/utils/locations.py:336
|
||||||
msgid "Altitude"
|
msgid "Altitude"
|
||||||
msgstr "Höhe"
|
msgstr "Höhe"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/locations.py:335
|
#: c3nav/mapdata/utils/locations.py:338
|
||||||
msgid "Subtitle"
|
msgid "Subtitle"
|
||||||
msgstr "Untertitel"
|
msgstr "Untertitel"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/locations.py:367
|
#: c3nav/mapdata/utils/locations.py:370
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Point in %(level)s"
|
msgid "In %(level)s"
|
||||||
msgstr "Punkt innerhalb %(level)s"
|
msgstr "In %(level)s"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/locations.py:373
|
#: c3nav/mapdata/utils/locations.py:376
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Point near %(poi)s"
|
msgid "Near %(poi)s"
|
||||||
msgstr "Punkt nahe %(poi)s"
|
msgstr "Nahe %(poi)s"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/locations.py:377
|
#: c3nav/mapdata/utils/locations.py:380
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "near %(area)s"
|
msgid "near %(area)s"
|
||||||
msgstr "nahe %(area)s"
|
msgstr "nahe %(area)s"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/locations.py:379
|
#: c3nav/mapdata/utils/locations.py:382
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Point in %(area)s"
|
msgid "In %(area)s"
|
||||||
msgstr "Punkt innerhalb %(area)s"
|
msgstr "Nahe %(area)s"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/locations.py:383
|
#: c3nav/mapdata/utils/locations.py:386
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Point near %(area)s"
|
msgid "Near %(area)s"
|
||||||
msgstr "Punkt nahe %(area)s"
|
msgstr "Nahe %(area)s"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/locations.py:385
|
#: c3nav/mapdata/utils/locations.py:388
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Point in %(space)s"
|
msgid "In %(space)s"
|
||||||
msgstr "Punkt innerhalb %(space)s"
|
msgstr "In %(space)s"
|
||||||
|
|
||||||
#: c3nav/mapdata/utils/user.py:15
|
#: c3nav/mapdata/utils/user.py:15
|
||||||
msgid "not logged in"
|
msgid "not logged in"
|
||||||
|
@ -1954,18 +1954,22 @@ msgstr[1] "%d freigeschaltete Bereiche"
|
||||||
msgid "Login"
|
msgid "Login"
|
||||||
msgstr "Anmelden"
|
msgstr "Anmelden"
|
||||||
|
|
||||||
#: c3nav/routing/api.py:46
|
#: c3nav/routing/api.py:47
|
||||||
msgid "Not yet routable, try again shortly."
|
msgid "Not yet routable, try again shortly."
|
||||||
msgstr "Noch nicht routebar, bitte einige Minuten warten."
|
msgstr "Noch nicht routebar, bitte einige Minuten warten."
|
||||||
|
|
||||||
#: c3nav/routing/api.py:50
|
#: c3nav/routing/api.py:51
|
||||||
msgid "Unreachable location."
|
msgid "Unreachable location."
|
||||||
msgstr "Unerreichbarer Ort."
|
msgstr "Unerreichbarer Ort."
|
||||||
|
|
||||||
#: c3nav/routing/api.py:54
|
#: c3nav/routing/api.py:55
|
||||||
msgid "No route found."
|
msgid "No route found."
|
||||||
msgstr "Keine Route gefunden."
|
msgstr "Keine Route gefunden."
|
||||||
|
|
||||||
|
#: c3nav/routing/api.py:88
|
||||||
|
msgid "Invalid scan data."
|
||||||
|
msgstr "Invalide Scandaten."
|
||||||
|
|
||||||
#: c3nav/routing/forms.py:18
|
#: c3nav/routing/forms.py:18
|
||||||
msgid "Unknown origin."
|
msgid "Unknown origin."
|
||||||
msgstr "Unbekannter Startort."
|
msgstr "Unbekannter Startort."
|
||||||
|
@ -1974,7 +1978,7 @@ msgstr "Unbekannter Startort."
|
||||||
msgid "Unknown destination."
|
msgid "Unknown destination."
|
||||||
msgstr "Unbekannter Zielort."
|
msgstr "Unbekannter Zielort."
|
||||||
|
|
||||||
#: c3nav/routing/locator.py:129
|
#: c3nav/routing/locator.py:177
|
||||||
msgid "Invalid Scan."
|
msgid "Invalid Scan."
|
||||||
msgstr "Invalider Scan."
|
msgstr "Invalider Scan."
|
||||||
|
|
||||||
|
|
|
@ -250,7 +250,7 @@ class CustomLocation:
|
||||||
can_describe = True
|
can_describe = True
|
||||||
access_restriction_id = None
|
access_restriction_id = None
|
||||||
|
|
||||||
def __init__(self, level, x, y, permissions):
|
def __init__(self, level, x, y, permissions, icon='pin_drop'):
|
||||||
x = round(x, 2)
|
x = round(x, 2)
|
||||||
y = round(y, 2)
|
y = round(y, 2)
|
||||||
self.pk = 'c:%s:%s:%s' % (level.short_label, x, y)
|
self.pk = 'c:%s:%s:%s' % (level.short_label, x, y)
|
||||||
|
@ -258,6 +258,7 @@ class CustomLocation:
|
||||||
self.level = level
|
self.level = level
|
||||||
self.x = x
|
self.x = x
|
||||||
self.y = y
|
self.y = y
|
||||||
|
self.icon = icon
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def serialized_geometry(self):
|
def serialized_geometry(self):
|
||||||
|
@ -270,6 +271,7 @@ class CustomLocation:
|
||||||
result = OrderedDict((
|
result = OrderedDict((
|
||||||
('id', self.pk),
|
('id', self.pk),
|
||||||
('slug', self.pk),
|
('slug', self.pk),
|
||||||
|
('icon', self.icon),
|
||||||
('title', self.title),
|
('title', self.title),
|
||||||
('subtitle', self.subtitle),
|
('subtitle', self.subtitle),
|
||||||
('level', self.level.pk),
|
('level', self.level.pk),
|
||||||
|
@ -289,6 +291,7 @@ class CustomLocation:
|
||||||
|
|
||||||
if geometry:
|
if geometry:
|
||||||
result['geometry'] = self.serialized_geometry
|
result['geometry'] = self.serialized_geometry
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def details_display(self):
|
def details_display(self):
|
||||||
|
@ -364,25 +367,25 @@ class CustomLocation:
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def title_subtitle(self):
|
def title_subtitle(self):
|
||||||
title = _('Point in %(level)s') % {'level': self.level.title}
|
title = _('In %(level)s') % {'level': self.level.title}
|
||||||
if not self.space:
|
if not self.space:
|
||||||
return title, self.level.title,
|
return title, self.level.title,
|
||||||
|
|
||||||
subtitle = ()
|
subtitle = ()
|
||||||
if self.near_poi:
|
if self.near_poi:
|
||||||
title = _('Point near %(poi)s') % {'poi': self.near_poi.title}
|
title = _('Near %(poi)s') % {'poi': self.near_poi.title}
|
||||||
if self.areas:
|
if self.areas:
|
||||||
subtitle = (area.title for area in self.areas[:2])
|
subtitle = (area.title for area in self.areas[:2])
|
||||||
elif self.near_area:
|
elif self.near_area:
|
||||||
subtitle = (_('near %(area)s') % {'area': self.near_area.title}, )
|
subtitle = (_('near %(area)s') % {'area': self.near_area.title}, )
|
||||||
elif self.areas:
|
elif self.areas:
|
||||||
title = _('Point in %(area)s') % {'area': self.areas[0].title}
|
title = _('In %(area)s') % {'area': self.areas[0].title}
|
||||||
if self.areas:
|
if self.areas:
|
||||||
subtitle = (area.title for area in self.areas[1:2])
|
subtitle = (area.title for area in self.areas[1:2])
|
||||||
elif self.near_area:
|
elif self.near_area:
|
||||||
title = _('Point near %(area)s') % {'area': self.near_area.title}
|
title = _('Near %(area)s') % {'area': self.near_area.title}
|
||||||
else:
|
else:
|
||||||
return _('Point in %(space)s') % {'space': self.space.title}, self.level.title
|
return _('In %(space)s') % {'space': self.space.title}, self.level.title
|
||||||
|
|
||||||
subtitle = ', '.join(str(title) for title in chain(subtitle, (self.space.title, self.level.title)))
|
subtitle = ', '.join(str(title) for title in chain(subtitle, (self.space.title, self.level.title)))
|
||||||
return title, subtitle
|
return title, subtitle
|
||||||
|
|
|
@ -88,4 +88,4 @@ class RoutingViewSet(ViewSet):
|
||||||
'errors': (_('Invalid scan data.'),),
|
'errors': (_('Invalid scan data.'),),
|
||||||
}, status=400)
|
}, status=400)
|
||||||
|
|
||||||
return Response({'location': None if location is None else location.serialize()})
|
return Response({'location': None if location is None else location.serialize(simple_geometry=True)})
|
||||||
|
|
|
@ -89,7 +89,8 @@ class Locator:
|
||||||
for pk, space, station_ids in good_spaces:
|
for pk, space, station_ids in good_spaces:
|
||||||
point, score = space.get_best_point(scan_values, station_ids)
|
point, score = space.get_best_point(scan_values, station_ids)
|
||||||
if score < best_score:
|
if score < best_score:
|
||||||
location = CustomLocation(router.spaces[pk].level, point.x, point.y, permissions=permissions)
|
location = CustomLocation(router.spaces[pk].level, point.x, point.y,
|
||||||
|
permissions=permissions, icon='my_location')
|
||||||
best_location = location
|
best_location = location
|
||||||
best_score = score
|
best_score = score
|
||||||
|
|
||||||
|
|
|
@ -714,7 +714,7 @@ c3nav = {
|
||||||
},
|
},
|
||||||
_build_location_html: function(location, add_data) {
|
_build_location_html: function(location, add_data) {
|
||||||
html = $('<div class="location">')
|
html = $('<div class="location">')
|
||||||
.append($('<i class="icon material-icons">').text('place'))
|
.append($('<i class="icon material-icons">').text(location.icon || 'map'))
|
||||||
.append($('<span>').text(location.title))
|
.append($('<span>').text(location.title))
|
||||||
.append($('<small>').text(location.subtitle)).attr('data-id', location.id);
|
.append($('<small>').text(location.subtitle)).attr('data-id', location.id);
|
||||||
if (add_data) html.attr('data-location', JSON.stringify(location));
|
if (add_data) html.attr('data-location', JSON.stringify(location));
|
||||||
|
@ -726,6 +726,7 @@ c3nav = {
|
||||||
c3nav._locationinput_reset_autocomplete();
|
c3nav._locationinput_reset_autocomplete();
|
||||||
elem.toggleClass('selected', !!location).toggleClass('empty', !location)
|
elem.toggleClass('selected', !!location).toggleClass('empty', !location)
|
||||||
.data('location', location).data('lastlocation', location).removeData('suggestion');
|
.data('location', location).data('lastlocation', location).removeData('suggestion');
|
||||||
|
elem.find('.icon').text(location ? (location.icon || 'place') : '');
|
||||||
elem.find('input').val(location ? location.title : '').removeData('origval');
|
elem.find('input').val(location ? location.title : '').removeData('origval');
|
||||||
elem.find('small').text(location ? location.subtitle : '');
|
elem.find('small').text(location ? location.subtitle : '');
|
||||||
},
|
},
|
||||||
|
@ -748,6 +749,7 @@ c3nav = {
|
||||||
}
|
}
|
||||||
if (c3nav._current_user_location) {
|
if (c3nav._current_user_location) {
|
||||||
c3nav._locationinput_set($(this).parent(), c3nav._current_user_location);
|
c3nav._locationinput_set($(this).parent(), c3nav._current_user_location);
|
||||||
|
c3nav.update_state();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_locationinput_reset_autocomplete: function () {
|
_locationinput_reset_autocomplete: function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue