FossilRepo

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