From c0eda1273f338c8f488f1ce5df1b2d9a3071d69a Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 18 Apr 2015 01:20:49 -0700 Subject: [PATCH] GUAC-1053: Add user preferences page, visible to all users. --- .../navigation/services/userPageService.js | 6 +++ .../app/navigation/styles/user-menu.css | 3 +- .../directives/guacSettingsPreferences.js | 42 +++++++++++++++++++ .../app/settings/templates/settings.html | 1 + .../templates/settingsPreferences.html | 27 ++++++++++++ .../src/main/webapp/translations/en_US.json | 6 +++ 6 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 guacamole/src/main/webapp/app/settings/directives/guacSettingsPreferences.js create mode 100644 guacamole/src/main/webapp/app/settings/templates/settingsPreferences.html diff --git a/guacamole/src/main/webapp/app/navigation/services/userPageService.js b/guacamole/src/main/webapp/app/navigation/services/userPageService.js index 2ff396d56..86453c576 100644 --- a/guacamole/src/main/webapp/app/navigation/services/userPageService.js +++ b/guacamole/src/main/webapp/app/navigation/services/userPageService.js @@ -223,6 +223,12 @@ angular.module('navigation').factory('userPageService', ['$injector', )); } + // Add link to user preferences (always accessible) + pages.push(new Page( + 'USER_MENU.ACTION_MANAGE_PREFERENCES', + '/settings/preferences' + )); + return pages; }; diff --git a/guacamole/src/main/webapp/app/navigation/styles/user-menu.css b/guacamole/src/main/webapp/app/navigation/styles/user-menu.css index b2a649233..708c37efc 100644 --- a/guacamole/src/main/webapp/app/navigation/styles/user-menu.css +++ b/guacamole/src/main/webapp/app/navigation/styles/user-menu.css @@ -196,7 +196,8 @@ .user-menu .options li a[href="#/settings/users"], .user-menu .options li a[href="#/settings/connections"], -.user-menu .options li a[href="#/settings/sessions"] { +.user-menu .options li a[href="#/settings/sessions"], +.user-menu .options li a[href="#/settings/preferences"] { background-image: url('images/action-icons/guac-config-dark.png'); } diff --git a/guacamole/src/main/webapp/app/settings/directives/guacSettingsPreferences.js b/guacamole/src/main/webapp/app/settings/directives/guacSettingsPreferences.js new file mode 100644 index 000000000..002624964 --- /dev/null +++ b/guacamole/src/main/webapp/app/settings/directives/guacSettingsPreferences.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +/** + * A directive for managing preferences local to the current user. + */ +angular.module('settings').directive('guacSettingsPreferences', [function guacSettingsPreferences() { + + return { + // Element only + restrict: 'E', + replace: true, + + scope: { + }, + + templateUrl: 'app/settings/templates/settingsPreferences.html', + controller: ['$scope', '$injector', function settingsPreferencesController($scope, $injector) { + + }] + }; + +}]); diff --git a/guacamole/src/main/webapp/app/settings/templates/settings.html b/guacamole/src/main/webapp/app/settings/templates/settings.html index 59ac3d35e..4ba42a616 100644 --- a/guacamole/src/main/webapp/app/settings/templates/settings.html +++ b/guacamole/src/main/webapp/app/settings/templates/settings.html @@ -36,5 +36,6 @@ THE SOFTWARE. + diff --git a/guacamole/src/main/webapp/app/settings/templates/settingsPreferences.html b/guacamole/src/main/webapp/app/settings/templates/settingsPreferences.html new file mode 100644 index 000000000..c5e072aa5 --- /dev/null +++ b/guacamole/src/main/webapp/app/settings/templates/settingsPreferences.html @@ -0,0 +1,27 @@ +
+ + + +

TODO

+ +
\ No newline at end of file diff --git a/guacamole/src/main/webapp/translations/en_US.json b/guacamole/src/main/webapp/translations/en_US.json index c4a00f81f..1136719d8 100644 --- a/guacamole/src/main/webapp/translations/en_US.json +++ b/guacamole/src/main/webapp/translations/en_US.json @@ -11,6 +11,7 @@ "ACTION_LOGIN" : "Login", "ACTION_LOGOUT" : "Logout", "ACTION_MANAGE_CONNECTIONS" : "Connections", + "ACTION_MANAGE_PREFERENCES" : "Preferences", "ACTION_MANAGE_SETTINGS" : "Settings", "ACTION_MANAGE_SESSIONS" : "Active Sessions", "ACTION_MANAGE_USERS" : "Users", @@ -399,6 +400,10 @@ }, + "SETTINGS_PREFERENCES" : { + + }, + "SETTINGS_USERS" : { "ACTION_ACKNOWLEDGE" : "@:APP.ACTION_ACKNOWLEDGE", @@ -447,6 +452,7 @@ "ACTION_CHANGE_PASSWORD" : "@:APP.ACTION_CHANGE_PASSWORD", "ACTION_LOGOUT" : "@:APP.ACTION_LOGOUT", "ACTION_MANAGE_CONNECTIONS" : "@:APP.ACTION_MANAGE_CONNECTIONS", + "ACTION_MANAGE_PREFERENCES" : "@:APP.ACTION_MANAGE_PREFERENCES", "ACTION_MANAGE_SESSIONS" : "@:APP.ACTION_MANAGE_SESSIONS", "ACTION_MANAGE_SETTINGS" : "@:APP.ACTION_MANAGE_SETTINGS", "ACTION_MANAGE_USERS" : "@:APP.ACTION_MANAGE_USERS",