Skip to content

Commit

Permalink
Only show extra closed fields when checkbox is ticked
Browse files Browse the repository at this point in the history
  • Loading branch information
rossjones committed Jan 27, 2015
1 parent 604db8f commit 88f502a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions ckan/templates/organization/snippets/organization_form.html
Expand Up @@ -24,16 +24,24 @@

{{ form.image_upload(data, errors, is_upload_enabled=h.uploads_enabled(), is_url=is_url, is_upload=is_upload) }}

{{ form.checkbox('closed', id='field-closed', checked=data.get('closed', False), label=_('Closed'), value="true") }}
<div class="control-group ">
<div class="controls">
<label class="checkbox" for="field-closed">
<input id="field-closed" type="checkbox" name="closed" value="true" {% if data.get('closed', False) %}checked{% endif %} class="collapse" data-toggle="collapse" data-target="#closed-properties">
Closed
</label>
</div>
</div>

<span id="closed-properties">
<div id="closed-properties" {% if data.get('closed', False) %}class="collapse in"{% else %}class="collapse"{% endif %}>
{% set relationship_options = [{'value': ''},
{'value': _('replaced by') },
{'value': _('partially replaced') },
{'value': _('split up') },
{'value': _('merged into new organization')} ] %}
{{ form.select('related_group_relationship', label=_('Organization relationship'), options=relationship_options, selected=data.related_group_relationship, error=error) }}


<div class="control-group control-full">
{% set related_label = _("Related Organization") %}
<label class="control-label" for="related_group_id">{{ related_label }}</label>
Expand All @@ -44,7 +52,8 @@
data-module-source="/api/2/util/group/autocomplete?type=organization&q=?">
</div>
</div>
</span>
</div>


{% endblock %}

Expand Down

0 comments on commit 88f502a

Please sign in to comment.