diff options
author | Simo Sorce <simo@redhat.com> | 2015-02-18 14:27:58 -0500 |
---|---|---|
committer | Patrick Uiterwijk <puiterwijk@redhat.com> | 2015-02-24 16:58:25 +0100 |
commit | c89ae23656dceecba453c68ce97382b9fff5fda6 (patch) | |
tree | ab21f1b278a94557ce93b2c64f32e9afbff7fff4 /templates | |
parent | db88788fe906f315733b6ae67929f62cfc307d24 (diff) | |
download | ipsilon.git-c89ae23656dceecba453c68ce97382b9fff5fda6.tar.gz ipsilon.git-c89ae23656dceecba453c68ce97382b9fff5fda6.tar.xz ipsilon.git-c89ae23656dceecba453c68ce97382b9fff5fda6.zip |
Add support for new options to plugin_config.html
This add support in the template for showing ComplexList and
MappingList options.
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/admin/plugin_config.html | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/templates/admin/plugin_config.html b/templates/admin/plugin_config.html index 7071c7e..18792a2 100644 --- a/templates/admin/plugin_config.html +++ b/templates/admin/plugin_config.html @@ -23,7 +23,7 @@ <div class="form-group"> <label class="col-sm-2" for="{{ v.name }}">{{ v.name }}:</label> <div class="col-sm-10"> - {%- set value = v.get_value() -%} + {% set value = v.get_value() -%} {% if v.__class__.__name__ in ['String', 'Template'] -%} <input type="text" class="form-control" name="{{ v.name }}" {%- if value %} @@ -68,6 +68,61 @@ checked="true" {% endif -%} > + {% elif v.__class__.__name__ == 'ComplexList' -%} + <table class="table table-striped"> + <tr><th>#</th><th>Name</th><th>Delete</th></tr> + {% for line in value -%} + {%- set basename = "%s %d-"|format(v.name, loop.index0) -%} + <tr> + <td>{{loop.index}}</td> + <td> + <input type="text" name="{{basename}}name" + {%- if line.__class__.__name__ == 'list' -%} + value="{{ line|join(' / ') }}" + {%- else -%} + value="{{ line }}" + {%- endif -%} + > + </td> + <td> + <input type="checkbox" name="{{basename}}delete"> + <!-- Never cheked by default --> + </td> + </tr> + {% endfor -%} + </table> + {% elif v.__class__.__name__ == 'MappingList' -%} + <table class="table table-striped"> + <tr><th>#</th><th>From</th><th>To</th><th>Delete</th></tr> + {% for line in value -%} + {%- set basename = "%s %d-"|format(v.name, loop.index0) -%} + <tr> + <td>{{loop.index}}</td> + <td> + <input type="text" name="{{basename}}from" + {% if line[0].__class__.__name__ == 'list' -%} + value="{{ line[0]|join(' / ') }}" + {% else -%} + value="{{ line[0] }}" + {% endif -%} + > + </td> + <td> + <input type="text" name="{{basename}}to" + {% if line[1].__class__.__name__ == 'list' -%} + value="{{ line[1]|join(' / ') }}" + {% else -%} + value="{{ line[1] }}" + {% endif -%} + > + </td> + <td> + <input type="checkbox" name="{{basename}}delete"> + <!-- Never cheked by default --> + </td> + </tr> + {% endfor -%} + </table> {% else -%} {{ v.__class__.__name__ }} {% endif -%} |