home.html 6.26 KB
Newer Older
Dudás Ádám committed
1 2
{% extends "base.html" %}
{% load i18n %}
3
{% load l10n %}
Őry Máté committed
4
{% get_current_language as LANGUAGE_CODE %}
Dudás Ádám committed
5 6
{% block content %}
<div class="boxes">
Danyi Bence committed
7
    <div class="contentblock" id="state">
8
        <h2>{% trans "Virtual machines" %}</h2>
Danyi Bence committed
9 10
        <ul class="wm-list">
            {% include "box-vmlist.html" %}
Danyi Bence committed
11
            <li id="new-wm-button" class="wm new">
Danyi Bence committed
12
                <div class="summary">
Őry Máté committed
13
                    <div class="name">{% trans "Start new machine" %}</div>
Danyi Bence committed
14 15 16 17
                    <div class="clear"></div>
                </div>
            </li>
            <li id="new-wm" style="display: none">
Dányi Bence committed
18
                <h2>{% trans "Available shares" %}</h2>
Dányi Bence committed
19
                <p>
Dányi Bence committed
20
                    {% trans "Choose one of the following shared templates to launch." %}
Dányi Bence committed
21
                </p>
Danyi Bence committed
22 23
                <div class="container">
                    <ul class="wm-list modal">
tarokkk committed
24
                        {% for s in shares %}
Danyi Bence committed
25
                        <li class="wm">
Dányi Bence committed
26 27
                            <div class="summary">
                                <div class="quota">
Dányi Bence committed
28 29
                                    <div class="used" style="width:{% if s.running_shared >=  s.per_user_limit %}100%{% else %}{{ s.get_instance_pc|unlocalize }}%{% endif %}"/>
                                    </div>
Danyi Bence committed
30
                                </div>
Dányi Bence committed
31 32
                                <div class="name wm-on">
                                    {{s.name}} - {{ s.group.name }}   ({{ s.running_shared }}/{{ s.per_user_limit }})
Dányi Bence committed
33
                                </div>
Dányi Bence committed
34
                                <div class="status">{{s.get_running}}/{{s.instance_limit}}</div>
Dányi Bence committed
35 36 37 38
                                <div class="clear"></div>
                            </div>
                            <div class="details">
                                <div class="details-container">
Danyi Bence committed
39
                                    <ul>
Dányi Bence committed
40 41 42 43 44 45 46
                                        <li class="os-{{s.template.os_type}}">
                                            {% trans "System" %}:
                                            <span class="value">{{s.template.system}}</span>
                                            <div class="clear"></div>
                                        </li>
                                        <li class="type">
                                            {% trans "Size" %}:
47 48 49 50 51 52
                                            <span class="value">
                                                {{s.template.instance_type.name}}
                                                <span class="cpu">{{s.template.instance_type.CPU}}</span>
                                                <span class="memory">{{s.template.instance_type.RAM}}</span>
                                                <span class="credit">{{s.template.instance_type.credit}}</span>
                                            </span>
Dányi Bence committed
53 54 55 56
                                        </li>
                                        <li class="share-type">
                                            {% trans "Type" %}:
                                            <span class="value">{{s.type }}</span>
57 58 59 60
                                            ({% if s.get_type.suspend %}
                                            <span class="suspend"
                                                title="{% blocktrans with time=s.get_type.suspend %}Suspend after {{time}}.{%endblocktrans%}">
                                                {{s.get_type.suspendx|timeuntil}}
Dányi Bence committed
61
                                            </span>
62 63 64
                                            {%endif%}{% if s.get_type.delete %}<span class="delete"
                                                title="{% blocktrans with time=s.get_type.delete %}Delete after {{time}}.{%endblocktrans%}">
                                                {{s.get_type.deletex|timeuntil}}</span>{%endif%})
Dányi Bence committed
65 66 67 68 69 70
                                        </li>
                                        <li class="description">
                                            {% trans "Description" %}:
                                            <span class="value">{{s.description}}</span>
                                            <div class="clear"></div>
                                        </li>
Dányi Bence committed
71 72 73
                                        <li>
                                            &nbsp;
                                            <span class="value">
Dányi Bence committed
74 75
                                                <form method="POST" action="/vm/new/s{{s.pk}}/">
                                                    {% csrf_token %}
76
                                                    <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" />
Dányi Bence committed
77 78 79 80
                                                </form>
                                            </span>
                                            <div class="clear"></div>
                                        </li>
Danyi Bence committed
81 82
                                    </ul>
                                </div>
Dányi Bence committed
83
                            </div>
Danyi Bence committed
84 85 86 87
                        </li>
                        {% endfor %}
                    </ul>
                </div>
Danyi Bence committed
88
            </li>
Dányi Bence committed
89 90 91
            <li class="wm small">
                <div class="summary">
                    <div class="quota">
Őry Máté committed
92
                        <div class="used" style="background-color: rgba(0,255,0,0.2); width: {{userdetails.get_instance_pc|unlocalize}}%"></div>
Dányi Bence committed
93
                    </div>
Dányi Bence committed
94 95 96
                    <div class="name">
                        {% blocktrans with used=userdetails.get_weighted_instance_count all=userdetails.instance_quota %}Personal quota: {{used}}/{{all}}{% endblocktrans %}
                    </div>
Dányi Bence committed
97 98 99
                    <div class="clear"></div>
                </div>
            </li>
Danyi Bence committed
100 101
        </ul>
    </div>
Dudás Ádám committed
102 103
    {% for box in boxes %}
    {% if forloop.counter0|divisibleby:2 %}
Dányi Bence committed
104 105 106 107
    <div class="contentblock">
        <h2>{{ box.title }}</h2>
        <div class="content">{{ box.text|safe }}</div>
    </div>
Dudás Ádám committed
108 109
    {% endif %}
    {% endfor %}
Dányi Bence committed
110

111 112 113 114 115
{% if userdetails.share_quota %}
    {% include "box-templatelist.html" %}
    {% include "box-grouplist.html" %}
{% endif %}

Dudás Ádám committed
116
</div>
117
{% include "box-filelist.html" %}
Dudás Ádám committed
118
{% endblock %}