summaryrefslogtreecommitdiffstats
path: root/modules-available/roomplanner/templates
diff options
context:
space:
mode:
authorSimon Rettberg2016-09-07 15:35:34 +0200
committerSimon Rettberg2016-09-07 15:35:34 +0200
commit73e3c24c042ac29316a5b0bff60ec73b97572ced (patch)
tree09b9c8490ad9f076f26d13f2b11186d813d78f9e /modules-available/roomplanner/templates
parent[roomplanner] Location name in h1 (diff)
downloadslx-admin-73e3c24c042ac29316a5b0bff60ec73b97572ced.tar.gz
slx-admin-73e3c24c042ac29316a5b0bff60ec73b97572ced.tar.xz
slx-admin-73e3c24c042ac29316a5b0bff60ec73b97572ced.zip
[roomplanner] Sanity checks/fixups when saving computers, more user feedback, smaller grid
Diffstat (limited to 'modules-available/roomplanner/templates')
-rw-r--r--modules-available/roomplanner/templates/page.html33
1 files changed, 29 insertions, 4 deletions
diff --git a/modules-available/roomplanner/templates/page.html b/modules-available/roomplanner/templates/page.html
index 47146875..f4487ad2 100644
--- a/modules-available/roomplanner/templates/page.html
+++ b/modules-available/roomplanner/templates/page.html
@@ -45,6 +45,8 @@
<h1>{{lang_roomplanner}} – {{location.locationname}}</h1>
<div class="alert alert-danger" style="display:none" id="error-msg"></div>
+<div class="alert alert-success" style="display:none" id="success-msg">{{lang_planSuccessfullySaved}}</div>
+<div class="alert alert-info" style="display:none" id="saving-msg">{{lang_planBeingSaved}}</div>
<div id="toolpanel" class="panel panel-default" style="z-index:200;">
<div class="panel-body">
@@ -120,13 +122,13 @@
<div itemtype="pc" itemlook="pc-south" class="draggable" obstacle=true style="width:100px; height:100px;" data-height="100" data-width="100" title="PC" noresize=1></div>
</li>
<li>
- <div itemtype="pc" itemlook="copier" class="draggable" obstacle=true style="width:200px; height:100px;" data-height="100" data-width="200" title="{{lang_photocopier}}" noresize=1></div>
+ <div itemtype="pc" itemlook="copier" class="draggable" obstacle=true style="width:100px; height:100px;" data-height="100" data-width="100" title="{{lang_photocopier}}" noresize=1></div>
</li>
<li>
<div itemtype="pc" itemlook="printer" class="draggable" obstacle=true style="width:100px; height:100px;" data-height="100" data-width="100" title="{{lang_printer}}" noresize=1></div>
</li>
<li>
- <div itemtype="pc" itemlook="telephone" class="draggable" obstacle=true style="width:50px; height:50px;" data-height="50" data-width="50" title="{{lang_telephone}}" noresize=1></div>
+ <div itemtype="pc" itemlook="telephone" class="draggable" obstacle=true style="width:100px; height:100px;" data-height="100" data-width="100" title="{{lang_telephone}}" noresize=1></div>
</li>
</ul>
</div>
@@ -308,12 +310,20 @@
</div>
- <button id="saveBtn" class="btn btn-success">Save</button>
+<div class="pull-left">
+
+</div>
+<div class="pull-right">
+ <button class="btn btn-default" onclick="triggerCancel()">{{lang_cancel}}</button>
+ <button id="saveBtn" class="btn btn-primary">{{lang_save}}</button>
+</div>
+<div class="clearfix"></div>
<script type="application/javascript"><!--
var locationId = '{{locationid}}';
var subnetMachines, roomConfiguration;
+var plannerLoadState = 'invalid';
document.addEventListener("DOMContentLoaded", function () {
subnetMachines = {{{subnetMachines}}};
@@ -329,9 +339,24 @@ document.addEventListener("DOMContentLoaded", function () {
).done(function() {
$.getScript("modules/roomplanner/js/init.js", function() {
initRoomplanner();
- roomplanner.load(roomConfiguration); // TODO: Filter invalid PCs, they're currently invisible and cannot be removed
+ loadRoom();
});
});
});
+function loadRoom() {
+ roomplanner.load(roomConfiguration); // TODO: Filter invalid PCs, they're currently invisible and cannot be removed
+ plannerLoadState = roomplanner.serialize();
+}
+
+function triggerCancel() {
+ if (roomplanner.serialize() !== plannerLoadState) {
+ if (!confirm('{{lang_confirmDiscardChanges}}'))
+ return;
+ }
+ window.close();
+ // In case this page wasn't opened via JS, it will not close on modern browsers, so let's reset
+ loadRoom();
+}
+
// --></script>