summaryrefslogtreecommitdiffstats
path: root/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/bwlpModule.js7
-rw-r--r--src/main/resources/controllers/groupFieldController.js26
-rw-r--r--src/main/resources/disclaimer.html5
-rw-r--r--src/main/resources/guac-manifest.json2
-rw-r--r--src/main/resources/login-logo.html3
-rw-r--r--src/main/resources/selection-logo.html3
-rw-r--r--src/main/resources/styles/login.css26
-rw-r--r--src/main/resources/templates/groupField.html3
8 files changed, 53 insertions, 22 deletions
diff --git a/src/main/resources/bwlpModule.js b/src/main/resources/bwlpModule.js
index 0a0f116..f0605e3 100644
--- a/src/main/resources/bwlpModule.js
+++ b/src/main/resources/bwlpModule.js
@@ -3,3 +3,10 @@ angular.module('group', [
]);
angular.module('index').requires.push('group');
+
+// Set custom logo
+$http = angular.injector(["ng"]).get("$http");
+$http.get('api/ext/de.bwlehrpool.bwgpul/logoUrl').then(function (response) {
+ if (!response.data) return
+ document.documentElement.style.setProperty('--logo', "url('" + response.data + "')")
+})
diff --git a/src/main/resources/controllers/groupFieldController.js b/src/main/resources/controllers/groupFieldController.js
index ce80854..7dc1612 100644
--- a/src/main/resources/controllers/groupFieldController.js
+++ b/src/main/resources/controllers/groupFieldController.js
@@ -1,6 +1,14 @@
-angular.module('group').controller('groupFieldController', ['$scope', function groupFieldController($scope) {
+angular.module('group').controller('groupFieldController', ['$scope', function groupFieldController($scope, $http) {
- $scope.data = { id: 0, password: '', resolution: window.innerWidth + 'x' + window.innerHeight };
+ $scope.data = {id: 0, password: '', resolution: window.innerWidth + 'x' + window.innerHeight};
+
+ // Preselect the first location without a password
+ if ($scope.field && $scope.field.groups && Array.isArray($scope.field.groups)) {
+ for (let i in $scope.field.groups) {
+ let group = $scope.field.groups[i];
+ if (!group.password) $scope.data.id = group.id;
+ }
+ }
$scope.$watch('data', function(newValue) {
if (window.location.hash !== '#/') {
@@ -12,17 +20,15 @@ angular.module('group').controller('groupFieldController', ['$scope', function g
$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-group').removeClass('selected-group');
- return;
- }
+ if ($scope.data.id !== id) $scope.data.password = '';
$scope.data.id = id;
- angular.element('.selected-group').removeClass('selected-group');
- angular.element($event.currentTarget).addClass('selected-group');
};
+ $scope.submitGroup = function submitGroup($event, id) {
+ $scope.selectGroup($event, id);
+ angular.element($event.currentTarget.closest('form')).scope().login();
+ }
+
$scope.logout = function logout() {
window.localStorage.removeItem('GUAC_AUTH');
window.location.hash = '#/';
diff --git a/src/main/resources/disclaimer.html b/src/main/resources/disclaimer.html
deleted file mode 100644
index b6c6190..0000000
--- a/src/main/resources/disclaimer.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<meta name="after" content=".login-ui .login-dialog">
-
-<div class="welcome">
- <h2>bwLehrpool</h2>
-</div>
diff --git a/src/main/resources/guac-manifest.json b/src/main/resources/guac-manifest.json
index 2e301e9..de2a5cf 100644
--- a/src/main/resources/guac-manifest.json
+++ b/src/main/resources/guac-manifest.json
@@ -6,7 +6,7 @@
"largeIcon" : "images/Logo_bwLehrpool_symbol.png",
"authProviders": ["de.bwlehrpool.bwlp_guac.BwlpAuthenticationProvider"],
"listeners" : ["de.bwlehrpool.bwlp_guac.TunnelListener"],
- "html" : [ "disclaimer.html" ],
+ "html" : [ "login-logo.html", "selection-logo.html" ],
"translations" : [
"translations/en.json",
"translations/de.json"
diff --git a/src/main/resources/login-logo.html b/src/main/resources/login-logo.html
new file mode 100644
index 0000000..2a097a4
--- /dev/null
+++ b/src/main/resources/login-logo.html
@@ -0,0 +1,3 @@
+<meta name="replace" content=".login-ui .login-dialog .logo">
+
+<img class="login-logo">
diff --git a/src/main/resources/selection-logo.html b/src/main/resources/selection-logo.html
new file mode 100644
index 0000000..b5620c4
--- /dev/null
+++ b/src/main/resources/selection-logo.html
@@ -0,0 +1,3 @@
+<meta name="before" content=".login-ui .login-dialog">
+
+<img class="selection-logo">
diff --git a/src/main/resources/styles/login.css b/src/main/resources/styles/login.css
index ab3b04d..8fe590b 100644
--- a/src/main/resources/styles/login.css
+++ b/src/main/resources/styles/login.css
@@ -1,11 +1,27 @@
-.login-ui .login-dialog .logo {
+:root {
+ --logo: url('app/ext/de.bwlehrpool/images/Logo_bwLehrpool.svg');
+}
+
+.login-ui .login-logo, .login-ui .selection-logo {
width: 215px;
- height: 50px;
- background-image: url('app/ext/de.bwlehrpool/images/Logo_bwLehrpool.svg');
- background-size: cover;
- background-position: center;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ content: var(--logo);
+}
+
+.login-ui .selection-logo {
+ margin-bottom: 40px;
+}
+
+.login-ui.initial .selection-logo, .login-ui.continuation .login-logo {
+ display: none;
}
.login-ui .login-dialog .app-name {
display: none;
}
+
+.login-ui.continuation .login-form p:first-of-type {
+ margin-top: 0;
+} \ No newline at end of file
diff --git a/src/main/resources/templates/groupField.html b/src/main/resources/templates/groupField.html
index 168d13b..8c3ce4f 100644
--- a/src/main/resources/templates/groupField.html
+++ b/src/main/resources/templates/groupField.html
@@ -1,7 +1,8 @@
<div style="font-size: 0.9em; color: grey; margin: -5px 0 20px 0">{{ 'GROUP_SELECTION.RESOLUTION_INFO' | translate }}</div>
<table class="bwlp-group-container">
<tr ng-repeat="group in field.groups" class="bwlp-group"
- ng-click="selectGroup($event, group.id)">
+ ng-click="selectGroup($event, group.id)" ng-dblclick="submitGroup($event, group.id)"
+ ng-class="{ 'selected-group': data.id === group.id }">
<td>
{{ group.name }}
</td>