parameters.html 2.46 KB
Newer Older
Janez K's avatar
Janez K committed
1
2
3
4
5
{% load url from future %}
<div id="widgetpreferences-{{widget.pk}}" rel="{{widget.pk}}" class="widgetdialog" title="{{widget.name}} parameters">
<fieldset>
{% for p in parameters %}
        {% if p.parameter_type == "checkbox" %}
6
7
        <input id="pref-{{p.pk}}" name="pref-{{p.pk}}" title="{{p.description}}" type="checkbox" value="true" {% ifequal p.value 'true' %}checked {% endifequal%} style="width:15px;display:inline;float:left;" />
    {% endif %}<label for="pref-{{p.pk}}" title="{{p.description}}" {% if p.parameter_type == "checkbox" %} style="float:left;"{% endif %}>{{p.name}}</label>
Janez K's avatar
Janez K committed
8
9
    {% if p.parameter_type == "checkbox" %}<div class="clear"><!----></div>{% endif %}
    {% if p.parameter_type == "text" %}
10
        <input id="pref-{{p.pk}}" name="pref-{{p.pk}}" title="{{p.description}}" type="text" value="{{p.value}}" onchange="" class="text ui-widget-content ui-corner-all" />
Janez K's avatar
Janez K committed
11
12
    {% endif %}
    {% if p.parameter_type == "select" %}
13
        <select id="pref-{{p.pk}}" name="pref-{{p.pk}}" title="{{p.description}}" style="background:#fefefe;width:99%;" class="text ui-widget-content ui-corner-all" onchange="">
Janez K's avatar
Janez K committed
14
15
16
17
18
19
        {% for o in p.options.all %}
            <option value="{{ o.value }}" {% if o.value == p.value %} selected {% endif %}>{{ o.name }}</option>
        {% endfor %}                                
        </select>
    {% endif %}                             
    {% if p.parameter_type == "textarea" %}                                    
20
        <textarea id="pref-{{p.pk}}" name="pref-{{p.pk}}" title="{{p.description}}" onchange="" class="text ui-widget-content ui-corner-all">{{ p.value }}</textarea>
Janez K's avatar
Janez K committed
21
22
23
24
25
    {% endif %}
    {% if p.parameter_type == "file" %}
        <form id="upload_form{{ p.pk }}" method="POST" action="{% url 'file upload' %}" enctype="multipart/form-data"  target="upload_target{{ p.pk }}">
        {% csrf_token %}
            <input type="hidden" name="input_id" value="{{p.pk}}" />
26
            <input id="id_file{{ p.pk }}" title="{{p.description}}" class="filename" type="file" name="file"><br/>
Janez K's avatar
Janez K committed
27
28
29
30
31
32
33
            <iframe id="upload_target{{ p.pk }}" name="upload_target{{ p.pk }}" src="" style="width:0px;height:0px;border:0px solid #fff;"></iframe>
            
        </form>
        <div id="parameter_comment{{p.pk}}">{{ p.value }}</div>
    {% endif %}
{% endfor %}
</fieldset>
34
35
<br/>
<a href="#" onclick="openConfiguration({{widget.pk}})" style="color:#a9a9a9;">Advanced widget's input/output configuration</a>
Janez K's avatar
Janez K committed
36
</div>