summaryrefslogtreecommitdiffstats
path: root/engagements/templates/engagements/engagement_detail.html
blob: c75523bc656bfdc979a0e8f7268d838408cd3d25 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{% extends "core/base.html" %}
{% load table_extras %}

{% block title %}{{ engagement }}{% endblock title %}

{% block content %}
    <div class="container mx-auto px-4 py-8">
        <div class="bg-white shadow-md rounded-lg overflow-hidden">
            <header class="bg-blue-100 p-4">
                <h2 class="text-3xl font-bold text-center">{{ engagement.friendly_type }}
                    at {{ engagement.external_party }}</h2>
            </header>
            <div class="p-4">
                <div class="mb-4">
                    <a href="{% url 'engagements:edit' engagement.pk %}" class="text-blue-600 hover:underline">Edit
                        Engagement</a>
                </div>

                <h3 class="text-2xl font-semibold mb-4">Details</h3>
                <div class="bg-white shadow-sm rounded-lg overflow-hidden">
                    <table class="min-w-full divide-y divide-gray-200 text-sm">
                        <tbody>
                            <tr class="bg-gray-50">
                                <td class="px-4 py-2 font-semibold text-gray-700">Date</td>
                                <td class="px-4 py-2 text-gray-900">
                                    {{ engagement.proposed_start_date|date:'l' }} -
                                    {{ engagement.proposed_start_date|date:'j M Y' }}
                                </td>
                            </tr>
                            <tr>
                                <td class="px-4 py-2 font-semibold text-gray-700">Site/Operation</td>
                                <td class="px-4 py-2 text-gray-900">{{ engagement.external_party }}</td>
                            </tr>
                            <tr class="bg-gray-50">
                                <td class="px-4 py-2 font-semibold text-gray-700">Subject of Activity</td>
                                <td class="px-4 py-2 text-gray-900">
                                    <p class="mb-2">Summary text</p>
                                    <table class="min-w-full divide-y divide-gray-200">
                                        <thead class="bg-gray-50">
                                        <tr>
                                            <th scope="col"
                                                class="px-3 py-2 text-left text-sm font-medium text-gray-700 uppercase tracking-wider">
                                                DSC
                                            </th>
                                        </tr>
                                        </thead>
                                        <tbody class="bg-white divide-y divide-gray-200">
                                        {% for t in dscs %}
                                            <tr>
                                                <td class="px-3 py-2 whitespace-nowrap text-base">
                                                    <a href='#' class="text-blue-600 hover:underline">{{ t }}</a>
                                                </td>
                                            </tr>
                                        {% endfor %}
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td class="px-4 py-2 font-semibold text-gray-700">Inspectors</td>
                                <td class="px-4 py-2 text-gray-900">{{ engagement.officers.all|commalist }}</td>
                            </tr>
                            <tr class="bg-gray-50">
                                <td class="px-4 py-2 font-semibold text-gray-700">Planned Effort</td>
                                <td class="px-4 py-2 text-gray-900">{{ effort_planned|floatformat }} hrs</td>
                            </tr>
                            <tr>
                                <td class="px-4 py-2 font-semibold text-gray-700">Actual Effort</td>
                                <td class="px-4 py-2 text-gray-900">{{ effort_actual|floatformat }} hrs</td>
                            </tr>
                            <tr class="bg-gray-50">
                                <td class="px-4 py-2 font-semibold text-gray-700">Total Effort</td>
                                <td class="px-4 py-2 text-gray-900">{{ effort_total|floatformat }} hrs</td>
                            </tr>
                        </tbody>
                    </table>
                </div>

                <div class="bg-white shadow overflow-hidden sm:rounded-lg mt-8">
                    <div class="px-4 py-5 sm:px-6 bg-blue-100">
                        <h3 class="text-2xl font-semibold text-black">Effort for this engagement</h3>
                    </div>
                    <div class="border-t border-gray-200">
                        <div class="px-4 py-5 sm:p-6">
                            <div class="mb-4">
                                <span class="font-medium">Add:</span>
                                <a href="{% url 'engagements:effort_create' engagement.pk 'TRAVEL' %}"
                                   class="text-blue-600 hover:underline ml-2">Travel</a>
                                <a href="{% url 'engagements:effort_create' engagement.pk 'PLANNING' %}" class="text-blue-600 hover:underline ml-2">Planning</a>
                                <a href="{% url 'engagements:effort_create' engagement.pk "REGULATION" %}"
                                   class="text-blue-600 hover:underline ml-2">Regulation</a>
                                <a href="{% url 'engagements:effort_create' engagement.pk "REPORTING" %}"
                                   class="text-blue-600 hover:underline ml-2">Reporting</a>
                            </div>

                            {% if effort %}
                                <div class="space-y-4">
                                    {% for e in effort.all %}
                                        <div id="planned_swap_{{ e.id }}" class="bg-gray-50 p-4 rounded-lg">
                                            {% include "engagements/snippets/effort_summary_panel.html" with e=e %}
                                        </div>
                                    {% endfor %}
                                </div>
                            {% else %}
                                <p class="text-gray-500">No effort records found for this engagement.</p>
                            {% endif %}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock content %}