diff options
Diffstat (limited to 'templates/admin')
-rw-r--r-- | templates/admin/plugin_config.html | 61 | ||||
-rw-r--r-- | templates/admin/plugins.html | 4 | ||||
-rw-r--r-- | templates/admin/providers.html | 4 |
3 files changed, 55 insertions, 14 deletions
diff --git a/templates/admin/plugin_config.html b/templates/admin/plugin_config.html index 1372f55..7071c7e 100644 --- a/templates/admin/plugin_config.html +++ b/templates/admin/plugin_config.html @@ -19,18 +19,59 @@ <div id="options"> <form class="form-horizontal" role="form" id="{{ name }}" action="{{ action }}" method="post" enctype="application/x-www-form-urlencoded"> - - {% for o in options_order %} + {% for k, v in config.iteritems() %} <div class="form-group"> - <label class="col-sm-2" for="{{ o }}">{{ o }}:</label> + <label class="col-sm-2" for="{{ v.name }}">{{ v.name }}:</label> <div class="col-sm-10"> - {% 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 %} - <span class="help-block">{{ plugin.get_config_desc(o) }}</span> + {%- set value = v.get_value() -%} + {% if v.__class__.__name__ in ['String', 'Template'] -%} + <input type="text" class="form-control" name="{{ v.name }}" + {%- if value %} + value="{{ value }}" + {%- endif -%} + > + {% elif v.__class__.__name__ == 'List' -%} + <textarea class="form-control" name="{{ v.name }}"> + {%- if value %} + {{- value|join('\n') -}} + {%- endif -%} + </textarea> + {% elif v.__class__.__name__ == 'Choice' -%} + {% set entries = v.get_allowed() -%} + <div class="row"> + {% for e in entries -%} + <div class="col-md-4"> + <input type="checkbox" name="{{ v.name }}_{{ e }}" + {%- if value and e in value %} + checked="true" + {%- endif -%} + > {{ e }} + </div> + {% endfor %} + </div> + {% elif v.__class__.__name__ == 'Pick' -%} + {% set entries = v.get_allowed() -%} + <div class="row"> + {% for e in entries -%} + <div class="col-md-4"> + <input type="radio" name="{{ v.name }}" value="{{ e }}" + {%- if e == value %} + checked="true" + {%- endif -%} + > {{ e }} + </div> + {% endfor %} + </div> + {% elif v.__class__.__name__ == 'Condition' -%} + <input type="checkbox" name="{{ v.name }}" + {%- if value %} + checked="true" + {% endif -%} + > + {% else -%} + {{ v.__class__.__name__ }} + {% endif -%} + <span class="help-block">{{ v.description }}</span> </div> </div> <hr> diff --git a/templates/admin/plugins.html b/templates/admin/plugins.html index 7bbe544..7ef50a0 100644 --- a/templates/admin/plugins.html +++ b/templates/admin/plugins.html @@ -28,7 +28,7 @@ <a class="text-info" href="{{ baseurl }}/disable/{{ p }}">Disable</a> </div> <div class="col-md-6 col-sm-6 col-xs-12"> - {%- if available[p].get_config_desc() %} + {%- if available[p].get_config_obj() %} <a class="text-primary" href="{{ baseurl }}/{{ p }}">Configure</a> {% endif %} </div> @@ -88,7 +88,7 @@ <a class="text-info" href="{{ baseurl }}/enable/{{ p }}">Enable</a> </div> <div class="col-md-6 col-sm-6 col-xs-12"> - {%- if available[p].get_config_desc() %} + {%- if available[p].get_config_obj() %} <span class="text-muted">Configure</span> {% endif %} </div> diff --git a/templates/admin/providers.html b/templates/admin/providers.html index c0147d8..333b10d 100644 --- a/templates/admin/providers.html +++ b/templates/admin/providers.html @@ -28,7 +28,7 @@ <p class="text-info"><a href="{{ baseurl }}/disable/{{ p }}">Disable</a></p> </div> <div class="col-md-4 col-sm-4 col-xs-12"> - {%- if available[p].get_config_desc() %} + {%- if available[p].get_config_obj() %} <p class="text-primary"><a href="{{ baseurl }}/{{ p }}">Configure</a></p> {% endif %} </div> @@ -54,7 +54,7 @@ <p class="text-info"><a href="{{ baseurl }}/enable/{{ p }}">Enable</a></p> </div> <div class="col-md-4 col-sm-4 col-xs-12"> - {%- if available[p].get_config_desc() %} + {%- if available[p].get_config_obj() %} <p class="text-muted">Configure</p> {% endif %} </div> |