From e060b6dfed1d4ea25c24a9de4291d58c2491c7df Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 8 Dec 2015 13:49:51 -0800 Subject: [PATCH 1/3] GUAC-1406: Generalize header formatting into own stylesheet. --- .../src/main/webapp/app/home/styles/home.css | 15 --- .../main/webapp/app/index/styles/headers.css | 107 ++++++++++++++++++ .../src/main/webapp/app/index/styles/ui.css | 73 +----------- 3 files changed, 108 insertions(+), 87 deletions(-) create mode 100644 guacamole/src/main/webapp/app/index/styles/headers.css diff --git a/guacamole/src/main/webapp/app/home/styles/home.css b/guacamole/src/main/webapp/app/home/styles/home.css index f055bd314..d34ca6f1d 100644 --- a/guacamole/src/main/webapp/app/home/styles/home.css +++ b/guacamole/src/main/webapp/app/home/styles/home.css @@ -53,18 +53,3 @@ div.recent-connections div.connection { max-width: 75%; overflow: hidden; } - -.connection-list-ui .header .filter { - margin: 0; - padding: 0.75em 0.5em; -} - -.connection-list-ui .header .filter input { - -moz-border-radius: 0; - -webkit-border-radius: 0; - -khtml-border-radius: 0; - border-radius: 0; - border: none; - border-left: 1px solid rgba(0, 0, 0, 0.125); - background-color: transparent; -} diff --git a/guacamole/src/main/webapp/app/index/styles/headers.css b/guacamole/src/main/webapp/app/index/styles/headers.css new file mode 100644 index 000000000..4da0a240f --- /dev/null +++ b/guacamole/src/main/webapp/app/index/styles/headers.css @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2015 Glyptodon LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +h1 { + + margin: 0; + padding: 0.5em; + + font-size: 2em; + vertical-align: middle; + text-align: center; + +} + +h2 { + font-size: 1.25em; + font-weight: bold; + text-transform: uppercase; + padding: 0.75em 0.5em; + margin: 0; +} + +.header { + + border-bottom: 1px solid rgba(0, 0, 0, 0.125); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.125); + background: rgba(0, 0, 0, 0.04); + + margin-bottom: 1em; + margin-top: 0; + border-top: none; + width: 100%; + + /* IE10 */ + display: -ms-flexbox; + -ms-flex-align: stretch; + -ms-flex-direction: row; + + /* Ancient Mozilla */ + display: -moz-box; + -moz-box-align: stretch; + -moz-box-orient: horizontal; + + /* Ancient WebKit */ + display: -webkit-box; + -webkit-box-align: stretch; + -webkit-box-orient: horizontal; + + /* Old WebKit */ + display: -webkit-flex; + -webkit-align-items: stretch; + -webkit-flex-direction: row; + + /* W3C */ + display: flex; + align-items: stretch; + flex-direction: row; + +} + +.header ~ * .header, +.header ~ .header { + margin-top: 1em; + border-top: 1px solid rgba(0, 0, 0, 0.125); +} + +.header h2 { + -ms-flex: 1 1 auto; + -moz-box-flex: 1; + -webkit-box-flex: 1; + -webkit-flex: 1 1 auto; + flex: 1 1 auto; +} + +.header .filter { + margin: 0; + padding: 0.75em 0.5em; +} + +.header .filter input { + -moz-border-radius: 0; + -webkit-border-radius: 0; + -khtml-border-radius: 0; + border-radius: 0; + border: none; + border-left: 1px solid rgba(0, 0, 0, 0.125); + background-color: transparent; +} diff --git a/guacamole/src/main/webapp/app/index/styles/ui.css b/guacamole/src/main/webapp/app/index/styles/ui.css index 281895178..a7a92ae39 100644 --- a/guacamole/src/main/webapp/app/index/styles/ui.css +++ b/guacamole/src/main/webapp/app/index/styles/ui.css @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Glyptodon LLC + * Copyright (C) 2015 Glyptodon LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -39,77 +39,6 @@ img { vertical-align: middle; } -h1 { - - margin: 0; - padding: 0.5em; - - font-size: 2em; - vertical-align: middle; - text-align: center; - -} - -h2 { - font-size: 1.25em; - font-weight: bold; - text-transform: uppercase; - padding: 0.75em 0.5em; - margin: 0; -} - -.header { - - border-bottom: 1px solid rgba(0, 0, 0, 0.125); - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.125); - background: rgba(0, 0, 0, 0.04); - - margin-bottom: 1em; - margin-top: 0; - border-top: none; - width: 100%; - - /* IE10 */ - display: -ms-flexbox; - -ms-flex-align: stretch; - -ms-flex-direction: row; - - /* Ancient Mozilla */ - display: -moz-box; - -moz-box-align: stretch; - -moz-box-orient: horizontal; - - /* Ancient WebKit */ - display: -webkit-box; - -webkit-box-align: stretch; - -webkit-box-orient: horizontal; - - /* Old WebKit */ - display: -webkit-flex; - -webkit-align-items: stretch; - -webkit-flex-direction: row; - - /* W3C */ - display: flex; - align-items: stretch; - flex-direction: row; - -} - -.header ~ * .header, -.header ~ .header { - margin-top: 1em; - border-top: 1px solid rgba(0, 0, 0, 0.125); -} - -.header h2 { - -ms-flex: 1 1 auto; - -moz-box-flex: 1; - -webkit-box-flex: 1; - -webkit-flex: 1 1 auto; - flex: 1 1 auto; -} - div.section { margin: 1em; padding: 0; From c31e865b4905c03eba39f45e5f7b3261f1b1a3ef Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 8 Dec 2015 13:56:24 -0800 Subject: [PATCH 2/3] GUAC-1406: Remove injection of unused $q service from manageUserController. --- .../main/webapp/app/manage/controllers/manageUserController.js | 1 - 1 file changed, 1 deletion(-) diff --git a/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js b/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js index ebd8530ff..77bd7d1a1 100644 --- a/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js +++ b/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js @@ -36,7 +36,6 @@ angular.module('manage').controller('manageUserController', ['$scope', '$injecto // Required services var $location = $injector.get('$location'); var $routeParams = $injector.get('$routeParams'); - var $q = $injector.get('$q'); var authenticationService = $injector.get('authenticationService'); var connectionGroupService = $injector.get('connectionGroupService'); var dataSourceService = $injector.get('dataSourceService'); From 8e0dbfc36ee25a4023ea59f0db5cff74a2513dd2 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 8 Dec 2015 13:55:33 -0800 Subject: [PATCH 3/3] GUAC-1406: Add filtering to connection permissions within user edit screen. --- .../controllers/manageUserController.js | 21 ++++++++++++++++++- .../app/manage/templates/manageUser.html | 11 ++++++++-- .../src/main/webapp/translations/de.json | 2 ++ .../src/main/webapp/translations/en.json | 2 ++ .../src/main/webapp/translations/fr.json | 2 ++ .../src/main/webapp/translations/it.json | 2 ++ .../src/main/webapp/translations/nl.json | 2 ++ .../src/main/webapp/translations/ru.json | 2 ++ 8 files changed, 41 insertions(+), 3 deletions(-) diff --git a/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js b/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js index 77bd7d1a1..700eecbb3 100644 --- a/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js +++ b/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js @@ -119,7 +119,26 @@ angular.module('manage').controller('manageUserController', ['$scope', '$injecto * @type Object. */ $scope.rootGroups = null; - + + /** + * Array of all connection properties that are filterable. + * + * @type String[] + */ + $scope.filteredConnectionProperties = [ + 'name', + 'protocol' + ]; + + /** + * Array of all connection group properties that are filterable. + * + * @type String[] + */ + $scope.filteredConnectionGroupProperties = [ + 'name' + ]; + /** * A map of data source identifiers to the set of all permissions * associated with the current user under that data source, or null if the diff --git a/guacamole/src/main/webapp/app/manage/templates/manageUser.html b/guacamole/src/main/webapp/app/manage/templates/manageUser.html index 79fb34dcc..6d275e5c1 100644 --- a/guacamole/src/main/webapp/app/manage/templates/manageUser.html +++ b/guacamole/src/main/webapp/app/manage/templates/manageUser.html @@ -87,11 +87,18 @@ THE SOFTWARE.
-

{{'MANAGE_USER.SECTION_HEADER_CONNECTIONS' | translate}}

+
+

{{'MANAGE_USER.SECTION_HEADER_CONNECTIONS' | translate}}

+ +
diff --git a/guacamole/src/main/webapp/translations/de.json b/guacamole/src/main/webapp/translations/de.json index 5940dcd2e..996f6adbb 100644 --- a/guacamole/src/main/webapp/translations/de.json +++ b/guacamole/src/main/webapp/translations/de.json @@ -254,6 +254,8 @@ "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", "FIELD_HEADER_USERNAME" : "Benutzername:", + "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", + "INFO_READ_ONLY" : "Dieses Benutzerkonto kann nicht bearbeitet werden.", "SECTION_HEADER_CONNECTIONS" : "Verbindungen", diff --git a/guacamole/src/main/webapp/translations/en.json b/guacamole/src/main/webapp/translations/en.json index caf3cbdbd..951b38b03 100644 --- a/guacamole/src/main/webapp/translations/en.json +++ b/guacamole/src/main/webapp/translations/en.json @@ -254,6 +254,8 @@ "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", "FIELD_HEADER_USERNAME" : "Username:", + "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", + "INFO_READ_ONLY" : "Sorry, but this user account cannot be edited.", "SECTION_HEADER_CONNECTIONS" : "Connections", diff --git a/guacamole/src/main/webapp/translations/fr.json b/guacamole/src/main/webapp/translations/fr.json index e1a835120..c8fa6be22 100644 --- a/guacamole/src/main/webapp/translations/fr.json +++ b/guacamole/src/main/webapp/translations/fr.json @@ -245,6 +245,8 @@ "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", "FIELD_HEADER_USERNAME" : "Identifiant:", + "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", + "SECTION_HEADER_CONNECTIONS" : "Connexions", "SECTION_HEADER_EDIT_USER" : "Modifier Utilisateur", "SECTION_HEADER_PERMISSIONS" : "Permissions", diff --git a/guacamole/src/main/webapp/translations/it.json b/guacamole/src/main/webapp/translations/it.json index 3c71c0841..0dea25c3f 100644 --- a/guacamole/src/main/webapp/translations/it.json +++ b/guacamole/src/main/webapp/translations/it.json @@ -242,6 +242,8 @@ "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", "FIELD_HEADER_USERNAME" : "Username:", + "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", + "SECTION_HEADER_CONNECTIONS" : "Connessioni", "SECTION_HEADER_EDIT_USER" : "Modifica Utente", "SECTION_HEADER_PERMISSIONS" : "Permessi", diff --git a/guacamole/src/main/webapp/translations/nl.json b/guacamole/src/main/webapp/translations/nl.json index 111b99ae8..4dbdd8c47 100644 --- a/guacamole/src/main/webapp/translations/nl.json +++ b/guacamole/src/main/webapp/translations/nl.json @@ -254,6 +254,8 @@ "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", "FIELD_HEADER_USERNAME" : "Gebruikersnaam:", + "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", + "INFO_READ_ONLY" : "Sorry, maar dit gebruikers account kan niet gewijzigd worden", "SECTION_HEADER_CONNECTIONS" : "Verbindingen", diff --git a/guacamole/src/main/webapp/translations/ru.json b/guacamole/src/main/webapp/translations/ru.json index 822faf72b..6ac7fbe0c 100644 --- a/guacamole/src/main/webapp/translations/ru.json +++ b/guacamole/src/main/webapp/translations/ru.json @@ -242,6 +242,8 @@ "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", "FIELD_HEADER_USERNAME" : "Имя пользователя:", + "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", + "SECTION_HEADER_CONNECTIONS" : "Подключения", "SECTION_HEADER_EDIT_USER" : "Редактировать пользователя", "SECTION_HEADER_PERMISSIONS" : "Разрешения",