root / ui / templates / home.html @ 42f67a2a
History | View | Annotate | Download (6.5 kB)
1 |
{% load i18n %} |
---|---|
2 |
<!DOCTYPE html>
|
3 |
<head>
|
4 |
<title>{{ project }}</title> |
5 |
<!-- include the Tools -->
|
6 |
<script src="static/jquery.tools.min.js"></script> |
7 |
<script src="static/jquery.cookie.js"></script> |
8 |
<script src="static/jQueryRotate.js"></script> |
9 |
<script src="static/jquery.dataTables.min.js"></script> |
10 |
<script>
|
11 |
/* These have to be here for the translations to work */
|
12 |
// ajax error checking
|
13 |
function ajax_error(jqXHR) {
|
14 |
// prepare the error message
|
15 |
$("#error-success h3").text('{% trans "Error!" %}');
|
16 |
// check the error code
|
17 |
switch (jqXHR.status) {
|
18 |
case 400: // YY error/message
|
19 |
$("#error-success p").text('{% trans "A Bad Request has been made." %}');
|
20 |
break;
|
21 |
case 404: // YY error/message
|
22 |
$("#error-success p").text('{% trans "Your request has failed." %}');
|
23 |
break;
|
24 |
case 501: // XX error/message
|
25 |
$("#error-success p").text('{% trans "There has been an Internal Error. Our administrators have been notified." %}');
|
26 |
break;
|
27 |
case 503: // XX error/message
|
28 |
$("#error-success p").text('{% trans "This service is unavailable right now, please try again later." %}');
|
29 |
break;
|
30 |
default: // XXYY error/message
|
31 |
$("#error-success p").text('{% trans "An error has happened. Our administrators have been notified." %}');
|
32 |
}
|
33 |
// bring up error notification
|
34 |
var triggers = $("a#notification").overlay({
|
35 |
// some mask tweaks suitable for modal dialogs
|
36 |
mask: {
|
37 |
color: '#ebecff',
|
38 |
opacity: '0.9'
|
39 |
},
|
40 |
top: 'center',
|
41 |
closeOnClick: false,
|
42 |
oneInstance: false,
|
43 |
load: false,
|
44 |
onClose: function(){
|
45 |
choose_view();
|
46 |
}
|
47 |
});
|
48 |
$("a#notification").data('overlay').load();
|
49 |
return false;
|
50 |
}
|
51 |
|
52 |
// ajax success checking
|
53 |
function ajax_success() {
|
54 |
// prepare the error message
|
55 |
$("#error-success h3").text('{% trans "Success!" %}');
|
56 |
$("#error-success p").text('{% trans "Your request has been succefully executed." %}');
|
57 |
// bring up success notification
|
58 |
var triggers = $("a#notification").overlay({
|
59 |
// some mask tweaks suitable for modal dialogs
|
60 |
mask: {
|
61 |
color: '#ebecff',
|
62 |
opacity: '0.9'
|
63 |
},
|
64 |
top: 'center',
|
65 |
closeOnClick: false,
|
66 |
oneInstance: false,
|
67 |
load: false,
|
68 |
onClose: function(){
|
69 |
choose_view();
|
70 |
}
|
71 |
});
|
72 |
$("a#notification").data('overlay').load();
|
73 |
return false;
|
74 |
}
|
75 |
|
76 |
</script>
|
77 |
<script src="static/synnefo.js"></script> |
78 |
|
79 |
<link rel="stylesheet" type="text/css" href="static/main.css"/> |
80 |
|
81 |
</head>
|
82 |
<body>
|
83 |
<div id="wrapper"> |
84 |
<div id='user'> |
85 |
<a href="#">{% trans "username" %}</a> | <a href="#">{% trans "settings" %}</a> |
86 |
{% get_available_languages as LANGUAGES %} |
87 |
{% for lang in LANGUAGES %} |
88 |
| |
89 |
<a {% if == lang.0 %}class="current_lang" {% else %} href="/lang/?l={{lang.0}}" {% endif %}>{{lang.0}}</a> |
90 |
{% endfor %} |
91 |
</div>
|
92 |
<div id='header'> |
93 |
<a href="/" class="logo"> |
94 |
<img src="static/nefo.png" alt="+nefo"/> |
95 |
</a>
|
96 |
<div class='fatborder'></div> |
97 |
</div>
|
98 |
<!-- tabs -->
|
99 |
<ul class="css-tabs"> |
100 |
<li><a href="machines" title="{% trans "manage virtual " %}" class="primary" id="machines"> |
101 |
{% trans "machines" %}</a></li> |
102 |
<li><a href="disks" title="{% trans "manage storage " %}" class="primary" id="disks"> |
103 |
{% trans "disks" %}</a></li> |
104 |
<li><a href="images" title="{% trans "manage images" %}" class="primary" id="images"> |
105 |
{% trans "images" %}</a></li> |
106 |
<li><a href="networks" title="{% trans "configure " %}" class="primary" id="networks"> |
107 |
{% trans "networks" %}</a></li> |
108 |
<li><a href="files" title="{% trans "your " %}" class="secondary" id="files"> |
109 |
{% trans "files" %}</a></li> |
110 |
<li><a href="desktops" title="{% trans "your " %}" class="secondary" id="desktops"> |
111 |
{% trans "desktops" %}</a></li> |
112 |
<li><a href="apps" title="{% trans "your " %}" class="secondary" id="apps"> |
113 |
{% trans "apps" %}</a></li> |
114 |
</ul>
|
115 |
<div class="more-tabs"><img src="static/arrow.png" id="arrow"></img></div> |
116 |
<div class="css-panes"> |
117 |
<div id="machines-pane" class="pane" style="display:block">{% include "machines.html" %}</div> |
118 |
<div id="disks-pane" class="pane"></div> |
119 |
<div id="images-pane" class="pane"></div> |
120 |
<div id="networks-pane" class="pane"></div> |
121 |
<div id="files-pane" class="pane"></div> |
122 |
<div id="desktops-pane" class="pane"></div> |
123 |
<div id="apps-pane" class="pane"></div> |
124 |
</div>
|
125 |
</div>
|
126 |
<!-- activate tabs with JavaScript -->
|
127 |
<script>
|
128 |
$(function() {
|
129 |
$('ul.css-tabs li').hover(function(){
|
130 |
$(this).find('a:not(.current)').animate({top:'0px'},{queue:false,duration:150});
|
131 |
}, function(){
|
132 |
$('ul.css-tabs li a:not(.current)').animate({top:'9px'},{queue:false,duration:150});
|
133 |
});
|
134 |
});
|
135 |
|
136 |
$(function() {
|
137 |
$("ul.css-tabs").tabs("div.css-panes div.pane", {
|
138 |
onBeforeClick: function(event, i) {
|
139 |
$('ul.css-tabs li a').animate({top:'9px'},{queue:false,duration:150});
|
140 |
// get the pane to be opened
|
141 |
var pane = this.getPanes().eq(i);
|
142 |
pane.text('');
|
143 |
// load it with a page specified in the tab's href attribute
|
144 |
pane.load(this.getTabs().eq(i).attr("href"),function(){if (!i) {choose_view()}});
|
145 |
}
|
146 |
});
|
147 |
});
|
148 |
|
149 |
// toggle main menu
|
150 |
$("#arrow").click(function(event){
|
151 |
toggleMenu();
|
152 |
});
|
153 |
|
154 |
</script>
|
155 |
|
156 |
</body>
|
157 |
</html>
|
158 |
|