From bb2f8d852db627deecde8d41e498422d18e2d182 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 13 Feb 2013 14:39:50 -0800 Subject: [PATCH] Ticket #268: More style improvements, bringing user properties up to style of main UI. --- guacamole/src/main/webapp/scripts/admin-ui.js | 41 ++++++++++++++++++- guacamole/src/main/webapp/styles/ui.css | 33 +++++++-------- 2 files changed, 54 insertions(+), 20 deletions(-) diff --git a/guacamole/src/main/webapp/scripts/admin-ui.js b/guacamole/src/main/webapp/scripts/admin-ui.js index f5e524b2f..a7554c10c 100644 --- a/guacamole/src/main/webapp/scripts/admin-ui.js +++ b/guacamole/src/main/webapp/scripts/admin-ui.js @@ -482,8 +482,18 @@ GuacAdmin.reset = function() { // Create form base elements var form_element = GuacUI.createElement("div", "form"); - var field_table = GuacUI.createChildElement(form_element, "table", "fields"); - var button_div = GuacUI.createChildElement(form_element, "div", "object-buttons"); + var user_header = GuacUI.createChildElement(form_element, "h2"); + var sections = GuacUI.createChildElement( + GuacUI.createChildElement(form_element, "div", "settings section"), + "dl"); + + var field_header = GuacUI.createChildElement(sections, "dt"); + var field_table = GuacUI.createChildElement( + GuacUI.createChildElement(sections, "dd"), + "table", "fields section"); + + user_header.textContent = name; + field_header.textContent = "Properties:"; // Deselect function deselect() { @@ -521,6 +531,33 @@ GuacAdmin.reset = function() { password_modified = true; }; + // If readable connections exist, list them + if (GuacAdmin.hasEntry(permissions.read_connection)) { + + // Add fields for per-connection checkboxes + var connections_header = GuacUI.createChildElement(sections, "dt"); + connections_header.textContent = "Connections:"; + var connections = GuacUI.createChildElement( + GuacUI.createChildElement(sections, "dd"), + "div", "list"); + + for (var conn in permissions.read_connection) { + + var connection = GuacUI.createChildElement(connections, "div", "connection"); + var connection_field = GuacUI.createChildElement(connection, "input"); + var connection_name = GuacUI.createChildElement(connection, "span", "name"); + + connection_field.setAttribute("type", "checkbox"); + + connection_name.textContent = conn; + + } + + } + + // Add buttons + var button_div = GuacUI.createChildElement(form_element, "div", "object-buttons"); + // Add save button var save_button = GuacUI.createChildElement(button_div, "button"); save_button.textContent = "Save"; diff --git a/guacamole/src/main/webapp/styles/ui.css b/guacamole/src/main/webapp/styles/ui.css index 2da651331..6eaada74e 100644 --- a/guacamole/src/main/webapp/styles/ui.css +++ b/guacamole/src/main/webapp/styles/ui.css @@ -129,7 +129,7 @@ h2 { border-top: 1px solid #AAA; border-bottom: 1px solid #AAA; - background: #DDD; + background: rgba(0, 0, 0, 0.07); } @@ -225,8 +225,8 @@ div.section { z-index: 1; border: 1px solid rgba(0, 0, 0, 0.5); - background: #DDD; - padding: 0.5em; + background: #E7E7E7; + padding: 0; margin: 0.25em; -moz-border-radius: 0.2em; @@ -240,11 +240,19 @@ div.section { .form .fields th { font-weight: normal; - font-size: 0.8em; vertical-align: middle; text-align: left; } +.form h2 { + border-top: none; +} + +.form h3 { + font-size: 1em; + margin-bottom: 0.25em; +} + .form { cursor: auto; animation-name: fadein; @@ -253,26 +261,13 @@ div.section { -webkit-animation-duration: 0.125s; } -.form .list { - - border: 1px solid rgba(0, 0, 0, 0.25); - -moz-border-radius: 0.2em; - -webkit-border-radius: 0.2em; - -khtml-border-radius: 0.2em; - border-radius: 0.2em; - - padding: 0.5em; - -} - .object-buttons { text-align: right; - font-size: 0.8em; border-top: 1px solid rgba(0, 0, 0, 0.1); padding-top: 0.5em; - margin-top: 0.5em; + margin: 0.5em; } @@ -313,11 +308,13 @@ div.section { * Settings formatting */ +.form dt, .settings dt { border-bottom: 1px dotted #AAA; padding-bottom: 0.25em; } +.form dd, .settings dd { margin: 1.5em; margin-left: 2.5em;