Browse Source

Remove STATIC_URL, use {% static ... %} instead

closes: #41

Signed-off-by: Sven Velt <sven@velt.de>
Sven Velt 10 years ago
parent
commit
44ccfe5036

+ 1 - 1
ToDo

@@ -1,5 +1,6 @@
 DONE
 ~~~~
+#41: STATIC_URL ersetzen
 #42: Traps als gelesen markieren oder löschen
 #43: States als gelesen markieren oder löschen
 #47: Alle Traps durch einen klick markieren, für "alle gelesen" u.ä.
@@ -10,7 +11,6 @@ TODO
 ~~~~
 #39: SNMPTT komplett ersetzen
 #40: SNMPTT-EXEC-Weg implementieren
-#41: STATIC_URL ersetzen
 #44: Wird eine Trap-Config geändert, werden die Änderungen NICHT in die DB übernommen (bei resolve schon!)
 #45: Traps archivieren
 #46: States archivieren

+ 4 - 3
nagtrap/templates/nagtrap/snippet_trap_as_tr.html

@@ -1,13 +1,14 @@
 	{% load cycle from future %}
+	{% load staticfiles %}
 	{% load add_get_parameter %}
 	{% for trap in traps %}
 	{% cycle 'Odd' 'Even' as OddEven silent %}
 	<tr>
 		<td width="6%" class="status{{OddEven}}">
 			<input type="checkbox" name="trapIDs" value="{{ trap.id }}" >
-			{% if not trap.trapread %}<a href="{% url "nagtrap_modify" %}{% add_get action="read" trapID=trap.id %}"><img src="{{ STATIC_URL }}images/dropline/mark.png" width=22 height=22 border="0" title="Mark as read"></a>{% else %}<img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" width=22 height=22>{% endif %}
-			<a href="{% url "nagtrap_modify" %}{% add_get action="delete" trapID=trap.id %}"><img src="{{ STATIC_URL }}images/dropline/delete.png" width=22 height=22 border="0" title="Delete"></a>
-			<!-- FIXME:#45 <a href="{% url "nagtrap_modify" %}{% add_get action="archive" trapID=trap.id %}"><img src="{{ STATIC_URL }}images/dropline/archive.png" width=22 height=22 border="0" title="Archive"></a> -->
+			{% if not trap.trapread %}<a href="{% url "nagtrap_modify" %}{% add_get action="read" trapID=trap.id %}"><img src="{% static "images/dropline/mark.png" %}" width=22 height=22 border="0" title="Mark as read"></a>{% else %}<img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" width=22 height=22>{% endif %}
+			<a href="{% url "nagtrap_modify" %}{% add_get action="delete" trapID=trap.id %}"><img src="{% static "images/dropline/delete.png" %}" width=22 height=22 border="0" title="Delete"></a>
+			<!-- FIXME:#45 <a href="{% url "nagtrap_modify" %}{% add_get action="archive" trapID=trap.id %}"><img src="{% static "images/dropline/archive.png" %}" width=22 height=22 border="0" title="Archive"></a> -->
 		</td>
 		<td width="7%" class="status{{OddEven}}"><span>{{ trap.traptime }}</span></td>
 		<td width="17%" class="status{{OddEven}}">

+ 4 - 3
states/templates/states/snippet_state_as_tr.html

@@ -1,13 +1,14 @@
 	{% load cycle from future %}
+	{% load staticfiles %}
 	{% load add_get_parameter %}
 	{% for state in states %}
 	{% cycle 'Odd' 'Even' as OddEven silent %}
 	<tr>
 		<td width="10%" class="status{{OddEven}}">
 			<input type="checkbox" name="stateIDs" value="{{ state.id }}" >
