diff options
author | Udo Walter | 2017-10-18 15:50:13 +0200 |
---|---|---|
committer | Udo Walter | 2017-10-18 15:50:13 +0200 |
commit | 663fd954b58e8b6376ecf67110876fa91f0008df (patch) | |
tree | c89d5dbf4adbc9b086e02e0ca706154330d2796b /modules-available/locations/templates | |
parent | [sysconfig] removed redundant horizontal lines (diff) | |
download | slx-admin-663fd954b58e8b6376ecf67110876fa91f0008df.tar.gz slx-admin-663fd954b58e8b6376ecf67110876fa91f0008df.tar.xz slx-admin-663fd954b58e8b6376ecf67110876fa91f0008df.zip |
[locations] added warning if subnets are marked for deletion; locations now scroll into view; subnet list now sorted by startip;
Diffstat (limited to 'modules-available/locations/templates')
-rw-r--r-- | modules-available/locations/templates/location-subnets.html | 22 | ||||
-rw-r--r-- | modules-available/locations/templates/locations.html | 24 |
2 files changed, 42 insertions, 4 deletions
diff --git a/modules-available/locations/templates/location-subnets.html b/modules-available/locations/templates/location-subnets.html index 9505ceac..2cc8e98b 100644 --- a/modules-available/locations/templates/location-subnets.html +++ b/modules-available/locations/templates/location-subnets.html @@ -1,6 +1,6 @@ <div class="slx-well"> <div class="slx-bold">{{lang_locationSettings}}</div> - <form method="post" action="?do=Locations"> + <form id="locationForm{{locationid}}" method="post" action="?do=Locations"> <input type="hidden" name="token" value="{{token}}"> <input type="hidden" name="action" value="updatelocation"> <input type="hidden" name="locationid" value="{{locationid}}"> @@ -86,7 +86,7 @@ </div> <div class="col-md-4 text-right"> <button style="margin-right: 10px" {{^deleteAllowed}}disabled{{/deleteAllowed}} type="button" class="btn btn-danger" data-toggle="modal" data-target="#deleteLocationModal{{locationid}}"><span class="glyphicon glyphicon-trash"></span> {{lang_deleteLocation}}</button> - <button {{^saveButton}}disabled{{/saveButton}} type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button> + <button onclick="deleteSubnetWarning('{{locationid}}')" {{^saveButton}}disabled{{/saveButton}} type="button" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button> </div> </div> @@ -102,11 +102,25 @@ </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> + <button type="submit" class="btn btn-danger" name="deletelocation" value="{{locationid}}"><span class="glyphicon glyphicon-trash"></span> {{lang_deleteLocation}}</button> + </div> + </div> + </div> + </div> + + <div class="modal fade" id="saveWarningModal{{locationid}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> + <div class="modal-dialog" style="width: 400px" role="document"> + <div class="modal-content"> + <div class="modal-body"> + {{lang_deleteSubnetWarning}} + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">{{lang_cancel}}</button> + <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button> </div> </div> </div> </div> </form> -</div> +</div>
\ No newline at end of file diff --git a/modules-available/locations/templates/locations.html b/modules-available/locations/templates/locations.html index 238d6630..fb09a45e 100644 --- a/modules-available/locations/templates/locations.html +++ b/modules-available/locations/templates/locations.html @@ -157,6 +157,7 @@ function slxOpenLocation(e, lid) { existing.show(); $(e).closest('tr').addClass('active slx-bold'); slxLastLocation = existing; + scollIntoView(existing); } return; } @@ -166,10 +167,24 @@ function slxOpenLocation(e, lid) { $(e).closest('tr').addClass('active slx-bold').after(tr); td.load('?do=Locations&action=showlocation&locationid=' + lid, function() { slxAttachCidr(); + scollIntoView(tr); }); slxLastLocation = tr; } +function scollIntoView(el) { + var offset = $(el).offset(); + var win = $(window); + var h = $(el).height(); + if (offset.top + h > win.scrollTop() + win.height()) { + offset.top -= win.height(); + offset.top += h; + $('html, body').animate({ + scrollTop: offset.top + }); + } +} + function slxAddSubnetRow(e, lid) { var tr = $('#loc-sub-' + lid); tr.before('<tr id="row' + slxAddCounter + '" class="cidrmagic">\ @@ -189,5 +204,14 @@ function removeNewSubnetRow(r) { function slxConfirm() { return confirm('{{lang_areYouSureNoUndo}}'); } + +function deleteSubnetWarning(locid) { + var form = $("#locationForm"+locid); + if (form.find("input[type=checkbox]:checked").length > 0) { + $("#saveWarningModal"+locid).modal(); + } else { + form.submit(); + } +} // --> </script> |