diff options
author | Rob Crittenden <rcritten@redhat.com> | 2015-07-17 14:07:16 -0400 |
---|---|---|
committer | Patrick Uiterwijk <puiterwijk@redhat.com> | 2015-08-18 09:52:25 +0200 |
commit | bfa0e5d352ea0d6217d31c952f35cd527264e4fa (patch) | |
tree | bb1023e9b4d5049a598e39e9a763a188b49e1ee7 /templates/admin/option_config.html | |
parent | 7b470b0e494a7ff5a088c3ead2e60754b67282f1 (diff) | |
download | ipsilon-bfa0e5d352ea0d6217d31c952f35cd527264e4fa.tar.gz ipsilon-bfa0e5d352ea0d6217d31c952f35cd527264e4fa.tar.xz ipsilon-bfa0e5d352ea0d6217d31c952f35cd527264e4fa.zip |
Mark the service as readonly in the UI in authpam plugin
Update the Option class to take a readonly keyword argument,
defaulting to False. Extend its subclasses to pass this value
along.
The page template will add the disabled keyword to input and
textarea if a config option is marked as readonly.
https://fedorahosted.org/ipsilon/ticket/6
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'templates/admin/option_config.html')
-rw-r--r-- | templates/admin/option_config.html | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/templates/admin/option_config.html b/templates/admin/option_config.html index 74eede5..1f921f6 100644 --- a/templates/admin/option_config.html +++ b/templates/admin/option_config.html @@ -59,9 +59,16 @@ {%- if value %} value="{{ value }}" {%- endif -%} + {% if v.is_readonly() -%} + disabled + {%- endif -%} > {% elif v.__class__.__name__ == 'List' -%} - <textarea class="form-control" name="{{ v.name }}"> + <textarea class="form-control" name="{{ v.name }}" + {% if v.is_readonly() -%} + disabled + {%- endif -%} + > {%- if value %} {{- value|join('\n') -}} {%- endif -%} @@ -75,6 +82,9 @@ {%- if value and e in value %} checked="true" {%- endif -%} + {% if v.is_readonly() -%} + disabled + {%- endif -%} > {{ e }} </div> {% endfor %} @@ -88,6 +98,9 @@ {%- if e == value %} checked="true" {%- endif -%} + {% if v.is_readonly() -%} + disabled + {%- endif -%} > {{ e }} </div> {% endfor %} @@ -97,6 +110,9 @@ {%- if value %} checked="true" {% endif -%} + {% if v.is_readonly() -%} + disabled + {%- endif -%} > {% elif v.__class__.__name__ == 'ComplexList' -%} <table class="table table-striped extensible-table"> @@ -112,6 +128,9 @@ {%- else -%} value="{{ line }}" {%- endif -%} + {% if v.is_readonly() -%} + disabled + {%- endif -%} > </td> <td> |