-			{% if not state.read %}<a href="{% url "state_modify" %}{% add_get action="read" stateID=state.id %}"><img src="{{ STATIC_URL }}images/dropline/mark.png" width=22 height=22 border="0" title="Mark as read"></a>{% else %}<img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" width=22 height=22>{% endif %}
-			<a href="{% url "state_modify" %}{% add_get action="delete" stateID=state.id %}"><img src="{{ STATIC_URL }}images/dropline/delete.png" width=22 height=22 border="0" title="Delete"></a>
-			<!-- FIXME:#46 <a href="{% url "state_modify" %}{% add_get action="archive" stateID=state.id %}"><img src="{{ STATIC_URL }}images/dropline/archive.png" width=22 height=22 border="0" title="Archive"></a> -->
+			{% if not state.read %}<a href="{% url "state_modify" %}{% add_get action="read" stateID=state.id %}"><img src="{% static "images/dropline/mark.png" %}" width=22 height=22 border="0" title="Mark as read"></a>{% else %}<img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" width=22 height=22>{% endif %}
+			<a href="{% url "state_modify" %}{% add_get action="delete" stateID=state.id %}"><img src="{% static "images/dropline/delete.png" %}" width=22 height=22 border="0" title="Delete"></a>
+			<!-- FIXME:#46 <a href="{% url "state_modify" %}{% add_get action="archive" stateID=state.id %}"><img src="{% static "images/dropline/archive.png" %}" width=22 height=22 border="0" title="Archive"></a> -->
 		</td>
 		<td width="15%" class="status{{OddEven}}"><span><a href="{% url "state_index" %}{% add_get hostname=state.hostname %}">{{ state.hostname }}</a><br />{{ state.agentip }}</span></td>
 		<td width="10%" class="status{{OddEven}}"><span{% if state.read %} style="text-decoration: line-through;"{% endif %}>{{ state.state.name }}</span></td>

+ 4 - 3
traps/templates/traps/snippet_trap_as_tr.html

@@ -1,13 +1,14 @@
 	{% load cycle from future %}
+	{% load staticfiles %}
 	{% load add_get_parameter %}
 	{% for trap in traps %}
 	{% cycle 'Odd' 'Even' as OddEven silent %}
 	<tr>
 		<td width="6%" class="status{{OddEven}}">
 			<input type="checkbox" name="trapIDs" value="{{ trap.id }}" >
-			{% if not trap.trapread %}<a href="{% url "trap_modify" %}{% add_get action="read" trapID=trap.id %}"><img src="{{ STATIC_URL }}images/dropline/mark.png" width=22 height=22 border="0" title="Mark as read"></a>{% else %}<img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" width=22 height=22>{% endif %}
-			<a href="{% url "trap_modify" %}{% add_get action="delete" trapID=trap.id %}"><img src="{{ STATIC_URL }}images/dropline/delete.png" width=22 height=22 border="0" title="Delete"></a>
-			<!-- FIXME:#45 <a href="{% url "trap_modify" %}{% add_get action="archive" trapID=trap.id %}"><img src="{{ STATIC_URL }}images/dropline/archive.png" width=22 height=22 border="0" title="Archive"></a> -->
+			{% if not trap.trapread %}<a href="{% url "trap_modify" %}{% add_get action="read" trapID=trap.id %}"><img src="{% static "images/dropline/mark.png" %}" width=22 height=22 border="0" title="Mark as read"></a>{% else %}<img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" width=22 height=22>{% endif %}
+			<a href="{% url "trap_modify" %}{% add_get action="delete" trapID=trap.id %}"><img src="{% static "images/dropline/delete.png" %}" width=22 height=22 border="0" title="Delete"></a>
+			<!-- FIXME:#45 <a href="{% url "trap_modify" %}{% add_get action="archive" trapID=trap.id %}"><img src="{% static "images/dropline/archive.png" %}" width=22 height=22 border="0" title="Archive"></a> -->
 		</td>
 		<td width="7%" class="status{{OddEven}}"><span>{{ trap.traptime|date:"Y-m-d H:i:s" }}</span></td>
 		<td width="17%" class="status{{OddEven}}">