FossilRepo

fossilrepo / templates / fossil / ticket_fields_list.html
Source Blame History 84 lines
c588255… ragelink 1 {% extends "base.html" %}
c588255… ragelink 2 {% block title %}Custom Ticket Fields — {{ project.name }} — Fossilrepo{% endblock %}
c588255… ragelink 3
c588255… ragelink 4 {% block content %}
c588255… ragelink 5 <h1 class="text-2xl font-bold text-gray-100 mb-2">{{ project.name }}</h1>
c588255… ragelink 6 {% include "fossil/_project_nav.html" %}
c588255… ragelink 7
c588255… ragelink 8 <div class="flex items-center justify-between mb-6">
c588255… ragelink 9 <h2 class="text-lg font-semibold text-gray-200">Custom Ticket Fields</h2>
c588255… ragelink 10 <div class="flex items-center gap-3">
0e40dc2… ragelink 11 <span class="search-wrap">
c588255… ragelink 12 <input type="search"
c588255… ragelink 13 name="search"
c588255… ragelink 14 value="{{ search }}"
c588255… ragelink 15 placeholder="Search fields..."
0e40dc2… ragelink 16 aria-label="Search custom fields"
c588255… ragelink 17 class="rounded-md border-gray-700 bg-gray-800 text-gray-100 shadow-sm focus:border-brand focus:ring-brand text-sm px-3 py-1.5"
c588255… ragelink 18 hx-get="{% url 'fossil:ticket_fields' slug=project.slug %}"
c588255… ragelink 19 hx-trigger="input changed delay:300ms, search"
c588255… ragelink 20 hx-target="#fields-content"
c588255… ragelink 21 hx-swap="innerHTML"
0e40dc2… ragelink 22 hx-push-url="true"
0e40dc2… ragelink 23 hx-indicator="closest .search-wrap" />
0e40dc2… ragelink 24 <svg class="search-spinner animate-spin h-4 w-4" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>
0e40dc2… ragelink 25 </span>
c588255… ragelink 26 <a href="{% url 'fossil:ticket_field_create' slug=project.slug %}"
c588255… ragelink 27 class="inline-flex items-center rounded-md bg-brand px-3 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-brand-hover">
c588255… ragelink 28 Add Field
c588255… ragelink 29 </a>
c588255… ragelink 30 </div>
c588255… ragelink 31 </div>
c588255… ragelink 32
c588255… ragelink 33 <div id="fields-content">
c588255… ragelink 34 {% if fields %}
c588255… ragelink 35 <div class="space-y-3">
c588255… ragelink 36 {% for field in fields %}
c588255… ragelink 37 <div class="rounded-lg bg-gray-800 border border-gray-700">
c588255… ragelink 38 <div class="px-5 py-4">
c588255… ragelink 39 <div class="flex items-start justify-between gap-4">
c588255… ragelink 40 <div class="flex-1 min-w-0">
c588255… ragelink 41 <div class="flex items-center gap-3 mb-1">
c588255… ragelink 42 <span class="text-sm font-medium text-gray-100">{{ field.label }}</span>
c588255… ragelink 43 <span class="inline-flex rounded-full bg-gray-700 px-2 py-0.5 text-xs font-semibold text-gray-400">{{ field.get_field_type_display }}</span>
c588255… ragelink 44 {% if field.is_required %}
c588255… ragelink 45 <span class="inline-flex rounded-full bg-red-900/50 px-2 py-0.5 text-xs font-semibold text-red-300">Required</span>
c588255… ragelink 46 {% endif %}
c588255… ragelink 47 </div>
c588255… ragelink 48 <div class="flex items-center gap-3 text-xs text-gray-500 mt-1">
c588255… ragelink 49 <span>Name: <code class="text-gray-400">{{ field.name }}</code></span>
c588255… ragelink 50 <span>Order: {{ field.sort_order }}</span>
c588255… ragelink 51 {% if field.choices %}
c588255… ragelink 52 <span>{{ field.choices_list|length }} choice{{ field.choices_list|length|pluralize }}</span>
c588255… ragelink 53 {% endif %}
c588255… ragelink 54 </div>
c588255… ragelink 55 </div>
c588255… ragelink 56 <div class="flex items-center gap-2 flex-shrink-0">
c588255… ragelink 57 <a href="{% url 'fossil:ticket_field_edit' slug=project.slug pk=field.pk %}"
c588255… ragelink 58 class="text-xs text-gray-400 hover:text-brand-light">Edit</a>
c588255… ragelink 59 <form method="post" action="{% url 'fossil:ticket_field_delete' slug=project.slug pk=field.pk %}"
c588255… ragelink 60 class="inline" onsubmit="return confirm('Delete this custom field?')">
c588255… ragelink 61 {% csrf_token %}
c588255… ragelink 62 <button type="submit" class="text-xs text-red-400 hover:text-red-300">Delete</button>
c588255… ragelink 63 </form>
c588255… ragelink 64 </div>
c588255… ragelink 65 </div>
c588255… ragelink 66 </div>
c588255… ragelink 67 </div>
c588255… ragelink 68 {% endfor %}
c588255… ragelink 69 </div>
c588255… ragelink 70 {% else %}
c588255… ragelink 71 <div class="rounded-lg bg-gray-800 border border-gray-700 p-8 text-center">
c588255… ragelink 72 <p class="text-sm text-gray-500">{% if search %}No fields matching "{{ search }}".{% else %}No custom ticket fields defined.{% endif %}</p>
c588255… ragelink 73 {% if not search %}
c588255… ragelink 74 <p class="text-xs text-gray-600 mt-1">Custom fields extend the Fossil ticket schema with project-specific data.</p>
c588255… ragelink 75 <a href="{% url 'fossil:ticket_field_create' slug=project.slug %}"
c588255… ragelink 76 class="mt-3 inline-flex items-center rounded-md bg-brand px-3 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-brand-hover">
c588255… ragelink 77 Add the first field
c588255… ragelink 78 </a>
c588255… ragelink 79 {% endif %}
c588255… ragelink 80 </div>
c588255… ragelink 81 {% endif %}
c588255… ragelink 82 {% include "includes/_pagination.html" %}
c588255… ragelink 83 </div>
c588255… ragelink 84 {% 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