Statistics
| Branch: | Tag: | Revision:

root / ui / templates / home.html @ 55e4b353

History | View | Annotate | Download (29.4 kB)

1
<!--
2
Copyright 2011 GRNET S.A. All rights reserved.
3

4
Redistribution and use in source and binary forms, with or
5
without modification, are permitted provided that the following
6
conditions are met:
7

8
  1. Redistributions of source code must retain the above
9
     copyright notice, this list of conditions and the following
10
     disclaimer.
11

12
  2. Redistributions in binary form must reproduce the above
13
     copyright notice, this list of conditions and the following
14
     disclaimer in the documentation and/or other materials
15
     provided with the distribution.
16

17
THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
18
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
21
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
24
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
POSSIBILITY OF SUCH DAMAGE.
29

30
The views and conclusions contained in the software and
31
documentation are those of the authors and should not be
32
interpreted as representing official policies, either expressed
33
or implied, of GRNET S.A.
34
-->
35

    
36
<html>
37

    
38
{% load i18n %}
39
<!DOCTYPE html>
40
<head>
41
    <title>~okeanos</title>
42
    <!-- include the Tools -->
43
    <!-- jquery tools minified for deployment-->
44
    <script src="static/jquery.tools.min.js"></script>
45
    <!-- jquery tools source for JS debugging -->
46
    <!--
47
    <script src="http://flowplayer.org/tools/download/1.2.5/jquery-1.4.2.js"></script>
48
    <script src="http://flowplayer.org/tools/download/1.2.5/tabs/tabs.js"></script>
49
    <script src="http://flowplayer.org/tools/download/1.2.5/scrollable/scrollable.js"></script>
50
    <script src="http://flowplayer.org/tools/download/1.2.5/overlay/overlay.js"></script>
51
    <script src="http://flowplayer.org/tools/download/1.2.5/rangeinput/rangeinput.js"></script>
52
    <script src="http://flowplayer.org/tools/download/1.2.5/toolbox/toolbox.expose.js"></script>
53
    -->
54
    <script src="static/jquery.cookie.js"></script>
55
    <script src="static/jquery.client.js"></script>
56
    <script src="static/json2.js"></script>
57
    <script src="static/jquery.dataTables.min.js"></script>
58
    <script src="static/invitations.js"></script>
59
    <script src="static/synnefo.js"></script>
60

    
61
    <link rel="stylesheet" type="text/css" href="static/main.css"/>
62
    <!--[if IE]><style type="text/css" media="all">@import url(static/ie.css);</style><![endif]-->
63
    <script>
64
        // empty object for console to avoid errors in browsers that don't support it
65
        if (!window.console) {window.console = {}; window.console.log = window.console.info = window.console.debug =
66
            window.console.error = function() {}};
67

68
        //populate available image icons array
69
        var os_icons = {{image_icons|safe}};
70

71
        // timeout value from settings.py
72
        var TIMEOUT = {{timeout}};
73
        var UPDATE_INTERVAL = {{update_interval}};
74
        var LOGOUT_REDIRECT = '{{ logout_redirect }}';
75
        var INVITATIONS_URL = "{% url invitations %}";
76
        var INVITATIONS_TITLE = "{% trans "Invite people" %}";
77
        var APP_DEBUG = {% if DEBUG %}true{% else %}false{% endif %};
78
        var FEEDBACK_URL = "{% url feedback %}";
79
        var FEEDBACK_TITLE = "{% trans "Send feedback" %}";
80
        
81
        // building statuses
82
        var BUILDING_STATUSES = {
83
            'INIT': '{% trans "Initializing..." %}',
84
            'IMAGE_COPY': '{% trans "{0} of {1} ({2}%)" %}',
85
            'FINISH': '{% trans "Finalizing..." %}'
86
        }
87

88
        // server statuses and transitions
89
        var STATUSES = {
90
            'UNKNOWN'   : '{% trans "Unknown" %}',
91
            'BUILD'     : '{% trans "Building" %}',
92
            'REBOOT'    : '{% trans "Rebooting" %}',
93
            'STOPPED'   : '{% trans "Stopped" %}',
94
            'ACTIVE'    : '{% trans "Running" %}',
95
            'ERROR'     : '{% trans "Error" %}'
96
        };
