tag.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. {% extends 'generic/object.html' %}
  2. {% load helpers %}
  3. {% load plugins %}
  4. {% load render_table from django_tables2 %}
  5. {% block content %}
  6. <div class="row">
  7. <div class="col col-md-6">
  8. <div class="card">
  9. <h5 class="card-header">
  10. Tag
  11. </h5>
  12. <div class="card-body">
  13. <table class="table table-hover panel-body attr-table">
  14. <tr>
  15. <th scope="row">Name</th>
  16. <td>
  17. {{ object.name }}
  18. </td>
  19. </tr>
  20. <tr>
  21. <th scope="row">Description</th>
  22. <td>
  23. {{ object.description|placeholder }}
  24. </td>
  25. </tr>
  26. <tr>
  27. <th scope="row">Color</th>
  28. <td>
  29. <span class="color-label" style="background-color: #{{ object.color }}">&nbsp;</span>
  30. </td>
  31. </tr>
  32. <tr>
  33. <th scope="row">Tagged Items</th>
  34. <td>
  35. {{ taggeditem_table.rows|length }}
  36. </td>
  37. </tr>
  38. </table>
  39. </div>
  40. </div>
  41. {% plugin_left_page object %}
  42. </div>
  43. <div class="col col-md-6">
  44. <div class="card">
  45. <h5 class="card-header">
  46. Tagged Item Types
  47. </h5>
  48. <div class="card-body">
  49. <table class="table table-hover panel-body attr-table">
  50. {% for object_type in object_types %}
  51. <tr>
  52. <td>{{ object_type.content_type.name|bettertitle }}</td>
  53. <td>
  54. {% with viewname=object_type.content_type.model_class|validated_viewname:"list" %}
  55. {% if viewname %}
  56. <a href="{% url viewname %}?tag={{ object.slug }}">{{ object_type.item_count }}</a>
  57. {% else %}
  58. {{ object_type.item_count }}
  59. {% endif %}
  60. {% endwith %}
  61. </td>
  62. </tr>
  63. {% endfor %}
  64. </table>
  65. </div>
  66. </div>
  67. {% plugin_right_page object %}
  68. </div>
  69. </div>
  70. <div class="row">
  71. <div class="col col-md-12">
  72. <div class="card">
  73. <h5 class="card-header">Tagged Objects</h5>
  74. <div class="card-body table-responsive">
  75. {% render_table taggeditem_table 'inc/table.html' %}
  76. {% include 'inc/paginator.html' with paginator=taggeditem_table.paginator page=taggeditem_table.page %}
  77. </div>
  78. </div>
  79. {% plugin_full_width_page object %}
  80. </div>
  81. </div>
  82. {% endblock %}