From 3e8780621bcbade3820b789baacebad63e57bc41 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 19 Feb 2013 17:47:47 +0100 Subject: [PATCH] feature #1664: Update userst-tab css --- src/sunstone/public/css/app.css | 14 ++- .../public/js/plugins/templates-tab.js | 2 +- src/sunstone/public/js/plugins/users-tab.js | 92 ++++++++++++------- src/sunstone/public/js/sunstone.js | 2 +- src/sunstone/public/sass/app.scss | 12 ++- 5 files changed, 82 insertions(+), 40 deletions(-) diff --git a/src/sunstone/public/css/app.css b/src/sunstone/public/css/app.css index 922b51a152..0c22cb6812 100644 --- a/src/sunstone/public/css/app.css +++ b/src/sunstone/public/css/app.css @@ -6208,7 +6208,7 @@ div.button-bar { /* line 210, ../sass/app.scss */ #navigation i { - margin-right: 5px; + margin-right: 3px; } /* line 215, ../sass/app.scss */ @@ -6288,7 +6288,7 @@ div.button-bar { /* line 339, ../sass/app.scss */ .button.small { - font-size: 13px; + font-size: 14px; padding: 6px 12px 6px; box-shadow: none; } @@ -6303,3 +6303,13 @@ div.button-bar { .tabs.vertical li a { padding: 15px 11px; } + +/* line 354, ../sass/app.scss */ +input { + height: 28px !important; +} + +/* line 358, ../sass/app.scss */ +.right { + float: right; +} diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index bcdffd4d17..7cbae19061 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -17,7 +17,7 @@ /*Templates tab plugin*/ var templates_tab_content = '\ -
\ +\
\
\

Templates