97

98
        var TRANSITIONS = {
99
            'Shutting down' : '{% trans "Shutting down" %}',
100
            'Rebooting'     : '{% trans "Rebooting" %}',
101
            'Starting'      : '{% trans "Starting" %}',
102
            'Destroying'    : '{% trans "Destroying" %}',
103
            'Connecting'    : '{% trans "Connecting" %}',   // used only in networks
104
            'Disconnecting' : '{% trans "Disconnecting" %}' // used only in networks
105
        };
106

107
        // Server statuses and transitions that should be displayed as active or inactive
108
        var ACTIVE_STATES = [
109
            '{% trans "Building" %}',
110
            '{% trans "Rebooting" %}',
111
            '{% trans "Running" %}',
112
            '{% trans "Shutting down" %}',
113
            '{% trans "Rebooting" %}',
114
            '{% trans "Destroying" %}'
115
        ];
116
        
117
        var TRANSITION_STATES = [
118
            '{% trans "Building" %}',
119
            '{% trans "Rebooting" %}',
120
            '{% trans "Starting" %}',
121
            '{% trans "Shutting down" %}',
122
            '{% trans "Destroying" %}',
123
            '{% trans "Connecting" %}',
124
            '{% trans "Disconnectig" %}'
125
        ]
126
        var TRANSITION_STATE_APPEND = "...";
127

128
        var INACTIVE_STATES = [
129
            '{% trans "Unknown" %}',
130
            '{% trans "Stopped" %}',
131
            '{% trans "Error" %}',
132
            '{% trans "Starting" %}',
133
        ];
134

135
        // Network statuses and transitions
136
        var NET_STATES = {
137
            'ACTIVE'        : '{% trans "Private network" %}',  // this comes from the API
138
            'DELETED'       : '{% trans "Deleted" %}',          // this comes from the API
139
            'Destroying'    : '{% trans "Destroying" %}',
140
            'Connecting'    : '{% trans "Connecting" %}',
141
            'Disconnecting' : '{% trans "Disconnecting" %}'
142
        };
143

144
        var ERRORS = {
145
            // error message header
146
            'HEADER' : '{% trans "Error" %}',
147
            // default
148
            'DEFAULT' : '{% trans "Could not contact the service. Please check your network connectivity and try again." %}',
149
            // bad request
150
            '400' : '{% trans "Malformed request." %}',
151
            // not found
152
            '404' : '{% trans "Your request has failed. Resource not found." %}',
153
            // internal server error
154
            '500' : '{% trans "There has been an Internal Error. Our administrators have been notified." %}',
155
            // service unavailable
156
            '501' : '{% trans "This server has not been implemented yet." %}',
157
            // service unavailable
158
            '502' : '{% trans "Bad Gateway error." %}',
159
            // service unavailable
160
            '503' : '{% trans "This service is unavailable right now, please try again later." %}',
161
            // no server handshake
162
            '0' : '{% trans "Could not contact the server." %}',
163
            // no images found
164
            'NO_IMAGES' : '{% trans "Cannot show the Create machine wizard: No images found." %}',
165
            // no flavors found
166
            'NO_FLAVORS' : '{% trans "Cannot show the Create machine wizard: No machine configurations found." %}',
167
            // error box title
168
            'GENERIC_POPUP_HEADER' : '{% trans "Something seems to have gone wrong :( Here is what happened:" %}',
169
            // no advanced details
170
            'NO_DETAILS' : '{% trans "Νο advanced details provided" %}'
171
        };
172

