FossilRepo

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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button