Statistics
| Branch: | Tag: | Revision:

root / ui / templates / home.html @ 146b6003

History | View | Annotate | Download (8.1 kB)

1
{% load i18n %}
2
<!DOCTYPE html>
3
<head>
4
        <title>{{ project }}</title>
5
        <!-- include the Tools -->
6
    <!-- jquery tools minified for deployment-->
7
    <!--script src="static/jquery.tools.min.js"></script-->
8
    
9
        <!-- jquery tools source for debugging -->    
10
    <script src="http://flowplayer.org/tools/download/1.2.5/jquery-1.4.2.js"></script>   
11
        <script src="http://flowplayer.org/tools/download/1.2.5/tabs/tabs.js"></script>
12
        <script src="http://flowplayer.org/tools/download/1.2.5/scrollable/scrollable.js"></script>
13
        <script src="http://flowplayer.org/tools/download/1.2.5/overlay/overlay.js"></script>
14
        <script src="http://flowplayer.org/tools/download/1.2.5/rangeinput/rangeinput.js"></script>
15
        <script src="http://flowplayer.org/tools/download/1.2.5/toolbox/toolbox.expose.js"></script>
16
    
17
    <script src="static/jquery.cookie.js"></script>
18
    <script src="static/jQueryRotate.js"></script>
19
    <script src="static/jquery.dataTables.min.js"></script>
20
    <script src="static/synnefo.js"></script>
21
        <link rel="stylesheet" type="text/css" href="static/main.css"/>        
22
    <script>
23
        // timeout value from settings.py
24
        var TIMEOUT = {{timeout}};
25
        var UPDATE_INTERVAL = {{5000}};
26
        var STATUS_MESSAGES = {
27
            'BUILD'     : '{% trans "Building" %}',
28
            'REBOOT'     : '{% trans "Rebooting" %}',            
29
            'STOPPED'   : '{% trans "Stopped" %}',
30
            'ACTIVE'   : '{% trans "Running" %}',
31
            'ERROR'   : '{% trans "Error" %}'
32
        };
33
        
34
        var ERRORS = {
35
            // error message header
36
            'HEADER' : '{% trans "Error!" %}',
37
            // default
38
            'DEFAULT' : '{% trans "Could not contact the service. Please check your network connectivity and try again." %}',
39
            // bad request
40
            '400' : '{% trans "Malformed request." %}',
41
            // not found
42
            '404' : '{% trans "Your request has failed. Resource not found." %}',
43
            // internal server error
44
            '501' : '{% trans "There has been an Internal Error. Our administrators have been notified." %}',
45
            // service unavailable
46
            '503' : '{% trans "This service is unavailable right now, please try again later." %}',
47
            // no images unavailable
48
            'NO_IMAGES' : '{% trans "Cannot show the Create machine wizard: No images found." %}',
49
            // no images unavailable
50
            'NO_FLAVORS' : '{% trans "Cannot show the Create machine wizard: No machine configurations found." %}'
51
        };
52
        
53
        var SUCCESS = {
54
            'HEADER' : '{% trans "Success!" %}',
55
            'DEFAULT' : '{% trans "Your request has been succefully executed." %}',
56
        };
57
        
58
        // ajax error checking  
59
        function ajax_error(status) {
60
            // prepare the error message
61
            $("#error-success h3").text(ERRORS['HEADER']);
62
            
63
            if (status != undefined && ERRORS[status]) {
64
                $("#error-success p").text(ERRORS[status]);
65
            } else {
66
                $("#error-success p").text(ERRORS['DEFAULT']);   
67
            }
68
            
69
            // bring up error notification
70
            var triggers = $("a#notification").overlay({
71
                // some mask tweaks suitable for modal dialogs
72
                mask: {
73
                    color: '#ebecff',
74
                    opacity: '0.9'
75
                },
76
                top: 'center',
77
                closeOnClick: false,
78
                oneInstance: false,
79
                load: false,
80
                onClose: function(){
81
                    // With partial refresh working properly,
82
                    // it is no longer necessary to refresh the whole page
83
                    // choose_view();
84
                }
85
            });
86
            $("a#notification").data('overlay').load();
87
            return false;
88
        }
89
        
90
        // ajax success checking
