diff options
Diffstat (limited to 'archaeological_finds')
-rw-r--r-- | archaeological_finds/templates/ishtar/sheet_basefind.html | 14 | ||||
-rw-r--r-- | archaeological_finds/urls.py | 2 | ||||
-rw-r--r-- | archaeological_finds/views.py | 10 |
3 files changed, 18 insertions, 8 deletions
diff --git a/archaeological_finds/templates/ishtar/sheet_basefind.html b/archaeological_finds/templates/ishtar/sheet_basefind.html index 74a2b527e..fa96ddf0e 100644 --- a/archaeological_finds/templates/ishtar/sheet_basefind.html +++ b/archaeological_finds/templates/ishtar/sheet_basefind.html @@ -66,15 +66,14 @@ </div> {% endif %} <h3>{% trans "Map"%}</h3> - {% with geo_item=base_find %} - {% include "ishtar/blocks/sheet_simple_map.html"%} - {% endwith %} - {% if base_find.x or base_find.y or base_find.topographic_localisation %} <div class='row'> + {% with geo_item=base_find %} + {% include "ishtar/blocks/sheet_simple_map.html"%} + {% endwith %} {% field_flex "Point of topographic reference" base_find.topographic_localisation %} - <dl class="col-12 d-flex flex-wrap row"> - <dt class="col-2">{% trans "Coordinates" %}</dt> - <dd class="col-10"> + <dl class="col-12 col-lg-6 d-flex flex-wrap row"> + <dt class="col-4">{% trans "Coordinates" %}</dt> + <dd class="col-8"> {% trans "X:"%} {{base_find.x|default_if_none:"-"}} {% if base_find.estimated_error_x %} ({% trans "error:" %} {{base_find.estimated_error_x}}){% endif %}, {% trans "Y:"%} {{base_find.y|default_if_none:"-"}}, @@ -89,6 +88,5 @@ </dl> </div> {% endif %} - {% endif %} </div> diff --git a/archaeological_finds/urls.py b/archaeological_finds/urls.py index fe7b2acd2..7e8b52ddf 100644 --- a/archaeological_finds/urls.py +++ b/archaeological_finds/urls.py @@ -250,6 +250,8 @@ urlpatterns = [ url(r'^show-find/basket-(?:(?P<pk>.+)/(?P<type>.+)?)?$', views.show_findbasket, name='show-findbasket'), + url(r'^show-basefind/(?:(?P<pk>.+)/(?P<type>.+)?)?$', + views.show_basefind, name='show-basefind'), url(r'^display-find/basket-(?P<pk>.+)/$', views.display_findbasket, name='display-findbasket'), url(r'^show-historized-find/(?P<pk>.+)?/(?P<date>.+)?$', diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py index e4f8ab66d..72d02305c 100644 --- a/archaeological_finds/views.py +++ b/archaeological_finds/views.py @@ -118,6 +118,15 @@ def autocomplete_treatmentfile(request): return HttpResponse(data, content_type='text/plain') +def show_basefind(request, pk, **dct): + q = models.Find.objects.filter(base_finds__pk=pk, + downstream_treatment__isnull=True) + if not q.count(): + return Http404() + find_pk = q.order_by('-pk')[0] + return show_item(models.Find, 'find')(request, find_pk, **dct) + + def show_find_extra(request, find): if not request.user or not request.user.ishtaruser: return {} @@ -156,6 +165,7 @@ def autocomplete_findbasket(request, current_right=None): ) return HttpResponse(data, content_type='text/plain') + get_find_basket = get_item( models.FindBasket, 'get_findbasket', 'findbasket', model_for_perms=models.Find |