|
1
|
{% extends "base.html" %} |
|
2
|
{% block title %}Edit: {{ ticket.title }} — {{ project.name }} — Fossilrepo{% endblock %} |
|
3
|
|
|
4
|
{% block content %} |
|
5
|
<h1 class="text-2xl font-bold text-gray-100 mb-2">{{ project.name }}</h1> |
|
6
|
{% include "fossil/_project_nav.html" %} |
|
7
|
|
|
8
|
<div class="mb-4"> |
|
9
|
<a href="{% url 'fossil:ticket_detail' slug=project.slug ticket_uuid=ticket.uuid %}" class="text-sm text-brand-light hover:text-brand">← Back to ticket</a> |
|
10
|
</div> |
|
11
|
|
|
12
|
<div class="mx-auto max-w-2xl"> |
|
13
|
<h2 class="text-xl font-bold text-gray-100 mb-4">Edit Ticket</h2> |
|
14
|
|
|
15
|
<form method="post" class="space-y-4 rounded-lg bg-gray-800 p-6 shadow-sm border border-gray-700"> |
|
16
|
{% csrf_token %} |
|
17
|
|
|
18
|
<div> |
|
19
|
<label class="block text-sm font-medium text-gray-300 mb-1">Title</label> |
|
20
|
<input type="text" name="title" value="{{ ticket.title }}" |
|
21
|
class="w-full rounded-md border-gray-600 bg-gray-900 text-gray-100 shadow-inner focus:border-brand focus:ring-1 focus:ring-brand sm:text-sm transition-colors"> |
|
22
|
</div> |
|
23
|
|
|
24
|
<div class="grid grid-cols-2 gap-4"> |
|
25
|
<div> |
|
26
|
<label class="block text-sm font-medium text-gray-300 mb-1">Status</label> |
|
27
|
<select name="status" class="w-full rounded-md border-gray-600 bg-gray-800 text-gray-100 shadow-inner focus:border-brand focus:ring-1 focus:ring-brand sm:text-sm transition-colors"> |
|
28
|
<option value="Open" {% if ticket.status == "Open" %}selected{% endif %}>Open</option> |
|
29
|
<option value="Fixed" {% if ticket.status == "Fixed" %}selected{% endif %}>Fixed</option> |
|
30
|
<option value="Closed" {% if ticket.status == "Closed" %}selected{% endif %}>Closed</option> |
|
31
|
<option value="Review" {% if ticket.status == "Review" %}selected{% endif %}>Review</option> |
|
32
|
<option value="Deferred" {% if ticket.status == "Deferred" %}selected{% endif %}>Deferred</option> |
|
33
|
</select> |
|
34
|
</div> |
|
35
|
<div> |
|
36
|
<label class="block text-sm font-medium text-gray-300 mb-1">Type</label> |
|
37
|
<select name="type" class="w-full rounded-md border-gray-600 bg-gray-800 text-gray-100 shadow-inner focus:border-brand focus:ring-1 focus:ring-brand sm:text-sm transition-colors"> |
|
38
|
<option value="Code_Defect" {% if ticket.type == "Code_Defect" %}selected{% endif %}>Code Defect</option> |
|
39
|
<option value="Feature_Request" {% if ticket.type == "Feature_Request" %}selected{% endif %}>Feature Request</option> |
|
40
|
<option value="Documentation" {% if ticket.type == "Documentation" %}selected{% endif %}>Documentation</option> |
|
41
|
<option value="Incident" {% if ticket.type == "Incident" %}selected{% endif %}>Incident</option> |
|
42
|
</select> |
|
43
|
</div> |
|
44
|
<div> |
|
45
|
<label class="block text-sm font-medium text-gray-300 mb-1">Severity</label> |
|
46
|
<select name="severity" class="w-full rounded-md border-gray-600 bg-gray-800 text-gray-100 shadow-inner focus:border-brand focus:ring-1 focus:ring-brand sm:text-sm transition-colors"> |
|
47
|
<option value="">—</option> |
|
48
|
<option value="Critical" {% if ticket.severity == "Critical" %}selected{% endif %}>Critical</option> |
|
49
|
<option value="Important" {% if ticket.severity == "Important" %}selected{% endif %}>Important</option> |
|
50
|
<option value="Minor" {% if ticket.severity == "Minor" %}selected{% endif %}>Minor</option> |
|
51
|
<option value="Cosmetic" {% if ticket.severity == "Cosmetic" %}selected{% endif %}>Cosmetic</option> |
|
52
|
</select> |
|
53
|
</div> |
|
54
|
<div> |
|
55
|
<label class="block text-sm font-medium text-gray-300 mb-1">Priority</label> |
|
56
|
<select name="priority" class="w-full rounded-md border-gray-600 bg-gray-800 text-gray-100 shadow-inner focus:border-brand focus:ring-1 focus:ring-brand sm:text-sm transition-colors"> |
|
57
|
<option value="">—</option> |
|
58
|
<option value="Critical" {% if ticket.priority == "Critical" %}selected{% endif %}>Critical</option> |
|
59
|
<option value="Important" {% if ticket.priority == "Important" %}selected{% endif %}>Important</option> |
|
60
|
<option value="Minor" {% if ticket.priority == "Minor" %}selected{% endif %}>Minor</option> |
|
61
|
<option value="Zero" {% if ticket.priority == "Zero" %}selected{% endif %}>Zero</option> |
|
62
|
</select> |
|
63
|
</div> |
|
64
|
</div> |
|
65
|
|
|
66
|
<div> |
|
67
|
<label class="block text-sm font-medium text-gray-300 mb-1">Resolution</label> |
|
68
|
<select name="resolution" class="w-full rounded-md border-gray-600 bg-gray-800 text-gray-100 shadow-inner focus:border-brand focus:ring-1 focus:ring-brand sm:text-sm transition-colors"> |
|
69
|
<option value="">—</option> |
|
70
|
<option value="Fixed" {% if ticket.resolution == "Fixed" %}selected{% endif %}>Fixed</option> |
|
71
|
<option value="Rejected" {% if ticket.resolution == "Rejected" %}selected{% endif %}>Rejected</option> |
|
72
|
<option value="Overcome_By_Events" {% if ticket.resolution == "Overcome_By_Events" %}selected{% endif %}>Overcome By Events</option> |
|
73
|
<option value="Works_As_Designed" {% if ticket.resolution == "Works_As_Designed" %}selected{% endif %}>Works As Designed</option> |
|
74
|
<option value="Unable_To_Reproduce" {% if ticket.resolution == "Unable_To_Reproduce" %}selected{% endif %}>Unable To Reproduce</option> |
|
75
|
<option value="Not_A_Bug" {% if ticket.resolution == "Not_A_Bug" %}selected{% endif %}>Not A Bug</option> |
|
76
|
<option value="Duplicate" {% if ticket.resolution == "Duplicate" %}selected{% endif %}>Duplicate</option> |
|
77
|
</select> |
|
78
|
</div> |
|
79
|
|
|
80
|
{% if custom_fields %} |
|
81
|
<div class="border-t border-gray-700 pt-4 mt-4"> |
|
82
|
<h3 class="text-sm font-semibold text-gray-300 mb-3">Custom Fields</h3> |
|
83
|
<div class="grid grid-cols-2 gap-4"> |
|
84
|
{% for cf in custom_fields %} |
|
85
|
<div{% if cf.field_type == "textarea" %} class="col-span-2"{% endif %}> |
|
86
|
<label class="block text-sm font-medium text-gray-300 mb-1"> |
|
87
|
{{ cf.label }} |
|
88
|
{% if cf.is_required %}<span class="text-red-400">*</span>{% endif %} |
|
89
|
</label> |
|
90
|
{% if cf.field_type == "text" or cf.field_type == "url" or cf.field_type == "date" %} |
|
91
|
<input type="{% if cf.field_type == "url" %}url{% elif cf.field_type == "date" %}date{% else %}text{% endif %}" |
|
92
|
name="custom_{{ cf.name }}" {% if cf.is_required %}required{% endif %} |
|
93
|
class="w-full rounded-md border-gray-600 bg-gray-900 text-gray-100 shadow-inner focus:border-brand focus:ring-1 focus:ring-brand sm:text-sm transition-colors"> |
|
94
|
{% elif cf.field_type == "textarea" %} |
|
95
|
<textarea name="custom_{{ cf.name }}" rows="3" {% if cf.is_required %}required{% endif %} |
|
96
|
class="w-full rounded-md border-gray-600 bg-gray-900 text-gray-100 shadow-inner focus:border-brand focus:ring-1 focus:ring-brand sm:text-sm transition-colors"></textarea> |
|
97
|
{% elif cf.field_type == "select" %} |
|
98
|
<select name="custom_{{ cf.name }}" {% if cf.is_required %}required{% endif %} |
|
99
|
class="w-full rounded-md border-gray-600 bg-gray-800 text-gray-100 shadow-inner focus:border-brand focus:ring-1 focus:ring-brand sm:text-sm transition-colors"> |
|
100
|
<option value="">--</option> |
|
101
|
{% for choice in cf.choices_list %} |
|
102
|
<option value="{{ choice }}">{{ choice }}</option> |
|
103
|
{% endfor %} |
|
104
|
</select> |
|
105
|
{% elif cf.field_type == "checkbox" %} |
|
106
|
<label class="flex items-center gap-2 text-sm text-gray-300 cursor-pointer mt-1"> |
|
107
|
<input type="checkbox" name="custom_{{ cf.name }}" |
|
108
|
class="rounded border-gray-600 bg-gray-900 text-brand focus:ring-brand"> |
|
109
|
{{ cf.label }} |
|
110
|
</label> |
|
111
|
{% endif %} |
|
112
|
</div> |
|
113
|
{% endfor %} |
|
114
|
</div> |
|
115
|
</div> |
|
116
|
{% endif %} |
|
117
|
|
|
118
|
<div class="flex justify-end gap-3 pt-2"> |
|
119
|
<a href="{% url 'fossil:ticket_detail' slug=project.slug ticket_uuid=ticket.uuid %}" |
|
120
|
class="rounded-md bg-gray-700 px-4 py-2 text-sm font-semibold text-gray-100 shadow-sm ring-1 ring-inset ring-gray-600 hover:bg-gray-600 transition-colors"> |
|
121
|
Cancel |
|
122
|
</a> |
|
123
|
<button type="submit" class="rounded-md bg-brand px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-brand-hover focus:outline-none focus:ring-2 focus:ring-brand focus:ring-offset-2 focus:ring-offset-gray-950 transition-colors"> |
|
124
|
Save Changes |
|
125
|
</button> |
|
126
|
</div> |
|
127
|
</form> |
|
128
|
</div> |
|
129
|
{% endblock %} |
|
130
|
|