|
1
|
{% extends "base.html" %} |
|
2
|
{% block title %}{{ 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:tickets' slug=project.slug %}" class="text-sm text-brand-light hover:text-brand">← Back to Tickets</a> |
|
10
|
</div> |
|
11
|
|
|
12
|
<div class="mx-auto max-w-2xl"> |
|
13
|
<h2 class="text-xl font-bold text-gray-100 mb-4">{{ title }}</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 <span class="text-red-400">*</span></label> |
|
20
|
<input type="text" name="title" required placeholder="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-1 sm:grid-cols-3 gap-4"> |
|
25
|
<div> |
|
26
|
<label class="block text-sm font-medium text-gray-300 mb-1">Type</label> |
|
27
|
<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"> |
|
28
|
<option value="Code_Defect">Code Defect</option> |
|
29
|
<option value="Feature_Request">Feature Request</option> |
|
30
|
<option value="Documentation">Documentation</option> |
|
31
|
<option value="Incident">Incident</option> |
|
32
|
</select> |
|
33
|
</div> |
|
34
|
<div> |
|
35
|
<label class="block text-sm font-medium text-gray-300 mb-1">Severity</label> |
|
36
|
<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"> |
|
37
|
<option value="">—</option> |
|
38
|
<option value="Critical">Critical</option> |
|
39
|
<option value="Important">Important</option> |
|
40
|
<option value="Minor">Minor</option> |
|
41
|
<option value="Cosmetic">Cosmetic</option> |
|
42
|
</select> |
|
43
|
</div> |
|
44
|
<div> |
|
45
|
<label class="block text-sm font-medium text-gray-300 mb-1">Priority</label> |
|
46
|
<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"> |
|
47
|
<option value="">—</option> |
|
48
|
<option value="Critical">Critical</option> |
|
49
|
<option value="Important">Important</option> |
|
50
|
<option value="Minor">Minor</option> |
|
51
|
<option value="Zero">Zero</option> |
|
52
|
</select> |
|
53
|
</div> |
|
54
|
</div> |
|
55
|
|
|
56
|
<div> |
|
57
|
<label class="block text-sm font-medium text-gray-300 mb-1">Description</label> |
|
58
|
<textarea name="body" rows="10" placeholder="Describe the issue..." |
|
59
|
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> |
|
60
|
</div> |
|
61
|
|
|
62
|
{% if custom_fields %} |
|
63
|
<div class="border-t border-gray-700 pt-4 mt-4"> |
|
64
|
<h3 class="text-sm font-semibold text-gray-300 mb-3">Custom Fields</h3> |
|
65
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4"> |
|
66
|
{% for cf in custom_fields %} |
|
67
|
<div{% if cf.field_type == "textarea" %} class="col-span-2"{% endif %}> |
|
68
|
<label class="block text-sm font-medium text-gray-300 mb-1"> |
|
69
|
{{ cf.label }} |
|
70
|
{% if cf.is_required %}<span class="text-red-400">*</span>{% endif %} |
|
71
|
</label> |
|
72
|
{% if cf.field_type == "text" or cf.field_type == "url" or cf.field_type == "date" %} |
|
73
|
<input type="{% if cf.field_type == "url" %}url{% elif cf.field_type == "date" %}date{% else %}text{% endif %}" |
|
74
|
name="custom_{{ cf.name }}" {% if cf.is_required %}required{% endif %} |
|
75
|
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"> |
|
76
|
{% elif cf.field_type == "textarea" %} |
|
77
|
<textarea name="custom_{{ cf.name }}" rows="3" {% if cf.is_required %}required{% endif %} |
|
78
|
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> |
|
79
|
{% elif cf.field_type == "select" %} |
|
80
|
<select name="custom_{{ cf.name }}" {% if cf.is_required %}required{% endif %} |
|
81
|
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"> |
|
82
|
<option value="">--</option> |
|
83
|
{% for choice in cf.choices_list %} |
|
84
|
<option value="{{ choice }}">{{ choice }}</option> |
|
85
|
{% endfor %} |
|
86
|
</select> |
|
87
|
{% elif cf.field_type == "checkbox" %} |
|
88
|
<label class="flex items-center gap-2 text-sm text-gray-300 cursor-pointer mt-1"> |
|
89
|
<input type="checkbox" name="custom_{{ cf.name }}" |
|
90
|
class="rounded border-gray-600 bg-gray-900 text-brand focus:ring-brand"> |
|
91
|
{{ cf.label }} |
|
92
|
</label> |
|
93
|
{% endif %} |
|
94
|
</div> |
|
95
|
{% endfor %} |
|
96
|
</div> |
|
97
|
</div> |
|
98
|
{% endif %} |
|
99
|
|
|
100
|
<div class="flex justify-end gap-3 pt-2"> |
|
101
|
<a href="{% url 'fossil:tickets' slug=project.slug %}" |
|
102
|
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"> |
|
103
|
Cancel |
|
104
|
</a> |
|
105
|
<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"> |
|
106
|
Create Ticket |
|
107
|
</button> |
|
108
|
</div> |
|
109
|
</form> |
|
110
|
</div> |
|
111
|
{% endblock %} |
|
112
|
|