permissions_table.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. {% load crispy_forms_field crispy_forms_tags i18n %}
  2. <fieldset>
  3. <legend>{{ form.legend }}</legend>
  4. <table class="table table-striped table-permissions">
  5. {% for field in form %}
  6. <tr{% if field.errors %} class="text-danger"{% endif %}>
  7. <td class="col-md-8">
  8. <label>{{ field.label }}:</label>
  9. {% for error in field.errors %}
  10. <p class="small"><strong>{{ error }}</strong></p>
  11. {% endfor %}
  12. {% if field.help_text %}
  13. <p class="text-muted small">{{ field.help_text }}</p>
  14. {% endif %}
  15. </td>
  16. <td>
  17. <div class="form-group{% if field.errors %} has-error{% endif %}">
  18. {% if field|is_checkboxselectmultiple %}
  19. {% include 'bootstrap3/layout/checkboxselectmultiple.html' %}
  20. {% endif %}
  21. {% if field|is_radioselect %}
  22. {% include 'bootstrap3/layout/radioselect.html' with hide_help_text=1 %}
  23. {% endif %}
  24. {% if not field|is_checkboxselectmultiple and not field|is_radioselect %}
  25. {% crispy_field field %}
  26. {% endif %}
  27. </div>
  28. </td>
  29. </tr>
  30. {% endfor %}
  31. </table>
  32. </fieldset>