diff --git a/extensions/guacamole-auth-totp/src/main/resources/templates/authenticationCodeField.html b/extensions/guacamole-auth-totp/src/main/resources/templates/authenticationCodeField.html index 30c07f434..7f2a3c485 100644 --- a/extensions/guacamole-auth-totp/src/main/resources/templates/authenticationCodeField.html +++ b/extensions/guacamole-auth-totp/src/main/resources/templates/authenticationCodeField.html @@ -41,6 +41,7 @@
diff --git a/guacamole/src/main/frontend/src/app/client/directives/guacClientNotification.js b/guacamole/src/main/frontend/src/app/client/directives/guacClientNotification.js index fadeab4cb..e1a08ebc6 100644 --- a/guacamole/src/main/frontend/src/app/client/directives/guacClientNotification.js +++ b/guacamole/src/main/frontend/src/app/client/directives/guacClientNotification.js @@ -243,6 +243,7 @@ angular.module('client').directive('guacClientNotification', [function guacClien if (connectionState === ManagedClientState.ConnectionState.CONNECTING || connectionState === ManagedClientState.ConnectionState.WAITING) { $scope.status = { + className : "connecting", title: "CLIENT.DIALOG_HEADER_CONNECTING", text: { key : "CLIENT.TEXT_CLIENT_STATUS_" + connectionState.toUpperCase() @@ -360,6 +361,7 @@ angular.module('client').directive('guacClientNotification', [function guacClien // Prompt for parameters $scope.status = { + className : "parameters-required", formNamespace : Protocol.getNamespace($scope.client.protocol), forms : $scope.client.forms, formModel : requiredParameters, diff --git a/guacamole/src/main/frontend/src/app/client/templates/connection.html b/guacamole/src/main/frontend/src/app/client/templates/connection.html index 305a5889a..ae5ef91f1 100644 --- a/guacamole/src/main/frontend/src/app/client/templates/connection.html +++ b/guacamole/src/main/frontend/src/app/client/templates/connection.html @@ -1,4 +1,4 @@ -
+
diff --git a/guacamole/src/main/frontend/src/app/client/templates/connectionGroup.html b/guacamole/src/main/frontend/src/app/client/templates/connectionGroup.html index 48c707f45..2e7d794cd 100644 --- a/guacamole/src/main/frontend/src/app/client/templates/connectionGroup.html +++ b/guacamole/src/main/frontend/src/app/client/templates/connectionGroup.html @@ -1,4 +1,4 @@ -
+
+
diff --git a/guacamole/src/main/frontend/src/app/client/templates/guacClient.html b/guacamole/src/main/frontend/src/app/client/templates/guacClient.html index 57b859c55..46a78d661 100644 --- a/guacamole/src/main/frontend/src/app/client/templates/guacClient.html +++ b/guacamole/src/main/frontend/src/app/client/templates/guacClient.html @@ -1,4 +1,4 @@ -
-
\ No newline at end of file +
diff --git a/guacamole/src/main/frontend/src/app/form/directives/form.js b/guacamole/src/main/frontend/src/app/form/directives/form.js index 81f500fc9..8d35774c7 100644 --- a/guacamole/src/main/frontend/src/app/form/directives/form.js +++ b/guacamole/src/main/frontend/src/app/form/directives/form.js @@ -86,6 +86,7 @@ angular.module('form').directive('guacForm', [function form() { controller: ['$scope', '$injector', function formController($scope, $injector) { // Required services + var formService = $injector.get('formService'); var translationStringService = $injector.get('translationStringService'); /** @@ -134,6 +135,22 @@ angular.module('form').directive('guacForm', [function form() { }; + /** + * Returns an object as would be provided to the ngClass directive + * that defines the CSS classes that should be applied to the given + * form. + * + * @param {Form} form + * The form to generate the CSS classes for. + * + * @return {!Object.} + * The ngClass object defining the CSS classes for the given + * form. + */ + $scope.getFormClasses = function getFormClasses(form) { + return formService.getClasses('form-', form); + }; + /** * Determines whether the given object is a form, under the * assumption that the object is either a form or a field. diff --git a/guacamole/src/main/frontend/src/app/form/directives/formField.js b/guacamole/src/main/frontend/src/app/form/directives/formField.js index fbc0cfecf..4fcead1d6 100644 --- a/guacamole/src/main/frontend/src/app/form/directives/formField.js +++ b/guacamole/src/main/frontend/src/app/form/directives/formField.js @@ -155,6 +155,21 @@ angular.module('form').directive('guacFormField', [function formField() { }; + /** + * Returns an object as would be provided to the ngClass directive + * that defines the CSS classes that should be applied to this + * field. + * + * @return {!Object.} + * The ngClass object defining the CSS classes for the current + * field. + */ + $scope.getFieldClasses = function getFieldClasses() { + return formService.getClasses('labeled-field-', $scope.field, { + empty: !$scope.model + }); + }; + /** * Returns whether the current field should be displayed. * diff --git a/guacamole/src/main/frontend/src/app/form/services/formService.js b/guacamole/src/main/frontend/src/app/form/services/formService.js index 0e9155c09..d2ac6be73 100644 --- a/guacamole/src/main/frontend/src/app/form/services/formService.js +++ b/guacamole/src/main/frontend/src/app/form/services/formService.js @@ -91,7 +91,7 @@ angular.module('form').provider('formService', function formServiceProvider() { * @type FieldType */ 'USERNAME' : { - templateUrl : 'app/form/templates/textField.html' + templateUrl : 'app/form/templates/usernameField.html' }, /** @@ -272,6 +272,53 @@ angular.module('form').provider('formService', function formServiceProvider() { }; + /** + * Given form content and an arbitrary prefix, returns a corresponding + * CSS class object as would be provided to the ngClass directive that + * assigns a content-specific CSS class based on the prefix and + * form/field name. Generated class names follow the lowercase with + * dashes naming convention. For example, if the prefix is "field-" and + * the provided content is a field with the name "Swap red/blue", the + * object { 'field-swap-red-blue' : true } would be returned. + * + * @param {!string} prefix + * The arbitrary prefix to prepend to the name of the generated CSS + * class. + * + * @param {!(Form|Field)} [content] + * The form or field whose name should be used to produce the CSS + * class name. + * + * @param {Object.} [object={}] + * The optional base ngClass object that should be used to provide + * additional name/value pairs within the returned object. + * + * @return {!Object.} + * The ngClass object based on the provided object and defining a + * CSS class name for the given content. + */ + service.getClasses = function getClasses(prefix, content, object) { + + // Default to no additional properties + object = object || {}; + + // Perform no transformation if there is no content or + // corresponding name + if (!content || !content.name) + return object; + + // Transform content name and prefix into lowercase-with-dashes + // CSS class name + var className = prefix + content.name.replace(/[^a-zA-Z0-9]+/g, '-').toLowerCase(); + + // Add CSS class name to provided base object (without touching + // base object) + var classes = angular.extend({}, object); + classes[className] = true; + return classes; + + }; + /** * Compiles and links the field associated with the given name to the given * scope, producing a distinct and independent DOM Element which functions diff --git a/guacamole/src/main/frontend/src/app/form/templates/checkboxField.html b/guacamole/src/main/frontend/src/app/form/templates/checkboxField.html index 80666c018..39d1f6b7d 100644 --- a/guacamole/src/main/frontend/src/app/form/templates/checkboxField.html +++ b/guacamole/src/main/frontend/src/app/form/templates/checkboxField.html @@ -1,7 +1,10 @@ - +
+ +
diff --git a/guacamole/src/main/frontend/src/app/form/templates/dateField.html b/guacamole/src/main/frontend/src/app/form/templates/dateField.html index 9048dec36..93a231f35 100644 --- a/guacamole/src/main/frontend/src/app/form/templates/dateField.html +++ b/guacamole/src/main/frontend/src/app/form/templates/dateField.html @@ -2,6 +2,7 @@
-

{{getSectionHeader(form) | translate}}

+

{{getSectionHeader(form) | translate}}

diff --git a/guacamole/src/main/frontend/src/app/form/templates/formField.html b/guacamole/src/main/frontend/src/app/form/templates/formField.html index 3e45d4cb6..8534515a2 100644 --- a/guacamole/src/main/frontend/src/app/form/templates/formField.html +++ b/guacamole/src/main/frontend/src/app/form/templates/formField.html @@ -1,4 +1,5 @@ -
+
diff --git a/guacamole/src/main/frontend/src/app/form/templates/languageField.html b/guacamole/src/main/frontend/src/app/form/templates/languageField.html index 2a22ff27d..a19d21cd0 100644 --- a/guacamole/src/main/frontend/src/app/form/templates/languageField.html +++ b/guacamole/src/main/frontend/src/app/form/templates/languageField.html @@ -1,4 +1,7 @@ - +
+ +
diff --git a/guacamole/src/main/frontend/src/app/form/templates/numberField.html b/guacamole/src/main/frontend/src/app/form/templates/numberField.html index b7666c680..1bf58a175 100644 --- a/guacamole/src/main/frontend/src/app/form/templates/numberField.html +++ b/guacamole/src/main/frontend/src/app/form/templates/numberField.html @@ -1,7 +1,10 @@ - +
+ +
diff --git a/guacamole/src/main/frontend/src/app/form/templates/passwordField.html b/guacamole/src/main/frontend/src/app/form/templates/passwordField.html index 3e1b2e512..17cfc0a6c 100644 --- a/guacamole/src/main/frontend/src/app/form/templates/passwordField.html +++ b/guacamole/src/main/frontend/src/app/form/templates/passwordField.html @@ -2,6 +2,7 @@ +
+ +
diff --git a/guacamole/src/main/frontend/src/app/form/templates/terminalColorSchemeField.html b/guacamole/src/main/frontend/src/app/form/templates/terminalColorSchemeField.html index a8425e41e..027f4e751 100644 --- a/guacamole/src/main/frontend/src/app/form/templates/terminalColorSchemeField.html +++ b/guacamole/src/main/frontend/src/app/form/templates/terminalColorSchemeField.html @@ -4,7 +4,9 @@ }"> - diff --git a/guacamole/src/main/frontend/src/app/form/templates/textAreaField.html b/guacamole/src/main/frontend/src/app/form/templates/textAreaField.html index 9761af77e..4e63eb53e 100644 --- a/guacamole/src/main/frontend/src/app/form/templates/textAreaField.html +++ b/guacamole/src/main/frontend/src/app/form/templates/textAreaField.html @@ -1,6 +1,9 @@ - +
+ +
diff --git a/guacamole/src/main/frontend/src/app/form/templates/textField.html b/guacamole/src/main/frontend/src/app/form/templates/textField.html index 856ec8d0d..fac7b3818 100644 --- a/guacamole/src/main/frontend/src/app/form/templates/textField.html +++ b/guacamole/src/main/frontend/src/app/form/templates/textField.html @@ -2,6 +2,7 @@ diff --git a/guacamole/src/main/frontend/src/app/form/templates/usernameField.html b/guacamole/src/main/frontend/src/app/form/templates/usernameField.html new file mode 100644 index 000000000..6a5c664d4 --- /dev/null +++ b/guacamole/src/main/frontend/src/app/form/templates/usernameField.html @@ -0,0 +1,10 @@ +
+ +
diff --git a/guacamole/src/main/frontend/src/app/home/templates/guacRecentConnections.html b/guacamole/src/main/frontend/src/app/home/templates/guacRecentConnections.html index 4654bd4d4..08362f66f 100644 --- a/guacamole/src/main/frontend/src/app/home/templates/guacRecentConnections.html +++ b/guacamole/src/main/frontend/src/app/home/templates/guacRecentConnections.html @@ -1,4 +1,4 @@ -
+

{{'HOME.INFO_NO_RECENT_CONNECTIONS' | translate}}

diff --git a/guacamole/src/main/frontend/src/app/home/templates/home.html b/guacamole/src/main/frontend/src/app/home/templates/home.html index 4597dffe1..b2b3db5bd 100644 --- a/guacamole/src/main/frontend/src/app/home/templates/home.html +++ b/guacamole/src/main/frontend/src/app/home/templates/home.html @@ -1,5 +1,4 @@ - -
+
@@ -8,9 +7,7 @@

{{'HOME.SECTION_HEADER_RECENT_CONNECTIONS' | translate}}

-
- -
+
@@ -33,4 +30,4 @@
-
\ No newline at end of file +
diff --git a/guacamole/src/main/frontend/src/app/manage/templates/connectionGroupPermission.html b/guacamole/src/main/frontend/src/app/manage/templates/connectionGroupPermission.html index 8ac52641e..2bc90cce9 100644 --- a/guacamole/src/main/frontend/src/app/manage/templates/connectionGroupPermission.html +++ b/guacamole/src/main/frontend/src/app/manage/templates/connectionGroupPermission.html @@ -1,4 +1,4 @@ -
+
diff --git a/guacamole/src/main/frontend/src/app/manage/templates/connectionPermission.html b/guacamole/src/main/frontend/src/app/manage/templates/connectionPermission.html index 3a0dddaea..e94f9114e 100644 --- a/guacamole/src/main/frontend/src/app/manage/templates/connectionPermission.html +++ b/guacamole/src/main/frontend/src/app/manage/templates/connectionPermission.html @@ -1,4 +1,4 @@ -
+
diff --git a/guacamole/src/main/frontend/src/app/manage/templates/locationChooserConnectionGroup.html b/guacamole/src/main/frontend/src/app/manage/templates/locationChooserConnectionGroup.html index b4371506e..e49b4c0b9 100644 --- a/guacamole/src/main/frontend/src/app/manage/templates/locationChooserConnectionGroup.html +++ b/guacamole/src/main/frontend/src/app/manage/templates/locationChooserConnectionGroup.html @@ -1,4 +1,4 @@ - - + {{item.name}} diff --git a/guacamole/src/main/frontend/src/app/manage/templates/manageConnection.html b/guacamole/src/main/frontend/src/app/manage/templates/manageConnection.html index 8f37b98d4..7be5d75de 100644 --- a/guacamole/src/main/frontend/src/app/manage/templates/manageConnection.html +++ b/guacamole/src/main/frontend/src/app/manage/templates/manageConnection.html @@ -1,5 +1,5 @@ -
+
diff --git a/guacamole/src/main/frontend/src/app/manage/templates/manageConnectionGroup.html b/guacamole/src/main/frontend/src/app/manage/templates/manageConnectionGroup.html index 1ed7e9c16..712183dc6 100644 --- a/guacamole/src/main/frontend/src/app/manage/templates/manageConnectionGroup.html +++ b/guacamole/src/main/frontend/src/app/manage/templates/manageConnectionGroup.html @@ -1,5 +1,5 @@ -
+
diff --git a/guacamole/src/main/frontend/src/app/manage/templates/manageSharingProfile.html b/guacamole/src/main/frontend/src/app/manage/templates/manageSharingProfile.html index f7e9d114e..6458075c0 100644 --- a/guacamole/src/main/frontend/src/app/manage/templates/manageSharingProfile.html +++ b/guacamole/src/main/frontend/src/app/manage/templates/manageSharingProfile.html @@ -1,4 +1,4 @@ -
+
diff --git a/guacamole/src/main/frontend/src/app/manage/templates/managementButtons.html b/guacamole/src/main/frontend/src/app/manage/templates/managementButtons.html index d43209a45..68e4108cc 100644 --- a/guacamole/src/main/frontend/src/app/manage/templates/managementButtons.html +++ b/guacamole/src/main/frontend/src/app/manage/templates/managementButtons.html @@ -1,6 +1,6 @@
- - - - + + + +
diff --git a/guacamole/src/main/frontend/src/app/manage/templates/sharingProfilePermission.html b/guacamole/src/main/frontend/src/app/manage/templates/sharingProfilePermission.html index 8d8311b76..0d1647255 100644 --- a/guacamole/src/main/frontend/src/app/manage/templates/sharingProfilePermission.html +++ b/guacamole/src/main/frontend/src/app/manage/templates/sharingProfilePermission.html @@ -1,4 +1,4 @@ -
+