From 5b048c6c3291e3b4f163fcb63c94e06da902eeed Mon Sep 17 00:00:00 2001 From: Marc Aubreville Date: Thu, 14 May 2026 11:21:42 +0200 Subject: [PATCH 1/9] Added new polished UI (Lightroom v2) --- .../templates/annotations/annotate_v3.html | 921 ++++++++++++++++++ exact/exact/annotations/views.py | 8 +- exact/exact/base/templates/base/base.html | 4 +- exact/exact/images/views.py | 10 +- .../migrations/0011_lightroom_v2_frontend.py | 18 + exact/exact/users/models.py | 1 + .../users/templates/users/view_user.html | 1 + 7 files changed, 958 insertions(+), 5 deletions(-) create mode 100644 exact/exact/annotations/templates/annotations/annotate_v3.html create mode 100644 exact/exact/users/migrations/0011_lightroom_v2_frontend.py diff --git a/exact/exact/annotations/templates/annotations/annotate_v3.html b/exact/exact/annotations/templates/annotations/annotate_v3.html new file mode 100644 index 00000000..c656f0a7 --- /dev/null +++ b/exact/exact/annotations/templates/annotations/annotate_v3.html @@ -0,0 +1,921 @@ +{% extends 'annotations/base.html' %} +{% load i18n %} +{% load static %} + +{% block additional_annotation_js %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{% endblock additional_annotation_js %} + +{% block bodyblock %} + +
+ + + + + + + + + + + + + + + + + + + {% if show_processing %} + + {% endif %} + + {% if annotation_types %} + + {% endif %} + + {% if HasMediaFiles %} + + {% endif %} + + + + {% if asthma %} + + {% endif %} + + + + +
+ + +
+ + +
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + + + + + +
{# /anno-osd-area #} + + +
+
+ +
+ +
{# /anno-viewer #} + + +
+
+ {% for set_image in set_images %} +
+ + Loading thumbnail + +
+ {% endfor %} +
+
+ + + + + + +
+ {% if show_advanced_options %} + + + {% else %} + + + {% endif %} +
+ + + + + + + + +
+
+ {{ selected_image.name }} + +
+
+ {% if annotation_types %} + + + + + + + + + + + + {% for annotation_type in annotation_types %} + + + + + + + + {% endfor %} + +
LabelKey#Vis
+ {{ annotation_type.name }} + {% if annotation_type.vector_type == 8 %} + seg + {% endif %} + {{ forloop.counter }} + +
+ {% endif %} + {% if global_annotation_types %} +
+
Image labels
+ {% for annotation_type in global_annotation_types %} +
+ + ⇧{{ forloop.counter }} + +
+ {% endfor %} +
+ {% endif %} +
+ {% csrf_token %} + +
{# /anno-float-panel #} + +
{# /annotator-shell #} + + + +{% endblock %} diff --git a/exact/exact/annotations/views.py b/exact/exact/annotations/views.py index 9e4bab47..f27f8953 100644 --- a/exact/exact/annotations/views.py +++ b/exact/exact/annotations/views.py @@ -84,7 +84,13 @@ def annotate(request, image_id): if hasattr(cache, "delete_pattern"): cache.set(f"{selected_image.image_set.id}_contains_asthma", asthma, 5*60) - template = 'annotations/annotate_v2.html' if hasattr(request.user,'prefs') and hasattr(request.user.prefs,'frontend') and request.user.prefs.frontend==2 else 'annotations/annotate.html' + _fe = request.user.prefs.frontend if hasattr(request.user, 'prefs') and hasattr(request.user.prefs, 'frontend') else 1 + if _fe == 3: + template = 'annotations/annotate_v3.html' + elif _fe == 2: + template = 'annotations/annotate_v2.html' + else: + template = 'annotations/annotate.html' response = render(request, template, { 'team': selected_image.image_set.team, diff --git a/exact/exact/base/templates/base/base.html b/exact/exact/base/templates/base/base.html index 94496d65..a4f86946 100644 --- a/exact/exact/base/templates/base/base.html +++ b/exact/exact/base/templates/base/base.html @@ -7,7 +7,7 @@ - {% if frontend == 2 %} + {% if frontend >= 2 %} {% else %} @@ -29,7 +29,7 @@ {% block selectorblock %}{% endblock %} - {% if frontend == 2 %} + {% if frontend >= 2 %}