Commit dc58db24 by Őry Máté

one: remove hard coded urls

parent 678568a1
...@@ -401,7 +401,7 @@ class Instance(models.Model): ...@@ -401,7 +401,7 @@ class Instance(models.Model):
@models.permalink @models.permalink
def get_absolute_url(self): def get_absolute_url(self):
return ('vm_show', None, {'iid':self.id}) return ('one.views.vm_show', None, {'iid':self.id})
def get_port(self, use_ipv6=False): def get_port(self, use_ipv6=False):
"""Get public port number for default access method.""" """Get public port number for default access method."""
......
<!DOCTYPE html> <!DOCTYPE html>
{% load i18n %} {% load i18n %}
{% load staticfiles %}
{% get_current_language as lang %} {% get_current_language as lang %}
<html lang="{{lang}}"> <html lang="{{lang}}">
<head> <head>
<title>{% block title %}IK Cloud{% endblock %}</title> <title>{% block title %}IK Cloud{% endblock %}</title>
<link href="https://fonts.googleapis.com/css?family=Titillium+Web&amp;subset=latin,latin-ext" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Titillium+Web&amp;subset=latin,latin-ext" rel="stylesheet" type="text/css">
<link rel="icon" type="image/png" href="/static/favicon.png" /> <link rel="icon" type="image/png" href="{% static "favicon.png" %}" />
<link rel="stylesheet/less" href="/static/style/style.less" /> <link rel="stylesheet/less" href="{% static "style/style.less" %}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="/static/script/jquery.min.js"></script> <script src="{% static "script/jquery.min.js" %}"></script>
<script type="text/javascript" src="{% url django.views.i18n.javascript_catalog %}"></script> <script type="text/javascript" src="{% url django.views.i18n.javascript_catalog %}"></script>
<script type="text/javascript"> <script type="text/javascript">
window.localStorage.removeItem('https://cloud.ik.bme.hu/static/style/style.less:timestamp'); window.localStorage.removeItem('https://cloud.ik.bme.hu/static/style/style.less:timestamp');
var current_user={{user.id}}; var current_user={{user.id}};
</script> </script>
<script src="/static/script/less.min.js"></script> <script src="{% static "script/less.min.js" %}"></script>
<script src="/static/script/knockout.min.js"></script> <script src="{% static "script/knockout.min.js" %}"></script>
<script type="text/javascript" src="/static/script/util.js"></script> <script type="text/javascript" src="{% static "script/util.js" %}"></script>
<script type="text/javascript" src="/static/script/cloud.js"></script> <script type="text/javascript" src="{% static "script/cloud.js" %}"></script>
{{ form.media }} {{ form.media }}
{% block js %}{% endblock %} {% block js %}{% endblock %}
</head> </head>
...@@ -27,24 +28,24 @@ ...@@ -27,24 +28,24 @@
<div id="loginblock"><p> <div id="loginblock"><p>
{% if user.is_authenticated %} {% if user.is_authenticated %}
{% trans "Logged in:" %} {{ user.username }}. {% trans "Logged in:" %} {{ user.username }}.
<a href="/logout/">{% trans "Logout" %}</a>. <a href="{% url logout %}">{% trans "Logout" %}</a>.
{% if user.is_staff %} {% if user.is_staff %}
<a href="/admin/">{% trans "Admin" %}</a>. <a href="{% url admin:index %}">{% trans "Admin" %}</a>.
{% endif %} {% endif %}
{% else %} {% else %}
<a href="/login/">{% trans "Login" %}</a>. <a href="{% url login %}">{% trans "Login" %}</a>.
{% endif %} {% endif %}
{% if lang == 'hu' %} {% if lang == 'hu' %}
<a href="/language/en/">In English</a>. <a href="{% url school.views.language "en" %}">In English</a>.
{% else %} {% else %}
<a href="/language/hu/">Magyarul</a>. <a href="{% url school.views.language "hu" %}">Magyarul</a>.
{% endif %} {% endif %}
</p> </p>
</div> </div>
{% endblock %} {% endblock %}
{% block header %} {% block header %}
{% block header_title %} {% block header_title %}
<h1><a href="/">IK Cloud</a></h1> <h1><a href="{% url one.views.index %}">IK Cloud</a></h1>
{% endblock %} {% endblock %}
{% endblock %} {% endblock %}
</div> </div>
......
{% extends "box/base/box.html" %} {% extends "box/base/box.html" %}
{% load i18n %} {% load i18n %}
{% load l10n %} {% load l10n %}
{% load staticfiles %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
{% block title %} {% block title %}
...@@ -9,7 +10,7 @@ ...@@ -9,7 +10,7 @@
{% block boxhelp %} {% block boxhelp %}
<div class="boxhelp"> <div class="boxhelp">
<div class="icon"> <div class="icon">
<img src="/static/icons/information-frame.png" alt="{% trans "Help" %}" /> <img src="{% static "icons/information-frame.png" %}" alt="{% trans "Help" %}" />
</div> </div>
<div class="boxhelp-box"> <div class="boxhelp-box">
<p>{% blocktrans %}This is your global data store.{% endblocktrans %}</p> <p>{% blocktrans %}This is your global data store.{% endblocktrans %}</p>
...@@ -100,7 +101,7 @@ ...@@ -100,7 +101,7 @@
</div> </div>
<div class="details"> <div class="details">
<div class="container"> <div class="container">
<form style="padding-bottom: 10px" action="/key/add/" method="POST"> <form style="padding-bottom: 10px" action="{% url one.views.key_add %}" method="POST">
{% csrf_token %} {% csrf_token %}
<textarea style="margin-bottom: 5px" name="key" placeholder="{% trans "Public key in OpenSSH format" %}"></textarea><br /> <textarea style="margin-bottom: 5px" name="key" placeholder="{% trans "Public key in OpenSSH format" %}"></textarea><br />
<input type="submit" style="margin-left: 10px;" value="{% trans "Save" %}" /> <input type="submit" style="margin-left: 10px;" value="{% trans "Save" %}" />
...@@ -139,7 +140,7 @@ ...@@ -139,7 +140,7 @@
<p id="upload-error-unknown" style="display: none"></p> <p id="upload-error-unknown" style="display: none"></p>
</div> </div>
<div style="display: none" class="upload-zone" id="old-upload-form"> <div style="display: none" class="upload-zone" id="old-upload-form">
<form action="/" method="POST" data-bind="attr: {action: uploadURL}" enctype="multipart/form-data"> <form action="{% url one.views.home %}" method="POST" data-bind="attr: {action: uploadURL}" enctype="multipart/form-data">
<input type="file" name="data" /> <input type="file" name="data" />
<input type="submit" value="Feltöltés" /> <input type="submit" value="Feltöltés" />
</form> </form>
......
{% extends "box/base/entry.html" %} {% extends "box/base/entry.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
{% block summary %} {% block summary %}
...@@ -8,13 +9,13 @@ ...@@ -8,13 +9,13 @@
<div class="info" data-bind="text: size"></div> <div class="info" data-bind="text: size"></div>
<div class="actions"> <div class="actions">
<a href="#" data-bind="click: $parent.rename, clickBubble: false"> <a href="#" data-bind="click: $parent.rename, clickBubble: false">
<img src="/static/icons/pencil.png" alt="{% trans "rename" %}" /> <img src="{% static "icons/pencil.png" %}" alt="{% trans "rename" %}" />
</a> </a>
<a href="#" data-bind="click: $parent.delete, clickBubble: false"> <a href="#" data-bind="click: $parent.delete, clickBubble: false">
<img src="/static/icons/minus-circle.png" alt="{% trans "remove" %}" /> <img src="{% static "icons/minus-circle.png" %}" alt="{% trans "remove" %}" />
</a> </a>
<a href="#" data-bind="click: $parent.download, clickBubble: false"> <a href="#" data-bind="click: $parent.download, clickBubble: false">
<img src="/static/icons/download-cloud.png" alt="{% trans "download" %}" /> <img src="{% static "icons/download-cloud.png" %}" alt="{% trans "download" %}" />
</a> </a>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
......
{% extends "box/base/entry.html" %} {% extends "box/base/entry.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
{% block content %} {% block content %}
...@@ -15,7 +16,7 @@ ...@@ -15,7 +16,7 @@
</div> </div>
<div class="actions"> <div class="actions">
<a href="#" class="remove delete-key" data-id="{{key.id}}"> <a href="#" class="remove delete-key" data-id="{{key.id}}">
<img src="/static/icons/minus-circle.png" alt="{% trans 'Remove' %}" /> <img src="{% static "icons/minus-circle.png" %}" alt="{% trans 'Remove' %}" />
</a> </a>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
......
{% extends "box/base/box.html" %} {% extends "box/base/box.html" %}
{% load i18n %} {% load i18n %}
{% load l10n %} {% load l10n %}
{% load staticfiles %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
{% block title %} {% block title %}
...@@ -10,7 +11,7 @@ ...@@ -10,7 +11,7 @@
{% block boxhelp %} {% block boxhelp %}
<div class="boxhelp"> <div class="boxhelp">
<div class="icon"> <div class="icon">
<img src="/static/icons/information-frame.png" alt="{% trans "Help" %}" /> <img src="{% static "icons/information-frame.png" %}" alt="{% trans "Help" %}" />
</div> </div>
<div class="boxhelp-box"> <div class="boxhelp-box">
<p>{% blocktrans %}This is the list of your own templates.{% endblocktrans %}</p> <p>{% blocktrans %}This is the list of your own templates.{% endblocktrans %}</p>
...@@ -53,17 +54,17 @@ ...@@ -53,17 +54,17 @@
<div class="summary public-template"> <div class="summary public-template">
<div class="name"> <div class="name">
{{t.name}} {{t.name}}
<img src="/static/icons/lock-small.png" alt="{% trans "locked" %}" <img src="{% static "icons/lock-small.png" %}" alt="{% trans "locked" %}"
title="{% trans "This is a shared template." %}" /> title="{% trans "This is a shared template." %}" />
</div> </div>
<div class="status">{{t.state}}</div> <div class="status">{{t.state}}</div>
<div class="actions"> <div class="actions">
{% if t.state == 'READY' %} {% if t.state == 'READY' %}
<a href="#" class="try-template-button" data-id="{{t.id}}" title="{% trans "Try" %}"> <a href="#" class="try-template-button" data-id="{{t.id}}" title="{% trans "Try" %}">
<img src="/static/icons/control.png" alt="{% trans "Start" %}"/> <img src="{% static "icons/control.png" %}" alt="{% trans "Start" %}"/>
</a> </a>
<a href="#" class="template-share" data-id="{{t.id}}" data-gid="{{group.id}}" title="{% trans "Share" %}"> <a href="#" class="template-share" data-id="{{t.id}}" data-gid="{{group.id}}" title="{% trans "Share" %}">
<img src="/static/icons/user-share.png" alt="{% trans "Share" %}" /> <img src="{% static "icons/user-share.png" %}" alt="{% trans "Share" %}" />
</a> </a>
{% endif %} {% endif %}
</div> </div>
...@@ -75,11 +76,11 @@ ...@@ -75,11 +76,11 @@
<div class="quota"> <div class="quota">
<div class="used" style="width: {{ i.get_instance_pc|unlocalize }}%"></div> <div class="used" style="width: {{ i.get_instance_pc|unlocalize }}%"></div>
</div> </div>
<form action="/vm/unshare/{{i.id}}/" method="post"> <form action="{% url one.views.vm_unshare i.id %}" method="post">
<span title="{{i.name}}">{{i.name|truncatechars:20}}</span> <span title="{{i.name}}">{{i.name|truncatechars:20}}</span>
({{i.get_running}}/{{i.instance_limit}}) {{i.type}} ({{i.get_running}}/{{i.instance_limit}}) {{i.type}}
<a href="#" class="edit" data-id="{{i.id}}"> <a href="#" class="edit" data-id="{{i.id}}">
<img src="/static/icons/pencil.png" alt="{% trans "Edit" %}" title="{% trans "Edit" %}" /> <img src="{% static "icons/pencil.png" %}" alt="{% trans "Edit" %}" title="{% trans "Edit" %}" />
</a> </a>
{% csrf_token %} {% csrf_token %}
<input type="submit" class="template-unshare" value="{% trans "Delete" %}" style="float: right"/> <input type="submit" class="template-unshare" value="{% trans "Delete" %}" style="float: right"/>
......
{% extends "box/base/summary.html" %} {% extends "box/base/summary.html" %}
{% load i18n %} {% load i18n %}
{% load l10n %} {% load l10n %}
{% load staticfiles %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
{% block content %} {% block content %}
...@@ -13,11 +14,11 @@ ...@@ -13,11 +14,11 @@
<div class="quota"> <div class="quota">
<div class="used" style="width: {{ i.get_instance_pc|unlocalize }}%"></div> <div class="used" style="width: {{ i.get_instance_pc|unlocalize }}%"></div>
</div> </div>
<form action="/vm/unshare/{{i.id}}/" method="post"> <form action="{% url one.views.vm_unshare i.id %}" method="post">
<span title="{{i.name}}">{{i.name|truncatechars:20}}</span> <span title="{{i.name}}">{{i.name|truncatechars:20}}</span>
({{i.get_running}}/{{i.instance_limit}}) {{i.type}} ({{i.get_running}}/{{i.instance_limit}}) {{i.type}}
<a href="#" class="edit" data-id="{{i.id}}"> <a href="#" class="edit" data-id="{{i.id}}">
<img src="/static/icons/pencil.png" alt="{% trans "Edit" %}" title="{% trans "Edit" %}" /> <img src="{% static "icons/pencil.png" %}" alt="{% trans "Edit" %}" title="{% trans "Edit" %}" />
</a> </a>
{% csrf_token %} {% csrf_token %}
<input class="template-unshare" type="submit" value="{% trans "Delete" %}" style="float: right"/> <input class="template-unshare" type="submit" value="{% trans "Delete" %}" style="float: right"/>
...@@ -48,19 +49,19 @@ ...@@ -48,19 +49,19 @@
{% block actions %} {% block actions %}
{% if t.state == 'READY' %} {% if t.state == 'READY' %}
<a href="#" class="try-template" data-id="{{t.id}}" title="{% trans "Try" %}"> <a href="#" class="try-template" data-id="{{t.id}}" title="{% trans "Try" %}">
<img src="/static/icons/control.png" alt="{% trans "Start" %}"/> <img src="{% static "icons/control.png" %}" alt="{% trans "Start" %}"/>
</a> </a>
<!--<a href="#" title="{% trans "Edit" %}"> <!--<a href="#" title="{% trans "Edit" %}">
<img src="/static/icons/pencil.png" alt="{% trans "Edit" %}" /> <img src="{% static "icons/pencil.png" %}" alt="{% trans "Edit" %}" />
</a>--> </a>-->
<a href="#" class="template-share" data-id="{{t.id}}" data-gid="{{group.id}}" title="{% trans "Share" %}"> <a href="#" class="template-share" data-id="{{t.id}}" data-gid="{{group.id}}" title="{% trans "Share" %}">
<img src="/static/icons/user-share.png" alt="{% trans "Share" %}" /> <img src="{% static "icons/user-share.png" %}" alt="{% trans "Share" %}" />
</a> </a>
{% endif %} {% endif %}
<a href="#" class="delete-template" data-id="{{ t.id }}" data-name="{{ t.name }}" title="{% trans "Remove" %}"> <a href="#" class="delete-template" data-id="{{ t.id }}" data-name="{{ t.name }}" title="{% trans "Remove" %}">
<img src="/static/icons/minus-circle.png" alt="{% trans "Remove" %}" /> <img src="{% static "icons/minus-circle.png" %}" alt="{% trans "Remove" %}" />
</a> </a>
<!--<a href="#" class="edit-template" data-id="{{ t.id }}" title="{% trans "Edit" %}"> <!--<a href="#" class="edit-template" data-id="{{ t.id }}" title="{% trans "Edit" %}">
<img src="/static/icons/pencil.png" alt="{% trans "Edit" %}" /> <img src="{% static "icons/pencil.png" %}" alt="{% trans "Edit" %}" />
</a>--> </a>-->
{% endblock actions %} {% endblock actions %}
{% extends "box/base/box.html" %} {% extends "box/base/box.html" %}
{% load i18n %} {% load i18n %}
{% load l10n %} {% load l10n %}
{% load staticfiles %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
{% block title %} {% block title %}
...@@ -10,7 +11,7 @@ ...@@ -10,7 +11,7 @@
{% block boxhelp %} {% block boxhelp %}
<div class="boxhelp"> <div class="boxhelp">
<div class="icon"> <div class="icon">
<img src="/static/icons/information-frame.png" alt="{% trans "Help" %}" /> <img src="{% static "icons/information-frame.png" %}" alt="{% trans "Help" %}" />
</div> </div>
<div class="boxhelp-box"> <div class="boxhelp-box">
<p>{% blocktrans %}This is the list of your running virtual machines.{% endblocktrans %}</p> <p>{% blocktrans %}This is the list of your running virtual machines.{% endblocktrans %}</p>
...@@ -103,7 +104,7 @@ ...@@ -103,7 +104,7 @@
<li> <li>
&nbsp; &nbsp;
<span class="value"> <span class="value">
<form method="POST" action="/vm/new/s{{s.pk}}/"> <form method="POST" action="{% url one.views.vm_new share=s.id %}">
{% csrf_token %} {% csrf_token %}
<input {% if s.running_shared >= s.per_user_limit or s.get_running >= s.instance_limit%}disabled="disabled" value="{% trans "Quota reached" %}" {%else%}value="{% trans "Launch" %}"{% endif %} type="submit" /> <input {% if s.running_shared >= s.per_user_limit or s.get_running >= s.instance_limit%}disabled="disabled" value="{% trans "Quota reached" %}" {%else%}value="{% trans "Launch" %}"{% endif %} type="submit" />
</form> </form>
......
{% extends "box/base/entry.html" %} {% extends "box/base/entry.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
{% block content %} {% block content %}
...@@ -57,7 +58,7 @@ ...@@ -57,7 +58,7 @@
{% trans "time of suspend"|capfirst %}: {% trans "time of suspend"|capfirst %}:
<span class="value"> <abbr title="{{vm.time_of_suspend}}">{{vm.time_of_suspend|timeuntil}}</abbr> <span class="value"> <abbr title="{{vm.time_of_suspend}}">{{vm.time_of_suspend|timeuntil}}</abbr>
<a href="#" class="renew-vm renew-suspend-vm" data-id="{{ vm.id }}" title="{% trans "Renew suspend time" %}"> <a href="#" class="renew-vm renew-suspend-vm" data-id="{{ vm.id }}" title="{% trans "Renew suspend time" %}">
<img src="/static/icons/control-double.png" alt="{% trans "Renew suspend time" %}" /> <img src="{% static "icons/control-double.png" %}" alt="{% trans "Renew suspend time" %}" />
</a> </a>
</span> </span>
</li> </li>
...@@ -67,7 +68,7 @@ ...@@ -67,7 +68,7 @@
{% trans "time of delete"|capfirst %}: {% trans "time of delete"|capfirst %}:
<span class="value"> <abbr title="{{vm.time_of_delete}}">{{vm.time_of_delete|timeuntil}}</abbr> <span class="value"> <abbr title="{{vm.time_of_delete}}">{{vm.time_of_delete|timeuntil}}</abbr>
<a href="#" class="renew-vm renew-delete-vm" data-id="{{ vm.id }}" title="{% trans "Renew deletion time" %}"> <a href="#" class="renew-vm renew-delete-vm" data-id="{{ vm.id }}" title="{% trans "Renew deletion time" %}">
<img src="/static/icons/control-double.png" alt="{% trans "Renew deletion time" %}" /> <img src="{% static "icons/control-double.png" %}" alt="{% trans "Renew deletion time" %}" />
</a> </a>
</span> </span>
</li> </li>
...@@ -75,7 +76,7 @@ ...@@ -75,7 +76,7 @@
<li> <li>
&nbsp; &nbsp;
<span class="value"> <span class="value">
<a href="/vm/show/{{vm.id}}/" title="{{vm.name}}">{% trans "More details" %}</a> <a href="{{ vm.get_absolute_url }}" title="{{vm.name}}">{% trans "More details" %}</a>
</span> </span>
</li> </li>
</ul> </ul>
......
{% extends "box/base/summary.html" %} {% extends "box/base/summary.html" %}
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
...@@ -12,7 +13,7 @@ ...@@ -12,7 +13,7 @@
<div class="name {% if vm.state == 'ACTIVE' %}vm-on{% else %}vm-off{% endif %}"> <div class="name {% if vm.state == 'ACTIVE' %}vm-on{% else %}vm-off{% endif %}">
<span id="vm-{{vm.id}}-name">{{vm.name|truncatechars:20}}</span> <span id="vm-{{vm.id}}-name">{{vm.name|truncatechars:20}}</span>
<small id="vm-{{vm.id}}-name-details" class="details"> <small id="vm-{{vm.id}}-name-details" class="details">
(<a href="/vm/show/{{vm.id}}/" title="{{vm.name}}">{% trans "More details" %}</a>) (<a href="{{ vm.get_absolute_url }}" title="{{vm.name}}">{% trans "More details" %}</a>)
</small> </small>
</div> </div>
{% endblock %} {% endblock %}
...@@ -23,42 +24,42 @@ ...@@ -23,42 +24,42 @@
{% block actions %} {% block actions %}
<a href="#" class="rename-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Edit name" %}"> <a href="#" class="rename-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Edit name" %}">
<img src="/static/icons/pencil.png" alt="{% trans "Edit name" %}" /> <img src="{% static "icons/pencil.png" %}" alt="{% trans "Edit name" %}" />
</a> </a>
{% if vm.waiting %} {% if vm.waiting %}
<a href="#"> <a href="#">
<img src="/static/image/load.gif" /> <img src="{% static "image/load.gif" %}" />
</a> </a>
{% elif vm.state == 'ACTIVE' %} {% elif vm.state == 'ACTIVE' %}
<a href="{{vm.get_connect_uri}}" data-id="{{ vm.id }}" class="connect-vm" title="{% trans "Connect" %}"> <a href="{{vm.get_connect_uri}}" data-id="{{ vm.id }}" class="connect-vm" title="{% trans "Connect" %}">
<img src="/static/icons/plug.png" alt="{% trans "Connect" %}" /> <img src="{% static "icons/plug.png" %}" alt="{% trans "Connect" %}" />
</a> </a>
<a href="#" class="stop-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Pause" %}"> <a href="#" class="stop-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Pause" %}">
<img src="/static/icons/control-pause.png" alt="{% trans "Pause" %}" /> <img src="{% static "icons/control-pause.png" %}" alt="{% trans "Pause" %}" />
</a> </a>
<a href="#" class="delete-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Delete" %}"> <a href="#" class="delete-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Delete" %}">
<img src="/static/icons/minus-circle.png" alt="{% trans "Delete" %}" /> <img src="{% static "icons/minus-circle.png" %}" alt="{% trans "Delete" %}" />
</a> </a>
<a href="#" class="restart-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Restart" %}"> <a href="#" class="restart-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Restart" %}">
<img src="/static/icons/arrow-circle-double.png" alt="↺" /> <img src="{% static "icons/arrow-circle-double.png" %}" alt="↺" />
</a> </a>
{% elif vm.state == 'PENDING' %} {% elif vm.state == 'PENDING' %}
<a href="#"> <a href="#">
<img src="/static/image/load.gif" /> <img src="{% static "image/load.gif" %}" />
</a> </a>
<a style="float: right" href="#" class="delete-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Delete" %}"> <a style="float: right" href="#" class="delete-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Delete" %}">
<img src="/static/icons/minus-circle.png" alt="{% trans "Delete" %}" /> <img src="{% static "icons/minus-circle.png" %}" alt="{% trans "Delete" %}" />
</a> </a>
{% elif vm.state == 'STOPPED' %} {% elif vm.state == 'STOPPED' %}
<a href="#" class="resume-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Resume" %}"> <a href="#" class="resume-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Resume" %}">
<img src="/static/icons/control.png" alt="{% trans "Resume" %}" /> <img src="{% static "icons/control.png" %}" alt="{% trans "Resume" %}" />
</a> </a>
<a href="#" class="delete-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Delete" %}"> <a href="#" class="delete-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Delete" %}">
<img src="/static/icons/minus-circle.png" alt="{% trans "Delete" %}" /> <img src="{% static "icons/minus-circle.png" %}" alt="{% trans "Delete" %}" />
</a> </a>
{% elif vm.state == 'FAILED' %} {% elif vm.state == 'FAILED' %}
<a href="#" class="delete-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Delete" %}"> <a href="#" class="delete-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Delete" %}">
<img src="/static/icons/minus-circle.png" alt="{% trans "Delete" %}" /> <img src="{% static "icons/minus-circle.png" %}" alt="{% trans "Delete" %}" />
</a> </a>
{% endif %} {% endif %}
{% endblock actions %} {% endblock actions %}
{% load i18n %} {% load i18n %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<form action="/ajax/shareEdit/{{share.id}}/" method="post" id="template-wizard"> <form action="{% url one.views.ajax_share_edit_wizard share.id %}" method="post" id="template-wizard">
{% csrf_token %} {% csrf_token %}
<div id="new-share" class="wizard"> <div id="new-share" class="wizard">
<h2> <h2>
......
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
{% block js %} {% block js %}
<script type="text/javascript" src="/static/script/store.js"></script> <script type="text/javascript" src="{% static "script/store.js" %}"></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="boxes"> <div class="boxes">
......
{% load i18n %} {% load i18n %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<form action="/ajax/share/{{base.id}}/" method="post" id="template-wizard"> <form action="{% url one.views.ajax_share_wizard id=base.id %}" method="post" id="template-wizard">
{% csrf_token %} {% csrf_token %}
<div id="new-share" class="wizard"> <div id="new-share" class="wizard">
<h2> <h2>
......
{% load i18n %} {% load i18n %}
{% load staticfiles %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<form action="/ajax/templateWizard" method="post" id="template-wizard"> <form action="{% url one.views.ajax_template_wizard %}" method="post" id="template-wizard">
{% csrf_token %} {% csrf_token %}
<div id="new-template-step-1" class="wizard"> <div id="new-template-step-1" class="wizard">
<div class="progress"> <div class="progress">
...@@ -28,7 +29,7 @@ ...@@ -28,7 +29,7 @@
<input type="radio" name="base" value="{{m.id}}" /> <input type="radio" name="base" value="{{m.id}}" />
{{m.name}} {{m.name}}
{% if m.public %} {% if m.public %}
<img src="/static/icons/lock-small.png" alt="{% trans "locked" %}" <img src="{% static "icons/lock-small.png" %}" alt="{% trans "locked" %}"
title="{% trans "This is a shared template." %}" /> title="{% trans "This is a shared template." %}" />
{% endif %} {% endif %}
</label> </label>
...@@ -56,7 +57,7 @@ ...@@ -56,7 +57,7 @@
else { else {
$.ajax({ $.ajax({
'type': 'POST', 'type': 'POST',
'url': '/ajax/templateWizard', 'url': '{% url one.views.ajax_template_wizard %}',
'data': $('#template-wizard').serialize(), 'data': $('#template-wizard').serialize(),
'success': function(data) { 'success': function(data) {
$('#modal-container').html(data); $('#modal-container').html(data);
......
{% load i18n %} {% load i18n %}
{% load staticfiles %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<form action="/vm/new/{{base.id}}/" method="post" id="template-wizard"> <form action="{% url one.views.vm_new base.id %}" method="post" id="template-wizard">
{% csrf_token %} {% csrf_token %}
<div id="new-template-step-2" class="wizard"> <div id="new-template-step-2" class="wizard">
<div class="progress"> <div class="progress">
...@@ -75,7 +76,7 @@ ...@@ -75,7 +76,7 @@
var s = $(self).val(); var s = $(self).val();
$.ajax({ $.ajax({
'type': 'GET', 'type': 'GET',
'url': '{% one.views.ajax_template_name_unique %}?name=' + s, 'url': '{% url one.views.ajax_template_name_unique %}?name=' + s,
'success': function(data, b, c) { 'success': function(data, b, c) {
if (s != $("#new-template-name").val()) { if (s != $("#new-template-name").val()) {
return true; return true;
...@@ -99,7 +100,7 @@ ...@@ -99,7 +100,7 @@
e.preventDefault(); e.preventDefault();
$.ajax({ $.ajax({
'type': 'GET', 'type': 'GET',
'url': '{% one.views.ajax_template_name_unique %}?name=' + $("#new-template-name").val(), 'url': '{% url one.views.ajax_template_name_unique %}?name=' + $("#new-template-name").val(),
'success': function(data, b, c) { 'success': function(data, b, c) {
if (data == "True") { if (data == "True") {
$("#template-wizard").unbind('submit').submit() $("#template-wizard").unbind('submit').submit()
......
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %}
{% block js %} {% block js %}
<script type="text/javascript"> <script type="text/javascript">
...@@ -8,14 +9,14 @@ ...@@ -8,14 +9,14 @@
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
dataType: 'json', dataType: 'json',
url: '/ajax/vm/status/{{ id }}', url: '{% url one.views.vm_ajax_instance_status id %}',
success: function(data){ success: function(data){
if( !data.booting && data.state == 'ACTIVE'){ if (!data.booting && data.state == 'ACTIVE'){
window.location.reload(); window.location.reload();
} }
} }
}) })
},2000); }, 1000);
{% endif %} {% endif %}
</script> </script>
{% endblock %} {% endblock %}
...@@ -61,13 +62,13 @@ ...@@ -61,13 +62,13 @@
<div class="content"> <div class="content">
{% if state == "PENDING" or state == "ACTIVE" and booting %} {% if state == "PENDING" or state == "ACTIVE" and booting %}
<p style="font-size:25px; line-height:2em;text-align:center;"> <p style="font-size:25px; line-height:2em;text-align:center;">
<img src="/static/image/load.gif" /> <img src="{% static "image/load.gif" %}" />
{% trans "Starting..." %} {% trans "Starting..." %}
</p> </p>
{% elif state == "ACTIVE" and not booting %} {% elif state == "ACTIVE" and not booting %}
<p id="connect" style="display:block; font-size:25px; line-height:2em;text-align:center;"> <p id="connect" style="display:block; font-size:25px; line-height:2em;text-align:center;">
<a href="{{uri}}" class="button" onclick="return connectbutton();"> <a href="{{uri}}" class="button" onclick="return connectbutton();">
<img src="/static/image/load.gif" id="connecting" style="display:none;" /> <img src="{% static "image/load.gif" %}" id="connecting" style="display:none;" />
{% trans "Running" %} {% trans "Running" %}
</a> </a>
</p> </p>
...@@ -91,7 +92,7 @@ ...@@ -91,7 +92,7 @@
<h2> <h2>
<div class="boxhelp"> <div class="boxhelp">
<div class="icon"> <div class="icon">
<img src="/static/icons/information-frame.png" alt="{% trans "Help" %}" /> <img src="{% static "icons/information-frame.png" %}" alt="{% trans "Help" %}" />
</div> </div>
<div class="boxhelp-box"> <div class="boxhelp-box">
<p>{% blocktrans %}This is a list about the network ports <p>{% blocktrans %}This is a list about the network ports
...@@ -107,7 +108,7 @@ ...@@ -107,7 +108,7 @@
</div> </div>
{% trans "Port administration" %}</h2> {% trans "Port administration" %}</h2>
<div class="content"> <div class="content">
<form action="{% url vm_port_add i.id %}" method="post"> <form action="{% url one.views.vm_port_add i.id %}" method="post">
{% csrf_token %} {% csrf_token %}
<table> <table>
<tr> <tr>
...@@ -121,7 +122,7 @@ ...@@ -121,7 +122,7 @@
<td>{{port.public}}</td> <td>{{port.public}}</td>
{% if i.template.network.nat %}<td>{{port.private}}</td>{%endif%} {% if i.template.network.nat %}<td>{{port.private}}</td>{%endif%}
<td> <td>
<a href="/vm/port_del/{{i.id}}/{{port.proto}}/{{port.public}}/">{% trans "Delete" %}</a> <a href="{% url one.views.vm_port_del i.id port.proto port.public %}">{% trans "Delete" %}</a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
......
{% load i18n %} {% load i18n %}
{% load staticfiles %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<div class="content"> <div class="content">
<table> <table>
...@@ -8,7 +9,7 @@ ...@@ -8,7 +9,7 @@
<div class="boxhelp"> <div class="boxhelp">
<div class="icon"> <div class="icon">
<img src="/static/icons/information-frame.png" alt="{% trans "Help" %}" /> <img src="{% static "icons/information-frame.png" %}" alt="{% trans "Help" %}" />
</div> </div>
<div class="boxhelp-box"> <div class="boxhelp-box">
{% if i.template.os_type == 'linux' %} {% if i.template.os_type == 'linux' %}
......
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