173
        var SUCCESS = {
174
            'HEADER' : '{% trans "Success" %}',
175
            'DEFAULT' : '{% trans "Your request has been succefully executed." %}',
176
            'PASSWORD' : '{% trans "Password:" %}',
177
            'CREATE_VM_SUCCESS' : '{% trans "Success" %}',
178
            'CREATE_VM_SUCCESS_ONE' : '{% trans "Your new machine is now buidling... (this might take a few minutes)" %}',
179
            'CREATE_VM_SUCCESS_TWO' : '{% trans "Write down your password now:" %}',
180
            'CREATE_VM_SUCCESS_THREE' : '{% trans "You will need this later to connect to your machine." %}',
181
            'CREATE_VM_SUCCESS_FOUR' : '{% trans "After closing this window you will NOT be able to retrieve it again." %}'
182
        };
183

184
        var VARIOUS = {
185
            'CONFIRM' : '{% trans "Confirm" %}',
186
            'CANCEL' : '{% trans "Cancel" %}',
187
            'APPLY' : '{% trans "Apply" %}',
188
            'OFF' : '{% trans "Off" %}',
189
            'ON' : '{% trans "On" %}'
190
        };
191

192
        // ajax error checking
193
        function ajax_error(status, serverID, action, responseText) {
194
             // close existing overlays to begin with
195
            close_all_overlays();
196
            // clear old deferred calls (stops all auto-updates)
197
            clearTimeout(deferred);
198

199
            $('#error-success').addClass('error');
200
            $('#error-success').removeClass('success');
201

202
            var serverName = '';
203

204
            if (serverID !== undefined) {
205
                // standard view
206
                serverName = $("#" + serverID).find("span.name").text();
207
                if (serverName === "") { // list view
208
                    serverName = $("#" + serverID).parent().parent().find("span.name").text();
209
                }
210
            }
211

212
            // prepare the error message
213
            $("#error-success h3").text(ERRORS['HEADER']);
214
            if (responseText !== undefined) {
215
                var errors = parse_error(responseText, status), details = '';
216
                if (serverName) {
217
                    serverName = "<p>{% trans "Server" %}: " + serverName + "</p>";
218
                }
219

220
                if ((errors[0].details === undefined) || (errors[0].details === "")) {
221
                    details = ERRORS["NO_DETAILS"];
222
                    
223
                    // if no details message show debug info
224
                    if (window.APP_DEBUG) {
225
                        details = responseText;
226
                        try {
227
                            console.trace();
228
                        } catch (err) {
229
                        }
230
                    }
231
                } else {
232
                    details = errors[0].details;
233
                }
234

235
                $("#error-success .machine-now-building").html(ERRORS["GENERIC_POPUP_HEADER"]);
236
                $("#error-success .popup-header").addClass("popup-header-error");
237
                $("#error-success").addClass("popup-border-error");
238
                $("#error-success .password-container").hide();
239
                $("#error-success .popup-details").addClass("popup-details-error");
240
                $("#error-success .popup-separator").addClass("popup-separator-error");
241
                $("#error-success .popup-details").html("<p>" + 
242
                    (errors[0].message || ERRORS[errors[0].code] || serverID) + 
243
                    "</p>" + serverName + "<p>{% trans "Action" %}:" + 
244
                    action + "</p><p>{% trans "Code" %}: " + errors[0].code + 
245
                    "<p><a class='expand-details' href='#'>{% trans 'Details' %}</a><div class='more-details'>" + 
246
                    details + "</div></p>");
247

248
            } else if (ERRORS[status] !== undefined) {
249
                if (serverID === undefined) {
250
                    //eg no_images, no_flavors cases
251
                    $("#error-success .machine-now-building").html(ERRORS["GENERIC_POPUP_HEADER"]);
252
                    $("#error-success .popup-header").addClass("popup-header-error");
253
                    $("#error-success").addClass("popup-border-error");
254
                    $("#error-success .password-container").hide();
255
                    $("#error-success .popup-details").addClass("popup-details-error");
256
                    $("#error-success .popup-separator").addClass("popup-separator-error");
257
                    $("#error-success .popup-details").html("<p>" + ERRORS[status] + "</p>");
258
                } else {
259
                    $("#error-success .machine-now-building").html(ERRORS["GENERIC_POPUP_HEADER"]);
260
                    $("#error-success .popup-header").addClass("popup-header-error");
261
                    $("#error-success").addClass("popup-border-error");
262
                    $("#error-success .password-container").hide();
263
                    $("#error-success .popup-details").addClass("popup-details-error");
264
                    $("#error-success .popup-separator").addClass("popup-separator-error");
265
                    $("#error-success .popup-details").html("<p>" + ERRORS[status] + "</p><p>" + serverName + "</p>");
266
                }
267
            } else {
268
                $("#error-success .machine-now-building").html(ERRORS["DEFAULT"]);
269
                $("#error-success .popup-header").addClass("popup-header-error");
270
                $("#error-success").addClass("popup-border-error");
271
                $("#error-success .password-container").hide();
272
                $("#error-success .popup-details").hide();
273
                $("#error-success .popup-separator").hide();
274
            }
275
            $("#error-success p:first").css("padding-bottom", "10px");
276
            $("#error-success p:first").css("color", "#800000");
277
            $("#error-success div.more-details").hide();
278
            $("#error-success a.expand-details").live('click', function () {
279
                $(this).parent().parent().find("div.more-details").slideToggle(600);
280
                return false;
281
            });
282
            //stop the progress icon and hide the wizard
283
            if (action !== undefined) {
284
                if (action === 'Create VM') {
285
                    $('#wizard #start').text('{% trans "Create VM" %}');
286
                    $("#wizard").hide();
287
                } else if (action === 'Create network') {
288
                    $('#networks-wizard').hide();
289
                } else if (action === 'Add server to network') {
290
                    $('#add-machines-wizard').hide();
291
                }
292
            }
293

294
            
295
            // prepare ajax call to get called when user clicks on 
296
            // send error report button
297
            function initialize_error_report(cont, extra_data) {
298
                var cont = $(cont);
299
                var sel = function(sel) {return $(sel, cont)};
300
                var btn = sel(".send-btn");
301
                var extra_data = extra_data;
302

303
                // clear previous callbacks
304
                btn.unbind('click');
305
                btn.click(function(){
306
                    // wrap in its own try catch to avoid retriggering ajax_error
307
                    try {
308

309
                        // fallback to error object
310
                        try {
311
                            var data = $.extend({'error_info': $.extend({}, extra_data)}, get_user_data());
312
                        } catch (err) {
313
                            var data = {'error': err};
314
                        }
315

316
                        var payload = {'feedback-msg': "Automated error report", 'feedback-data': JSON.stringify(data)};
317

318
                        // we will close error overlay to display feedback form
319
                        // set feedback pending flag to not reload the window url
320
                        // unless the user is done with the feedback
321
                        window.FEEDBACK_PENDING = true;
322

323
                        $("a#notification").overlay().close();
324

325
                        var errorCode = extra_data[0] || -10;
326
                        var errorType = extra_data[1] || "Generic error";
327
                        var errorAction = extra_data[2] || "noaction";
328
                        var errorData = extra_data[3] || "";
329
                            
330
                        fdb_msg =   "Error report\n" +
331
                                    "------------\n" + 
332
                                    "Code: " + errorCode + "\n" + 
333
                                    "Type: " + errorType + "\n" + 
334
                                    "Action: " + errorAction + "\n" + 
335
                                    "Data: " + errorData + "\n\n" + 
336
                                    "Please describe the actions that triggered the error:\n";
337

338
                        setTimeout('show_feedback_form(fdb_msg, 1); $("#exposeMask").show();', 400);
339
                    } catch (err) {
340
                        sel(".send-btn").hide();
341
                        sel(".errormsg").fadeIn();
342
                        window.FEEDBACK_PENDING = false;
343
                    }
344
                });
345
            }
346

347
            // bring up error notification
348
            var triggers = $("a#notification").overlay({
349
                // some mask tweaks suitable for modal dialogs
350
                mask: '#666',
351
                top: 'center',
352
                closeOnClick: false,
353
                fixed: false,
354
                oneInstance: false,
355
                load: false,
356
                onClose: function () {
357
                    // user requested feedback from error page
358
                    if (!window.FEEDBACK_PENDING) {
359
                        // refresh the whole page
360
                       location.reload();
361
                    }
362
                },
363
                onLoad: function() {
364
                    initialize_error_report($(this.getOverlay()), [status, serverID, action, responseText]);
365
                }
366

367
            });
368

369
            // we need to give the browser some time to close the old overlays before opening the new one
370
            setTimeout("$('a#notification').data('overlay').load()",400);
371
            return false;
372
        }
