Commit 6c71ffbc by Őry Máté

use static template tag instead variable substitution

sed -i -e 's/{{ *STATIC_URL *}}\([^"]*\)"/{% static "\1" %}"/g' $(find -name \*.html)
for i in $(comm <(git grep -l %.static|sort) <(git grep -l staticfiles) -23); do sed -i $i -e '1a {% load staticfiles %}'; done
parent c3ccaaa8
{% extends "base.html" %} {% extends "base.html" %}
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% block title-site %}Dashboard | CIRCLE{% endblock %} {% block title-site %}Dashboard | CIRCLE{% endblock %}
...@@ -7,7 +8,7 @@ ...@@ -7,7 +8,7 @@
{% block navbar-brand %} {% block navbar-brand %}
<a class="navbar-brand" href="{% url "dashboard.index" %}" style="padding: 10px 15px;"> <a class="navbar-brand" href="{% url "dashboard.index" %}" style="padding: 10px 15px;">
<img src="{{ STATIC_URL}}dashboard/img/logo.png" style="height: 25px;"/> <img src="{% static "dashboard/img/logo.png" %}" style="height: 25px;"/>
</a> </a>
{% endblock %} {% endblock %}
......
{% extends "dashboard/base.html" %} {% extends "dashboard/base.html" %}
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% load render_table from django_tables2 %} {% load render_table from django_tables2 %}
...@@ -25,5 +26,5 @@ ...@@ -25,5 +26,5 @@
{% endblock %} {% endblock %}
{% block extra_js %} {% block extra_js %}
<script src="{{ STATIC_URL}}dashboard/group-list.js"></script> <script src="{% static "dashboard/group-list.js" %}"></script>
{% endblock %} {% endblock %}
{% extends "dashboard/base.html" %} {% extends "dashboard/base.html" %}
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% block title-page %}{% trans "Index" %}{% endblock %} {% block title-page %}{% trans "Index" %}{% endblock %}
...@@ -45,6 +46,6 @@ ...@@ -45,6 +46,6 @@
{% endblock %} {% endblock %}
{% block extra_js %} {% block extra_js %}
<script src="{{ STATIC_URL }}dashboard/vm-create.js"></script> <script src="{% static "dashboard/vm-create.js" %}"></script>
<script src="{{ STATIC_URL }}dashboard/node-create.js"></script> <script src="{% static "dashboard/node-create.js" %}"></script>
{% endblock %} {% endblock %}
{% extends "dashboard/base.html" %} {% extends "dashboard/base.html" %}
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% block title-page %}{{ node.name }} | {% trans "Node" %}{% endblock %} {% block title-page %}{{ node.name }} | {% trans "Node" %}{% endblock %}
...@@ -105,5 +106,5 @@ ...@@ -105,5 +106,5 @@
{% endblock %} {% endblock %}
{% block extra_js %} {% block extra_js %}
<script src="{{ STATIC_URL}}dashboard/node-details.js"></script> <script src="{% static "dashboard/node-details.js" %}"></script>
{% endblock %} {% endblock %}
{% extends "dashboard/base.html" %} {% extends "dashboard/base.html" %}
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% load render_table from django_tables2 %} {% load render_table from django_tables2 %}
...@@ -43,5 +44,5 @@ ...@@ -43,5 +44,5 @@
{% endblock %} {% endblock %}
{% block extra_js %} {% block extra_js %}
<script src="{{ STATIC_URL}}dashboard/node-list.js"></script> <script src="{% static "dashboard/node-list.js" %}"></script>
{% endblock %} {% endblock %}
{% extends "dashboard/base.html" %} {% extends "dashboard/base.html" %}
{% load staticfiles %}
{% block content %} {% block content %}
<div class="body-content"> <div class="body-content">
...@@ -17,6 +18,6 @@ ...@@ -17,6 +18,6 @@
{% block extra_js %} {% block extra_js %}
{% if template == "dashboard/_vm-create-1.html" or template == "dashboard/_vm-create-2.html" %} {% if template == "dashboard/_vm-create-1.html" or template == "dashboard/_vm-create-2.html" %}
<script src="{{ STATIC_URL }}dashboard/vm-create.js"></script> <script src="{% static "dashboard/vm-create.js" %}"></script>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% extends "dashboard/base.html" %} {% extends "dashboard/base.html" %}
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
...@@ -107,5 +108,5 @@ ...@@ -107,5 +108,5 @@
{% endblock %} {% endblock %}
{% block extra_js %} {% block extra_js %}
<script src="{{ STATIC_URL }}dashboard/profile.js"></script> <script src="{% static "dashboard/profile.js" %}"></script>
{% endblock %} {% endblock %}
{% extends "dashboard/base.html" %} {% extends "dashboard/base.html" %}
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% block title-page %}{% trans "List" %} | {% trans "Store" %}{% endblock %} {% block title-page %}{% trans "List" %} | {% trans "Store" %}{% endblock %}
...@@ -38,5 +39,5 @@ ...@@ -38,5 +39,5 @@
{% endblock %} {% endblock %}
{% block extra_js %} {% block extra_js %}
<script src="{{ STATIC_URL}}dashboard/store.js"></script> <script src="{% static "dashboard/store.js" %}"></script>
{% endblock %} {% endblock %}
{% extends "dashboard/base.html" %} {% extends "dashboard/base.html" %}
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% load sizefieldtags %} {% load sizefieldtags %}
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
...@@ -115,5 +116,5 @@ ...@@ -115,5 +116,5 @@
}); });
</script> </script>
<script src="{{ STATIC_URL }}dashboard/disk-list.js"></script> <script src="{% static "dashboard/disk-list.js" %}"></script>
{% endblock %} {% endblock %}
{% extends "dashboard/base.html" %} {% extends "dashboard/base.html" %}
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% load render_table from django_tables2 %} {% load render_table from django_tables2 %}
...@@ -57,6 +58,6 @@ ...@@ -57,6 +58,6 @@
{% endblock %} {% endblock %}
{% block extra_js %} {% block extra_js %}
<script src="{{ STATIC_URL}}dashboard/template-list.js"></script> <script src="{% static "dashboard/template-list.js" %}"></script>
<script src="{{ STATIC_URL}}dashboard/js/stupidtable.min.js"></script> <script src="{% static "dashboard/js/stupidtable.min.js" %}"></script>
{% endblock %} {% endblock %}
{% extends "dashboard/base.html" %} {% extends "dashboard/base.html" %}
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% block title-page %}{{ instance.name }} | vm{% endblock %} {% block title-page %}{{ instance.name }} | vm{% endblock %}
...@@ -172,10 +173,10 @@ ...@@ -172,10 +173,10 @@
{% endblock %} {% endblock %}
{% block extra_js %} {% block extra_js %}
<script src="{{ STATIC_URL }}dashboard/bootstrap-tour.min.js"></script> <script src="{% static "dashboard/bootstrap-tour.min.js" %}"></script>
<script src="{{ STATIC_URL }}dashboard/vm-details.js"></script> <script src="{% static "dashboard/vm-details.js" %}"></script>
<script src="{{ STATIC_URL }}dashboard/vm-common.js"></script> <script src="{% static "dashboard/vm-common.js" %}"></script>
<script src="{{ STATIC_URL }}dashboard/vm-console.js"></script> <script src="{% static "dashboard/vm-console.js" %}"></script>
<script src="{{ STATIC_URL }}dashboard/disk-list.js"></script> <script src="{% static "dashboard/disk-list.js" %}"></script>
<script src="{{ STATIC_URL }}dashboard/vm-tour.js"></script> <script src="{% static "dashboard/vm-tour.js" %}"></script>
{% endblock %} {% endblock %}
{% load i18n %} {% load i18n %}
{% load staticfiles %}
<div class="btn-toolbar"> <div class="btn-toolbar">
{% if perms.vm.access_console %} {% if perms.vm.access_console %}
<button id="sendCtrlAltDelButton" class="btn btn-danger btn-sm">{% trans "Send Ctrl+Alt+Del" %}</button> <button id="sendCtrlAltDelButton" class="btn btn-danger btn-sm">{% trans "Send Ctrl+Alt+Del" %}</button>
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
<canvas id="noVNC_canvas" width="640px" height="20px">Canvas not supported. <canvas id="noVNC_canvas" width="640px" height="20px">Canvas not supported.
</canvas> </canvas>
<script src="{{ STATIC_URL }}dashboard/novnc/util.js"></script> <script src="{% static "dashboard/novnc/util.js" %}"></script>
<script> <script>
var INCLUDE_URI = '{{ STATIC_URL }}dashboard/novnc/'; var INCLUDE_URI = '{{ STATIC_URL }}dashboard/novnc/';
var VNC_URL = "{{ vnc_url }}"; var VNC_URL = "{{ vnc_url }}";
......
{% extends "dashboard/base.html" %} {% extends "dashboard/base.html" %}
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% block title-page %}{% trans "Virtual machines" %}{% endblock %} {% block title-page %}{% trans "Virtual machines" %}{% endblock %}
...@@ -118,6 +119,6 @@ ...@@ -118,6 +119,6 @@
{% endblock %} {% endblock %}
{% block extra_js %} {% block extra_js %}
<script src="{{ STATIC_URL}}dashboard/vm-list.js"></script> <script src="{% static "dashboard/vm-list.js" %}"></script>
<script src="{{ STATIC_URL}}dashboard/js/stupidtable.min.js"></script> <script src="{% static "dashboard/js/stupidtable.min.js" %}"></script>
{% endblock %} {% endblock %}
...@@ -76,6 +76,6 @@ ...@@ -76,6 +76,6 @@
{% block navbar-brand %} {% block navbar-brand %}
<a class="navbar-brand" href="{% url "dashboard.index" %}" style="padding: 10px 15px;"> <a class="navbar-brand" href="{% url "dashboard.index" %}" style="padding: 10px 15px;">
<img src="{{ STATIC_URL}}dashboard/img/logo.png" style="height: 25px;"/> <img src="{% static "dashboard/img/logo.png" %}" style="height: 25px;"/>
</a> </a>
{% endblock %} {% endblock %}
{% extends "registration/base.html" %} {% extends "registration/base.html" %}
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
...@@ -7,7 +8,7 @@ ...@@ -7,7 +8,7 @@
{% block navbar-brand %} {% block navbar-brand %}
<a class="navbar-brand" href="{% url "dashboard.index" %}" style="padding: 10px 15px;"> <a class="navbar-brand" href="{% url "dashboard.index" %}" style="padding: 10px 15px;">
<img src="{{ STATIC_URL}}dashboard/img/logo.png" style="height: 25px;"/> <img src="{% static "dashboard/img/logo.png" %}" style="height: 25px;"/>
</a> </a>
{% endblock %} {% endblock %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment