Commit a8bc5968 by Dányi Bence

webui: template reindent

parent 30e712c1
...@@ -6,60 +6,55 @@ ...@@ -6,60 +6,55 @@
<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="icon" type="image/png" href="one/static/favicon.png">
<link rel="stylesheet/less" href="/static/style.less" /> <link rel="stylesheet/less" href="/static/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/jquery.min.js"></script> <script src="/static/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">
/*less = { window.localStorage.clear();
env: 'developement'
};*/
</script> </script>
<script src="/static/less.min.js"></script> <script src="/static/less.min.js"></script>
<script src="/static/knockout.min.js"></script> <script src="/static/knockout.min.js"></script>
<script type="text/javascript" src="/static/cloud.js"></script> <script type="text/javascript" src="/static/cloud.js"></script>
{{ form.media }} {{ form.media }}
{% block js %}{% endblock %} {% block js %}{% endblock %}
</head> </head>
<body> <body>
<div id="header"> <div id="header">
{% block login %} {% block login %}
<div id="loginblock"><p> <div id="loginblock"><p>
{% if user.is_authenticated %} {% if user.is_authenticated %}
Bejelentkezve: {{ user.username }}. Bejelentkezve: {{ user.username }}.
<a href="/logout/">Kijelentkezés</a>. <a href="/logout/">Kijelentkezés</a>.
{% if user.is_staff %} {% if user.is_staff %}
<a href="/admin/">Admin</a>. <a href="/admin/">Admin</a>.
{% endif %} {% endif %}
{% else %} {% else %}
<a href="/login/">Bejelentkezés</a>. <a href="/login/">Bejelentkezés</a>.
{% endif %} {% endif %}
{% if lang == 'hu' %} {% if lang == 'hu' %}
<a href="/language/en/">In English</a>. <a href="/language/en/">In English</a>.
{% else %} {% else %}
<a href="/language/hu/">Magyarul</a>. <a href="/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="/">IK Cloud</a></h1>
{% endblock %} {% endblock %}
{% endblock %} {% endblock %}
</div> </div>
{% block messages %} {% block messages %}
{% if messages %} {% if messages %}
<ul class="messagelist">{% for message in messages %} <ul class="messagelist">
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li> {% for message in messages %}
{% endfor %}</ul> <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
{% endif %} {% endfor %}
</ul>
{% endif %}
{% endblock messages %} {% endblock messages %}
<div id="content"> <div id="content">
{% block content %}{% endblock %} {% block content %}{% endblock %}
<div class="clear"></div> <div class="clear"></div>
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<div class="boxes"> <div class="boxes">
<div class="contentblock"> <div class="contentblock">
<h2> <h2>{% trans "Data store" %}</h2>
{% trans "Data store" %}
</h2>
<div class="content"> <div class="content">
<ul class="file-list"> <ul class="file-list">
<li class="wm small" id="current-location"> <li class="wm small" id="current-location">
...@@ -16,7 +14,12 @@ ...@@ -16,7 +14,12 @@
<option value="size">Méret szerint</option> <option value="size">Méret szerint</option>
</select> </select>
</div> </div>
<div class="name"><small>Jelenlegi hely: <span data-bind="text: currentPath"></span></small></div> <div class="name">
<small>
Jelenlegi hely:
<span data-bind="text: currentPath"></span>
</small>
</div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</li> </li>
...@@ -24,9 +27,7 @@ ...@@ -24,9 +27,7 @@
<ul class="file-list" id="file-list"> <ul class="file-list" id="file-list">
<li class="wm real" data-bind="visible: notInRoot, click: jumpUp"> <li class="wm real" data-bind="visible: notInRoot, click: jumpUp">
<div class="summary"> <div class="summary">
<div class="name filetype-jump-out"> <div class="name filetype-jump-out">..</div>
..
</div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</li> </li>
...@@ -57,14 +58,19 @@ ...@@ -57,14 +58,19 @@
<div class="details"> <div class="details">
<div class="details-container"> <div class="details-container">
<ul> <ul>
<li class="date">{% trans "Last modification" %}: <small class="value" data-bind="text: mTime"></small></li> <li class="date">
<li class="filetype-text">{% trans "Type" %}: <span class="value" data-bind="text: type"></span></li> {% trans "Last modification" %}:
<small class="value" data-bind="text: mTime"></small>
</li>
<li class="filetype-text">
{% trans "Type" %}:
<span class="value" data-bind="text: type"></span>
</li>
</ul> </ul>
</div> </div>
</div> </div>
</li> </li>
<!-- /ko --> <!-- /ko --> </ul>
</ul>
<ul class="file-list"> <ul class="file-list">
<li class="wm small-row"> <li class="wm small-row">
<div class="summary" id="new-folder"> <div class="summary" id="new-folder">
...@@ -88,7 +94,11 @@ ...@@ -88,7 +94,11 @@
<div class="container"> <div class="container">
<div id="upload-zone" class="upload-zone"> <div id="upload-zone" class="upload-zone">
<p>{% trans "Drag and drop files here to start uploading." %}</p> <p>{% trans "Drag and drop files here to start uploading." %}</p>
<p>{% trans 'You can also use the <a href="#" id="old-upload">the traditional upload form</a>.' %}</p> <p>
{% trans 'You can also use the
<a href="#" id="old-upload">the traditional upload form</a>
.' %}
</p>
<p>{% trans 'Upload limit is 1GB per file!' %}</p> <p>{% trans 'Upload limit is 1GB per file!' %}</p>
</div> </div>
<div style="display: none" id="upload-progress-text" class="upload-zone"></div> <div style="display: none" id="upload-progress-text" class="upload-zone"></div>
...@@ -114,8 +124,11 @@ ...@@ -114,8 +124,11 @@
<div class="softLimit" data-bind="style: {left: quota.softPos}"></div> <div class="softLimit" data-bind="style: {left: quota.softPos}"></div>
</div> </div>
<div class="name"> <div class="name">
{% trans "File quota" %}: <abbr data-bind="text: quota.used" title="{% trans "Used space" %}"></abbr>/<abbr data-bind="text: quota.soft" title="{% trans "soft limit" %}"></abbr> {% trans "File quota" %}: <abbr data-bind="text: quota.used" title="{% trans "Used space" %}"></abbr>
(<abbr title="{% trans "hard limit" %}" data-bind="text: quota.hard"></abbr>) / <abbr data-bind="text: quota.soft" title="{% trans "soft limit" %}"></abbr>
(
<abbr title="{% trans "hard limit" %}" data-bind="text: quota.hard"></abbr>
)
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<div class="boxes" id="groups"> <div class="boxes" id="groups">
<div class="contentblock"> <div class="contentblock">
<h2> <h2>{% trans "My Groups" %}</h2>
{% trans "My Groups" %}
</h2>
<div class="content"> <div class="content">
<ul class="wm-list"> <ul class="wm-list">
{% if groups %} {% if groups %}
...@@ -45,7 +43,9 @@ ...@@ -45,7 +43,9 @@
</li> </li>
<li> <li>
&nbsp; &nbsp;
<span class="value"><a href="/group/show/{{group.id}}">{% trans "More details" %}</a></span> <span class="value">
<a href="/group/show/{{group.id}}">{% trans "More details" %}</a>
</span>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -54,9 +54,7 @@ ...@@ -54,9 +54,7 @@
{% else %} {% else %}
<div id="new-wm-tooltip"> <div id="new-wm-tooltip">
<div id="new-wm-tooltip-container"> <div id="new-wm-tooltip-container">
<p> <p>{% trans "You have no groups." %}</p>
{% trans "You have no groups." %}
</p>
<p> <p>
{% trans "Create a new one, and add your students to the new group." %} {% trans "Create a new one, and add your students to the new group." %}
</p> </p>
...@@ -89,19 +87,23 @@ ...@@ -89,19 +87,23 @@
<textarea name="members" placeholder="{% trans 'Student NEPTUN codes, one per line' %}" id="new-group-members"></textarea> <textarea name="members" placeholder="{% trans 'Student NEPTUN codes, one per line' %}" id="new-group-members"></textarea>
</p> </p>
<!--<h4>{% trans "Summary" %}</h4> <!--<h4>{% trans "Summary" %}</h4>
<p> <p> <strong>{% trans "Group name" %}:</strong>
<strong>{% trans "Group name" %}:</strong> <span id="new-group-summary-name"></span><br /> <span id="new-group-summary-name"></span>
<strong>{% trans "Semester" %}:</strong> <span id="new-group-summary-semester"></span><br /> <br /> <strong>{% trans "Semester" %}:</strong>
<strong>{% trans "Member count" %}:</strong> <span id="new-group-summary-count"></span><br /> <span id="new-group-summary-semester"></span>
</p>--> <br />
<p> <strong>{% trans "Member count" %}:</strong>
{% csrf_token %} <span id="new-group-summary-count"></span>
<input type="submit" value="{% trans "Done" %}"> <br />
</p> </p>
</form> -->
</div> <p>
</li> {% csrf_token %}
</ul> <input type="submit" value="{% trans "Done" %}"></p>
</div> </form>
</div>
</li>
</ul>
</div> </div>
</div> </div>
</div>
{% load i18n %} {% load i18n %}
{% load l10n %} {% load l10n %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<div class="contentblock" id="template"> <div class="contentblock" id="template">
<h2>{% trans "Templates" %}</h2> <h2>{% trans "Templates" %}</h2>
<ul class="wm-list"> <ul class="wm-list">
{% for t in mytemplates %} {% for t in mytemplates %}
<li class="wm" id="t{{t.id }}"> <li class="wm" id="t{{t.id }}">
<div class="summary {% if t.state == 'NEW' or t.state == 'SAVING'%}unfinished{% endif %}"> <div class="summary {% if t.state == 'NEW' or t.state == 'SAVING'%}unfinished{% endif %}">
<div class="name"> <div class="name">{{t.name}}</div>
{{t.name}}
</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" %}"/></a> <img src="/static/icons/control.png" alt="{% trans "Start" %}"/>
<a href="#" title="{% 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" %}"><img src="/static/icons/user-share.png" alt="{% trans "Share" %}" /></a> <a href="#" title="{% trans "Edit" %}">
{% endif %} <img src="/static/icons/pencil.png" alt="{% trans "Edit" %}" />
<a href="#" class="delete-template-button" data-id="{{ t.id }}" data-name="{{ t.name }}" title="{% trans "Remove" %}"><img src="/static/icons/minus-circle.png" alt="{% trans "Remove" %}" /></a> </a>
</div> <a href="#" class="template-share" data-id="{{t.id}}" data-gid="{{group.id}}" title="{% trans "Share" %}">
<div class="clear"></div> <img src="/static/icons/user-share.png" alt="{% trans "Share" %}" />
{% if t.myshares %} </a>
<ul class="shares">
{% for i in t.myshares %}
<li>
<div class="quota">
<div class="used" style="width: {{ i.get_instance_pc|unlocalize }}%"></div>
</div>
<form action="/vm/unshare/{{i.id}}/" method="post">
<span title="{{i.name}}">{{i.name|truncatechars:20}}</span>
({{i.get_running}}/{{i.instance_limit}} = {{i.get_instance_pc}}%)
{% csrf_token %}
<input type="submit" value="{% trans "Delete" %}" style="float: right"/>
</form>
<div class="clear"></div>
</li>
{% endfor %}
</ul>
{% endif %} {% endif %}
<a href="#" class="delete-template-button" data-id="{{ t.id }}" data-name="{{ t.name }}" title="{% trans "Remove" %}">
<img src="/static/icons/minus-circle.png" alt="{% trans "Remove" %}" />
</a>
</div> </div>
<div class="details"> <div class="clear"></div>
<ul> {% if t.myshares %}
<li class="name">{% trans "System" %}: <span class="value">{{t.system}}</span><div class="clear"></div></li> <ul class="shares">
<li class="type">{% trans "Size" %}: <span class="value">{{t.instance_type}}: {% for i in t.myshares %}
<li>
<div class="quota">
<div class="used" style="width: {{ i.get_instance_pc|unlocalize }}%"></div>
</div>
<form action="/vm/unshare/{{i.id}}/" method="post">
<span title="{{i.name}}">{{i.name|truncatechars:20}}</span>
({{i.get_running}}/{{i.instance_limit}} = {{i.get_instance_pc}}%)
{% csrf_token %}
<input type="submit" value="{% trans "Delete" %}" style="float: right"/>
</form>
<div class="clear"></div>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
<div class="details">
<ul>
<li class="name">
{% trans "System" %}:
<span class="value">{{t.system}}</span>
<div class="clear"></div>
</li>
<li class="type">
{% trans "Size" %}:
<span class="value">
{{t.instance_type}}:
<span class="cpu">{{t.instance_type.CPU}}</span> <span class="cpu">{{t.instance_type.CPU}}</span>
<span class="memory">{{t.instance_type.RAM}}</span> <span class="memory">{{t.instance_type.RAM}}</span>
<span class="credit">{{t.instance_type.credit}}</span> <span class="credit">{{t.instance_type.credit}}</span>
</span></li> </span>
<li class="description">{% trans "Description" %}: <span class="value">{{t.description}}</span><div class="clear"></div></li> </li>
<li class="date" >{% trans "Created at" %}: <span class="value">{{t.created_at}} ({{t.owner.get_profile}})</span><div class="clear"></div></li> <li class="description">
<li class="count">{% trans "Running instances" %}: <span class="value">{{ t.running_instances }}</span></li> {% trans "Description" %}:
</ul> <span class="value">{{t.description}}</span>
</div> <div class="clear"></div>
</li> </li>
{% endfor %} <li class="date" >
{% trans "Created at" %}:
<span class="value">{{t.created_at}} ({{t.owner.get_profile}})</span>
<div class="clear"></div>
</li>
<li class="count">
{% trans "Running instances" %}:
<span class="value">{{ t.running_instances }}</span>
</li>
</ul>
</div>
</li>
{% endfor %}
{% if not mytemplates and not group %} {% if not mytemplates and not group %}
<div id="new-wm-tooltip"> <div id="new-wm-tooltip">
<div id="new-wm-tooltip-container"> <div id="new-wm-tooltip-container">
<p> <p>{% trans "You have no own templates." %}</p>
{% trans "You have no own templates." %} <p>
</p> {% trans "Create a new one, and share it with your students. Or you can also use a common one." %}
<p> </p>
{% trans "Create a new one, and share it with your students. Or you can also use a common one." %} <div id="new-wm-tooltip-tail"></div>
</p> </div>
<div id="new-wm-tooltip-tail"></div> </div>
</div> {% endif %}
</div>
{% endif %}
{% if not group %} {% if not group %}
<li id="new-template-button" class="wm new"> <li id="new-template-button" class="wm new">
<div class="summary"> <div class="summary">
<div class="name">Új Sablon</div> <div class="name">Új Sablon</div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</li> </li>
{% endif %} {% endif %}
{% if publictemplates %} {% if publictemplates %}
{% for t in publictemplates %} {% for t in publictemplates %}
<li class="wm" id="t{{t.id }}"> <li class="wm" id="t{{t.id }}">
<div class="summary public-template"> <div class="summary public-template">
<div class="name"> <div class="name">{{t.name}}</div>
{{t.name}} <div class="status">{{t.state}}</div>
</div> <div class="actions">
<div class="status">{{t.state}}</div> {% if t.state == 'READY' %}
<div class="actions"> <a href="#" class="try-template-button" data-id="{{t.id}}" title="{% trans "Try" %}">
{% if t.state == 'READY' %} <img src="/static/icons/control.png" alt="{% trans "Start" %}"/>
<a href="#" class="try-template-button" data-id="{{t.id}}" title="{% trans "Try" %}"> </a>
<img src="/static/icons/control.png" alt="{% trans "Start" %}"/></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" %}" /></a> <img src="/static/icons/user-share.png" alt="{% trans "Share" %}" />
{% endif %} </a>
</div>
<div class="clear"></div>
{% if t.myshares %}
<ul class="shares">
{% for i in t.myshares %}
<li>
<div class="quota">
<div class="used" style="width: {{ i.get_instance_pc|unlocalize }}%"></div>
</div>
<form action="/vm/unshare/{{i.id}}/" method="post">
<span title="{{i.name}}">{{i.name|truncatechars:20}}</span>
({{i.get_running}}/{{i.instance_limit}} = {{i.get_instance_pc}}%)
{% csrf_token %}
<input type="submit" value="{% trans "Delete" %}" style="float: right"/>
</form>
<div class="clear"></div>
</li>
{% endfor %}
</ul>
{% endif %} {% endif %}
</div> </div>
<div class="details"> <div class="clear"></div>
<ul> {% if t.myshares %}
<li class="name">{% trans "System" %}: <span class="value">{{t.system}}</span><div class="clear"></div></li> <ul class="shares">
<li class="type">{% trans "Size" %}: <span class="value">{{t.instance_type}}: {% for i in t.myshares %}
<li>
<div class="quota">
<div class="used" style="width: {{ i.get_instance_pc|unlocalize }}%"></div>
</div>
<form action="/vm/unshare/{{i.id}}/" method="post">
<span title="{{i.name}}">{{i.name|truncatechars:20}}</span>
({{i.get_running}}/{{i.instance_limit}} = {{i.get_instance_pc}}%)
{% csrf_token %}
<input type="submit" value="{% trans "Delete" %}" style="float: right"/>
</form>
<div class="clear"></div>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
<div class="details">
<ul>
<li class="name">
{% trans "System" %}:
<span class="value">{{t.system}}</span>
<div class="clear"></div>
</li>
<li class="type">
{% trans "Size" %}:
<span class="value">
{{t.instance_type}}:
<span class="cpu">{{t.instance_type.CPU}}</span> <span class="cpu">{{t.instance_type.CPU}}</span>
<span class="memory">{{t.instance_type.RAM}}</span> <span class="memory">{{t.instance_type.RAM}}</span>
<span class="credit">{{t.instance_type.credit}}</span> <span class="credit">{{t.instance_type.credit}}</span>
</span></li> </span>
<li class="description">{% trans "Description" %}: <span class="value">{{t.description}}</span><div class="clear"></div></li> </li>
<li class="date" >{% trans "Created at" %}: <span class="value">{{t.created_at}} ({{t.owner.get_profile}})</span><div class="clear"></div></li> <li class="description">
<li class="count">{% trans "Running instances" %}: <span class="value">{{t.running_instances}}</span></li> {% trans "Description" %}:
</ul> <span class="value">{{t.description}}</span>
</div> <div class="clear"></div>
</li> </li>
{% endfor %} <li class="date" >
{% trans "Created at" %}:
<span class="value">{{t.created_at}} ({{t.owner.get_profile}})</span>
<div class="clear"></div>
</li>
<li class="count">
{% trans "Running instances" %}:
<span class="value">{{t.running_instances}}</span>
</li>
</ul>
</div>
</li>
{% endfor %}
{% endif %} {% endif %}
<li class="wm small"> <li class="wm small">
<div class="summary"> <div class="summary">
<div class="quota"> <div class="quota">
<div class="used" style="background-color: rgba(0,255,0,0.2); width: {{userdetails.get_share_pc|unlocalize}}%"></div> <div class="used" style="background-color: rgba(0,255,0,0.2); width: {{userdetails.get_share_pc|unlocalize}}%"></div>
</div> </div>
<div class="name">{% blocktrans with used=userdetails.get_weighted_share_count all=userdetails.share_quota %}Share quota: {{used}}/{{all}}{% endblocktrans %}</div> <div class="name">
<div class="clear"></div> {% blocktrans with used=userdetails.get_weighted_share_count all=userdetails.share_quota %}Share quota: {{used}}/{{all}}{% endblocktrans %}
</div> </div>
</li> <div class="clear"></div>
</ul> </div>
</div> </li>
</ul>
</div>
...@@ -3,84 +3,120 @@ ...@@ -3,84 +3,120 @@
{% if instances %} {% if instances %}
{% for i in instances %} {% for i in instances %}
<li class="wm {% if id == i.id %}opened{% endif %}"> <li class="wm {% if id == i.id %}opened{% endif %}">
<div class="summary {% if id == i.id %}selected-summary{% endif %} {% if i.template.state == "NEW" %}unfinished{% endif %}"> <div class="summary {% if id == i.id %}selected-summary{% endif %} {% if i.template.state == "NEW" %}unfinished{% endif %}">
<!--<div class="id"></div>--> <!--<div class="id"></div>
<div class="name {% if i.state == 'ACTIVE' %}wm-on{% else %}wm-off{% endif %}"> -->
{{i.name|truncatechars:20}} <div class="name {% if i.state == 'ACTIVE' %}wm-on{% else %}wm-off{% endif %}">{{i.name|truncatechars:20}}</div>
</div> <div class="status">{{i.state}}</div>
<div class="status"> <div class="actions">
{{i.state}} {% if i.state == 'ACTIVE' %}
</div> <a href="{{i.get_connect_uri}}" data-id="{{ i.id }}" class="connect-vm-button" title="{% trans "Connect" %}">
<div class="actions"> <img src="/static/icons/plug.png" alt="{% trans "Connect" %}" />
{% if i.state == 'ACTIVE' %} </a>
<a href="{{i.get_connect_uri}}" data-id="{{ i.id }}" class="connect-vm-button" title="{% trans "Connect" %}"> <a href="#" class="stop-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Pause" %}">
<img src="/static/icons/plug.png" alt="{% trans "Connect" %}" /> <img src="/static/icons/control-pause.png" alt="{% trans "Pause" %}" />
</a> </span>
<a href="#" class="stop-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Pause" %}"> <a href="#" class="delete-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Delete" %}">
<img src="/static/icons/control-pause.png" alt="{% trans "Pause" %}" /> <img src="/static/icons/minus-circle.png" alt="{% trans "Delete" %}" />
</span> </a>
<a href="#" class="delete-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Delete" %}"> <a href="#" class="restart-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Restart" %}">
<img src="/static/icons/minus-circle.png" alt="{% trans "Delete" %}" /> <img src="/static/icons/arrow-circle-double.png" alt="↺" />
</a> </a>
<a href="#" class="restart-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Restart" %}"> {% endif %}
<img src="/static/icons/arrow-circle-double.png" alt="↺" />
</a>
{% endif %}
{% if i.state == 'PENDING' %} {% if i.state == 'PENDING' %}
<img src="/static/load.gif" /> {% trans "starting…" %} <img src="/static/load.gif" />
{% trans "starting…" %}
{% endif %} {% endif %}
{% if i.state == 'STOPPED' %} {% if i.state == 'STOPPED' %}
<a href="#" class="resume-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Resume" %}"> <a href="#" class="resume-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Resume" %}">
<img src="/static/icons/control.png" alt="{% trans "Resume" %}" /> <img src="/static/icons/control.png" alt="{% trans "Resume" %}" />
</span> </span>
<a href="#" class="delete-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Delete" %}"> <a href="#" class="delete-vm-button" data-name="{{ i.name}}" data-id="{{ i.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 %}
{% if i.state == 'FAILED' %} {% if i.state == 'FAILED' %}
<a href="#" class="delete-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Delete" %}"> <a href="#" class="delete-vm-button" data-name="{{ i.name}}" data-id="{{ i.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 %}
</div>
<div class="clear"></div>
</div> </div>
<div class="details"> <div class="clear"></div>
<div class="details-container"> </div>
<ul> <div class="details">
<li class="name">{% trans "Hostname" %}: <span class="value">{{i.name}}</span><div class="clear"></div></li> <div class="details-container">
<li class="os-{{i.template.os_type}}">{% trans "System" %}: <span class="value">{{i.template.system}}</span><div class="clear"></div></li> <ul>
<li class="template">{% trans "Type" %}: <span class="value">{{i.share.type}}</span><div class="clear"></div></li> <li class="name">
<li class="template">{% trans "Share" %}: <span class="value">{{i.share.name}}</span><div class="clear"></div></li> {% trans "Hostname" %}:
<li class="template">{% trans "Template" %}: <span class="value">{{i.template.name}}</span><div class="clear"></div></li> <span class="value">{{i.name}}</span>
<li class="type">{% trans "Size" %}: <span class="value">{{i.template.instance_type.name}}: <div class="clear"></div>
</li>
<li class="os-{{i.template.os_type}}">
{% trans "System" %}:
<span class="value">{{i.template.system}}</span>
<div class="clear"></div>
</li>
<li class="template">
{% trans "Type" %}:
<span class="value">{{i.share.type}}</span>
<div class="clear"></div>
</li>
<li class="template">
{% trans "Share" %}:
<span class="value">{{i.share.name}}</span>
<div class="clear"></div>
</li>
<li class="template">
{% trans "Template" %}:
<span class="value">{{i.template.name}}</span>
<div class="clear"></div>
</li>
<li class="type">
{% trans "Size" %}:
<span class="value">
{{i.template.instance_type.name}}:
<span class="cpu">{{i.template.instance_type.CPU}}</span> <span class="cpu">{{i.template.instance_type.CPU}}</span>
<span class="memory">{{i.template.instance_type.RAM}}</span> <span class="memory">{{i.template.instance_type.RAM}}</span>
<span class="credit">{{i.template.instance_type.credit}}</span> <span class="credit">{{i.template.instance_type.credit}}</span>
</span></li> </span>
<li class="date">{% trans "Created at" %}: <span class="value">{{i.created_at}}</span></li> </li>
{% if i.time_of_suspend %} <li class="date">
<li class="date">{% trans "time of suspend"|capfirst %}: <span class="value"><abbr title="{{i.time_of_suspend}}">{{i.time_of_suspend|timeuntil}}</abbr></span></li> {% trans "Created at" %}:
{% endif %} <span class="value">{{i.created_at}}</span>
</li>
{% if i.time_of_suspend %}
<li class="date">
{% trans "time of suspend"|capfirst %}:
<span class="value"> <abbr title="{{i.time_of_suspend}}">{{i.time_of_suspend|timeuntil}}</abbr>
</span>
</li>
{% endif %}
{% if i.time_of_delete %} {% if i.time_of_delete %}
<li class="date">{% trans "time of delete"|capfirst %}: <span class="value"><abbr title="{{i.time_of_delete}}">{{i.time_of_delete|timeuntil}}</abbr></span></li> <li class="date">
{% endif %} {% trans "time of delete"|capfirst %}:
<li>&nbsp;<span class="value"><a href="/vm/show/{{i.id}}/" title="{{i.name}}">{% trans "More details" %}</a></span></li> <span class="value"> <abbr title="{{i.time_of_delete}}">{{i.time_of_delete|timeuntil}}</abbr>
</ul> </span>
</div> </li>
{% endif %}
<li>
&nbsp;
<span class="value">
<a href="/vm/show/{{i.id}}/" title="{{i.name}}">{% trans "More details" %}</a>
</span>
</li>
</ul>
</div> </div>
</div>
</li> </li>
{% endfor %} {% endfor %}
{% else %} {% else %}
<div id="new-wm-tooltip"> <div id="new-wm-tooltip">
<div id="new-wm-tooltip-container"> <div id="new-wm-tooltip-container">
<p> <p>{% trans "You have not started any machines yet." %}</p>
{% trans "You have not started any machines yet." %} <p>
</p> {% trans "Choose a template, and you can use the system in a minute." %}
<p> </p>
{% trans "Choose a template, and you can use the system in a minute." %} <div id="new-wm-tooltip-tail"></div>
</p> </div>
<div id="new-wm-tooltip-tail"></div>
</div>
</div> </div>
{% endif %} {% endif %}
...@@ -7,7 +7,10 @@ ...@@ -7,7 +7,10 @@
<div class="content"> <div class="content">
<form action="{% url vm_delete i.id %}" method="post"> <form action="{% url vm_delete i.id %}" method="post">
{% csrf_token %} {% csrf_token %}
<p>{% trans "Are you sure?" %} <input type="submit" value="{% trans "Remove" %}" /></p> <p>
{% trans "Are you sure?" %}
<input type="submit" value="{% trans "Remove" %}" />
</p>
</form> </form>
</div> </div>
</div> </div>
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
{% load i18n %} {% load i18n %}
{% load l10n %} {% load l10n %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
{% block content %} {% block content %}
<div class="boxes"> <div class="boxes">
<div class="contentblock" id="state"> <div class="contentblock" id="state">
...@@ -17,9 +15,9 @@ ...@@ -17,9 +15,9 @@
</div> </div>
</li> </li>
<li id="new-wm" style="display: none"> <li id="new-wm" style="display: none">
<h2>{% trans "Available shares" %}</h2> <h2>{% trans "Available shares" %}</h2>
<p> <p>
{% trans "Choose one of the following shared templates to launch." %} {% trans "Choose one of the following shared templates to launch." %}
</p> </p>
<div class="container"> <div class="container">
<ul class="wm-list modal"> <ul class="wm-list modal">
...@@ -27,29 +25,52 @@ ...@@ -27,29 +25,52 @@
<li class="wm"> <li class="wm">
<div class="summary"> <div class="summary">
<div class="quota"> <div class="quota">
<div class="used" style="width:{% if s.running_shared >= s.per_user_limit %}100%{% else %}{{ s.get_instance_pc|unlocalize }}%{% endif %}"/></div> <div class="used" style="width:{% if s.running_shared >= s.per_user_limit %}100%{% else %}{{ s.get_instance_pc|unlocalize }}%{% endif %}"/>
</div>
</div> </div>
<div class="name wm-on">{{s.name}} - {{ s.group.name }} ({{ s.running_shared }}/{{ s.per_user_limit }})</div> <div class="name wm-on">
<div class="status"> {{s.name}} - {{ s.group.name }} ({{ s.running_shared }}/{{ s.per_user_limit }})
{{s.get_running}}/{{s.instance_limit}}
</div> </div>
<div class="status">{{s.get_running}}/{{s.instance_limit}}</div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="details"> <div class="details">
<div class="details-container"> <div class="details-container">
<ul> <ul>
<li class="os-{{s.template.os_type}}">{% trans "System" %}: <span class="value">{{s.template.system}}</span><div class="clear"></div></li> <li class="os-{{s.template.os_type}}">
<li class="type">{% trans "Size" %}: <span class="value">{{s.template.instance_type.name}}</span></li> {% trans "System" %}:
<li class="share-type">{% trans "Type" %}: <span class="value">{{s.type }}</span></li> <span class="value">{{s.template.system}}</span>
<li class="memory">{% trans "Memory" %}: <div class="clear"></div>
<span class="value">{% blocktrans with m=s.template.instance_type.RAM %}{{m}} MiB{% endblocktrans %}</span></li> </li>
<li class="cpu">{% trans "CPU cores" %}: <span class="value">{{s.template.instance_type.CPU}}</span></li> <li class="type">
<li class="description">{% trans "Description" %}:<span class="value">{{s.description}}</span><div class="clear"></div></li> {% trans "Size" %}:
<span class="value">{{s.template.instance_type.name}}</span>
</li>
<li class="share-type">
{% trans "Type" %}:
<span class="value">{{s.type }}</span>
</li>
<li class="memory">
{% trans "Memory" %}:
<span class="value">
{% blocktrans with m=s.template.instance_type.RAM %}{{m}} MiB{% endblocktrans %}
</span>
</li>
<li class="cpu">
{% trans "CPU cores" %}:
<span class="value">{{s.template.instance_type.CPU}}</span>
</li>
<li class="description">
{% trans "Description" %}:
<span class="value">{{s.description}}</span>
<div class="clear"></div>
</li>
<li> <li>
&nbsp; &nbsp;
<span class="value"> <span class="value">
<form method="POST" action="/vm/new/s{{s.pk}}/">{% csrf_token %} <form method="POST" action="/vm/new/s{{s.pk}}/">
<input {% if s.running_shared >= s.per_user_limit or s.get_running >= s.instance_limit%}disabled{% endif %} type="submit" value="{% trans "Launch" %}"/> {% csrf_token %}
<input {% if s.running_shared >= s.per_user_limit or s.get_running >= s.nstance_limit%}disabled{% endif %} type="submit" value="{% trans "Launch" %}"/>
</form> </form>
</span> </span>
<div class="clear"></div> <div class="clear"></div>
...@@ -67,7 +88,9 @@ ...@@ -67,7 +88,9 @@
<div class="quota"> <div class="quota">
<div class="used" style="background-color: rgba(0,255,0,0.2); width: {{userdetails.get_instance_pc|unlocalize}}%"></div> <div class="used" style="background-color: rgba(0,255,0,0.2); width: {{userdetails.get_instance_pc|unlocalize}}%"></div>
</div> </div>
<div class="name">{% blocktrans with used=userdetails.get_weighted_instance_count all=userdetails.instance_quota %}Personal quota: {{used}}/{{all}}{% endblocktrans %}</div> <div class="name">
{% blocktrans with used=userdetails.get_weighted_instance_count all=userdetails.instance_quota %}Personal quota: {{used}}/{{all}}{% endblocktrans %}
</div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</li> </li>
...@@ -75,12 +98,10 @@ ...@@ -75,12 +98,10 @@
</div> </div>
{% for box in boxes %} {% for box in boxes %}
{% if forloop.counter0|divisibleby:2 %} {% if forloop.counter0|divisibleby:2 %}
<div class="contentblock"> <div class="contentblock">
<h2>{{ box.title }}</h2> <h2>{{ box.title }}</h2>
<div class="content"> <div class="content">{{ box.text|safe }}</div>
{{ box.text|safe }} </div>
</div>
</div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% include "box-templatelist.html" %} {% include "box-templatelist.html" %}
......
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% block content %} {% block content %}
<div class="boxes"> <div class="boxes">
<div class="contentblock" id="project_closed"> <div class="contentblock" id="project_closed">
<h2>Bejelentkezés</h2> <h2>Bejelentkezés</h2>
<div class="content"> <div class="content">
<p>A tesztüzem alatt a felhasználók belépése és azonosítása "önbevallásos" alapon működik (a jövőben <a href="http://login.bme.hu/">EduID-s</a> bejelentkezésre lesz lehetőség):</p> <p>
<form action="/login/" method="POST">{% csrf_token %} A tesztüzem alatt a felhasználók belépése és azonosítása "önbevallásos" alapon működik (a jövőben
<p><label>NEPTUN-kód: <input maxlength="8" size="8" type="text" name="neptun" required pattern="[A-Z][A-Z0-9]{5}" onkeyup="javascript:this.value=this.value.toUpperCase();"/></label></p> <a href="http://login.bme.hu/">EduID-s</a>
<p><label>Jelszó: <input maxlength="8" size="8" type="password" name="pw" required /></label></p> bejelentkezésre lesz lehetőség):
<p><input type="hidden" name="next" value="{{nex}}"/><input type="submit" value="Bejelentkezés"/></label></p> </p>
</div> <form action="/login/" method="POST">
{% csrf_token %}
<p>
<label>
NEPTUN-kód:
<input maxlength="8" size="8" type="text" name="neptun" required pattern="[A-Z][A-Z0-9]{5}" onkeyup="javascript:this.value=this.value.toUpperCase();"/>
</label>
</p>
<p>
<label>
Jelszó:
<input maxlength="8" size="8" type="password" name="pw" required />
</label>
</p>
<p>
<input type="hidden" name="next" value="{{nex}}"/>
<input type="submit" value="Bejelentkezés"/>
</p>
</form>
</div> </div>
</div>
</div>
</div> </div>
{% endblock %} {% endblock %}
{% 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">{% csrf_token %} <form action="/ajax/share/{{base.id}}/" method="post" id="template-wizard">
{% csrf_token %}
<div id="new-share" class="wizard"> <div id="new-share" class="wizard">
<h2>{% blocktrans with t=base.name%}Sharing template: {{t}}{% endblocktrans %}</h2> <h2>
{% blocktrans with t=base.name%}Sharing template: {{t}}{% endblocktrans %}
</h2>
{% if not group %} {% if not group %}
<div class="hilight"> <div class="hilight">
<p style="margin: 5px">{% trans "Choose a group" %}</p> <p style="margin: 5px">{% trans "Choose a group" %}</p>
...@@ -14,7 +17,9 @@ ...@@ -14,7 +17,9 @@
<label for="share-group">{% trans "Group" %}</label> <label for="share-group">{% trans "Group" %}</label>
<select id="share-group-select" name="group"{% if not groups %} disabled=""{%endif%}> <select id="share-group-select" name="group"{% if not groups %} disabled=""{%endif%}>
<option value="" selected="" class="dummy">--</option> <option value="" selected="" class="dummy">--</option>
{%for i in groups%}<option value="{{i.id}}">{{i.name}} ({{i.members.count}})</option>{%endfor%} {%for i in groups%}
<option value="{{i.id}}">{{i.name}} ({{i.members.count}})</option>
{%endfor%}
</select> </select>
<div class="clear"></div> <div class="clear"></div>
</li> </li>
...@@ -27,38 +32,37 @@ ...@@ -27,38 +32,37 @@
<p>{% trans "Change the parameters as needed." %}</p> <p>{% trans "Change the parameters as needed." %}</p>
<ul> <ul>
<li> <li>
<label for="share-name">{% trans "Name of share" %}</label> <label for="share-name">{% trans "Name of share" %}</label>
<input type="text" name="name" id="share-name" value="{{base.name}}" /> <input type="text" name="name" id="share-name" value="{{base.name}}" />
<div class="clear"></div> <div class="clear"></div>
</li> </li>
<li class="li-share-type"> <li class="li-share-type">
<label for="share-type">{% trans "Type" %}</label> <label for="share-type">{% trans "Type" %}</label>
<ul class="radio"> <ul class="radio">
{% for s in types %} {% for s in types %}
<li> <li>
<label> <label>
<input type="radio" name="type" value="{{s.id}}" id="share-type-{{s.id}}" <input type="radio" name="type" value="{{s.id}}" id="share-type-{{s.id}}"
{% if s.default %}checked="checked"{% endif %} /> {% if s.default %}checked="checked"{% endif %} />
{{s.verbose_name}} {{s.verbose_name}}
</label> </label>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
{% for s in types %} {% for s in types %}
<p id="share-type-summary-{{s.id}}" class="type-summary clear" <p id="share-type-summary-{{s.id}}" class="type-summary clear"
{% if not s.default %}style="display:none"{% endif %}> {% if not s.default %}style="display:none"{% endif %}>
{{s.help_text}} {{s.help_text}}
({% if s.suspend %} ({% if s.suspend %}
<span class="suspend" <span class="suspend"
title="{% blocktrans with time=s.suspend %}Suspend after {{time}}.{%endblocktrans%}"> title="{% blocktrans with time=s.suspend %}Suspend after {{time}}.{%endblocktrans%}">{{s.suspendx|timeuntil}}</span>
{{s.suspendx|timeuntil}} {%endif%}{% if s.delete %}
</span> <span class="delete"
{%endif%}{% if s.delete %}<span class="delete" title="{% blocktrans with time=s.delete %}Delete after {{time}}.{%endblocktrans%}">{{s.deletex|timeuntil}}</span>
title="{% blocktrans with time=s.delete %}Delete after {{time}}.{%endblocktrans%}"> {%endif%})
{{s.deletex|timeuntil}}</span>{%endif%}) </p>
</p> {% endfor %}
{% endfor %} <div class="clear"></div>
<div class="clear"></div>
</li> </li>
<li> <li>
<label for="share-instance-limit">{% trans "Maximal count of instances" %}</label> <label for="share-instance-limit">{% trans "Maximal count of instances" %}</label>
......
{% load i18n %} {% load i18n %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<form action="/ajax/templateWizard" method="post" id="template-wizard">{% csrf_token %} <form action="/ajax/templateWizard" method="post" id="template-wizard">
{% csrf_token %}
<div id="new-template-step-1" class="wizard"> <div id="new-template-step-1" class="wizard">
<div class="progress"> <div class="progress">
<div class="bar-container"> <div class="bar-container">
<div class="bar" style="width: 33%"></div> <div class="bar" style="width: 33%"></div>
</div> </div>
<h3>{% blocktrans with step=1 all=3 %}{{step}}/{{all}}{% endblocktrans %}</h3> <h3>
{% blocktrans with step=1 all=3 %}{{step}}/{{all}}{% endblocktrans %}
</h3>
</div> </div>
<h2>{% blocktrans with step=1 %}Step {{step}}{% endblocktrans %}</h2> <h2>{% blocktrans with step=1 %}Step {{step}}{% endblocktrans %}</h2>
<p class="help">{% trans "Please choose the base system you want to customize." %}</p> <p class="help">
{% trans "Please choose the base system you want to customize." %}
</p>
<div class="container"> <div class="container">
<ul class="tpl-list modal"> <ul class="tpl-list modal">
{% if not templates %} {% if not templates %}
...@@ -18,7 +23,12 @@ ...@@ -18,7 +23,12 @@
{% for m in templates %} {% for m in templates %}
<li class="tpl"> <li class="tpl">
<div class="summary"> <div class="summary">
<div class="name tpl os-{{m.os_type}}" title="{{m.description}}"><label><input type="radio" name="base" value="{{m.id}}" /> {{m.name}}</label></div> <div class="name tpl os-{{m.os_type}}" title="{{m.description}}">
<label>
<input type="radio" name="base" value="{{m.id}}" />
{{m.name}}
</label>
</div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</li> </li>
...@@ -56,5 +66,5 @@ ...@@ -56,5 +66,5 @@
}) })
</script> </script>
</div> </div>
</div> </div>
</form> </form>
{% load i18n %} {% load i18n %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<form action="/vm/new/{{base.id}}/" method="post" id="template-wizard">{% csrf_token %} <form action="/vm/new/{{base.id}}/" method="post" id="template-wizard">
{% csrf_token %}
<div id="new-template-step-2" class="wizard"> <div id="new-template-step-2" class="wizard">
<div class="progress"> <div class="progress">
<div class="bar-container"> <div class="bar-container">
<div class="bar" style="width: 66%"></div> <div class="bar" style="width: 66%"></div>
</div> </div>
<h3>{% blocktrans with step=2 all=3 %}{{step}}/{{all}}{% endblocktrans %}</h3> <h3>
{% blocktrans with step=2 all=3 %}{{step}}/{{all}}{% endblocktrans %}
</h3>
</div> </div>
<h2>{% blocktrans with step=2 %}Step {{step}}{% endblocktrans %}</h2> <h2>{% blocktrans with step=2 %}Step {{step}}{% endblocktrans %}</h2>
<p>{% trans "Change the parameters as needed." %}</p> <p>{% trans "Change the parameters as needed." %}</p>
<ul> <ul>
<li> <li>
<label for="new-template-name">{% trans "Name" %}</label> <label for="new-template-name">{% trans "Name" %}</label>
<input type="text" name="name" id="new-template-name" value="{{base.name}}" <input type="text" name="name" id="new-template-name" value="{{base.name}}"
class="error validated" title="{% trans "Please choose a different name." %}" /> class="error validated" title="{% trans "Please choose a different name." %}" />
<div class="clear"></div> <div class="clear"></div>
...@@ -33,7 +36,9 @@ ...@@ -33,7 +36,9 @@
{% for s in sizes %} {% for s in sizes %}
<p id="new-template-size-summary-{{s.id}}" class="size-summary clear" <p id="new-template-size-summary-{{s.id}}" class="size-summary clear"
{% if s != base.instance_type %}style="display:none"{% endif %}> {% if s != base.instance_type %}style="display:none"{% endif %}>
<span class="cpu">{% blocktrans count n=s.CPU %}{{n}} core{% plural %}{{n}} cores{% endblocktrans %}</span> <span class="cpu">
{% blocktrans count n=s.CPU %}{{n}} core{% plural %}{{n}} cores{% endblocktrans %}
</span>
<span class="memory">{{s.RAM}} MiB</span> <span class="memory">{{s.RAM}} MiB</span>
<span class="credit">{{s.credit}}</span> <span class="credit">{{s.credit}}</span>
</p> </p>
...@@ -47,12 +52,13 @@ ...@@ -47,12 +52,13 @@
</li> </li>
</ul> </ul>
<nav> <nav>
<!-- <a href="#" class="prev">{% trans "&laquo; Cancel" %}</a> --> <!-- <a href="#" class="prev">{% trans "&laquo; Cancel" %}</a>
<input type="reset" class="prev" value="{% trans "Cancel" %}" /> -->
<input type="submit" class="next" value="{% trans "Launch master instance" %}" /> <input type="reset" class="prev" value="{% trans "Cancel" %}" />
<div class="clear"></div> <input type="submit" class="next" value="{% trans "Launch master instance" %}" />
</nav> <div class="clear"></div>
<script type="text/javascript"> </nav>
<script type="text/javascript">
$(function(){ $(function(){
$('#new-template-step-2 nav .prev').click(function(){ $('#new-template-step-2 nav .prev').click(function(){
$('#modal').hide(); $('#modal').hide();
...@@ -85,5 +91,5 @@ ...@@ -85,5 +91,5 @@
}); });
}) })
</script> </script>
</div> </div>
</form> </form>
...@@ -24,57 +24,61 @@ ...@@ -24,57 +24,61 @@
{% if i.template.state != "READY" %} {% if i.template.state != "READY" %}
<div class="contentblock wide note big"> <div class="contentblock wide note big">
<p>{% blocktrans %}This is a master image for your new template.{% endblocktrans %}</p> <p>
<form action="{% url one.views.vm_saveas id %}" method="POST">{% csrf_token %} {% blocktrans %}This is a master image for your new template.{% endblocktrans %}
</p>
<form action="{% url one.views.vm_saveas id %}" method="POST">
{% csrf_token %}
{% if i.template.state == "NEW" %} {% if i.template.state == "NEW" %}
<p style="float: right; margin-top:2em;margin-right:1em;"> <p style="float: right; margin-top:2em;margin-right:1em;">
<input type="submit" value="{% trans "Save" %}" class="big" style="background-color:rgba(102, 255, 0, 0.4)" /> <input type="submit" value="{% trans "Save" %}" class="big" style="background-color:rgba(102, 255, 0, 0.4)" />
</p> </p>
{% endif %} {% endif %}
</form> </form>
<ol> <ol>
<li{% if i.template.state == "SAVING" %} class="done"{%endif%}>{% blocktrans %}Connect to the machine.{% endblocktrans %}</li> <li{% if i.template.state == "SAVING" %} class="done"{%endif%}>{% blocktrans %}Connect to the machine.{% endblocktrans %}</li>
<li{% if i.template.state == "SAVING" %} class="done"{%endif%}>{% blocktrans %}Do all the needed installation/customization.{% endblocktrans %}</li> <li{% if i.template.state == "SAVING" %} class="done"{%endif%}>
<li{% if i.template.state == "SAVING" %} class="done"{%endif%}>{% blocktrans %}Log off (keep the machine running).{% endblocktrans %}</li> {% blocktrans %}Do all the needed installation/customization.{% endblocktrans %}
<li{% if i.template.state == "SAVING" %} class="done"{%endif%}>{% blocktrans %}Click on the "save" button on the right.{% endblocktrans %}</li> </li>
<li>{% blocktrans %}The machine will be shut down and its disk saved.{% endblocktrans %}</li> <li{% if i.template.state == "SAVING" %} class="done"{%endif%}>
<li>{% blocktrans %}You can share the template with your groups.{% endblocktrans %}</li> {% blocktrans %}Log off (keep the machine running).{% endblocktrans %}
</li>
<li{% if i.template.state == "SAVING" %} class="done"{%endif%}>
{% blocktrans %}Click on the "save" button on the right.{% endblocktrans %}
</li>
<li>
{% blocktrans %}The machine will be shut down and its disk saved.{% endblocktrans %}
</li>
<li>
{% blocktrans %}You can share the template with your groups.{% endblocktrans %}
</li>
</ol> </ol>
</div> </div>
{% endif %} {% endif %}
<div class="boxes"> <div class="boxes">
<div class="contentblock wm" id="state"> <div class="contentblock wm" id="state">
<h2>{{name}}</h2> <h2>{{name}}</h2>
<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/load.gif" /> <img src="/static/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/load.gif" id="connecting" style="display:none;" /> <img src="/static/load.gif" id="connecting" style="display:none;" />
{% trans "Running" %} {% trans "Running" %}
</a> </a>
</p> </p>
{% elif state == "STOPPED" %} {% elif state == "STOPPED" %}
<p style="font-size:25px; line-height:2em;text-align:center;"> <p style="font-size:25px; line-height:2em;text-align:center;">{% trans "Stopped" %}</p>
{% trans "Stopped" %} {% endif %}
</p>
{% endif %}
{% if state == "DONE" %} {% if state == "DONE" %}
<p style="font-size:25px; line-height:2em;text-align:center;"> <p style="font-size:25px; line-height:2em;text-align:center;">{% trans "Deleted" %}</p>
{% trans "Deleted" %} {% endif %}
</p>
{% endif %}
{% if state == "FAILED" %} {% if state == "FAILED" %}
<p style="font-size:25px; line-height:2em;text-align:center;"> <p style="font-size:25px; line-height:2em;text-align:center;">{% trans "Unexpected error occured" %}</p>
{% trans "Unexpected error occured" %}
</p>
{% endif %} {% endif %}
</div> </div>
</div> </div>
......
{% load i18n %} {% load i18n %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<div class="content"> <div class="content">
<table> <table>
<tr> <tr>
<th>{% trans "Protocol" %}:</th> <th>{% trans "Protocol" %}:</th>
<td>{{i.template.access_type|upper}}</td> <td>{{i.template.access_type|upper}}</td>
</tr> </tr>
<tr> <tr>
<th>{% trans "IP" %}:</th> <th>{% trans "IP" %}:</th>
<td>{{ i.firewall_host.pub_ipv4 }}</td> <td>{{ i.firewall_host.pub_ipv4 }}</td>
</tr> </tr>
<tr> <tr>
<th>{% trans "Port" %}:</th> <th>{% trans "Port" %}:</th>
<td>{{ i.get_port}}</td> <td>{{ i.get_port}}</td>
</tr> </tr>
<tr> <tr>
<th>{% trans "Username" %}:</th> <th>{% trans "Username" %}:</th>
<td>cloud</td> <td>cloud</td>
</tr> </tr>
<tr> <tr>
<th>{% trans "Password" %}:</th> <th>{% trans "Password" %}:</th>
<td>{{ i.pw }}</td> <td>{{ i.pw }}</td>
</tr> </tr>
</table> </table>
</div> </div>
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