373

374
        // ajax success checking
375
        function ajax_success(status, password) {
376
            // prepare the error message
377
            // bring up success notification
378
            $('#error-success').addClass('success');
379
            $('#error-success').removeClass('error');
380
            if (status !== undefined && SUCCESS[status]) {
381
                if (password !== undefined && status === "CREATE_VM_SUCCESS") {
382

383
                    //stop the progress icon and hide the wizard
384
                    $('#wizard #start').text('{% trans "Create VM" %}');
385
                    $("#wizard").hide();
386

387
                    $("#error-success h3 span.header-box").text(SUCCESS[status]);
388
                    var CREATE_VM_SUCCESS_MSG = SUCCESS["CREATE_VM_SUCCESS_THREE"] + '<br / >'
389
                        + SUCCESS["CREATE_VM_SUCCESS_FOUR"];
390
                    $("#error-success div.machine-now-building").html(SUCCESS["CREATE_VM_SUCCESS_ONE"]);
391
                    $("#error-success .popup-header").removeClass("popup-header-error");
392
                    $("#error-success").removeClass("popup-border-error");
393
                    $("#error-success .popup-details").removeClass("popup-details-error");
394
                    $("#error-success .popup-separator").removeClass("popup-separator-error");
395
                    $("#error-success .password-container").show();
396

397
                    $("#error-success .popup-details").html("</div><div class=\"write-password-details\">" + CREATE_VM_SUCCESS_MSG + "</div>");
398
                    $("#error-success div.password").html("<div class=\"write-password\">" + SUCCESS["CREATE_VM_SUCCESS_TWO"] + "<div class=\"write-password-password\"> " + password + "</div></div>");
399
                    //$("#error-success div.write-password").html(SUCCESS["CREATE_VM_SUCCESS_TWO"]);
400
                    //$("#error-success div.write-password-details").html(CREATE_VM_SUCCESS_MSG);
401
                } else {
402
                    $("#error-success h3").text(SUCCESS['HEADER']);
403
                    $("#error-success div.popup-body-inner").text("<p>" + SUCCESS[status] + "</p>");
404
                }
405
            } else {
406
                $("#error-success h3").text(SUCCESS['HEADER']);
407
                $("#error-success div.popup-body-inner").html("<p>" + SUCCESS['DEFAULT'] + "</p>");
408
            }
409

410
            var triggers = $("a#notification").overlay({
411
                // some mask tweaks suitable for modal dialogs
412
                mask: '#666',
413
                top: 'center',
414
                closeOnClick: false,
415
                oneInstance: false,
416
                load: false,
417
                onClose: function () {
418
                    // With partial refresh working properly,
419
                    // it is no longer necessary to refresh the whole page
420
                    // choose_view();
421
                }
422
            });
423
            $("a#notification").data('overlay').load();
424
            return false;
425
        }
