show route options again
This commit is contained in:
parent
a97d4e922d
commit
af8d9123e1
2 changed files with 6 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
from enum import StrEnum
|
||||
from typing import Annotated, Optional, Union
|
||||
from typing import Annotated, Optional, Union, Any
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.urls import reverse
|
||||
|
@ -148,6 +148,7 @@ class RouteSchema(BaseSchema):
|
|||
class RouteResponse(BaseSchema):
|
||||
request: RouteParametersSchema
|
||||
options: RouteOptionsSchema
|
||||
options_form: Any
|
||||
report_issue_url: NonEmptyStr
|
||||
result: RouteSchema
|
||||
|
||||
|
@ -227,10 +228,11 @@ def get_route(request, parameters: RouteParametersSchema):
|
|||
return RouteResponse(
|
||||
request=parameters,
|
||||
options=_new_serialize_route_options(options),
|
||||
options_form=options.serialize(),
|
||||
report_issue_url=reverse('site.report_create', kwargs={
|
||||
'origin': parameters.origin,
|
||||
'destination': parameters.destination,
|
||||
'options': options.serialize_string()
|
||||
'options': options.serialize_string(),
|
||||
}),
|
||||
result=route.serialize(locations=visible_locations_for_request(request)),
|
||||
)
|
||||
|
|
|
@ -525,9 +525,9 @@ c3nav = {
|
|||
return;
|
||||
}
|
||||
$('#route-details .report').attr('href', data.report_issue_url);
|
||||
c3nav._push_state({route_result: data.result, route_options: data.options}, true);
|
||||
c3nav._push_state({route_result: data.result, route_options: data.options_form}, true);
|
||||
c3nav._display_route_result(data.result, nofly);
|
||||
c3nav._display_route_options(data.options);
|
||||
c3nav._display_route_options(data.options_form);
|
||||
},
|
||||
_display_route_result: function(result, nofly) {
|
||||
var $route = $('#route-summary'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue