summaryrefslogtreecommitdiffstats
path: root/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/bwlpModule.js4
-rw-r--r--src/main/resources/config/groupConfig.js11
-rw-r--r--src/main/resources/config/locationConfig.js11
-rw-r--r--src/main/resources/controllers/groupFieldController.js (renamed from src/main/resources/controllers/locationFieldController.js)10
-rw-r--r--src/main/resources/guac-manifest.json2
-rw-r--r--src/main/resources/styles/groupField.css (renamed from src/main/resources/styles/locationField.css)14
-rw-r--r--src/main/resources/templates/groupField.html19
-rw-r--r--src/main/resources/templates/locationField.html19
-rw-r--r--src/main/resources/translations/en.json2
9 files changed, 46 insertions, 46 deletions
diff --git a/src/main/resources/bwlpModule.js b/src/main/resources/bwlpModule.js
index 67fb487..0a0f116 100644
--- a/src/main/resources/bwlpModule.js
+++ b/src/main/resources/bwlpModule.js
@@ -1,5 +1,5 @@
-angular.module('location', [
+angular.module('group', [
'form'
]);
-angular.module('index').requires.push('location');
+angular.module('index').requires.push('group');
diff --git a/src/main/resources/config/groupConfig.js b/src/main/resources/config/groupConfig.js
new file mode 100644
index 0000000..09adb0d
--- /dev/null
+++ b/src/main/resources/config/groupConfig.js
@@ -0,0 +1,11 @@
+angular.module('group').config(['formServiceProvider',
+ function groupConfig(formServiceProvider) {
+
+ // Define field for the TOTP code provided by the user
+ formServiceProvider.registerFieldType('GROUP', {
+ module : 'group',
+ controller : 'groupFieldController',
+ templateUrl : 'app/ext/bwlp/templates/groupField.html'
+ });
+
+ }]); \ No newline at end of file
diff --git a/src/main/resources/config/locationConfig.js b/src/main/resources/config/locationConfig.js
deleted file mode 100644
index 6074752..0000000
--- a/src/main/resources/config/locationConfig.js
+++ /dev/null
@@ -1,11 +0,0 @@
-angular.module('location').config(['formServiceProvider',
- function locationConfig(formServiceProvider) {
-
- // Define field for the TOTP code provided by the user
- formServiceProvider.registerFieldType('LOCATION', {
- module : 'location',
- controller : 'locationFieldController',
- templateUrl : 'app/ext/bwlp/templates/locationField.html'
- });
-
- }]); \ No newline at end of file
diff --git a/src/main/resources/controllers/locationFieldController.js b/src/main/resources/controllers/groupFieldController.js
index af2b6fe..3b6f9ea 100644
--- a/src/main/resources/controllers/locationFieldController.js
+++ b/src/main/resources/controllers/groupFieldController.js
@@ -1,4 +1,4 @@
-angular.module('location').controller('locationFieldController', ['$scope', function locationFieldController($scope) {
+angular.module('group').controller('groupFieldController', ['$scope', function groupFieldController($scope) {
$scope.data = { id: 0, password: '' };
@@ -10,17 +10,17 @@ angular.module('location').controller('locationFieldController', ['$scope', func
$scope.model = JSON.stringify(newValue);
}, true);
- $scope.selectLocation = function selectLocation($event, id) {
+ $scope.selectGroup = function selectGroup($event, id) {
if (angular.element($event.target).hasClass('bwlp-password-input')) return;
$scope.data.password = '';
if ($scope.data.id === id) {
$scope.data.id = 0;
- angular.element('.selected-location').removeClass('selected-location');
+ angular.element('.selected-group').removeClass('selected-group');
return;
}
$scope.data.id = id;
- angular.element('.selected-location').removeClass('selected-location');
- angular.element($event.currentTarget).addClass('selected-location');
+ angular.element('.selected-group').removeClass('selected-group');
+ angular.element($event.currentTarget).addClass('selected-group');
};
$scope.logout = function logout() {
diff --git a/src/main/resources/guac-manifest.json b/src/main/resources/guac-manifest.json
index def8a3f..a71d8a9 100644
--- a/src/main/resources/guac-manifest.json
+++ b/src/main/resources/guac-manifest.json
@@ -17,6 +17,6 @@
],
"resources" : {
"images/Logo_bwLehrpool.svg" : "image/svg+xml",
- "templates/locationField.html" : "text/html"
+ "templates/groupField.html" : "text/html"
}
}
diff --git a/src/main/resources/styles/locationField.css b/src/main/resources/styles/groupField.css
index 1764af9..337bac5 100644
--- a/src/main/resources/styles/locationField.css
+++ b/src/main/resources/styles/groupField.css
@@ -1,32 +1,32 @@
-.bwlp-location-container {
+.bwlp-group-container {
border: 2px solid #3d3d3d;
width: 100%;
border-spacing: 0;
}
-.bwlp-location {
+.bwlp-group {
background-color: white;
cursor: pointer;
}
-.bwlp-location > td {
+.bwlp-group > td {
padding: 14px;
}
-.bwlp-location .bwlp-password {
+.bwlp-group .bwlp-password {
padding: 4px 8px !important;
margin: -10px 0 !important;
}
-.bwlp-location:hover {
+.bwlp-group:hover {
filter: brightness(0.9);
}
-.bwlp-location.selected-location {
+.bwlp-group.selected-group {
background-color: #c8ffc8;
}
-.bwlp-location-status {
+.bwlp-group-status {
font-size: 16px;
text-align: center;
}
diff --git a/src/main/resources/templates/groupField.html b/src/main/resources/templates/groupField.html
new file mode 100644
index 0000000..c2ea026
--- /dev/null
+++ b/src/main/resources/templates/groupField.html
@@ -0,0 +1,19 @@
+<table class="bwlp-group-container">
+ <tr ng-repeat="group in field.groups" class="bwlp-group"
+ ng-click="selectGroup($event, group.id)">
+ <td>
+ {{ group.name }}
+ </td>
+ <td class="bwlp-group-status">
+ {{ group.freeCount }} available ({{ group.offlineCount }} offline)
+ </td>
+ <td style="width: 200px">
+ <div ng-if="group.password" class="bwlp-password">
+ <span ng-if="data.id !== group.id">Password protected</span>
+ <input ng-if="data.id === group.id" ng-model="data.password"
+ type="password" placeholder="Password" class="bwlp-password-input" required>
+ </div>
+ </td>
+ </tr>
+</table>
+<button type="button" class="logout-button" ng-click="logout()">Log out</button>
diff --git a/src/main/resources/templates/locationField.html b/src/main/resources/templates/locationField.html
deleted file mode 100644
index 9feb83c..0000000
--- a/src/main/resources/templates/locationField.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<table class="bwlp-location-container">
- <tr ng-repeat="location in field.locations" class="bwlp-location"
- ng-click="selectLocation($event, location.id)">
- <td>
- {{ location.name }}
- </td>
- <td class="bwlp-location-status">
- {{ location.freeCount }} available ({{ location.offlineCount }} offline)
- </td>
- <td style="width: 200px">
- <div ng-if="location.password" class="bwlp-password">
- <span ng-if="data.id !== location.id">Password protected</span>
- <input ng-if="data.id === location.id" ng-model="data.password"
- type="password" placeholder="Password" class="bwlp-password-input" required>
- </div>
- </td>
- </tr>
-</table>
-<button class="logout-button" ng-click="logout()">Log out</button>
diff --git a/src/main/resources/translations/en.json b/src/main/resources/translations/en.json
index 85a8b6e..8e4fdbc 100644
--- a/src/main/resources/translations/en.json
+++ b/src/main/resources/translations/en.json
@@ -3,6 +3,6 @@
"NAME" : "bwLehrpool"
},
"LOGIN" : {
- "FIELD_HEADER_LOCATION" : ""
+ "FIELD_HEADER_GROUP" : ""
}
} \ No newline at end of file