-
-
Notifications
You must be signed in to change notification settings - Fork 253
/
edit_record.html
87 lines (83 loc) · 4.11 KB
/
edit_record.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php">{% trans %}Home{% endtrans %}</a></li>
<li class="breadcrumb-item"><a href="index.php?page=list_zones">{% trans %}Zones{% endtrans %}</a></li>
<li class="breadcrumb-item"><a href="index.php?page=edit&id={{ zid }}">
{% if idn_zone_name %}
{{ idn_zone_name }}
{% else %}
{{ zone_name }}
{% endif %}
</a></li>
<li class="breadcrumb-item" aria-current="page">{% trans %}Edit record{% endtrans %}</li>
</ol>
</nav>
{% if idn_zone_name %}
<h5 class="mb-3">{% trans %}Edit record in zone{% endtrans %} "{{ idn_zone_name }}" ({{ zone_name }})</h5>
{% else %}
<h5 class="mb-3">{% trans %}Edit record in zone{% endtrans %} "{{ zone_name }}"</h5>
{% endif %}
<form class="needs-validation" method="post" action="index.php?page=edit_record&id={{ record_id }}" novalidate>
<table class="table table-striped table-hover table-sm">
<thead>
<tr>
<th>{% trans %}Name{% endtrans %}</th>
<th> </th>
<th>{% trans %}Type{% endtrans %}</th>
<th>{% trans %}Content{% endtrans %}</th>
<th>{% trans %}Priority{% endtrans %}</th>
<th>{% trans %}TTL{% endtrans %}</th>
<th>{% trans %}Disabled{% endtrans %}</th>
</tr>
</thead>
<tr>
{% if zone_type == "SLAVE" or perm_edit == "none" or (perm_edit == "own" or perm_edit == "own_as_client")
and user_is_zone_owner == "0" %}
<td>{{ record["name"] }}</td>
<td>IN</td>
<td>{{ record["type"] }}</td>
<td>{{ record['content'] }}</td>
<td>{{ record["prio"] }}</td>
<td>{{ record["ttl"] }}</td>
{% else %}
<td>
<input type="hidden" name="rid" value="{{ record_id }}">
<input type="hidden" name="zid" value="{{ zid }}">
<input class="form-control form-control-sm" type="text" name="name" value="{{ record['record_name'] }}">
.{{ idn_zone_name ?: zone_name }}
</td>
<td>IN</td>
<td>
<select class="form-select form-select-sm" name="type">
{% set found_selected_type = false %}
{% for type_available in recordTypes %}
{% if type_available == record["type"] %}
{% set add = "SELECTED" %}
{% set found_selected_type = true %}
{% else %}
{% set add = "" %}
{% endif %}
<option {{ add }} value="{{ type_available }}">{{ type_available }}</option>
{% endfor %}
{% if not found_selected_type %}
<option selected value="{{ record['type'] }}">{{ record['type'] }}</option>
{% endif %}
</select>
</td>
<td><textarea class="form-control form-control-sm" name="content" rows="1" required>{{ record['content'] }}</textarea>
<div class="invalid-feedback">{% trans %}Provide content{% endtrans %}</div>
</td>
<td><input class="form-control form-control-sm" type="number" name="prio" min="0" max="65535"
pattern="[0-9]*" value="{{ record['prio'] }}"></td>
<td><input class="form-control form-control-sm" type="number" name="ttl" min="0" max="2147483647"
pattern="[0-9]*" value="{{ record['ttl'] }}"></td>
<td>
<input class="form-check-input" type="checkbox" name="disabled" {% if record['disabled'] == 1 %}checked{% endif %}>
</td>
{% endif %}
</tr>
</table>
<input class="btn btn-primary btn-sm" type="submit" name="commit" value="{% trans %}Update{% endtrans %}">
<input class="btn btn-secondary btn-sm" type="reset" name="reset" value="{% trans %}Reset{% endtrans %}">
</form>
<script src="assets/textareaAutoResize.js"></script>