\ diff --git a/src/sunstone/public/js/plugins/users-tab.js b/src/sunstone/public/js/plugins/users-tab.js index f774f6eb38..7ff6bbec1d 100644 --- a/src/sunstone/public/js/plugins/users-tab.js +++ b/src/sunstone/public/js/plugins/users-tab.js @@ -42,18 +42,33 @@ var user_acct_graphs = [ var users_tab_content = '\ -

'+tr("Users")+'

\ -\ -
\ +\ +
\ +
\ +

'+tr("Users")+'

\ +
\ +
\ +
\ +
\ +
\
\ -\ +
\ + \ +
\ +
\ +
\ +\ +\ +
\ +
\ +
\ \ \ - \ + \ \ \ \ - \ + \ \ \ \ @@ -63,6 +78,8 @@ var users_tab_content = '\ \ \
'+tr("All")+''+tr("ID")+''+tr("Name")+''+tr("Group")+''+tr("Authentication driver")+''+tr("Auth driver")+''+tr("VMs")+''+tr("Used memory")+''+tr("Used CPU")+'
\ +
\ +
\
\ ?\

\ @@ -105,6 +122,7 @@ var create_user_tmpl = \ \

\ + ×\ \ '; @@ -389,31 +407,35 @@ var user_actions = { var user_buttons = { "User.refresh" : { type: "action", - text: '', + layout: "refresh", alwaysActive: true }, "User.create_dialog" : { type: "create_dialog", - text: tr("+ New"), + layout: "create", condition: mustBeAdmin }, "User.update_dialog" : { type: "action", text: tr("Update properties"), + layout: "more_select", alwaysActive: true }, "User.update_password" : { type : "action", + layout: "more_select", text : tr("Change password") }, "User.quotas_dialog" : { type : "action", + layout: "more_select", text : tr("Update quotas"), condition: mustBeAdmin }, "User.chgrp" : { type: "confirm_with_select", text: tr("Change group"), + layout: "user_select", select: groups_sel, tip: tr("This will change the main group of the selected users. Select the new group")+":", condition: mustBeAdmin @@ -421,6 +443,7 @@ var user_buttons = { "User.chauth" : { type: "confirm_with_select", text: tr("Change authentication"), + layout: "user_select", //We insert our custom select there. select: function() { return '\ @@ -448,13 +471,14 @@ var user_buttons = { "User.delete" : { type: "confirm", text: tr("Delete"), + layout: "del", condition: mustBeAdmin }, - "User.help" : { - type: "action", - text: '?', - alwaysActive: true - } + //"User.help" : { + // type: "action", + // text: '?', + // alwaysActive: true + //} }; @@ -768,13 +792,15 @@ function setupCreateUserDialog(){ dialog.html(create_user_tmpl); //Prepare jquery dialog - dialog.dialog({ - autoOpen: false, - modal:true, - width: 400 - }); + //dialog.dialog({ + // autoOpen: false, + // modal:true, + // width: 400 + //}); - $('button',dialog).button(); + dialog.addClass("reveal-modal"); + + //$('button',dialog).button(); $('input[name="custom_auth"]',dialog).parent().hide(); $('select#driver').change(function(){ @@ -804,7 +830,7 @@ function setupCreateUserDialog(){ } }; Sunstone.runAction("User.create",user_json); - $create_user_dialog.dialog('close'); + $create_user_dialog.trigger("reveal:close") return false; }); } @@ -816,13 +842,15 @@ function setupUpdatePasswordDialog(){ dialog.html(update_pw_tmpl); //Prepare jquery dialog - dialog.dialog({ - autoOpen: false, - modal:true, - width: 400 - }); + //dialog.dialog({ + // autoOpen: false, + // modal:true, + // width: 400 + //}); - $('button',dialog).button(); + dialog.addClass("reveal-modal"); + + //$('button',dialog).button(); $('#update_user_pw_form',dialog).submit(function(){ var pw=$('#new_password',this).val(); @@ -833,7 +861,7 @@ function setupUpdatePasswordDialog(){ } Sunstone.runAction("User.passwd",getSelectedNodes(dataTable_users),pw); - $update_pw_dialog.dialog('close'); + $update_pw_dialog.trigger("reveal:close") return false; }); }; @@ -854,14 +882,14 @@ function popUpUserQuotasDialog(){ } function popUpCreateUserDialog(){ - $create_user_dialog.dialog('open'); + $create_user_dialog.reveal(); } function popUpUpdatePasswordDialog(){ $('#new_password',$update_pw_dialog).val(""); - $update_pw_dialog.dialog('open'); + $update_pw_dialog.reveal(); } // Prepare the autorefresh of the list @@ -879,14 +907,10 @@ function setUserAutorefresh(){ $(document).ready(function(){ //if we are not oneadmin, our tab will not even be in the DOM. dataTable_users = $("#datatable_users",main_tabs_context).dataTable({ - "bJQueryUI": true, - //"bSortClasses": false, - "sPaginationType": "full_numbers", - "sDom" : '<"H"lfrC>t<"F"ip>', + "sDom" : "<'H'>t<'row'<'six columns'i><'six columns'p>>", "oColVis": { "aiExclude": [ 0 ] }, - "bAutoWidth":false, "aoColumnDefs": [ //{ "bSortable": false, "aTargets": ["check"] }, { "sWidth": "60px", "aTargets": [0] }, diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js index 099f9185a1..4596c1eef5 100644 --- a/src/sunstone/public/js/sunstone.js +++ b/src/sunstone/public/js/sunstone.js @@ -554,7 +554,7 @@ function insertButtonsInTab(tab_name){ "
"+ "
"+ "
"+ - '
'+ + '
'+ '
    '+ '
  • '+ "
    "+ diff --git a/src/sunstone/public/sass/app.scss b/src/sunstone/public/sass/app.scss index 0089b8df46..d98f0705a2 100644 --- a/src/sunstone/public/sass/app.scss +++ b/src/sunstone/public/sass/app.scss @@ -208,7 +208,7 @@ div.button-bar { } #navigation i { - margin-right: 5px; + margin-right: 3px; } @@ -337,7 +337,7 @@ div.button-bar { .button.small { - font-size: 13px; + font-size: 14px; padding: 6px 12px 6px; box-shadow: none; } @@ -349,4 +349,12 @@ div.button-bar { .tabs.vertical li a { padding: 15px 11px; +} + +input { + height: 28px !important; +} + +.right { + float: right; } \ No newline at end of file