426
    </script>
427
</head>
428
<body>
429
    <div id="container">
430
        <div id='header'>
431
            <div id='user'>
432
                <div class="usermenu">
433
                    <div class="username">{{ request.user.uniq }}</div>
434
                    <ul class="useractions">
435
                        <li class="invitations"><a class="action" href="#">{% trans "invite friends..." %}</a></li>
436
                        <li class="feedback"><a class="action" href="#">{% trans "send feedback..." %}</a></li>
437
                        <li class="logout last"><a class="action" href="#">{% trans "logout" %}</a></li>
438
                    </ul>
439
                </div>
440
                <div class="langmenu">
441
                <a class="current_lang">en</a>
442
                {% comment %}
443
                {% get_available_languages as LANGUAGES %}
444
                {% for lang in LANGUAGES %}
445
                <a {% if  == lang.0 %}class="current_lang" {% else %}  href="/lang/?l={{lang.0}}" {% endif %}>{{lang.0}}</a>
446
                    {% if not forloop.last %}<span class="sep">~</span>{% endif %}
447
                    {% endfor %}
448
                {% endcomment %}
449
                </div>
450
            </div>
451
            <div class="header-logo">
452
                <a href="/">
453
                    <img src="static/okeanos-logo-alpha.png" alt="okeanos (alpha)"/>
