fix: version badge rendering, Jinja2 scoping, navbar i18n, missing GET task endpoint

- Fix version badge showing [object Object] or Python dict dump in
  select_recipe, task_list, and task_complete templates by accessing
  current_version.version_number instead of the whole object
- Fix recipe_editor.html Internal Server Error caused by Jinja2 block
  scoping: {% set %} variables from block content were invisible in
  block extra_js, replaced with direct recipe.* references
- Fix task_editor.html SyntaxError from Italian apostrophe in
  nell'eliminazione breaking JS string literals, switched to |tojson
- Add i18n {{ _() }} wrappers to all hardcoded navbar strings (desktop
  and mobile menus) so language toggle works correctly
- Add app title text "TieMeasureFlow" next to logo in navbar
- Add missing GET /api/tasks/{task_id} endpoint on server that caused
  405 Method Not Allowed when starting measurements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Adriano
2026-02-07 20:44:33 +01:00
parent 2453e552fb
commit d262ef68af
7 changed files with 40 additions and 26 deletions
+1 -1
View File
@@ -150,7 +150,7 @@
</span>
<span class="badge badge-neutral text-xs"
x-show="recipe.current_version || recipe.version"
x-text="'v' + (recipe.current_version || recipe.version || '')">
x-text="'v' + (recipe.current_version ? recipe.current_version.version_number : (recipe.version || ''))">
</span>
</div>
+2 -2
View File
@@ -55,7 +55,7 @@
</div>
<div>
<p class="text-sm font-medium mb-1" style="color: var(--text-muted);">{{ _('Versione') }}</p>
<p class="font-mono font-medium" style="color: var(--text-primary);">{{ recipe.current_version or recipe.version }}</p>
<p class="font-mono font-medium" style="color: var(--text-primary);">{{ recipe.current_version.version_number if recipe.current_version else recipe.version }}</p>
</div>
<div>
<p class="text-sm font-medium mb-1" style="color: var(--text-muted);">{{ _('Lotto') }}</p>
@@ -299,7 +299,7 @@ window.CSV_I18N = {
window.measurementData = {
recipeName: {{ recipe.name|tojson }},
recipeCode: {{ recipe.code|tojson }},
version: {{ (recipe.current_version or recipe.version)|tojson }},
version: {{ (recipe.current_version.version_number if recipe.current_version else recipe.version)|tojson }},
lotNumber: {{ (lot_number or '')|tojson }},
serialNumber: {{ (serial_number or '')|tojson }},
measurements: {{ measurements|tojson }}
+1 -1
View File
@@ -44,7 +44,7 @@
<!-- Version Badge -->
{% if recipe.current_version or recipe.version %}
<span class="badge badge-neutral">
v{{ recipe.current_version or recipe.version }}
v{{ recipe.current_version.version_number if recipe.current_version else recipe.version }}
</span>
{% endif %}
</div>