From 3058405688d7a700eed46fdbc73a93c4aa5f7bd7 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Fri, 4 Mar 2016 18:16:59 +0100 Subject: [PATCH] Feature #4363: Fix top row style --- src/sunstone/public/app/app.js | 52 ++++----------- .../public/app/sunstone/user_and_zone.hbs | 66 +++++++++++++++++++ .../public/app/utils/menu/top-row.hbs | 16 +++-- .../public/app/utils/tab-datatable/table.hbs | 2 +- src/sunstone/public/scss/_top-row.scss | 7 ++ src/sunstone/public/scss/app.scss | 14 +++- 6 files changed, 107 insertions(+), 50 deletions(-) create mode 100644 src/sunstone/public/app/sunstone/user_and_zone.hbs create mode 100644 src/sunstone/public/scss/_top-row.scss diff --git a/src/sunstone/public/app/app.js b/src/sunstone/public/app/app.js index 1cbf43f22d..3e550e3880 100644 --- a/src/sunstone/public/app/app.js +++ b/src/sunstone/public/app/app.js @@ -29,6 +29,8 @@ define(function(require) { var Locale = require('utils/locale'); var UserInputs = require('utils/user-inputs'); + var UserAndZoneTemplate = require('hbs!sunstone/user_and_zone'); + var _commonDialogs = [ require('utils/dialogs/confirm'), require('utils/dialogs/confirm-with-select'), @@ -87,47 +89,14 @@ define(function(require) { } function _insertUserAndZoneSelector() { - var user_login_content = - '\ - \ - \ - '; - - $(".user-zone-info").html(user_login_content); - $(".user-zone-info").foundation(); + $(".user-zone-info").html(UserAndZoneTemplate({ + displayName: config['display_name'], + settingsTabEnabled: Config.isTabEnabled(SETTINGS_TAB_ID), + availableViews: config['available_views'], + zoneName: config['zone_name'] + })).foundation(); + $('.quickconf_view[view="' + config['user_config']["default_view"] + '"] i').addClass('fa-check'); $(".user-zone-info a.quickconf_view_header").click(function() { var context = $(this).closest('ul'); $(".quickconf_view", context).toggle(); @@ -147,7 +116,8 @@ define(function(require) { success: function (request, obj_list) { $('.zone-ul').empty(); $.each(obj_list, function() { - $('.zone-ul').append('
  • ' + this.ZONE.NAME + '
  • '); + $('.zone-ul').append('
  • ' + + '' + this.ZONE.NAME + '
  • '); }); }, error: Notifier.onError diff --git a/src/sunstone/public/app/sunstone/user_and_zone.hbs b/src/sunstone/public/app/sunstone/user_and_zone.hbs new file mode 100644 index 0000000000..badc2822e4 --- /dev/null +++ b/src/sunstone/public/app/sunstone/user_and_zone.hbs @@ -0,0 +1,66 @@ +{{! -------------------------------------------------------------------------- }} +{{! Copyright 2002-2015, OpenNebula Project, OpenNebula Systems }} +{{! }} +{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }} +{{! not use this file except in compliance with the License. You may obtain }} +{{! a copy of the License at }} +{{! }} +{{! http://www.apache.org/licenses/LICENSE-2.0 }} +{{! }} +{{! Unless required by applicable law or agreed to in writing, software }} +{{! distributed under the License is distributed on an "AS IS" BASIS, }} +{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }} +{{! See the License for the specific language governing permissions and }} +{{! limitations under the License. }} +{{! -------------------------------------------------------------------------- }} + + \ No newline at end of file diff --git a/src/sunstone/public/app/utils/menu/top-row.hbs b/src/sunstone/public/app/utils/menu/top-row.hbs index 677bbfaada..c4ed0ffc6a 100644 --- a/src/sunstone/public/app/utils/menu/top-row.hbs +++ b/src/sunstone/public/app/utils/menu/top-row.hbs @@ -14,13 +14,17 @@ {{! limitations under the License. }} {{! -------------------------------------------------------------------------- }} -
    -
    +
    +
    - - +
    + +
    +
    + +
    diff --git a/src/sunstone/public/app/utils/tab-datatable/table.hbs b/src/sunstone/public/app/utils/tab-datatable/table.hbs index 5e9e1cc0c9..ea96bbc7e0 100644 --- a/src/sunstone/public/app/utils/tab-datatable/table.hbs +++ b/src/sunstone/public/app/utils/tab-datatable/table.hbs @@ -26,7 +26,7 @@
    {{/if}} - +
    diff --git a/src/sunstone/public/scss/_top-row.scss b/src/sunstone/public/scss/_top-row.scss new file mode 100644 index 0000000000..477431ee96 --- /dev/null +++ b/src/sunstone/public/scss/_top-row.scss @@ -0,0 +1,7 @@ +#top-row { + padding: 2rem 0 0 0; + + .opennebula-img { + height: 1.5rem; + } +} \ No newline at end of file diff --git a/src/sunstone/public/scss/app.scss b/src/sunstone/public/scss/app.scss index 87b4047654..7d17bb605f 100644 --- a/src/sunstone/public/scss/app.scss +++ b/src/sunstone/public/scss/app.scss @@ -6,17 +6,27 @@ @import "settings"; @import "foundation"; +@import './top-row'; +@import './menu'; + @include foundation-everything; @font-face { font-family: 'Open Sans'; font-style: normal; - font-weight: 400; + font-weight: 200; font-stretch: condensed; src: local('Open Sans'), local('OpenSans'), url('opensans/opensans.woff') format('woff'); } .right { - float: right !important; } \ No newline at end of file + float: right !important; +} + +table { + input { + margin-bottom: 0px !important; + } +} \ No newline at end of file