From 2d60d2a4f958133a4107f5ba58a2a5f04e208933 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 18 Dec 2014 23:11:16 -0800 Subject: [PATCH] GUAC-932: Make display of connections and groups within guacGroupList more abstract. --- .../app/groupList/directives/guacGroupList.js | 31 +++++++++++++++- .../webapp/app/groupList/styles/groupList.css | 21 ----------- .../groupList/templates/guacGroupList.html | 21 ++--------- .../webapp/app/home/templates/connection.html | 35 +++++++++++++++++++ .../app/home/templates/connectionGroup.html | 26 ++++++++++++++ .../main/webapp/app/home/templates/home.html | 5 ++- 6 files changed, 97 insertions(+), 42 deletions(-) delete mode 100644 guacamole/src/main/webapp/app/groupList/styles/groupList.css create mode 100644 guacamole/src/main/webapp/app/home/templates/connection.html create mode 100644 guacamole/src/main/webapp/app/home/templates/connectionGroup.html diff --git a/guacamole/src/main/webapp/app/groupList/directives/guacGroupList.js b/guacamole/src/main/webapp/app/groupList/directives/guacGroupList.js index 42399fd2b..150607a9a 100644 --- a/guacamole/src/main/webapp/app/groupList/directives/guacGroupList.js +++ b/guacamole/src/main/webapp/app/groupList/directives/guacGroupList.js @@ -35,7 +35,36 @@ angular.module('groupList').directive('guacGroupList', [function guacGroupList() * * @type ConnectionGroup|Object */ - connectionGroup : '=' + connectionGroup : '=', + + /** + * Arbitrary object which shall be made available to the connection + * and connection group templates within the scope as + * context. + */ + context : '=', + + /** + * The URL or ID of the Angular template to use when rendering a + * connection. The @link{GroupListItem} associated with that + * connection will be exposed within the scope of the template + * as item, and the arbitrary context object, if any, + * will be exposed as context. + * + * @type String + */ + connectionTemplate : '=', + + /** + * The URL or ID of the Angular template to use when rendering a + * connection group. The @link{GroupListItem} associated with that + * connection group will be exposed within the scope of the + * template as item, and the arbitrary context object, + * if any, will be exposed as context. + * + * @type String + */ + connectionGroupTemplate : '=' }, diff --git a/guacamole/src/main/webapp/app/groupList/styles/groupList.css b/guacamole/src/main/webapp/app/groupList/styles/groupList.css deleted file mode 100644 index 85fdf92d6..000000000 --- a/guacamole/src/main/webapp/app/groupList/styles/groupList.css +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2014 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. - */ diff --git a/guacamole/src/main/webapp/app/groupList/templates/guacGroupList.html b/guacamole/src/main/webapp/app/groupList/templates/guacGroupList.html index 269961041..942cacb79 100644 --- a/guacamole/src/main/webapp/app/groupList/templates/guacGroupList.html +++ b/guacamole/src/main/webapp/app/groupList/templates/guacGroupList.html @@ -25,35 +25,18 @@
- -
- - -
-
-
- - - {{item.name}} - -
-
+
-
- - - {{item.name}} - {{item.name}} - +
diff --git a/guacamole/src/main/webapp/app/home/templates/connection.html b/guacamole/src/main/webapp/app/home/templates/connection.html new file mode 100644 index 000000000..f9fc9c554 --- /dev/null +++ b/guacamole/src/main/webapp/app/home/templates/connection.html @@ -0,0 +1,35 @@ + + + +
+ + +
+
+
+ + + {{item.name}} + +
+
diff --git a/guacamole/src/main/webapp/app/home/templates/connectionGroup.html b/guacamole/src/main/webapp/app/home/templates/connectionGroup.html new file mode 100644 index 000000000..ef140b1fe --- /dev/null +++ b/guacamole/src/main/webapp/app/home/templates/connectionGroup.html @@ -0,0 +1,26 @@ + + + + {{item.name}} + {{item.name}} + diff --git a/guacamole/src/main/webapp/app/home/templates/home.html b/guacamole/src/main/webapp/app/home/templates/home.html index 1b10fbb58..384e1b5f8 100644 --- a/guacamole/src/main/webapp/app/home/templates/home.html +++ b/guacamole/src/main/webapp/app/home/templates/home.html @@ -36,7 +36,10 @@

{{'home.allConnections' | translate}}

- +
\ No newline at end of file