|
1
|
{% extends "base.html" %} |
|
2
|
{% block title %}{{ title }} — Fossilrepo{% endblock %} |
|
3
|
|
|
4
|
{% block content %} |
|
5
|
<div class="mb-6"> |
|
6
|
{% if group %} |
|
7
|
<a href="{% url 'projects:group_detail' slug=group.slug %}" class="text-sm text-brand-light hover:text-brand">← Back to {{ group.name }}</a> |
|
8
|
{% else %} |
|
9
|
<a href="{% url 'projects:group_list' %}" class="text-sm text-brand-light hover:text-brand">← Back to Groups</a> |
|
10
|
{% endif %} |
|
11
|
</div> |
|
12
|
|
|
13
|
<div class="mx-auto max-w-2xl"> |
|
14
|
<h1 class="text-2xl font-bold text-gray-100 mb-6">{{ title }}</h1> |
|
15
|
|
|
16
|
<form method="post" class="space-y-6 rounded-lg bg-gray-800 p-6 shadow border border-gray-700"> |
|
17
|
{% csrf_token %} |
|
18
|
|
|
19
|
{% for field in form %} |
|
20
|
<div> |
|
21
|
<label for="{{ field.id_for_label }}" class="block text-sm font-medium text-gray-300"> |
|
22
|
{{ field.label }}{% if field.field.required %} <span class="text-red-400">*</span>{% endif %} |
|
23
|
</label> |
|
24
|
<div class="mt-1">{{ field }}</div> |
|
25
|
{% if field.errors %} |
|
26
|
<p class="mt-1 text-sm text-red-400">{{ field.errors.0 }}</p> |
|
27
|
{% endif %} |
|
28
|
</div> |
|
29
|
{% endfor %} |
|
30
|
|
|
31
|
<div class="flex justify-end gap-3 pt-4"> |
|
32
|
{% if group %} |
|
33
|
<a href="{% url 'projects:group_detail' slug=group.slug %}" |
|
34
|
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"> |
|
35
|
Cancel |
|
36
|
</a> |
|
37
|
{% else %} |
|
38
|
<a href="{% url 'projects:group_list' %}" |
|
39
|
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"> |
|
40
|
Cancel |
|
41
|
</a> |
|
42
|
{% endif %} |
|
43
|
<button type="submit" |
|
44
|
class="rounded-md bg-brand px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-brand-hover"> |
|
45
|
{% if group %}Update{% else %}Create{% endif %} |
|
46
|
</button> |
|
47
|
</div> |
|
48
|
</form> |
|
49
|
</div> |
|
50
|
{% endblock %} |
|
51
|
|