Browse Source

Headers fixed

Sebastian Lohff 3 years ago
parent
commit
337184baa6

+ 1
- 1
templates/domains/obj_edit.html View File

@@ -6,7 +6,7 @@
6 6
 <div class="row">
7 7
 	<div class="col-sm-12">
8 8
 		<div class="panel panel-default">
9
-			<div class="panel-heading">Header</div>
9
+			<div class="panel-heading">Edit {{ form.instance }} <small>({{ form.instance.getClassName }})</small></div>
10 10
 			<div class="panel-body">
11 11
 				<form method="post" action="#">
12 12
 					{% csrf_token %}

+ 4
- 4
templates/whoisdb/handle_show.html View File

@@ -12,15 +12,15 @@
12 12
 				{% for field in object|getFields:user %}
13 13
 					<tr>
14 14
 						<td>{{ field.0 }}</td>
15
-						<td>{% if field.1.through %}{{ field.1.all|linkObjects }}{% else %}{{ field.1 }}{% endif %}</td>
15
+						<td>{% if field.1.through %}{{ field.1.all|linkObjects|default:"-" }}{% else %}{{ field.1|default:"-" }}{% endif %}</td>
16 16
 					</tr>
17 17
 				{% endfor %}
18 18
 				{% if object|userCanEdit:user %}
19 19
 					<tr>
20 20
 						<td>Actions</td>
21
-						{% with "whoisdb:"|add:object.getClassName|lower|add:"-edit" as editView %}
22
-						{% with "whoisdb:"|add:object.getClassName|lower|add:"-delete" as deleteView %}
23
-						<td><a href="{% url editView handle=object.handle %}">Edit object<a/>, <a href="{% url deleteView handle=object.handle %}">Delete object</a></td>
21
+						{% with request.resolver_match.namespaces.0|add:":"|add:object.getClassName|lower|add:"-edit" as editView %}
22
+						{% with request.resolver_match.namespaces.0|add:":"|add:object.getClassName|lower|add:"-delete" as deleteView %}
23
+						<td><a href="{% url editView object.getPK %}">Edit object<a/>, <a href="{% url deleteView object.getPK %}">Delete object</a></td>
24 24
 						{% endwith %}
25 25
 						{% endwith %}
26 26
 					</tr>

+ 0
- 21
templates/whoisdb/maintainer_edit.html View File

@@ -1,21 +0,0 @@
1
-{% extends "base.html" %}
2
-
3
-{% load crispy_forms_tags %}
4
-
5
-{% block content %}
6
-<div class="row">
7
-	<div class="col-sm-12">
8
-		<div class="panel panel-default">
9
-			<div class="panel-heading">Header</div>
10
-			<div class="panel-body">
11
-				<form method="post" action="#">
12
-					{% csrf_token %}
13
-					{{ form | crispy }}
14
-					<button type="submit" class="btn btn-primary">Create</button>
15
-				</form>
16
-			</div>
17
-		</div>
18
-	</div>
19
-</div>
20
-{% endblock %}
21
-

+ 1
- 1
templates/whoisdb/obj_edit.html View File

@@ -6,7 +6,7 @@
6 6
 <div class="row">
7 7
 	<div class="col-sm-12">
8 8
 		<div class="panel panel-default">
9
-			<div class="panel-heading">Header</div>
9
+			<div class="panel-heading">Edit {{ form.instance }} <small>({{ form.instance.getClassName }})</small></div>
10 10
 			<div class="panel-body">
11 11
 				<form method="post" action="#">
12 12
 					{% csrf_token %}

+ 1
- 1
whoisdb/models.py View File

@@ -84,7 +84,7 @@ class Maintainer(WhoisObject):
84 84
 	handle = models.SlugField(max_length=32, unique=True, verbose_name='handle', validators=[HandleValidatorWithSuffix('MNT')], help_text="Must end with -MNT, eg FOO3-MNT")
85 85
 	description = models.CharField(max_length=64, blank=True, help_text="Short description what this maintainer is for")
86 86
 
87
-	admin_c = models.ManyToManyField("Contact")
87
+	admin_c = models.ManyToManyField("Contact", verbose_name="Administrative Contact")
88 88
 
89 89
 	rir = models.BooleanField(default=False)
90 90
 	lir = models.BooleanField(default=False)

+ 1
- 1
whoisdb/views.py View File

@@ -104,7 +104,7 @@ class MaintainerCreate(LoginRequiredMixin, CreateView):
104 104
 
105 105
 
106 106
 class MaintainerEdit(LoginRequiredMixin, UpdateView):
107
-	template_name = "whoisdb/maintainer_edit.html"
107
+	template_name = "whoisdb/obj_edit.html"
108 108
 	model = Maintainer
109 109
 	form_class = MntForm
110 110
 	slug_field = "handle"

Loading…
Cancel
Save