454
                </a>
455
            </div>
456
        </div>
457
        <div id="content">
458
            <div id="wrapper">
459
                <!-- tabs -->
460
                <div class="tab-name">{% trans "machines" %}</div>
461
                <div class="tab-separator"></div>
462
                <ul class="css-tabs">
463
                    <li><a href="machines" title="{% trans "manage  virtual " %}" class="primary" id="machines">
464
                        <img src="static/machines-icon.png" /></a></li><div class="tab-separator"></div>
465
                    <li><a href="networks" title="{% trans "configure " %}" class="primary" id="networks">
466
                        <img src="static/networks-icon.png" /></a></li><div class="tab-separator"></div>
467
                    <li><a href="disks" title="{% trans "manage  storage " %}" class="primary" id="disks">
468
                        <img src="static/disks-icon.png" /></a></li>
469
                </ul>
470
                <div class="css-panes">
471
                    <div id="machines-pane" class="pane" style="display:block;"></div>
472
                    <div id="networks-pane" class="pane"></div>
473
                    <div id="disks-pane" class="pane"></div>
474
                </div>
475
            </div>
476
        </div>
477
        {% include "footer.html" %}
478
    </div>
479

    
480
    <!-- activate tabs with JavaScript -->
481
    <script>
482

483
        $(function() {
484
            // check pane cookie to select the initial pane
485
            var initial = 0, pane = $.cookie("pane");
486
            if (pane > 0)
487
                initial = pane;
488
            //alert(initial);
489
            $("ul.css-tabs").tabs("div.css-panes div.pane", {
490
                initialIndex: initial,
491
                onBeforeClick: function(event, i) {
492
                    this.getPanes().children().remove();
493
                    // get the pane to be opened
494
                    var pane = this.getPanes().eq(i);
495
                    //change the displaying title
496
                    $(".tab-name").text(this.getTabs().eq(i).attr("href"));
497
                    // load it with a page specified in the tab's href attribute
498
                    pane.load(this.getTabs().eq(i).attr("href"),function() {if (!i) {choose_view()}});
499
                }
500
            });
501
        });
502

503
        // set pane cookie whenever the user clicks on a different pane
504
        $("ul.css-tabs a").click(function(i) {
505
            $.cookie("pane", $("ul.css-tabs a").index(this));
506
        });
507

508
        //change menu title on hover
509
        $("ul.css-tabs li").hover(
510
            function () {
511
                if ($(this).find("a.current").length == 0) {
512
                    $(this).parent().parent().find(".tab-name").text($(this).find("a").attr("href"));
513
                }
514
            },
515
            function () {
516
                $(this).parent().parent().find(".tab-name").text($(this).parent().find("a.current").attr("href"));
517
            }
518
        );
519

520
        //load opera css fixes
521
        if ($.browser.opera) {
522
            $("<link/>", {
523
               rel: "stylesheet",
524
               type: "text/css",
525
               href: "static/opera.css"
526
            }).appendTo("head");
527
        }
528

