Revision 30584056

View differences:

src/sunstone/public/app/app.js
29 29
  var Locale = require('utils/locale');
30 30
  var UserInputs = require('utils/user-inputs');
31 31

  
32
  var UserAndZoneTemplate = require('hbs!sunstone/user_and_zone');
33

  
32 34
  var _commonDialogs = [
33 35
    require('utils/dialogs/confirm'),
34 36
    require('utils/dialogs/confirm-with-select'),
......
87 89
  }
88 90

  
89 91
  function _insertUserAndZoneSelector() {
90
    var user_login_content =
91
    '<button type="button" data-toggle="userSelectDropdown" class="button secondary dropdown" id="logout">\
92
      <i class="fa fa-user fa-lg fa-fw header-icon"></i> ' + config['display_name'] + '</button>\
93
      <ul id="userSelectDropdown" data-dropdown data-close-on-click="true" class="dropdown-pane menu vertical">';
94

  
95
    if (config['available_views'].length > 1){
96
        user_login_content +=
97
        '<li><a href="#" class="quickconf_view_header"><i class="fa fa-fw fa-eye"></i> '+Locale.tr("Views")+'</a></li>';
98

  
99
      $.each(config['available_views'], function(i, view) {
100
        var faclass = "";
101

  
102
        if (view == config['user_config']["default_view"]){
103
          faclass = "fa fa-fw fa-check";
104
        } else {
105
          faclass = "fa fa-fw";
106
        }
107

  
108
        user_login_content +=
109
        '<li><a href="#" class="quickconf_view" view="'+view+'"><i class="'+faclass+'"></i> '+view+'</a></li>';
110
      });
111

  
112
      user_login_content +=
113
        '<li><hr/></li>';
114
    }
115

  
116
    if (Config.isTabEnabled(SETTINGS_TAB_ID)){
117
      user_login_content +=
118
        '<li><a href="#" class="configuration"><i class="fa fa-fw fa-cog"></i> '+Locale.tr("Settings")+'</a></li>';
119
    }
120

  
121
    user_login_content +=
122
        '<li><a href="#" class="logout"><i class="fa fa-fw fa-power-off"></i> '+Locale.tr("Sign Out")+'</a></li>\
123
      </ul>\
124
    <button type="button" data-toggle="drop2" class="button secondary dropdown" id="zonelector">\
125
      <i class="fa fa-home fa-lg fa-fw header-icon"></i> ' + config['zone_name'] + '</button>\
126
      <ul id="drop2" data-dropdown data-close-on-click="true" class="zone-ul dropdown-pane menu vertical"></ul>';
127

  
128
    $(".user-zone-info").html(user_login_content);
129
    $(".user-zone-info").foundation();
130

  
92
    $(".user-zone-info").html(UserAndZoneTemplate({
93
      displayName: config['display_name'],
94
      settingsTabEnabled: Config.isTabEnabled(SETTINGS_TAB_ID),
95
      availableViews: config['available_views'],
96
      zoneName: config['zone_name']
97
    })).foundation();
98

  
99
    $('.quickconf_view[view="' + config['user_config']["default_view"] + '"] i').addClass('fa-check');
131 100
    $(".user-zone-info a.quickconf_view_header").click(function() {
132 101
      var context = $(this).closest('ul');
133 102
      $(".quickconf_view", context).toggle();
......
147 116
        success: function (request, obj_list) {
148 117
          $('.zone-ul').empty();
149 118
          $.each(obj_list, function() {
150
            $('.zone-ul').append('<li><a id="' + this.ZONE.NAME + '" class="zone-choice">' + this.ZONE.NAME + '</a></li>');
119
            $('.zone-ul').append('<li>' +
120
              '<a href="#" id="' + this.ZONE.NAME + '" class="zone-choice">' + this.ZONE.NAME + '</a></li>');
151 121
          });
152 122
        },
153 123
        error: Notifier.onError
src/sunstone/public/app/sunstone/user_and_zone.hbs
1
{{! -------------------------------------------------------------------------- }}
2
{{! Copyright 2002-2015, OpenNebula Project, OpenNebula Systems                }}
3
{{!                                                                            }}
4
{{! Licensed under the Apache License, Version 2.0 (the "License"); you may    }}
5
{{! not use this file except in compliance with the License. You may obtain    }}
6
{{! a copy of the License at                                                   }}
7
{{!                                                                            }}
8
{{! http://www.apache.org/licenses/LICENSE-2.0                                 }}
9
{{!                                                                            }}
10
{{! Unless required by applicable law or agreed to in writing, software        }}
11
{{! distributed under the License is distributed on an "AS IS" BASIS,          }}
12
{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   }}
13
{{! See the License for the specific language governing permissions and        }}
14
{{! limitations under the License.                                             }}
15
{{! -------------------------------------------------------------------------- }}
16

  
17
<ul class="dropdown menu" data-disable-hover="true" data-click-open="true" data-alignment="right" data-dropdown-menu>
18
  <li>
19
    <a href="#">
20
      <i class="fa fa-user fa-lg fa-fw header-icon"></i>
21
      {{displayName}}
22
    </a>
23
    <ul class="menu">
24
      {{#if settingsTabEnabled}}
25
      <li>
26
        <a href="#" class="configuration">
27
          <i class="fa fa-fw fa-cog"></i>
28
          {{tr "Settings"}}
29
        </a>
30
      </li>
31
      {{/if}}
32
      <li>
33
        <a href="#" class="logout">
34
          <i class="fa fa-fw fa-power-off"></i>
35
          {{tr "Sign Out"}}
36
        </a>
37
      </li>
38
      {{#if availableViews}}
39
      <li>
40
        <a href="#">
41
          <i class="fa fa-fw fa-eye"></i>
42
          {{tr "Views"}}
43
        </a>
44
        <ul class="menu">
45
          {{#each availableViews}}
46
          <li>
47
            <a href="#" class="quickconf_view" view="{{this}}">
48
              <i class="fa fa-fw"></i> 
49
              {{this}}
50
            </a>
51
          </li>
52
          {{/each}}
53
        </ul>
54
      </li>
55
      {{/if}}
56
    </ul>
57
  </li>
58
  <li>
59
    <a id="zonelector" href="#">
60
      <i class="fa fa-globe fa-lg fa-fw header-icon"></i>
61
      {{zoneName}}
62
    </a>
63
    <ul class="menu zone-ul">
64
    </ul>
65
  </li>
66
</ul>
src/sunstone/public/app/utils/menu/top-row.hbs
14 14
{{! limitations under the License.                                             }}
15 15
{{! -------------------------------------------------------------------------- }}
16 16

  
17
<div class="small-12 columns" style="padding-top: 15px">
18
  <div id="" class="row left-body left-header">
17
<div class="small-12 columns">
18
  <div id="" class="row left-body left-header media-object">
19 19
    <div class="logo-header small-12 medium-4 columns">
20
      <button id="menu-toggle" class="button medium radius secondary white_button">
21
        <i class="fa fa-lg fa-fw fa-bars"></i>
22
      </button>
23
      <img src="{{logo}}" style="height: 20px;vertical-align: middle;"/>
20
      <div class="media-object-section">
21
        <button id="menu-toggle" class="button secondary tiny">
22
          <i class="fa fa-bars"></i>
23
        </button>
24
      </div>
25
      <div class="media-object-section">
26
        <img class="opennebula-img" src="{{logo}}"/>
27
      </div class="media-object-section">
24 28
    </div>
25 29
    <div class="small-12 medium-8 columns">
26 30
      <div class="user-zone-info right">
src/sunstone/public/app/utils/tab-datatable/table.hbs
26 26
    </div>
27 27
  </div>
28 28
  {{/if}}
29
  <table id="{{dataTableId}}" class="datatable twelve">
29
  <table id="{{dataTableId}}" class="hover">
30 30
    <thead>
31 31
      <tr>
32 32
        <th class="check">
src/sunstone/public/scss/_top-row.scss
1
#top-row {
2
  padding: 2rem 0 0 0;
3

  
4
  .opennebula-img {
5
    height: 1.5rem;
6
  }
7
}
src/sunstone/public/scss/app.scss
6 6
@import "settings";
7 7
@import "foundation";
8 8

  
9
@import './top-row';
10
@import './menu';
11

  
9 12
@include foundation-everything;
10 13

  
11 14

  
12 15
@font-face {
13 16
  font-family: 'Open Sans';
14 17
  font-style: normal;
15
  font-weight: 400;
18
  font-weight: 200;
16 19
  font-stretch: condensed;
17 20
  src: local('Open Sans'), local('OpenSans'), url('opensans/opensans.woff') format('woff');
18 21
}
19 22

  
20 23

  
21 24
.right {
22
  float: right !important; }
25
  float: right !important; 
26
}
27

  
28
table {
29
  input {
30
    margin-bottom: 0px !important;
31
  }
32
}

Also available in: Unified diff