summaryrefslogtreecommitdiffstats
path: root/engagements/templates/engagements/snippets/effort_summary_panel.html
blob: d0dc256d39ecaf0a1682f5131e2d5ab9c5267200 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{% load table_extras %}

<div class="bg-white shadow-sm rounded-lg overflow-hidden border {% if e.is_planned %}border-green-500{% else %}border-gray-300{% endif %} mb-4">
  <div class="px-4 py-3 bg-gray-50 flex justify-between items-center">
    <h5 class="text-lg font-semibold">{{ e.proposed_start_date|date:'j M Y' }} - {{ e.effort_type }}</h5>
    <div class="text-right">
      <p class="text-sm font-medium">{{ e.effort_total_hours|floatformat }} hrs</p>
      <span class="text-sm text-gray-500">Planned: {{ e.is_planned|yesno:"Yes,No" }}</span>
      <button hx-get="{% url 'engagements:htmx-effort-planned' e.id %}" hx-target="#planned_swap_{{ e.id }}" class="ml-2 px-2 py-1 text-sm bg-blue-500 text-white rounded hover:bg-blue-600">
        Flip
      </button>
    </div>
  </div>
  <div class="px-4 py-3">
    <p class="mb-2"><strong class="font-medium">Inspectors:</strong> {{ e.officers.all|commalist }}</p>
    <p class="mb-2">
      <strong class="font-medium">Start time:</strong> {{ e.proposed_start_date|date:'H:i' }}
      {% if e.proposed_end_date %}
        - {{ e.proposed_end_date|date:'H:i' }}
      {% endif %}
    </p>
    {% if e.sub_instruments.all %}
      <div>
        <strong class="font-medium">DSCs:</strong>
        <ul class="list-disc list-inside mt-1 ml-4">
          {% for dsc in e.sub_instruments.all %}
            <li><a href="#" class="text-blue-600 hover:underline">{{ dsc.title }}</a></li>
          {% endfor %}
        </ul>
      </div>
    {% endif %}
  </div>
</div>