custom_fields_panel.html 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. {% with custom_fields=obj.get_custom_fields %}
  2. {% if custom_fields %}
  3. <div class="panel panel-default">
  4. <div class="panel-heading">
  5. <strong>Custom Fields</strong>
  6. </div>
  7. <table class="table table-hover panel-body attr-table">
  8. {% for field, value in custom_fields.items %}
  9. <tr>
  10. <td>{{ field }}</td>
  11. <td>
  12. {% if field.type == 'boolean' and value == True %}
  13. <i class="glyphicon glyphicon-ok text-success" title="True"></i>
  14. {% elif field.type == 'boolean' and value == False %}
  15. <i class="glyphicon glyphicon-remove text-danger" title="False"></i>
  16. {% elif field.type == 'url' and value %}
  17. <a href="{{ value }}">{{ value|truncatechars:70 }}</a>
  18. {% elif field.type == 'integer' or value %}
  19. {{ value }}
  20. {% elif field.required %}
  21. <span class="text-warning">Not defined</span>
  22. {% else %}
  23. <span class="text-muted">&mdash;</span>
  24. {% endif %}
  25. </td>
  26. </tr>
  27. {% endfor %}
  28. </table>
  29. </div>
  30. {% endif %}
  31. {% endwith %}