FossilRepo

fossilrepo / templates / organization / user_form.html
Source Blame History 57 lines
c588255… ragelink 1 {% extends "base.html" %}
c588255… ragelink 2 {% block title %}{{ title }} — Fossilrepo{% endblock %}
c588255… ragelink 3
c588255… ragelink 4 {% block content %}
c588255… ragelink 5 <div class="mb-6">
c588255… ragelink 6 <a href="{% url 'organization:members' %}" class="text-sm text-brand-light hover:text-brand">&larr; Back to Members</a>
c588255… ragelink 7 </div>
c588255… ragelink 8
c588255… ragelink 9 <div class="mx-auto max-w-2xl">
c588255… ragelink 10 <h1 class="text-2xl font-bold text-gray-100 mb-6">{{ title }}</h1>
c588255… ragelink 11
c588255… ragelink 12 {% if edit_user %}
c588255… ragelink 13 <div class="mb-6 rounded-lg bg-gray-800 p-4 shadow border border-gray-700">
c588255… ragelink 14 <p class="text-sm text-gray-400">Username: <span class="font-medium text-gray-100">{{ edit_user.username }}</span></p>
c588255… ragelink 15 </div>
c588255… ragelink 16 {% endif %}
c588255… ragelink 17
c588255… ragelink 18 <form method="post" class="space-y-6 rounded-lg bg-gray-800 p-6 shadow border border-gray-700">
c588255… ragelink 19 {% csrf_token %}
c588255… ragelink 20
c588255… ragelink 21 {% for field in form %}
c588255… ragelink 22 <div>
c588255… ragelink 23 {% if field.field.widget.input_type == "checkbox" %}
c588255… ragelink 24 <div class="flex items-center gap-3">
c588255… ragelink 25 {{ field }}
c588255… ragelink 26 <label for="{{ field.id_for_label }}" class="text-sm font-medium text-gray-300">
c588255… ragelink 27 {{ field.label }}
c588255… ragelink 28 </label>
c588255… ragelink 29 </div>
c588255… ragelink 30 {% if field.help_text %}
c588255… ragelink 31 <p class="mt-1 text-sm text-gray-500">{{ field.help_text }}</p>
c588255… ragelink 32 {% endif %}
c588255… ragelink 33 {% else %}
c588255… ragelink 34 <label for="{{ field.id_for_label }}" class="block text-sm font-medium text-gray-300">
c588255… ragelink 35 {{ field.label }}{% if field.field.required %} <span class="text-red-400">*</span>{% endif %}
c588255… ragelink 36 </label>
c588255… ragelink 37 <div class="mt-1">{{ field }}</div>
c588255… ragelink 38 {% endif %}
c588255… ragelink 39 {% if field.errors %}
c588255… ragelink 40 <p class="mt-1 text-sm text-red-400">{{ field.errors.0 }}</p>
c588255… ragelink 41 {% endif %}
c588255… ragelink 42 </div>
c588255… ragelink 43 {% endfor %}
c588255… ragelink 44
c588255… ragelink 45 <div class="flex justify-end gap-3 pt-4">
c588255… ragelink 46 <a href="{% url 'organization:members' %}"
c588255… ragelink 47 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">
c588255… ragelink 48 Cancel
c588255… ragelink 49 </a>
c588255… ragelink 50 <button type="submit"
c588255… ragelink 51 class="rounded-md bg-brand px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-brand-hover">
c588255… ragelink 52 {% if edit_user %}Update{% else %}Create User{% endif %}
c588255… ragelink 53 </button>
c588255… ragelink 54 </div>
c588255… ragelink 55 </form>
c588255… ragelink 56 </div>
c588255… ragelink 57 {% 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