diff options
author | Udo Walter | 2017-10-03 20:07:15 +0200 |
---|---|---|
committer | Udo Walter | 2017-10-03 20:07:15 +0200 |
commit | 3941f2482e26590e7f0f24147bc87740ab7f18af (patch) | |
tree | b782293185db8ea8847b335628fb709f2928b69f /modules-available/locations/templates | |
parent | [internetaccess] implemented new permission system (diff) | |
download | slx-admin-3941f2482e26590e7f0f24147bc87740ab7f18af.tar.gz slx-admin-3941f2482e26590e7f0f24147bc87740ab7f18af.tar.xz slx-admin-3941f2482e26590e7f0f24147bc87740ab7f18af.zip |
[locations] implemented new permission system
Diffstat (limited to 'modules-available/locations/templates')
-rw-r--r-- | modules-available/locations/templates/location-subnets.html | 40 | ||||
-rw-r--r-- | modules-available/locations/templates/locations.html | 17 | ||||
-rw-r--r-- | modules-available/locations/templates/subnets.html | 10 |
3 files changed, 37 insertions, 30 deletions
diff --git a/modules-available/locations/templates/location-subnets.html b/modules-available/locations/templates/location-subnets.html index 9cfa5cc8..754616c6 100644 --- a/modules-available/locations/templates/location-subnets.html +++ b/modules-available/locations/templates/location-subnets.html @@ -8,24 +8,26 @@ <button type="submit" class="btn btn-primary">Save</button> </div> <div class="row"> - <div class="col-sm-5"> - <div class="input-group"> - <span class="input-group-addon slx-ga">{{lang_name}}</span> - <input class="form-control" type="text" name="locationname" value="{{locationname}}" pattern=".*\S.*"> + <div class="{{^editAllowed}}disabled{{/editAllowed}}"> + <div class="col-sm-5"> + <div class="input-group"> + <span class="input-group-addon slx-ga">{{lang_name}}</span> + <input class="form-control" type="text" name="locationname" value="{{locationname}}" pattern=".*\S.*"> + </div> </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 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 {{disabled}} value="{{locationid}}" {{#selected}}selected="selected"{{/selected}}>{{locationpad}} {{locationname}}</option> + {{/parents}} + </select> + </div> </div> </div> <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> + <button {{^deleteAllowed}}disabled{{/deleteAllowed}} type="button" class="btn btn-sm btn-danger" data-toggle="modal" data-target="#deleteLocationModal{{locationid}}"><span class="glyphicon glyphicon-trash"></span></button> </div> </div> <br> @@ -41,11 +43,11 @@ {{#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="{{^editSubnetAllowed}}disabled{{/editSubnetAllowed}}"><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 class="{{^editSubnetAllowed}}disabled{{/editSubnetAllowed}}"><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"> <div class="checkbox text-center" style="margin-left: 9px"> - <input type="checkbox" name="deletesubnet[{{subnetid}}]" value="on"> + <input {{^deleteSubnetAllowed}}disabled{{/deleteSubnetAllowed}} type="checkbox" name="deletesubnet[{{subnetid}}]" value="on"> <label class="text-left"></label> </div> </td> @@ -53,7 +55,7 @@ {{/list}} <tr id="loc-sub-{{locationid}}"> <td colspan="4"> - <button class="btn btn-success btn-sm pull-right" type="button" onclick="slxAddSubnetRow(this, {{locationid}})" title="{{lang_addNewSubnet}}"> + <button {{^addSubnetAllowed}}disabled{{/addSubnetAllowed}} class="btn btn-success btn-sm pull-right" type="button" onclick="slxAddSubnetRow(this, {{locationid}})" title="{{lang_addNewSubnet}}"> <span class="glyphicon glyphicon-plus"></span> {{lang_subnet}} </button> </td> @@ -86,7 +88,7 @@ </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> + <button {{^saveButton}}disabled{{/saveButton}} type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button> </div> </div> diff --git a/modules-available/locations/templates/locations.html b/modules-available/locations/templates/locations.html index 451d8add..afbca3c6 100644 --- a/modules-available/locations/templates/locations.html +++ b/modules-available/locations/templates/locations.html @@ -24,9 +24,10 @@ <tr> <td> <div style="display:inline-block;width:{{depth}}em"></div> - <a href="#" onclick="slxOpenLocation(this, {{locationid}}); return false">{{locationname}} <b class="caret"></b></a> + <a href="#" class="{{linkClass}}" onclick="slxOpenLocation(this, {{locationid}}); return false">{{locationname}}{{^linkClass}} <b class="caret"></b>{{/linkClass}}</a> </td> <td class="text-nowrap" align="right"> + {{^linkClass}} {{#havestatistics}} {{clientCount}} <span class="text-muted"> @@ -35,13 +36,17 @@ </span> <a class="btn btn-default btn-xs" href="?do=Statistics&show=list&filters=location={{locationid}}"><span class="glyphicon glyphicon-eye-open"></span></a> {{/havestatistics}} + {{/linkClass}} </td> <td class="text-nowrap" align="right"> + {{^linkClass}} {{#havestatistics}} {{clientLoad}} {{/havestatistics}} + {{/linkClass}} </td> <td class="text-nowrap"> + {{^linkClass}} {{#havebaseconfig}} <div class="pull-right" style="z-index:-1"> <a class="btn btn-default btn-xs" href="?do=baseconfig&module=locations&locationid={{locationid}}"><span class="glyphicon glyphicon-edit"></span></a> @@ -50,8 +55,10 @@ {{lang_overrideCount}}: {{overriddenVars}}   {{/overriddenVars}} {{/havebaseconfig}} + {{/linkClass}} </td> <td class="text-nowrap"> + {{^linkClass}} {{#havesysconfig}} <div class="pull-right"> <a class="btn btn-default btn-xs" href="?do=sysconfig&locationid={{locationid}}"><span class="glyphicon glyphicon-edit"></span></a> @@ -60,6 +67,7 @@ {{configName}}   </span> {{/havesysconfig}} + {{/linkClass}} </td> </tr> {{/list}} @@ -90,12 +98,10 @@ <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()"> + <button {{^addAllowed}}disabled{{/addAllowed}} class="btn btn-success" type="button" onclick="slxAddLocationRow()"> <span class="glyphicon glyphicon-plus"></span> {{lang_location}} </button> - </td> - </tr> </table> </form> @@ -122,8 +128,7 @@ function slxAddLocationRow() { 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}}\ + {{#addAllowedList}}<option {{disabled}} value="{{locationid}}">{{locationpad}} {{locationname}}</option>{{/addAllowedList}}\ </select></td>\ <td class="text-center"><button class="btn btn-default btn-sm" type="button" onclick="removeNewLocationRow(' + slxAddCounter + ')"><span class="glyphicon glyphicon-remove"></span></button></td>\ </tr>'); diff --git a/modules-available/locations/templates/subnets.html b/modules-available/locations/templates/subnets.html index 4c96cc4d..0a1eca21 100644 --- a/modules-available/locations/templates/subnets.html +++ b/modules-available/locations/templates/subnets.html @@ -17,12 +17,12 @@ {{#list}} <tr class="cidrmagic"> <td>{{subnetid}}</td> - <td><input class="form-control cidrstart" type="text" name="startaddr[{{subnetid}}]" value="{{startaddr}}"></td> - <td><input class="form-control cidrend" type="text" name="endaddr[{{subnetid}}]" value="{{endaddr}}"></td> - <td> + <td class="{{^editThisSubnetAllowed}}disabled{{/editThisSubnetAllowed}}"><input class="form-control cidrstart" type="text" name="startaddr[{{subnetid}}]" value="{{startaddr}}"></td> + <td class="{{^editThisSubnetAllowed}}disabled{{/editThisSubnetAllowed}}"><input class="form-control cidrend" type="text" name="endaddr[{{subnetid}}]" value="{{endaddr}}"></td> + <td class="{{^deleteThisSubnetAllowed}}disabled{{/deleteThisSubnetAllowed}}"> <select class="form-control" name="location[{{subnetid}}]"> {{#locations}} - <option value="{{locationid}}" {{#selected}}selected="selected"{{/selected}}>{{locationpad}} {{locationname}}</option> + <option {{disabled}} value="{{locationid}}" {{#selected}}selected="selected"{{/selected}}>{{locationpad}} {{locationname}}</option> {{/locations}} </select> </td> @@ -30,7 +30,7 @@ {{/list}} </table> <div class="text-right" style="margin-bottom: 20px"> - <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button> + <button {{^editSubnetAllowed}}disabled{{/editSubnetAllowed}} type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button> </div> </form> </div> |