Statistics
| Branch: | Tag: | Revision:

root / ui / templates / home.html @ d36493ce

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
        var TIMEOUT = {{timeout}};
12
        /* These have to be here for the translations to work */
13
        // ajax error checking  
14
        function ajax_error(jqXHR) {
15
            // prepare the error message
16
            $("#error-success h3").text('{% trans "Error!" %}');
17
            // check the error code
18
            switch (jqXHR.status) {
19
                case 400: // YY error/message
20
                    $("#error-success p").text('{% trans "A Bad Request has been made." %}');
21
                    break;
22
                case 404: // YY error/message
23
                    $("#error-success p").text('{% trans "Your request has failed." %}');
24
                    break;
25
                case 501: // XX error/message
26
                    $("#error-success p").text('{% trans "There has been an Internal Error. Our administrators have been notified." %}');
27
                    break;
28
                case 503: // XX error/message
29
                    $("#error-success p").text('{% trans "This service is unavailable right now, please try again later." %}');
30
                    break;
31
                default: // XXYY error/message
32
                    $("#error-success p").text('{% trans "An error has happened. Our administrators have been notified." %}');
33
            }         
34
            // bring up error notification
35
            var triggers = $("a#notification").overlay({
36
                // some mask tweaks suitable for modal dialogs
37
                mask: {
38
                    color: '#ebecff',
39
                    opacity: '0.9'
40
                },
41
                top: 'center',
42
                closeOnClick: false,
43
                oneInstance: false,
44
                load: false,
45
                onClose: function(){
46
                    choose_view();
47
                }
48
            });
49
            $("a#notification").data('overlay').load();
50
            return false;
51
        }
52
        
53
        // ajax success checking
54
        function ajax_success() {          
55
            // prepare the error message
56
            $("#error-success h3").text('{% trans "Success!" %}');
57
            $("#error-success p").text('{% trans "Your request has been succefully executed." %}');             
58
            // bring up success notification
59
            var triggers = $("a#notification").overlay({
60
                // some mask tweaks suitable for modal dialogs
61
                mask: {
62
                    color: '#ebecff',
63
                    opacity: '0.9'
64
                },
65
                top: 'center',
66
                closeOnClick: false,
67
                oneInstance: false,
68
                load: false,
69
                onClose: function(){
70
                    choose_view();
71
                }
72
            });
73
            $("a#notification").data('overlay').load();
74
            return false;
75
        }
76
    
77
    </script>
78
    <script src="static/synnefo.js"></script>
79

    
80
        <link rel="stylesheet" type="text/css" href="static/main.css"/>        
81

    
82
</head>
83
<body>
84
    <div id="wrapper">
85
        <div id='user'>
86
            <a href="#">{% trans "username" %}</a> &nbsp;|&nbsp; <a href="#">{% trans "settings" %}</a>
87
            {% get_available_languages as LANGUAGES %}
88
            {% for lang in LANGUAGES %}
89
                &nbsp;|&nbsp;
90
                <a {% if  == lang.0 %}class="current_lang" {% else %}  href="/lang/?l={{lang.0}}" {% endif %}>{{lang.0}}</a> 
91
            {% endfor %}
92
        </div>
93
        <div id='header'>
94
            <a href="/" class="logo">
95
                <img src="static/nefo.png" alt="+nefo"/>
96
            </a>
97
            <div class='fatborder'></div>
98
        </div>
99
        <!-- tabs -->
100
        <ul class="css-tabs">
101
                <li><a href="machines" title="{% trans "manage  virtual " %}" class="primary" id="machines">
102
                {% trans "machines" %}</a></li>
103
                <li><a href="disks" title="{% trans "manage  storage " %}" class="primary" id="disks">
104
                {% trans "disks" %}</a></li>
105
                <li><a href="images" title="{% trans "manage  images" %}" class="primary" id="images">
106
                {% trans "images" %}</a></li>
107
                <li><a href="networks" title="{% trans "configure " %}" class="primary" id="networks">
108
                {% trans "networks" %}</a></li>
109
            <li><a href="files" title="{% trans "your " %}" class="secondary" id="files">
110
                {% trans "files" %}</a></li>
111
                <li><a href="desktops" title="{% trans "your " %}" class="secondary" id="desktops">
112
                {% trans "desktops" %}</a></li>
113
                <li><a href="apps" title="{% trans "your " %}" class="secondary" id="apps">
114
                {% trans "apps" %}</a></li>
115
        </ul>
116
        <div class="more-tabs"><img src="static/arrow.png" id="arrow"></img></div>
117
        <div class="css-panes">
118
                <div id="machines-pane" class="pane" style="display:block">{% include "machines.html" %}</div>
119
                <div id="disks-pane" class="pane"></div>
120
                <div id="images-pane" class="pane"></div>
121
                <div id="networks-pane" class="pane"></div>
122
            <div id="files-pane" class="pane"></div>
123
                <div id="desktops-pane" class="pane"></div>
124
                <div id="apps-pane" class="pane"></div>
125
        </div>
126
    </div>
127
    <!-- activate tabs with JavaScript -->
128
    <script>
129
                $(function() {
130
                    $('ul.css-tabs li').hover(function(){
131
                            $(this).find('a:not(.current)').animate({top:'0px'},{queue:false,duration:150});
132
            }, function(){
133
                $('ul.css-tabs li a:not(.current)').animate({top:'9px'},{queue:false,duration:150});
134
                    });
135
                });
136
                
137
        $(function() {
138
                $("ul.css-tabs").tabs("div.css-panes div.pane", {        
139
                        onBeforeClick: function(event, i) {
140
                    $('ul.css-tabs li a').animate({top:'9px'},{queue:false,duration:150});
141
                                // get the pane to be opened
142
                                var pane = this.getPanes().eq(i);
143
                    pane.text('');
144
                                // load it with a page specified in the tab's href attribute
145
                                pane.load(this.getTabs().eq(i).attr("href"),function(){if (!i) {choose_view()}});
146
                        }
147
                });
148
        });
149

150
        // toggle main menu
151
        $("#arrow").click(function(event){
152
                toggleMenu();
153
        });    
154
        
155
    </script>
156
    
157
</body>
158
</html>
159