Skip to content

Instantly share code, notes, and snippets.

@esseti
Created March 30, 2018 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esseti/f068a2ffb32092a22953b6929ad8e234 to your computer and use it in GitHub Desktop.
Save esseti/f068a2ffb32092a22953b6929ad8e234 to your computer and use it in GitHub Desktop.
{% load consenta_utils %}
{% with item=qs|index:widget.index %}
<div class="col-md-3 ">
<div class="panel purpose panel-default {% if widget.attrs.checked %}panel-primary{% endif %}"
style="cursor: pointer;">
<div class="panel-heading ">
<!-- this is the standard for the checkbox from django . i suggest to hide this in the class-->
<!-- the click on the div .panel checks the checbox (see js) -->
<input type="checkbox"
name="{{ widget.name }}"
{% if widget.value != None %}
value="{{ widget.value|stringformat:'s' }}"
{% endif %}
{% for name, value in widget.attrs.items %}{% if value is not False %}
{{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}
{% endif %}{% endfor %}/>
</div>
<div class="panel-body">
{{ item.description }}
</div>
</div>
</div>
{% endwith %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment