Skip to content

Commit

Permalink
initial bool support
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed May 3, 2016
1 parent 788bca2 commit 04f3d80
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
10 changes: 8 additions & 2 deletions src/appier_extras/parts/admin/templates/admin/macros.html.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,15 @@
<div class="data-source" data-type="isocountries" data-iso="iso2"></div>
</div>
{% elif type_s == "bool" %}
<input type="checkbox" class="check-field" name="{{ name }}" data-error="{{ error }}" />
{% if value %}
<input type="checkbox" class="check-field" name="{{ name }}" data-error="{{ error }}" />
{% else %}
<input type="checkbox" class="check-field" name="{{ name }}" checked="1"
data-error="{{ error }}" />
{% endif %}
{% else %}
<input type="text" class="text-field" name="{{ name }}" data-error="{{ error }}" />
<input type="text" class="text-field" name="{{ name }}" value="{{ value }}"
data-error="{{ error }}" />
{% endif %}
{%- endmacro %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@
action="{{ url_for('admin.link_model', model = model._name(), link = link.method, ids = entity._id) }}" >
{% for parameter in link.parameters %}
{% set label, name, data_type = parameter[:3] %}
{% set default = parameter[3] if parameter|length > 3 else "" %}
<label>{{ label }}</label>
{{ tag_input_b("parameters", type = data_type) }}
{{ tag_input_b("parameters", value = default, type = data_type) }}
{% endfor %}
<div class="window-buttons">
<span class="button button-cancel close-button">Cancel</span>
Expand All @@ -66,8 +67,9 @@
action="{{ url_for('admin.operation_model', model = model._name(), operation = operation.method, ids = entity._id, next = location_f) }}" >
{% for parameter in operation.parameters %}
{% set label, name, data_type = parameter[:3] %}
{% set default = parameter[3] if parameter|length > 3 else "" %}
<label>{{ label }}</label>
{{ tag_input_b("parameters", type = data_type) }}
{{ tag_input_b("parameters", value = default, type = data_type) }}
{% endfor %}
<div class="window-buttons">
<span class="button button-cancel close-button">Cancel</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@
action="{{ url_for('admin.link_model', model = model._name(), link = link.method, is_global = '' if link.instance else '1') }}">
{% for parameter in link.parameters %}
{% set label, name, data_type = parameter[:3] %}
{% set default = parameter[3] if parameter|length > 3 else "" %}
<label>{{ label }}</label>
{{ tag_input_b("parameters", type = data_type) }}
{{ tag_input_b("parameters", value = default, type = data_type) }}
{% endfor %}
<div class="window-buttons">
<span class="button button-cancel close-button">Cancel</span>
Expand All @@ -82,8 +83,9 @@
action="{{ url_for('admin.operation_model', model = model._name(), operation = operation.method, is_global = '' if operation.instance else '1', next = location_f) }}">
{% for parameter in operation.parameters %}
{% set label, name, data_type = parameter[:3] %}
{% set default = parameter[3] if parameter|length > 3 else "" %}
<label>{{ label }}</label>
{{ tag_input_b("parameters", type = data_type) }}
{{ tag_input_b("parameters", value = default, type = data_type) }}
{% endfor %}
<div class="window-buttons">
<span class="button button-cancel close-button">Cancel</span>
Expand Down

0 comments on commit 04f3d80

Please sign in to comment.