Skip to content

Commit

Permalink
new support for tag input (basic) version
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Nov 23, 2015
1 parent 5aa5853 commit 6937a52
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
18 changes: 18 additions & 0 deletions src/appier_extras/parts/admin/templates/admin/macros.html.tpl
Expand Up @@ -175,6 +175,24 @@
{% endif %}
{%- endmacro %}

{% macro tag_input_b(name, value = "", error = "", type = None, disabled = False) -%}
{% if type == "file" %}
<a data-name="{{ name }}" class="uploader" data-error="{{ error }}">Select file</a>
{% elif type == "longtext" %}
<textarea class="text-area" name="{{ name }}" data-error="{{ error }}"></textarea>
{% elif type == "country" %}
<div class="drop-field drop-field-select {{ disabled_s|safe }}" data-error="{{ error }}"
data-number_options="-1">
<input name="{{ name }}" type="hidden" class="hidden-field" />
<div class="data-source" data-type="isocountries" data-iso="iso2"></div>
</div>
{% elif type == "bool" %}
<input type="checkbox" class="check-field" name="{{ name }}" data-error="{{ error }}" />
{% else %}
<input type="text" class="text-field" name="{{ name }}" data-error="{{ error }}" />
{% endif %}
{%- endmacro %}

{% macro menu_link(name, href = "#") -%}
{% if area == name %}
<a class="active" href="{{ href }}">{{ name }}</a>
Expand Down
Expand Up @@ -43,15 +43,7 @@
{% set label, name, data_type = parameter[:3] %}
{% set data_type_s = data_type.__name__ %}
<label>{{ label }}</label>
{% if data_type == "file" %}
<a data-name="parameters" class="uploader">Select file</a>
{% elif data_type == "longtext" %}
<textarea class="text-area" name="parameters"></textarea>
{% elif data_type_s == "bool" %}
<input type="checkbox" class="check-field" name="parameters" />
{% else %}
<input type="text" class="text-field" name="parameters" />
{% endif %}
{{ tag_input_b("parameters", type = data_type) }}
{% endfor %}
<div class="window-buttons">
<span class="button button-cancel close-button">Cancel</span>
Expand Down
Expand Up @@ -59,15 +59,7 @@
{% set label, name, data_type = parameter[:3] %}
{% set data_type_s = data_type.__name__ %}
<label>{{ label }}</label>
{% if data_type == "file" %}
<a data-name="parameters" class="uploader">Select file</a>
{% elif data_type == "longtext" %}
<textarea class="text-area" name="parameters"></textarea>
{% elif data_type_s == "bool" %}
<input type="checkbox" class="check-field" name="parameters" />
{% else %}
<input type="text" class="text-field" name="parameters" />
{% endif %}
{{ tag_input_b("parameters", type = data_type) }}
{% endfor %}
<div class="window-buttons">
<span class="button button-cancel close-button">Cancel</span>
Expand Down

0 comments on commit 6937a52

Please sign in to comment.