summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-05-02 10:47:53 +0200
committerSimon Rettberg2019-05-02 10:47:53 +0200
commitad4362a29096b30b4fe4fe8db818affc81720481 (patch)
treed4a9c1c05808fdd7a1e5dd9b767c571939af4c63
parent[statistics] Update translations (diff)
downloadslx-admin-ad4362a29096b30b4fe4fe8db818affc81720481.tar.gz
slx-admin-ad4362a29096b30b4fe4fe8db818affc81720481.tar.xz
slx-admin-ad4362a29096b30b4fe4fe8db818affc81720481.zip
[locations] subnet inputs: disabled -> readonly; disable save button
There was unfinished code to disable the save button if there are no actions allowed to perform in the location detail box, which is now working. Also make the text inputs readonly instead of diabled if we're not allowed to edit them, so copy & paste still works.
-rw-r--r--inc/permission.inc.php5
-rw-r--r--modules-available/locations/templates/location-subnets.html6
2 files changed, 7 insertions, 4 deletions
diff --git a/inc/permission.inc.php b/inc/permission.inc.php
index aaef6ba6..3a7bdc36 100644
--- a/inc/permission.inc.php
+++ b/inc/permission.inc.php
@@ -40,7 +40,10 @@ class Permission
$temp = ['disabled' => 'disabled', 'readonly' => 'readonly'];
}
if (!$one && !is_null($noneAvailDisabled)) {
- $array[$noneAvailDisabled]['disabled'] = true;
+ $array[$noneAvailDisabled] = [
+ 'disabled' => 'disabled',
+ 'readonly' => 'readonly',
+ ];
}
}
diff --git a/modules-available/locations/templates/location-subnets.html b/modules-available/locations/templates/location-subnets.html
index 897f84b0..78ef99a0 100644
--- a/modules-available/locations/templates/location-subnets.html
+++ b/modules-available/locations/templates/location-subnets.html
@@ -40,8 +40,8 @@
{{#list}}
<tr class="cidrmagic">
<td>{{subnetid}}</td>
- <td><input {{perms.location.edit.subnets.disabled}} 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 {{perms.location.edit.subnets.disabled}} 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><input {{perms.location.edit.subnets.readonly}} 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 {{perms.location.edit.subnets.readonly}} 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 {{perms.location.edit.subnets.disabled}} type="checkbox" name="deletesubnet[{{subnetid}}]" value="on">
@@ -122,7 +122,7 @@
</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>
+ <button type="submit" class="btn btn-primary" {{perms.save_button.disabled}}><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button>
</div>
</div>
</div>