summaryrefslogtreecommitdiffstats
path: root/modules-available
diff options
context:
space:
mode:
authorChristian Hofmaier2020-10-13 18:24:24 +0200
committerChristian Hofmaier2020-10-13 18:24:24 +0200
commit100e75084060b6e23dc90f66210ec4c48c629931 (patch)
treef8bae8e827301c920c35e4468165b98f50da1e20 /modules-available
parent[locations] install: Make openingtime migration a bit more robust (diff)
downloadslx-admin-100e75084060b6e23dc90f66210ec4c48c629931.tar.gz
slx-admin-100e75084060b6e23dc90f66210ec4c48c629931.tar.xz
slx-admin-100e75084060b6e23dc90f66210ec4c48c629931.zip
[locationinfo] add forward link to location module
+ delete some unused code
Diffstat (limited to 'modules-available')
-rw-r--r--modules-available/locationinfo/clientscript.js62
-rw-r--r--modules-available/locationinfo/lang/de/template-tags.json2
-rw-r--r--modules-available/locationinfo/lang/en/template-tags.json2
-rw-r--r--modules-available/locationinfo/templates/ajax-config-location.html13
-rw-r--r--modules-available/locationinfo/templates/page-locations.html1
-rw-r--r--modules-available/locations/templates/locations.html10
6 files changed, 24 insertions, 66 deletions
diff --git a/modules-available/locationinfo/clientscript.js b/modules-available/locationinfo/clientscript.js
index 25c255fb..f8309a8a 100644
--- a/modules-available/locationinfo/clientscript.js
+++ b/modules-available/locationinfo/clientscript.js
@@ -89,65 +89,3 @@ function simpleToExpert() {
}
return retval;
}
-
-/**
- * Triggered when the form is submitted
- */
-function submitLocationSettings(event) {
- var schedule, s, e;
- var badFormat = false;
- $('#settings-outer').find('.red-bg').removeClass('red-bg');
- if ($('#week-open').length > 0) {
- schedule = simpleToExpert();
- for (var i = 0; i < schedule.length; ++i) {
- s = getTime(schedule[i].openingtime);
- e = getTime(schedule[i].closingtime);
- if (s === false) {
- $(schedule[i].tag + '-open').addClass('red-bg');
- badFormat = true;
- }
- if (e === false || e <= s) {
- $(schedule[i].tag + '-close').addClass('red-bg');
- badFormat = true;
- }
- }
- } else {
- // Serialize
- schedule = [];
- $('#expert-table').find('.expert-row').each(function () {
- var $t = $(this);
- if ($t.find('.i-delete').is(':checked')) return; // Skip marked as delete
- var entry = {
- 'days': [],
- 'openingtime': $t.find('.i-openingtime').val(),
- 'closingtime': $t.find('.i-closingtime').val()
- };
- for (var i = 0; i < allDays.length; ++i) {
- if ($t.find('.i-' + allDays[i]).is(':checked')) {
- entry['days'].push(allDays[i]);
- }
- }
- if (entry.openingtime.length === 0 && entry.closingtime.length === 0 && entry.days.length === 0) return; // Also ignore empty lines
- s = getTime(entry.openingtime);
- e = getTime(entry.closingtime);
- if (s === false) {
- $t.find('.i-openingtime').addClass('red-bg');
- badFormat = true;
- }
- if (e === false || e <= s) {
- $t.find('.i-closingtime').addClass('red-bg');
- badFormat = true;
- }
- if (entry.days.length === 0) {
- $t.find('.days-box').addClass('red-bg');
- badFormat = true;
- }
- if (badFormat) return;
- schedule.push(entry);
- });
- }
- if (badFormat) {
- event.preventDefault();
- }
- $('#json-openingtimes').val(JSON.stringify(schedule));
-} \ No newline at end of file
diff --git a/modules-available/locationinfo/lang/de/template-tags.json b/modules-available/locationinfo/lang/de/template-tags.json
index 90a38885..42d6c936 100644
--- a/modules-available/locationinfo/lang/de/template-tags.json
+++ b/modules-available/locationinfo/lang/de/template-tags.json
@@ -43,6 +43,8 @@
"lang_friday": "Freitag",
"lang_general": "Allgemein",
"lang_generalSettings": "Allgemeine Einstellungen",
+ "lang_goToLocation": "Gehe zu Raum",
+ "lang_goToLocationWarning": "Weiterleitung zum Raum-Modul",
"lang_hostnameTooltip": "Zeige kurzen Hostnamen in Rechner-Piktogramm",
"lang_ignoreSslTooltip": "Akzeptiere ung\u00fcltige, abgelaufene oder selbstsignierte SSL-Zertifikate",
"lang_insecureSsl": "Unsicheres SSL",
diff --git a/modules-available/locationinfo/lang/en/template-tags.json b/modules-available/locationinfo/lang/en/template-tags.json
index 64846ab6..c95208af 100644
--- a/modules-available/locationinfo/lang/en/template-tags.json
+++ b/modules-available/locationinfo/lang/en/template-tags.json
@@ -43,6 +43,8 @@
"lang_friday": "Friday",
"lang_general": "General",
"lang_generalSettings": "General Settings",
+ "lang_goToLocation": "GoTo Location",
+ "lang_goToLocationWarning": "Forward to Location-Module",
"lang_hostnameTooltip": "Show simple hostname inside computer icon",
"lang_ignoreSslTooltip": "Accept invalid, expired or self-signed ssl certificates",
"lang_insecureSsl": "Insecure SSL",
diff --git a/modules-available/locationinfo/templates/ajax-config-location.html b/modules-available/locationinfo/templates/ajax-config-location.html
index f7e96b9d..2ae049d1 100644
--- a/modules-available/locationinfo/templates/ajax-config-location.html
+++ b/modules-available/locationinfo/templates/ajax-config-location.html
@@ -1,6 +1,7 @@
<input type="hidden" name="locationid" value="{{id}}">
<div id="settings-outer">
<h3>{{lang_openingTime}}</h3>
+
{{^expertMode}}
<div id="simple-mode">
@@ -79,13 +80,21 @@
<div class="row">
<div class="col-sm-6">{{lang_openingTime}}</div>
<div class="col-sm-4">{{lang_closingTime}}</div>
- <div class="col-sm-2 text-right">{{lang_delete}}</div>
</div>
</div>
- <hr>
</div>
</div>
+<div class="row" style="margin-top: 20px; margin-right: 15px;">
+ <a class="pull-right" title="{{lang_goToLocationWarning}}" href='?do=locations#{{id}}'>
+ <span class="glyphicon glyphicon-new-window">
+ {{lang_goToLocation}}
+ </span>
+ </a>
+</div>
+<hr>
+
+
<h3>{{lang_remoteSchedule}}</h3>
<div class="row">
<div class="col-sm-3">
diff --git a/modules-available/locationinfo/templates/page-locations.html b/modules-available/locationinfo/templates/page-locations.html
index 9635268c..26f0b621 100644
--- a/modules-available/locationinfo/templates/page-locations.html
+++ b/modules-available/locationinfo/templates/page-locations.html
@@ -78,7 +78,6 @@ document.addEventListener("DOMContentLoaded", function () {
$('#location-modal-header').text("[" + locationId + "] " + locationName);
$('#location-modal').modal('show').find('.modal-body').load("?do=locationinfo&action=config-location&id=" + locationId);
});
- $('#settings-form').submit(submitLocationSettings);
});
//--></script>
diff --git a/modules-available/locations/templates/locations.html b/modules-available/locations/templates/locations.html
index 12d401c1..ed049d73 100644
--- a/modules-available/locations/templates/locations.html
+++ b/modules-available/locations/templates/locations.html
@@ -55,7 +55,7 @@
<span>{{locationname}}</span>
{{/show-only}}
{{^show-only}}
- <a href="#" onclick="slxOpenLocation(this, {{locationid}}); return false">
+ <a id={{locationid}} href="#" onclick="slxOpenLocation(this, {{locationid}}); return false">
{{locationname}}
<b class="caret"></b>
</a>
@@ -167,6 +167,14 @@ var slxLastLocation = false;
var newRowCounter = 0;
+document.addEventListener("DOMContentLoaded", function() {
+ var id = window.location.hash.substring(1);
+ if (id !== "") {
+ var loc_dom = document.getElementById(id);
+ slxOpenLocation(loc_dom, id);
+ }
+});
+
function slxAddLocationRow() {
$("#saveLocationRows").show();
var tr = $('#lasttr');