summaryrefslogtreecommitdiffstats
path: root/modules-available/locations
diff options
context:
space:
mode:
authorUdo Walter2017-09-13 17:01:30 +0200
committerUdo Walter2017-09-13 17:01:30 +0200
commit1724b55abdfcee25fe58f5f9fb763e99081043c9 (patch)
tree9864db93b8e1721559f7584a534246ce2123cff9 /modules-available/locations
parent[js_stupidtable] fixed stupidtable not working with collapsed tables (diff)
downloadslx-admin-1724b55abdfcee25fe58f5f9fb763e99081043c9.tar.gz
slx-admin-1724b55abdfcee25fe58f5f9fb763e99081043c9.tar.xz
slx-admin-1724b55abdfcee25fe58f5f9fb763e99081043c9.zip
[locations] fixed inconsistencies + small design changes
Diffstat (limited to 'modules-available/locations')
-rw-r--r--modules-available/locations/lang/de/template-tags.json4
-rw-r--r--modules-available/locations/lang/en/template-tags.json8
-rw-r--r--modules-available/locations/templates/location-subnets.html92
-rw-r--r--modules-available/locations/templates/locations.html46
-rw-r--r--modules-available/locations/templates/subnets.html9
5 files changed, 104 insertions, 55 deletions
diff --git a/modules-available/locations/lang/de/template-tags.json b/modules-available/locations/lang/de/template-tags.json
index 29a19b85..72f6c4f2 100644
--- a/modules-available/locations/lang/de/template-tags.json
+++ b/modules-available/locations/lang/de/template-tags.json
@@ -28,7 +28,7 @@
"lang_startAddress": "Startadresse",
"lang_subnet": "IP-Bereich",
"lang_sysConfig": "Lokalisierung",
- "lang_thisListByLocation": "Zur Ortsansicht",
- "lang_thisListBySubnet": "Nach Subnetzen auflisten",
+ "lang_thisListByLocation": "Orte",
+ "lang_thisListBySubnet": "Subnetze",
"lang_unassignedMachines": "Rechner, die in keinen definierten Ort fallen"
} \ No newline at end of file
diff --git a/modules-available/locations/lang/en/template-tags.json b/modules-available/locations/lang/en/template-tags.json
index 6094ebce..720e029f 100644
--- a/modules-available/locations/lang/en/template-tags.json
+++ b/modules-available/locations/lang/en/template-tags.json
@@ -7,10 +7,10 @@
"lang_deleteLocation": "Delete location",
"lang_deleteSubnet": "Delete range",
"lang_editConfigVariables": "Config vars",
- "lang_editRoomplan": "edit roomplan",
+ "lang_editRoomplan": "Edit roomplan",
"lang_endAddress": "End address",
"lang_listOfSubnets": "List of subnets",
- "lang_location": "Ort",
+ "lang_location": "Location",
"lang_locationInfo": "Location details",
"lang_locationName": "Name",
"lang_locationOtherOverlap": "Warning! These locations have overlapping address ranges",
@@ -28,7 +28,7 @@
"lang_startAddress": "Start address",
"lang_subnet": "IP range",
"lang_sysConfig": "Localization\/Integration",
- "lang_thisListByLocation": "List by location",
- "lang_thisListBySubnet": "List by subnet",
+ "lang_thisListByLocation": "Locations",
+ "lang_thisListBySubnet": "Subnets",
"lang_unassignedMachines": "Machines not matching any location"
} \ No newline at end of file
diff --git a/modules-available/locations/templates/location-subnets.html b/modules-available/locations/templates/location-subnets.html
index b8a2b091..0722e54b 100644
--- a/modules-available/locations/templates/location-subnets.html
+++ b/modules-available/locations/templates/location-subnets.html
@@ -8,9 +8,9 @@
<button type="submit" class="btn btn-primary">Save</button>
</div>
<div class="row">
- <div class="col-sm-6">
+ <div class="col-sm-5">
<div class="input-group">
- <span class="input-group-addon slx-ga2">{{lang_name}}</span>
+ <span class="input-group-addon slx-ga">{{lang_name}}</span>
<input class="form-control" type="text" name="locationname" value="{{locationname}}" pattern=".*\S.*">
</div>
</div>
@@ -24,13 +24,9 @@
</select>
</div>
</div>
- </div>
- <div>
- <div class="pull-right">
- <label><input type="checkbox" name="recursive" value="on"> {{lang_deleteChildLocations}}</label>
- <button type="submit" class="btn btn-sm btn-danger" name="deletelocation" value="{{locationid}}" onclick="return slxConfirm()">{{lang_deleteLocation}}</button>
+ <div class="col-sm-1 text-center">
+ <button type="button" class="btn btn-sm btn-danger" data-toggle="modal" data-target="#deleteLocationModal{{locationid}}"><span class="glyphicon glyphicon-trash"></span></button>
</div>
- <div class="clearfix"></div>
</div>
<br>
<div class="slx-bold">{{lang_assignedSubnets}}</div>
@@ -40,47 +36,81 @@
<th>#</th>
<th>{{lang_startAddress}}</th>
<th>{{lang_endAddress}}</th>
- <th title="{{lang_deleteSubnet}}"><span class="glyphicon glyphicon-trash"></span></th>
+ <th title="{{lang_deleteSubnet}}" class="text-center"><span class="glyphicon glyphicon-trash"></span></th>
</tr>
{{#list}}
<tr class="cidrmagic">
<td>{{subnetid}}</td>
<td><input class="form-control cidrstart" type="text" name="startaddr[{{subnetid}}]" value="{{startaddr}}" pattern="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"></td>
<td><input class="form-control cidrend" type="text" name="endaddr[{{subnetid}}]" value="{{endaddr}}" pattern="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"></td>
- <td class="danger" align="center"><input type="checkbox" name="deletesubnet[{{subnetid}}]" value="on"></td>
+ <td class="danger">
+ <div class="checkbox text-center" style="margin-left: 9px">
+ <input type="checkbox" name="deletesubnet[{{subnetid}}]" value="on">
+ <label class="text-left"></label>
+ </div>
+ </td>
</tr>
{{/list}}
<tr id="loc-sub-{{locationid}}">
<td colspan="4">
- <button class="btn btn-success btn-sm" type="button" onclick="slxAddSubnetRow(this, {{locationid}})" title="{{lang_addNewSubnet}}">
+ <button class="btn btn-success btn-sm pull-right" type="button" onclick="slxAddSubnetRow(this, {{locationid}})" title="{{lang_addNewSubnet}}">
<span class="glyphicon glyphicon-plus-sign"></span> {{lang_subnet}}
</button>
</td>
</tr>
</table>
- <br>
- <div class="btn-group">
- {{#roomplanner}}
- <a class="btn btn-default" href="?do=roomplanner&amp;locationid={{locationid}}" target="_blank"
+ <div class="slx-bold">{{lang_locationInfo}}</div>
+
+ <div class="row">
+ <div class="col-md-4">
+ {{#haveDozmod}}
+ <div>
+ <span class="slx-ga2">{{lang_referencingLectures}}:</span> {{lectures}}
+ </div>
+ {{/haveDozmod}}
+ {{#haveStatistics}}
+ <div>
+ <span class="slx-ga2">{{lang_matchingMachines}}:</span> <a href="?do=Statistics&amp;show=list&amp;filters=location={{locationid}}">{{machines}} / {{machines_online}} / {{machines_used}} ({{used_percent}}%)</a>
+ </div>
+ {{/haveStatistics}}
+ </div>
+ <div class="col-md-4 text-center">
+ <div class="btn-group">
+ {{#roomplanner}}
+ <a class="btn btn-default" href="?do=roomplanner&amp;locationid={{locationid}}" target="_blank"
onclick="window.open(this.href, '_blank', 'toolbar=0,scrollbars,resizable');return false">
- <span class="glyphicon glyphicon-move"></span>{{lang_editRoomplan}}
- </a>
- {{/roomplanner}}
+ <span class="glyphicon glyphicon-move"></span> {{lang_editRoomplan}}
+ </a>
+ {{/roomplanner}}
+ </div>
+ </div>
+ <div class="col-md-4 text-right">
+ <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button>
+ </div>
</div>
- <div class="pull-right">
- <button type="submit" class="btn btn-primary">{{lang_save}}</button>
- </div>
- <div class="slx-bold">{{lang_locationInfo}}</div>
- {{#haveDozmod}}
- <div>
- <span class="slx-ga2">{{lang_referencingLectures}}:</span> {{lectures}}
- </div>
- {{/haveDozmod}}
- {{#haveStatistics}}
- <div>
- <span class="slx-ga2">{{lang_matchingMachines}}:</span> <a href="?do=Statistics&amp;show=list&amp;filters=location={{locationid}}">{{machines}} / {{machines_online}} / {{machines_used}} ({{used_percent}}%)</a>
+
+ <div class ="modal fade" id="deleteLocationModal{{locationid}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
+ <div class="modal-dialog" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+ <h4 class="modal-title" id="myModalLabel2">{{lang_deleteLocation}}</h4>
+ </div>
+ <div class="modal-body">
+ {{lang_areYouSureNoUndo}}
+ <div class="checkbox">
+ <input type="checkbox" name="recursive" value="on">
+ <label>{{lang_deleteChildLocations}}</label>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">{{lang_cancel}}</button>
+ <button type="submit" class="btn btn-sm btn-danger" name="deletelocation" value="{{locationid}}"><span class="glyphicon glyphicon-trash"></span> {{lang_deleteLocation}}</button>
+ </div>
+ </div>
+ </div>
</div>
- {{/haveStatistics}}
+
</form>
</div>
diff --git a/modules-available/locations/templates/locations.html b/modules-available/locations/templates/locations.html
index c2dc610e..15dcdd42 100644
--- a/modules-available/locations/templates/locations.html
+++ b/modules-available/locations/templates/locations.html
@@ -1,6 +1,7 @@
<div>
- <div class="pull-right">
- <a href="?do=Locations&amp;action=showsubnets">{{lang_thisListBySubnet}}</a>
+ <div class="btn-group pull-right">
+ <a href="?do=Locations&amp;action=showlocations" class="btn btn-primary"><span class="glyphicon glyphicon-home"></span> {{lang_thisListByLocation}}</a>
+ <a href="?do=Locations&amp;action=showsubnets" class="btn btn-default"><span class="glyphicon glyphicon-list-alt"></span> {{lang_thisListBySubnet}}</a>
</div>
<h1>{{lang_locationsMainHeading}}</h1>
<table class="table table-condensed locations" style="margin-bottom:0px">
@@ -84,15 +85,17 @@
<input type="hidden" name="action" value="addlocations">
<table class="table table-condensed table-hover">
<tr id="lasttr">
- <td>
- <button class="btn btn-success btn-sm" type="button" onclick="slxAddLocationRow()">
+ <td width="50%">&emsp;</td>
+ <td class="text-right" colspan="2">
+ <button id="saveLocationRows" type="submit" class="btn btn-primary" style="display: none">
+ <span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}
+ </button>
+ <button class="btn btn-success" type="button" onclick="slxAddLocationRow()">
<span class="glyphicon glyphicon-plus-sign"></span> {{lang_location}}
</button>
+
</td>
- <td width="80%">&emsp;</td>
- <td width="20%" align="right">
- <button type="submit" class="btn btn-primary">{{lang_save}}</button>
- </td>
+
</tr>
</table>
</form>
@@ -111,17 +114,29 @@
var slxAddCounter = 0;
var slxLastLocation = false;
+var newRowCounter = 0;
+
function slxAddLocationRow() {
+ $("#saveLocationRows").show();
var tr = $('#lasttr');
- tr.before('<tr>\
- <td>#</td>\
+ tr.before('<tr id="row' + slxAddCounter + '">\
<td><input class="form-control" type="text" name="newlocation[' + slxAddCounter + ']" placeholder="{{lang_locationName}}" pattern=".*\\S.*"></td>\
<td><select class="form-control" name="newparent[' + slxAddCounter + ']">\
<option value="0">{{lang_noParent}}</option>\
{{#list}}<option value="{{locationid}}">{{locationpad}} {{locationname}}</option>{{/list}}\
</select></td>\
+ <td class="text-center"><button class="btn btn-default btn-sm" type="button" onclick="removeNewLocationRow(' + slxAddCounter + ')"><span class="glyphicon glyphicon-remove-sign"></span></button></td>\
</tr>');
slxAddCounter++;
+ newRowCounter++;
+}
+
+function removeNewLocationRow(r) {
+ $("#row"+r).remove();
+ newRowCounter--;
+ if (newRowCounter === 0) {
+ $("#saveLocationRows").hide();
+ }
}
function slxOpenLocation(e, lid) {
@@ -134,7 +149,7 @@ function slxOpenLocation(e, lid) {
if (existing.is(slxLastLocation)) {
slxLastLocation = false;
} else {
- existing.show()[0].scrollIntoView();
+ existing.show();
$(e).closest('tr').addClass('active slx-bold');
slxLastLocation = existing;
}
@@ -146,23 +161,26 @@ function slxOpenLocation(e, lid) {
$(e).closest('tr').addClass('active slx-bold').after(tr);
td.load('?do=Locations&action=showlocation&locationid=' + lid, function() {
slxAttachCidr();
- $('#location-details-' + lid)[0].scrollIntoView();
});
slxLastLocation = tr;
}
function slxAddSubnetRow(e, lid) {
var tr = $('#loc-sub-' + lid);
- tr.before('<tr class="cidrmagic">\
+ tr.before('<tr id="row' + slxAddCounter + '" class="cidrmagic">\
<td>#</td>\
<td><input class="form-control cidrstart" type="text" name="newstartaddr[' + slxAddCounter + ']" pattern="\\d{1,3}\.\\d{1,3}\.\\d{1,3}\.\\d{1,3}"></td>\
<td><input class="form-control cidrend" type="text" name="newendaddr[' + slxAddCounter + ']" pattern="\\d{1,3}\.\\d{1,3}\.\\d{1,3}\.\\d{1,3}"></td>\
- <td></td>\
+ <td class="text-center"><button class="btn btn-default btn-sm" type="button" onclick="removeNewSubnetRow(' + slxAddCounter + ')"><span class="glyphicon glyphicon-remove-sign"></span></button></td>\
</tr>');
slxAddCounter++;
slxAttachCidr();
}
+function removeNewSubnetRow(r) {
+ $("#row"+r).remove();
+}
+
function slxConfirm() {
return confirm('{{lang_areYouSureNoUndo}}');
}
diff --git a/modules-available/locations/templates/subnets.html b/modules-available/locations/templates/subnets.html
index 15fa28f2..1da5a942 100644
--- a/modules-available/locations/templates/subnets.html
+++ b/modules-available/locations/templates/subnets.html
@@ -1,6 +1,7 @@
<div>
- <div class="pull-right">
- <a href="?do=Locations&amp;action=showlocations">{{lang_thisListByLocation}}</a>
+ <div class="btn-group pull-right">
+ <a href="?do=Locations&amp;action=showlocations" class="btn btn-default"><span class="glyphicon glyphicon-home"></span> {{lang_thisListByLocation}}</a>
+ <a href="?do=Locations&amp;action=showsubnets" class="btn btn-primary"><span class="glyphicon glyphicon-list-alt"></span> {{lang_thisListBySubnet}}</a>
</div>
<h1>{{lang_listOfSubnets}}</h1>
<form method="post" action="?do=Locations">
@@ -28,8 +29,8 @@
</tr>
{{/list}}
</table>
- <div>
- <button type="submit" class="btn btn-primary">{{lang_save}}</button>
+ <div class="text-right">
+ <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button>
</div>
</form>
</div>