Statistics
| Branch: | Tag: | Revision:

root / ui / templates / home.html @ a4531705

History | View | Annotate | Download (5.3 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

    
11
        <link rel="stylesheet" type="text/css" href="static/main.css"/>        
12

    
13
</head>
14
<body>
15
    <div id="wrapper">
16
        <div id='user'>
17
            <a href="#">{% trans "username" %}</a> &nbsp;|&nbsp; <a href="#">{% trans "settings" %}</a>
18
            {% get_available_languages as LANGUAGES %}
19
            {% for lang in LANGUAGES %}
20
                &nbsp;|&nbsp;
21
                <a {% if  == lang.0 %}class="current_lang" {% else %}  href="/lang/?l={{lang.0}}" {% endif %}>{{lang.0}}</a> 
22
            {% endfor %}
23
        </div>
24
        <div id='header'>
25
            <a href="/" class="logo">
26
                <img src="static/nefo.png" alt="+nefo"/>
27
            </a>
28
            <div class='fatborder'></div>
29
        </div>
30
        <!-- tabs -->
31
        <ul class="css-tabs">
32
                <li><a href="machines" title="{% trans "manage  virtual " %}" class="primary" id="machines">
33
                {% trans "machines" %}</a></li>
34
                <li><a href="disks" title="{% trans "manage  storage " %}" class="primary" id="disks">
35
                {% trans "disks" %}</a></li>
36
                <li><a href="images" title="{% trans "manage  images" %}" class="primary" id="images">
37
                {% trans "images" %}</a></li>
38
                <li><a href="networks" title="{% trans "configure " %}" class="primary" id="networks">
39
                {% trans "networks" %}</a></li>
40
            <li><a href="files" title="{% trans "your " %}" class="secondary" id="files">
41
                {% trans "files" %}</a></li>
42
                <li><a href="desktops" title="{% trans "your " %}" class="secondary" id="desktops">
43
                {% trans "desktops" %}</a></li>
44
                <li><a href="apps" title="{% trans "your " %}" class="secondary" id="apps">
45
                {% trans "apps" %}</a></li>
46
        </ul>
47
        <div class="more-tabs"><img src="static/arrow.png" id="arrow"></img></div>
48
        <div class="css-panes">
49
                <div id="machines-pane" class="pane" style="display:block">{% include "machines.html" %}</div>
50
                <div id="disks-pane" class="pane"></div>
51
                <div id="images-pane" class="pane"></div>
52
                <div id="networks-pane" class="pane"></div>
53
            <div id="files-pane" class="pane"></div>
54
                <div id="desktops-pane" class="pane"></div>
55
                <div id="apps-pane" class="pane"></div>
56
        </div>
57
    </div>
58
    <!-- activate tabs with JavaScript -->
59
    <script>
60
                $(function() {
61
                    $('ul.css-tabs li').hover(function(){
62
                            $(this).find('a:not(.current)').animate({top:'0px'},{queue:false,duration:150});
63
            }, function(){
64
                $('ul.css-tabs li a:not(.current)').animate({top:'9px'},{queue:false,duration:150});
65
                    });
66
                });
67
                
68
        $(function() {
69
                $("ul.css-tabs").tabs("div.css-panes div.pane", {        
70
                        onBeforeClick: function(event, i) {
71
                    $('ul.css-tabs li a').animate({top:'9px'},{queue:false,duration:150});
72
                                // get the pane to be opened
73
                                var pane = this.getPanes().eq(i);
74
                    pane.text('');
75
                                // load it with a page specified in the tab's href attribute
76
                                pane.load(this.getTabs().eq(i).attr("href"));
77

78
                        }
79
                });
80
        });
81

82
        // toggle main menu
83
        $("#arrow").click(function(event){
84
                toggleMenu();
85
        }); 
86
                
87
                function toggleMenu() {
88
                var primary = $("ul.css-tabs li a.primary");
89
            var secondary = $("ul.css-tabs li a.secondary");
90
            var all = $("ul.css-tabs li a");                        
91
                        var toggled = $('ul.css-tabs li a.current').hasClass('secondary');
92
                        
93
                        // if anything is still moving, do nothing
94
                if ($(":animated").length) {
95
                        return;
96
                } 
97
                
98
                // nothing is current to begin with
99
            $('ul.css-tabs li a.current').removeClass('current');
100
                        
101
                        // move stuff around
102
            all.animate({top:'30px'}, {complete: function() { 
103
                $(this).hide();
104
                if (toggled) {
105
                        primary.show();
106
                        primary.animate({top:'9px'}, {complete: function() {
107
                                $('ul.css-tabs li a.primary#machines').addClass('current');
108
                                $('a#machines').click();                                   
109
                        }});
110
                } else {
111
                        secondary.show();
112
                        secondary.animate({top:'9px'}, {complete: function() {
113
                                $('ul.css-tabs li a.secondary#files').addClass('current');
114
                                $('a#files').click();                                                                           
115
                        }});
116
                }                                              
117
            }});
118
            
119
            // rotate arrow icon
120
            if (toggled) {
121
                    $("#arrow").rotate({animateAngle: (0), bind:[{"click":function(){toggleMenu()}}]});
122
                    $("#arrow").rotateAnimation(0);                    
123
            } else {
124
                    $("#arrow").rotate({animateAngle: (-180), bind:[{"click":function(){toggleMenu()}}]});
125
                    $("#arrow").rotateAnimation(-180);
126
            }            
127
                }  
128
    </script>
129
</body>
130
</html>
131