summaryrefslogtreecommitdiffstats
path: root/engagements/templates/engagements/snippets/effort_detail.html
blob: bfa6fc5fbca2ecc5f0a998061261f5ac3566eb4c (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
<div id="effort-detail-{{ effort.id }}" class="bg-gray-100 p-4 w-full">
    <div class="flex justify-between items-center mb-2">
        {{ effort_total }}
        <h4 class="text-lg font-semibold">Details</h4>
        <button onclick="closeEffortDetail({{ effort.id }})" class="text-gray-500 hover:text-gray-700">
            <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"
                 xmlns="http://www.w3.org/2000/svg">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
            </svg>
        </button>
    </div>

    <!-- Add w-full and min-w-full to enforce full width -->
    <div class="relative z-10 w-full">
        <div class="bg-white border border-gray-300 rounded-lg shadow-sm p-4 w-full min-w-full">
            <table class="w-full table-sm">
                <tbody>
                    <tr>
                        <td class="py-0 font-bold text-gray-600">Type:</td>
                        <td class="py-0 text-gray-800">{{ effort.effort_type|lower|capfirst }}</td>
                    </tr>
                    <tr>
                        <td class="py-0 font-bold text-gray-600">Start:</td>
                        <td class="py-0 text-gray-800">{{ effort.proposed_start_date|date:"H:i - l j M Y" }}</td>
                    </tr>
                    <tr>
                        <td class="py-0 font-bold text-gray-600">End:</td>
                        <td class="py-0 text-gray-800">{{ effort.proposed_end_date|date:"H:i - l j M Y" }}</td>
                    </tr>
                    <tr>
                        <td class="py-0 font-bold text-gray-600">Planned Hours:</td>
                        <td class="py-0 text-gray-800">{{ effort.effort_total_planned_hours|floatformat:1 }}</td>
                    </tr>
                    <tr>
                        <td class="py-0 font-bold text-gray-600">Actual Hours:</td>
                        <td class="py-0 text-gray-800">{{ effort.effort_actual|floatformat:1 }}</td>
                    </tr>
                    <tr>
                        <td class="py-0 font-bold text-gray-600">Hours per Inspector:</td>
                        <td class="py-0 text-gray-800">{{ effort.effort_per_officer_hours|floatformat:1 }}</td>
                    </tr>
                    <tr>
                        <td class="py-0 font-bold text-gray-600">Inspectors:</td>
                        <td class="py-0 text-gray-800">{% if effort.get_officers %}{{ effort.get_officers|join:", " }} {% else %} None listed {% endif %}</td>
                    </tr>
                    <tr>
                        <td class="py-0 font-bold text-gray-600">Notes:</td>
                        <td class="py-0 text-gray-800">No notes available</td>
                    </tr>
                </tbody>
            </table>

            <hr class="my-4 border-t border-gray-300">
            <div class="mt-4 flex justify-between">
                <a href="#" class="text-blue-500 hover:text-blue-700">Edit</a>
                <a href="#" class="text-red-500 hover:text-red-700">Delete</a>
            </div>
        </div>
    </div>
</div>

<script>
    function closeEffortDetail(effortId) {
        const detailDiv = document.getElementById(`effort-detail-${effortId}`);
        detailDiv.classList.add('hidden');
    }
</script>