let's start improving route descriptions
This commit is contained in:
parent
936b2c4b3d
commit
23f5086749
2 changed files with 14 additions and 5 deletions
|
@ -71,10 +71,22 @@ class Route:
|
|||
item.descriptions.append((icon, item.waytype.description_up))
|
||||
else:
|
||||
item.descriptions.append((icon, item.waytype.description))
|
||||
elif item.new_space:
|
||||
pass # todo: custom space transition descriptions
|
||||
elif item.last_item and item.new_space:
|
||||
item.descriptions.append(('more_vert', _('Go to %(space_title)s.') % {
|
||||
'space_title': item.space.title
|
||||
}))
|
||||
next_item = item
|
||||
|
||||
# add description for last space
|
||||
remaining_distance = 0
|
||||
for item in reversed(items):
|
||||
if item.descriptions:
|
||||
break
|
||||
if item.edge:
|
||||
remaining_distance += item.edge.distance
|
||||
if remaining_distance:
|
||||
item.descriptions.append(('more_vert', _('%d m remaining to your destination.') % max(remaining_distance, 1)))
|
||||
|
||||
items[-1].descriptions.append(('done', _('You have reached your destination.')))
|
||||
|
||||
duration = round(duration)
|
||||
|
|
|
@ -343,9 +343,6 @@ c3nav = {
|
|||
}
|
||||
level_collect = level_collect.slice(-1);
|
||||
}
|
||||
if (i > 0 && item.space && item.space.title && item.space.id !== result.destination.id) {
|
||||
$details.append(c3nav._build_route_item('place', item.space.title));
|
||||
}
|
||||
}
|
||||
if (last_primary_level) {
|
||||
c3nav._add_line_to_route(last_primary_level, next_level_collect);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue