Browse Source

Handle template cleanups

Sebastian Lohff 4 years ago
parent
commit
e6d85236a3

+ 18
- 0
templates/whoisdb/handle_panel.html View File

@@ -0,0 +1,18 @@
1
+{% with object.getAppName|add:":"|add:object.getClassName|lower|add:"-edit" as editView %}
2
+	{% with object.getAppName|add:":"|add:object.getClassName|lower|add:"-delete" as deleteView %}
3
+        <div class="panel panel-default">
4
+            <div class="panel-heading">
5
+				{{ object }} <small>({{ object.getClassName }})</small>
6
+				<span class="pull-right">
7
+					<a href="{% url editView object.getPK %}"><span class="glyphicon glyphicon-pencil"></span></a>
8
+
9
+					<a href="{% url deleteView object.getPK %}"><span class="glyphicon glyphicon-trash"></span></a>
10
+				</span>
11
+			</div>
12
+            <div class="panel-body">
13
+                {% include "whoisdb/handle_table.html" with object=object %}
14
+            </div>
15
+        </div>
16
+	{% endwith %}
17
+{% endwith %}
18
+

+ 1
- 10
templates/whoisdb/handle_show.html View File

@@ -3,15 +3,6 @@
3 3
 {% load handletags %}
4 4
 
5 5
 {% block content %}
6
-<div class="row">
7
-	<div class="col-sm-12">
8
-		<div class="panel panel-default">
9
-			<div class="panel-heading">{{ object }} <small>({{ object.getClassName }})</small></div>
10
-			<div class="panel-body">
11
-				{% include "whoisdb/handle_table.html" with object=object %}
12
-			</div>
13
-		</div>
14
-	</div>
15
-</div>
6
+{% include "whoisdb/handle_panel.html" with object=object %}
16 7
 {% endblock %}
17 8
 

+ 4
- 1
templates/whoisdb/handle_table.html View File

@@ -11,7 +11,10 @@
11 11
 		<td>Actions</td>
12 12
 		{% with object.getAppName|add:":"|add:object.getClassName|lower|add:"-edit" as editView %}
13 13
 		{% with object.getAppName|add:":"|add:object.getClassName|lower|add:"-delete" as deleteView %}
14
-		<td><a href="{% url editView object.getPK %}">Edit object<a/>, <a href="{% url deleteView object.getPK %}">Delete object</a></td>
14
+		<td>
15
+			<a href="{% url editView object.getPK %}"><span class="glyphicon glyphicon-pencil"></span></a>
16
+			<a href="{% url deleteView object.getPK %}"><span class="glyphicon glyphicon-trash"></span></a>
17
+		</td>
15 18
 		{% endwith %}
16 19
 		{% endwith %}
17 20
 	</tr>

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

@@ -13,7 +13,7 @@
13 13
 				<p>
14 14
 				You can create new database objects <a href="{% url "whoisdb:createObjectOverview" %}">here</a>.
15 15
 				{% if hasDelegations %}
16
-				See <a href="?delegated=1">also delegated objects</a>.
16
+				See <a href="?delegated=1">also lir/rir objects</a>.
17 17
 				{% endif %}
18 18
 				</p>
19 19
 

+ 1
- 19
templates/whoisdb/search.html View File

@@ -12,19 +12,6 @@
12 12
 					<button class="btn btn-primary">Search</button>
13 13
 				</form>
14 14
 				</p>
15
-				{% comment %}
16
-				{% if term %}
17
-				<p>
18
-					<h3>Search for '{{ term }}'</h3>
19
-						{% for obj in results %}
20
-							<h5>{{ obj }}</h5>
21
-							{% include "whoisdb/handle_table.html" with object=obj %}
22
-						{% empty %}
23
-							No objects found.
24
-						{% endfor %}
25
-				</p>
26
-				{% endif %}
27
-				{% endcomment %}
28 15
 				{% if term and not results %}
29 16
 					No objects found.
30 17
 				{% endif %}
@@ -36,12 +23,7 @@
36 23
 {% for obj in results %}
37 24
 <div class="row">
38 25
 	<div class="col-sm-12">
39
-		<div class="panel panel-default">
40
-			<div class="panel-heading">{{ obj }} <small>({{ obj.getClassName }})</small></div>
41
-			<div class="panel-body">
42
-				{% include "whoisdb/handle_table.html" with object=obj %}
43
-			</div>
44
-		</div>
26
+		{% include "whoisdb/handle_panel.html" with object=obj %}
45 27
 	</div>
46 28
 </div>
47 29
 {% endfor %}

Loading…
Cancel
Save