diff options
author | Simo Sorce <simo@redhat.com> | 2014-10-14 11:57:28 -0400 |
---|---|---|
committer | Patrick Uiterwijk <puiterwijk@redhat.com> | 2014-10-24 18:02:20 +0200 |
commit | c6fab2542f52f6cca71c207c1925785971e51295 (patch) | |
tree | 83c4bb441c7eb62c41b8b58c738e070bde674045 /templates | |
parent | cecf9f6c60a048f4f7c947a969f1610695d1d3be (diff) | |
download | ipsilon.git-c6fab2542f52f6cca71c207c1925785971e51295.tar.gz ipsilon.git-c6fab2542f52f6cca71c207c1925785971e51295.tar.xz ipsilon.git-c6fab2542f52f6cca71c207c1925785971e51295.zip |
Handle lists type options in plugins configuration
Autodetect and convert config values based on the options definition.
If the option is marked as list split a string on setting the configuration
or join the list into a string before saving it to the database.
Signed-off-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/admin/plugin_config.html | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/templates/admin/plugin_config.html b/templates/admin/plugin_config.html index 70d56f0..e722aa1 100644 --- a/templates/admin/plugin_config.html +++ b/templates/admin/plugin_config.html @@ -12,7 +12,12 @@ {% for o in options_order %} <div class="form-group"> <label for="{{ o }}">{{ o }}:</label> - <input type="text" class="form-control" name="{{ o }}" value="{{ plugin.get_config_value(o) }}"> + {% set val = plugin.get_config_value(o) %} + {% if val is string %} + <input type="text" class="form-control" name="{{ o }}" value="{{ val }}"> + {% else %} + <input type="text" class="form-control" name="{{ o }}" value="{{ val|join(', ') }}"> + {% endif %} </div> <span class="help-block">{{ plugin.get_config_desc(o) }}</span> {% endfor %} |