diff --git a/install.sh b/install.sh index e3ef5f3dd3..489e051632 100755 --- a/install.sh +++ b/install.sh @@ -1053,7 +1053,8 @@ SUNSTONE_PUBLIC_JS_PLUGINS_FILES="\ src/sunstone/public/js/plugins/users-tab.js \ src/sunstone/public/js/plugins/vms-tab.js \ src/sunstone/public/js/plugins/acls-tab.js \ - src/sunstone/public/js/plugins/vnets-tab.js" + src/sunstone/public/js/plugins/vnets-tab.js \ + src/sunstone/public/js/plugins/config-tab.js" SUNSTONE_PUBLIC_CSS_FILES="src/sunstone/public/css/application.css \ src/sunstone/public/css/layout.css \ diff --git a/src/sunstone/etc/sunstone-plugins.yaml b/src/sunstone/etc/sunstone-plugins.yaml index 38228d404e..ce33cfff64 100644 --- a/src/sunstone/etc/sunstone-plugins.yaml +++ b/src/sunstone/etc/sunstone-plugins.yaml @@ -45,3 +45,7 @@ :user: :group: oneadmin: true +- plugins/config-tab.js: + :ALL: true + :user: + :group: diff --git a/src/sunstone/public/css/layout.css b/src/sunstone/public/css/layout.css index 63630c8911..f5fbf16d98 100644 --- a/src/sunstone/public/css/layout.css +++ b/src/sunstone/public/css/layout.css @@ -169,15 +169,3 @@ background-image: -moz-linear-gradient( #navigation li:hover a, .navigation-active-li-a { color: #ffffff !important; } - -#language { - float:right; - margin-top:2px; - margin-right:25px; - width: 100px; -} - -#language select { - width: 100px; - height: 22px; -} diff --git a/src/sunstone/public/js/locale.js b/src/sunstone/public/js/locale.js index 28628c96de..d5b1e970c5 100644 --- a/src/sunstone/public/js/locale.js +++ b/src/sunstone/public/js/locale.js @@ -31,7 +31,7 @@ function tr(str){ //Updates template and session configuration and reloads the view. function setLang(lang_str){ var lang_tmp=""; - var dialog = $('
Loading new language... please wait '+spinner+'
').dialog({ + var dialog = $('
'+tr("Loading new language... please wait")+' '+spinner+'
').dialog({ draggable:false, modal:true, resizable:false, @@ -79,12 +79,6 @@ function setLang(lang_str){ }; $(document).ready(function(){ - if (lang) - $('#lang_sel option[value="'+lang+'"]').attr('selected','selected'); - $('#lang_sel').change(function(){ - setLang($(this).val()); - }); - //Update static translations $('#doc_link').text(tr("Documentation")); $('#support_link').text(tr("Support")); diff --git a/src/sunstone/public/js/plugins/config-tab.js b/src/sunstone/public/js/plugins/config-tab.js new file mode 100644 index 0000000000..cba0c032ca --- /dev/null +++ b/src/sunstone/public/js/plugins/config-tab.js @@ -0,0 +1,58 @@ +/* -------------------------------------------------------------------------- */ +/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */ +/* */ +/* 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. */ +/* -------------------------------------------------------------------------- */ + +var config_tab_content = +'
\ +\ + \ + \ + \ +
\ +
\ +

' + tr("Sunstone UI Configuration") + '

\ +
\ +\ + \ + \ + \ + \ + \ +
' + tr("Language") + '\ + \ +
\ +\ +
\ +
\ +
'; + +var config_tab = { + title: tr("Configuration"), + content: config_tab_content +} + +Sunstone.addMainTab('config_tab',config_tab); + +$(document).ready(function(){ + if (lang) + $('table#config_table #lang_sel option[value="'+lang+'"]').attr('selected','selected'); + $('table#config_table #lang_sel').change(function(){ + setLang($(this).val()); + }); + +}); \ No newline at end of file diff --git a/src/sunstone/public/locale/en_US/en_US.js b/src/sunstone/public/locale/en_US/en_US.js index 64da830846..1c0df1f1fe 100644 --- a/src/sunstone/public/locale/en_US/en_US.js +++ b/src/sunstone/public/locale/en_US/en_US.js @@ -51,9 +51,11 @@ locale={ "Change group":"", "Change owner":"", "Change password":"", + "Changing language":"", "Clone":"", "Clone this image":"", "Community":"", + "Configuration":"", "Confirmation of action":"", "Context":"", "Context variable name and value must be filled in":"", @@ -114,6 +116,7 @@ locale={ "Dummy":"", "EC2":"", "Enable":"", + "English":"", "Error":"", "failed":"", "fd":"", @@ -186,6 +189,7 @@ locale={ "Keyboard configuration locale to use in the VNC display":"", "Keymap":"", "KVM":"", + "Language":"", "LCM State":"", "Lease IP":"", "Lease MAC (opt):":"", @@ -314,6 +318,7 @@ locale={ "running":"", "Running VMs":"", "Running #VMS":"", + "Russian":"", "Save":"", "Save as":"", "Saveas for VM with ID":"", @@ -353,6 +358,7 @@ locale={ "Stop":"", "Submitted":"", "Summary of resources":"", + "Sunstone UI Configuration":"", "Support":"", "Suspend":"", "Swap":"", diff --git a/src/sunstone/views/index.erb b/src/sunstone/views/index.erb index 5cf0daab40..51b4a29ad7 100644 --- a/src/sunstone/views/index.erb +++ b/src/sunstone/views/index.erb @@ -68,14 +68,6 @@
Welcome  | Sign Out
-
-
- -
-