91
        function ajax_success(status, password) {
92
            // prepare the error message
93
            $("#error-success h3").text(SUCCESS['HEADER']);
94
            $("#error-success p").text(SUCCESS['DEFAULT']);             
95
            // bring up success notification
96
            var triggers = $("a#notification").overlay({
97
                // some mask tweaks suitable for modal dialogs
98
                mask: {
99
                    color: '#ebecff',
100
                    opacity: '0.9'
101
                },
102
                top: 'center',
103
                closeOnClick: false,
104
                oneInstance: false,
105
                load: false,
106
                onClose: function(){
107
                    // With partial refresh working properly,
108
                    // it is no longer necessary to refresh the whole page
109
                    // choose_view();
110
                }
111
            });
112
            $("a#notification").data('overlay').load();
113
            return false;
114
        }
115
    </script>
116
</head>
117
<body>
118
    <div id="wrapper">
119
        <div id='user'>
120
            <a href="#">{% trans "username" %}</a> &nbsp;|&nbsp; <a href="#">{% trans "settings" %}</a>
121
            {% get_available_languages as LANGUAGES %}
122
            {% for lang in LANGUAGES %}
123
                &nbsp;|&nbsp;
124
                <a {% if  == lang.0 %}class="current_lang" {% else %}  href="/lang/?l={{lang.0}}" {% endif %}>{{lang.0}}</a> 
125
            {% endfor %}
126
        </div>
127
        <div id='header'>
128
            <a href="/" class="logo">
129
                <img src="static/nefo.png" alt="+nefo"/>
130
            </a>
131
            <div class='fatborder'></div>
132
        </div>
133
        <!-- tabs -->
134
        <ul class="css-tabs">
135
                <li><a href="machines" title="{% trans "manage  virtual " %}" class="primary" id="machines">
136
                {% trans "machines" %}</a></li>
137
                <li><a href="disks" title="{% trans "manage  storage " %}" class="primary" id="disks">
138
                {% trans "disks" %}</a></li>
139
                <li><a href="images" title="{% trans "manage  images" %}" class="primary" id="images">
140
                {% trans "images" %}</a></li>
141
                <li><a href="networks" title="{% trans "configure " %}" class="primary" id="networks">
142
                {% trans "networks" %}</a></li>
143
            <li><a href="files" title="{% trans "your " %}" class="secondary" id="files">
144
                {% trans "files" %}</a></li>
145
                <li><a href="desktops" title="{% trans "your " %}" class="secondary" id="desktops">
146
                {% trans "desktops" %}</a></li>
147
                <li><a href="apps" title="{% trans "your " %}" class="secondary" id="apps">
148
                {% trans "apps" %}</a></li>
149
        </ul>
150
        <div class="more-tabs"><img src="static/arrow.png" id="arrow"></img></div>
151
        <div class="css-panes">
152
                <div id="machines-pane" class="pane" style="display:block">{% include "machines.html" %}</div>
153
                <div id="disks-pane" class="pane"></div>
154
                <div id="images-pane" class="pane"></div>
155
                <div id="networks-pane" class="pane"></div>
156
            <div id="files-pane" class="pane"></div>
157
                <div id="desktops-pane" class="pane"></div>
158
                <div id="apps-pane" class="pane"></div>
159
        </div>
160
    </div>
161
    <!-- activate tabs with JavaScript -->
162
    <script>
163
                $(function() {
164
                    $('ul.css-tabs li').hover(function(){
165
                            $(this).find('a:not(.current)').animate({top:'0px'},{queue:false,duration:150});
166
            }, function(){
167
                $('ul.css-tabs li a:not(.current)').animate({top:'9px'},{queue:false,duration:150});
168
                    });
169
                });
170
                
171
        $(function() {
172
                $("ul.css-tabs").tabs("div.css-panes div.pane", {        
173
                        onBeforeClick: function(event, i) {
174
                    $('ul.css-tabs li a').animate({top:'9px'},{queue:false,duration:150});
175
                                // get the pane to be opened
176
                                var pane = this.getPanes().eq(i);
177
                    pane.text('');
178
                                // load it with a page specified in the tab's href attribute
179
                                pane.load(this.getTabs().eq(i).attr("href"),function(){if (!i) {choose_view()}});
180
                        }
181
                });
182
        });
183

184
        // toggle main menu
185
        $("#arrow").click(function(event){
186
                toggleMenu();
187
        });    
188
        
189
    </script>
190
</body>
191
</html>
192