diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/locations/location-subnets.html | 73 | ||||
-rw-r--r-- | templates/locations/locations.html | 96 | ||||
-rw-r--r-- | templates/locations/subnets.html | 35 | ||||
-rw-r--r-- | templates/main-menu.html | 1 |
4 files changed, 205 insertions, 0 deletions
diff --git a/templates/locations/location-subnets.html b/templates/locations/location-subnets.html new file mode 100644 index 00000000..76b7442a --- /dev/null +++ b/templates/locations/location-subnets.html @@ -0,0 +1,73 @@ +<div class="slx-well"> + <div class="slx-bold">{{lang_locationSettings}}</div> + <form 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}}"> + <div style="display:none"> + <button type="submit" class="btn btn-primary">Save</button> + </div> + <div class="row"> + <div class="col-sm-6"> + <div class="input-group"> + <span class="input-group-addon slx-ga2">{{lang_name}}</span> + <input class="form-control" type="text" name="locationname" value="{{locationname}}" pattern=".*\S.*"> + </div> + </div> + <div class="col-sm-6"> + <div class="input-group"> + <span class="input-group-addon slx-ga2">{{lang_parentLocation}}</span> + <select class="form-control" name="parentlocationid"> + {{#parents}} + <option value="{{locationid}}" {{#selected}}selected="selected"{{/selected}}>{{locationpad}} {{locationname}}</option> + {{/parents}} + </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> + <div class="clearfix"></div> + </div> + <br> + <div class="slx-bold">{{lang_assignedSubnets}}</div> + <div><i>{{lang_assignSubnetExplanation}}</i></div> + <table class="table table-condensed table-striped"> + <tr> + <th>#</th> + <th>{{lang_startAddress}}</th> + <th>{{lang_endAddress}}</th> + <th title="{{lang_deleteSubnet}}"><span class="glyphicon glyphicon-trash"></span></th> + </tr> + {{#list}} + <tr> + <td>{{subnetid}}</td> + <td><input class="form-control" 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" 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> + </tr> + {{/list}} + <tr id="loc-sub-{{locationid}}"> + <td colspan="2"> + <button class="btn btn-success btn-sm" type="button" onclick="slxAddSubnetRow(this, {{locationid}})" title="{{lang_addNewSubnet}}"> + <span class="glyphicon glyphicon-plus-sign"></span> {{lang_subnet}} + </button> + </td> + <td colspan="2" align="right"> + <button type="submit" class="btn btn-primary">{{lang_save}}</button> + </div> + </tr> + </table> + </form> + <br> + <div class="slx-bold">{{lang_locationInfo}}</div> + <div> + <span class="slx-ga2">{{lang_referencingLectures}}:</span> {{lectures}} + </div> + <div> + <span class="slx-ga2">{{lang_matchingMachines}}:</span> <a href="?do=Statistics&filter=location&argument={{locationid}}">{{machines}} / {{machines_online}} / {{machines_used}} ({{used_percent}}%)</a> + </div> +</div>
\ No newline at end of file diff --git a/templates/locations/locations.html b/templates/locations/locations.html new file mode 100644 index 00000000..76c8f97c --- /dev/null +++ b/templates/locations/locations.html @@ -0,0 +1,96 @@ +<div> + <div class="pull-right"> + <a href="?do=Locations&action=showsubnets">{{lang_thisListBySubnet}}</a> + </div> + <h1>{{lang_locationsMainHeading}}</h1> + <table class="table table-condensed" style="margin-bottom:0px"> + <tr> + <th>#</th> + <th width="100%">{{lang_locationName}}</th> + <th></th> + </tr> + {{#list}} + <tr> + <td>{{locationid}}</td> + <td><div style="display:inline-block;width:{{depth}}em"></div>{{locationname}}</td> + <td align="right"> + <a class="btn btn-success btn-xs" onclick="slxOpenLocation(this, {{locationid}})"><span class="glyphicon glyphicon-edit"></span> {{lang_edit}}</a> + </td> + </tr> + {{/list}} + </table> + <form method="post" action="?do=Locations"> + <input type="hidden" name="token" value="{{token}}"> + <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()"> + <span class="glyphicon glyphicon-plus-sign"></span> {{lang_location}} + </button> + </td> + <td width="80%"> </td> + <td width="20%" align="right"> + <button type="submit" class="btn btn-primary">{{lang_save}}</button> + </td> + </tr> + </table> + </form> +</div> +<script type="text/javascript"><!-- +var slxAddCounter = 0; +var slxLastLocation = false; + +function slxAddLocationRow() { + var tr = $('#lasttr'); + tr.before('<tr>\ + <td>#</td>\ + <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>\ + </tr>'); + slxAddCounter++; +} + +function slxOpenLocation(e, lid) { + if (slxLastLocation !== false) { + slxLastLocation.hide(); + $(slxLastLocation).prev().removeClass('active slx-bold'); + } + var existing = $('#location-details-' + lid); + if (existing.length > 0) { + if (existing.is(slxLastLocation)) { + slxLastLocation = false; + } else { + existing.show(); + $(e).closest('tr').addClass('active slx-bold'); + slxLastLocation = existing; + } + return; + } + var td = $('<td>').attr('colspan', '12').css('padding', '0px 0px 12px'); + var tr = $('<tr>').attr('id', 'location-details-' + lid); + tr.append(td); + $(e).closest('tr').addClass('active slx-bold').after(tr); + td.load('?do=Locations&action=showlocation&locationid=' + lid); + slxLastLocation = tr; +} + +function slxAddSubnetRow(e, lid) { + var tr = $('#loc-sub-' + lid); + tr.before('<tr>\ + <td>#</td>\ + <td><input class="form-control" type="text" name="newstartaddr[' + slxAddCounter + ']" pattern="\\d{1,3}\.\\d{1,3}\.\\d{1,3}\.\\d{1,3}"></td>\ + <td><input class="form-control" type="text" name="newendaddr[' + slxAddCounter + ']" pattern="\\d{1,3}\.\\d{1,3}\.\\d{1,3}\.\\d{1,3}"></td>\ + <td></td>\ + </tr>'); + slxAddCounter++; +} + +function slxConfirm() { + return confirm('{{lang_areYouSureNoUndo}}'); +} + // --> +</script> diff --git a/templates/locations/subnets.html b/templates/locations/subnets.html new file mode 100644 index 00000000..2294f42b --- /dev/null +++ b/templates/locations/subnets.html @@ -0,0 +1,35 @@ +<div> + <div class="pull-right"> + <a href="?do=Locations&action=showlocations">{{lang_thisListByLocation}}</a> + </div> + <h1>{{lang_listOfSubnets}}</h1> + <form method="post" action="?do=Locations"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="action" value="updatesubnets"> + <table class="table table-condensed table-striped"> + <tr> + <th>#</th> + <th>{{lang_startAddress}}</th> + <th>{{lang_endAddress}}</th> + <th>{{lang_location}}</th> + </tr> + {{#list}} + <tr> + <td>{{subnetid}}</td> + <td><input class="form-control" type="text" name="startaddr[{{subnetid}}]" value="{{startaddr}}"></td> + <td><input class="form-control" type="text" name="endaddr[{{subnetid}}]" value="{{endaddr}}"></td> + <td> + <select class="form-control" name="location[{{subnetid}}]"> + {{#locations}} + <option value="{{locationid}}" {{#selected}}selected="selected"{{/selected}}>{{locationpad}} {{locationname}}</option> + {{/locations}} + </select> + </td> + </tr> + {{/list}} + </table> + <div> + <button type="submit" class="btn btn-primary">Späschohn (geht noch nicht!)</button> + </div> + </form> +</div> diff --git a/templates/main-menu.html b/templates/main-menu.html index 3e3a1d90..7852dd39 100644 --- a/templates/main-menu.html +++ b/templates/main-menu.html @@ -19,6 +19,7 @@ <li><a href="?do=SysConfig">{{lang_localization}}</a></li> <li><a href="?do=MiniLinux">bwLehrpool Mini-Linux</a></li> <li><a href="?do=BaseConfig">{{lang_configurationVariables}}</a></li> + <li><a href="?do=Locations">{{lang_locations}}</a></li> <li class="divider"></li> <li class="dropdown-header">{{lang_server}}</li> <li><a href="?do=ServerSetup">{{lang_configurationBasic}}</a></li> |