529
        $(document).ready(function(){
530

531
            $(".close-msg-box").live('click', close_all_overlays);
532

533
            {% if current_lang == "el" and not DEBUG %}
534
                window.location = "/lang/?l=en";
535
            {% endif %}
536

537
            // user menu interaction
538
            var resetUserMenu = function() {
539
                $(this).removeClass("hovered");
540
                $(this).removeClass("active");
541
            }
542
            $(".usermenu").live("click", function(){
543
                $(this).addClass("active");
544
            });
545
            $(".usermenu").bind('mouseleave', resetUserMenu);
546
            $(".usermenu").live("mouseover", function(){
547
                $(this).addClass("hovered");
548
            });
549

550
            $(".usermenu li").mouseenter(function(){$(this).addClass("hovered")})
551
            $(".usermenu li").mouseleave(function(){$(this).removeClass("hovered")});
552

553
            // bind menu actions
554
            $(".usermenu .logout").click(function() {
555
                user_session_logout();
556
            });
557

558
            $(".usermenu .invitations").click(show_invitations);
559
            $(".usermenu .feedback").click(show_feedback_form);
560
                
561
        });
562
    </script>
563
    <!-- base notification for error/success reporting -->
564
    <a id="notification" rel="#error-success" href="#"></a>
565
    <a id="msgbox" rel="#notification-box" href="#"></a>
566
    <a id="feedbackbox" rel="#feedback-form" href="#"></a>
567

    
568
    <div class="modal" id="error-success">
569
        <h3 class="popup-header">
570
            <span class="header-box"></span>
571
        </h3>
572
        <div class="popup-body">
573
            <div class="popup-body-inner">
574
                <div class="error-report">
575
                    <div class="send-btn">{% trans "report error" %}</div>
576
                    <div class="sending">{% trans "sending error report..." %}</div>
577
                    <div class="errormsg">{% trans "report failed" %}</div>
578
                    <div class="success">{% trans "report send successfully" %}</div>
579
                </div>
580
                <div class="machine-now-building"></div>
581
                <div class="popup-separator"></div>
582
                <div class="password-container">
583
                    <div class="password-header"></div>
584
                    <div class="password"></div>
585
                </div>
586
                <div class="popup-details">
587
                    <div class="write-password"></div>
588
                    <div class="write-password-details">{% trans "More details about the result"%}</div>
589
                </div>
590
            </div>
591
        </div>
592
    </div>
593

    
594
    <div class="modal" id="feedback-form" class="feedback notification-box">
595
        <h3 class="popup-header">
596
            <span class="header-box">{% trans "Send feedback" %}</span>
597
        </h3>
598
        <div class="popup-body">
599
            <div class="popup-body-inner">
600
                <div class="form-container">
601
                <p class="feedback-intro">
602
                {% blocktrans %}~okeanos is currently in alpha test and we would appreciate any kind of feedback.
603
We welcome any suggestions, questions and bug reports you may have.{% endblocktrans %}</p>
604
                <form id="feedback-form">
605
                    <label for="feedback-msg">{% trans "Please describe your problem here, provide as many details as possible" %}</label>
606
                    <div class="description"></div>
607
                    <div class="empty-error-msg">{% trans "Please provide some feedback" %}</div>
608
                    <textarea name="feedback-msg" class="feedback-text"></textarea>
609

    
610
                    <input type="checkbox" name="submit-submit-data" class='submit-data' />
611
                    <input type="submit" value="{% trans "submit " %}" class="submit" />
612
                    <textarea name="feedback-data" class="data-text"></textarea>
613
                </form>
614
            </div>
615

    
616
            <div class="message sending">{% trans "submiting your data....." %}</div>
617
            <div class="message success">
618
                {% trans "thank you for submiting your feedback" %}
619
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
620
            <div class="message errormsg">
621
                {% trans "some error occured submiting submiting your feedback, please try again later" %}
622
                <span class="close-msg-box"> {% trans "close feedback" %}</span></div>
623
            </div>
624
            </div>
625
        </div>
626
    </div>
627

    
628
    <div class="modal" id="notification-box" class="notification-box">
629
        <h3 class="popup-header">
630
            <span class="header-box"></span>
631
        </h3>
632
        <div class="popup-body">
633
            <div class="popup-body-inner">
634
                <div class="machine-now-building"></div>
635
                <div class="popup-separator"></div>
636
                <div class="password-container">
637
                    <div class="password"></div>
638
                </div>
639
                <div class="sub-text"></div>
640
            </div>
641
        </div>
642
    </div>
643
</body>
644
</html>