display → details
This commit is contained in:
parent
5f21f4ce6d
commit
8b27084335
2 changed files with 3 additions and 3 deletions
|
@ -299,14 +299,14 @@ class LocationViewSetBase(RetrieveModelMixin, GenericViewSet):
|
|||
|
||||
@detail_route(methods=['get'])
|
||||
@api_etag()
|
||||
def display(self, request, **kwargs):
|
||||
def details(self, request, **kwargs):
|
||||
location = self.get_object()
|
||||
|
||||
if location is None:
|
||||
raise NotFound
|
||||
|
||||
if isinstance(location, LocationRedirect):
|
||||
return redirect('../' + str(location.target.pk) + '/display/')
|
||||
return redirect('../' + str(location.target.pk) + '/details/')
|
||||
|
||||
return Response(location.details_display())
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ c3nav = {
|
|||
var $location_details = $('#location-details');
|
||||
if ($location_details.attr('data-id') !== String(location.id)) {
|
||||
$location_details.addClass('loading').attr('data-id', location.id);
|
||||
$.getJSON('/api/locations/'+location.id+'/display', c3nav._location_details_loaded).fail(function (data) {
|
||||
$.getJSON('/api/locations/'+location.id+'/details', c3nav._location_details_loaded).fail(function (data) {
|
||||
var $location_details = $('#location-details');
|
||||
$location_details.find('.details-body').text('Error '+String(data.status));
|
||||
$location_details.find('.details-body').html('').append(elem);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue