Compare commits
4 Commits
34a72e6f1a
...
61c265b38b
| Author | SHA1 | Date | |
|---|---|---|---|
| 61c265b38b | |||
| 74b348988e | |||
| a36a37aca0 | |||
| b8d04c54f7 |
@@ -27,6 +27,17 @@
|
|||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<!-- Top action: change recipe (easy to find) -->
|
||||||
|
<div class="mb-4">
|
||||||
|
<a href="{{ url_for('measure.select_recipe') }}"
|
||||||
|
class="btn btn-secondary gap-2">
|
||||||
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M10 19l-7-7m0 0l7-7m-7 7h18"/>
|
||||||
|
</svg>
|
||||||
|
{{ _('Seleziona altra ricetta') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Recipe Info Card -->
|
<!-- Recipe Info Card -->
|
||||||
<div class="tmf-card mb-8">
|
<div class="tmf-card mb-8">
|
||||||
<div class="p-5 sm:p-6">
|
<div class="p-5 sm:p-6">
|
||||||
@@ -111,83 +122,78 @@
|
|||||||
</h2>
|
</h2>
|
||||||
<span class="badge badge-neutral">
|
<span class="badge badge-neutral">
|
||||||
{{ tasks|length }} task
|
{{ tasks|length }} task
|
||||||
|
{%- set total_subs = namespace(count=0) -%}
|
||||||
|
{%- for t in tasks -%}
|
||||||
|
{%- if t.subtask_count is defined -%}
|
||||||
|
{%- set total_subs.count = total_subs.count + t.subtask_count -%}
|
||||||
|
{%- elif t.subtasks -%}
|
||||||
|
{%- set total_subs.count = total_subs.count + t.subtasks|length -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- if total_subs.count > 0 %} · {{ total_subs.count }} {{ _('misurazioni totali') }}{% endif %}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Task Cards -->
|
<!-- Task Cards -->
|
||||||
{% if tasks %}
|
{% if tasks %}
|
||||||
<div class="space-y-4">
|
<div class="space-y-2.5">
|
||||||
{% for task in tasks %}
|
{% for task in tasks %}
|
||||||
<div class="tmf-card hover:border-primary/30 transition-all duration-200 group">
|
<div class="tmf-card hover:border-primary/30 transition-all duration-200 group">
|
||||||
<div class="p-5 sm:p-6">
|
<div class="p-3 sm:p-4">
|
||||||
<div class="flex flex-col sm:flex-row sm:items-center gap-4">
|
<div class="flex flex-row items-center gap-3">
|
||||||
|
|
||||||
<!-- Task Number Circle -->
|
<!-- Task Number Circle -->
|
||||||
<div class="flex items-center justify-center w-12 h-12 rounded-full shrink-0
|
<div class="flex items-center justify-center w-9 h-9 rounded-full shrink-0
|
||||||
bg-primary-50 dark:bg-primary-900/30 border-2 border-primary-200 dark:border-primary-700
|
bg-primary-50 dark:bg-primary-900/30 border-2 border-primary-200 dark:border-primary-700
|
||||||
text-primary-700 dark:text-primary-300 font-bold text-lg">
|
text-primary-700 dark:text-primary-300 font-bold text-base">
|
||||||
{{ loop.index }}
|
{{ loop.index }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Task Info -->
|
<!-- Task Info -->
|
||||||
<div class="flex-1 min-w-0">
|
<div class="flex-1 min-w-0">
|
||||||
<!-- Task Header -->
|
|
||||||
<div class="flex items-center gap-2 mb-1">
|
|
||||||
<span class="text-xs font-medium text-[var(--text-muted)] uppercase tracking-wider">
|
|
||||||
Task {{ loop.index }} {{ _('di') }} {{ tasks|length }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Task Title -->
|
<!-- Task Title -->
|
||||||
<h3 class="text-lg font-semibold text-[var(--text-primary)] mb-1">
|
<h3 class="text-base font-semibold text-[var(--text-primary)] leading-tight truncate">
|
||||||
|
<span class="text-xs font-medium text-[var(--text-muted)] mr-1.5">{{ loop.index }}/{{ tasks|length }}</span>
|
||||||
{{ task.title or task.name or (_('Task') ~ ' ' ~ loop.index) }}
|
{{ task.title or task.name or (_('Task') ~ ' ' ~ loop.index) }}
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<!-- Directive -->
|
<!-- Directive -->
|
||||||
{% if task.directive or task.description %}
|
{% if task.directive or task.description %}
|
||||||
<p class="text-sm text-[var(--text-secondary)] leading-relaxed mb-3 line-clamp-2 whitespace-pre-wrap">
|
<p class="text-xs text-[var(--text-secondary)] leading-snug mt-0.5 line-clamp-1 whitespace-pre-wrap">
|
||||||
{{ task.directive or task.description }}
|
{{ task.directive or task.description }}
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Meta Row -->
|
|
||||||
<div class="flex items-center gap-4 flex-wrap">
|
|
||||||
<!-- Subtask Count -->
|
|
||||||
{% if task.subtask_count is defined or task.subtasks %}
|
|
||||||
<span class="inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)]">
|
|
||||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="1.75" viewBox="0 0 24 24">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z"/>
|
|
||||||
</svg>
|
|
||||||
<span class="font-medium">
|
|
||||||
{% if task.subtask_count is defined %}
|
|
||||||
{{ task.subtask_count }}
|
|
||||||
{% elif task.subtasks %}
|
|
||||||
{{ task.subtasks|length }}
|
|
||||||
{% endif %}
|
|
||||||
{{ _('misurazioni') }}
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<!-- File Attachment -->
|
|
||||||
{% if task.file_path %}
|
|
||||||
<span class="inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)]">
|
|
||||||
{% if task.file_path.endswith('.pdf') %}
|
|
||||||
<svg class="w-4 h-4 text-red-500" fill="none" stroke="currentColor" stroke-width="1.75" viewBox="0 0 24 24">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"/>
|
|
||||||
</svg>
|
|
||||||
{% else %}
|
|
||||||
<svg class="w-4 h-4 text-green-500" fill="none" stroke="currentColor" stroke-width="1.75" viewBox="0 0 24 24">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>
|
|
||||||
</svg>
|
|
||||||
{% endif %}
|
|
||||||
<span class="font-medium">{{ _('Allegato') }}</span>
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Action Button -->
|
<!-- Indicators (top-right): measurements + attachment -->
|
||||||
|
<div class="shrink-0 self-start flex items-center gap-2.5">
|
||||||
|
{% if task.subtask_count is defined or task.subtasks %}
|
||||||
|
<span class="inline-flex items-center gap-1 text-xs text-[var(--text-secondary)]"
|
||||||
|
title="{{ _('misurazioni') }}">
|
||||||
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="1.75" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z"/>
|
||||||
|
</svg>
|
||||||
|
<span class="font-medium font-mono">{% if task.subtask_count is defined %}{{ task.subtask_count }}{% elif task.subtasks %}{{ task.subtasks|length }}{% endif %}</span>
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if task.file_path %}
|
||||||
|
<span class="inline-flex items-center text-xs" title="{{ _('Allegato') }}">
|
||||||
|
{% if task.file_path.endswith('.pdf') %}
|
||||||
|
<svg class="w-4 h-4 text-red-500" fill="none" stroke="currentColor" stroke-width="1.75" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"/>
|
||||||
|
</svg>
|
||||||
|
{% else %}
|
||||||
|
<svg class="w-4 h-4 text-green-500" fill="none" stroke="currentColor" stroke-width="1.75" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>
|
||||||
|
</svg>
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Action Button (Maker only — operators start the guided flow with AVVIA) -->
|
||||||
|
{% if current_user and 'Maker' in current_user.get('roles', []) %}
|
||||||
<div class="shrink-0 sm:ml-4">
|
<div class="shrink-0 sm:ml-4">
|
||||||
<a href="{{ url_for('measure.task_execute', task_id=task.id) }}"
|
<a href="{{ url_for('measure.task_execute', task_id=task.id) }}"
|
||||||
class="btn btn-primary gap-2 w-full sm:w-auto justify-center
|
class="btn btn-primary gap-2 w-full sm:w-auto justify-center
|
||||||
@@ -202,6 +208,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -226,33 +233,5 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Bottom Navigation -->
|
|
||||||
<div class="mt-8 flex items-center justify-between">
|
|
||||||
<a href="{{ url_for('measure.select_recipe') }}"
|
|
||||||
class="btn btn-secondary gap-2">
|
|
||||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M10 19l-7-7m0 0l7-7m-7 7h18"/>
|
|
||||||
</svg>
|
|
||||||
{{ _('Seleziona altra ricetta') }}
|
|
||||||
</a>
|
|
||||||
|
|
||||||
{% if tasks %}
|
|
||||||
<div class="text-sm text-[var(--text-secondary)]">
|
|
||||||
{{ tasks|length }} task ·
|
|
||||||
{% set total_subs = namespace(count=0) %}
|
|
||||||
{% for t in tasks %}
|
|
||||||
{% if t.subtask_count is defined %}
|
|
||||||
{% set total_subs.count = total_subs.count + t.subtask_count %}
|
|
||||||
{% elif t.subtasks %}
|
|
||||||
{% set total_subs.count = total_subs.count + t.subtasks|length %}
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
{% if total_subs.count > 0 %}
|
|
||||||
{{ total_subs.count }} {{ _('misurazioni totali') }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user