home.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. {% extends 'base/layout.html' %}
  2. {% load get_status %}
  3. {% load helpers %}
  4. {% block header %}{% endblock %}
  5. {% block title %}Home{% endblock %}
  6. {% block content %}
  7. {# General stats #}
  8. <div class="row masonry">
  9. {% for section, items in stats %}
  10. <div class="col col-sm-12 col-lg-6 col-xl-4 my-2 masonry-item">
  11. <div class="card">
  12. <h6 class="card-header text-primary text-center">{{ section }}</h6>
  13. <div class="card-body">
  14. <div class="list-group list-group-flush">
  15. {% for item in items %}
  16. {% if item.count %}
  17. <a href="{% url item.url %}" class="list-group-item list-group-item-action{% if item.disabled %} disabled{% endif %}">
  18. <div class="d-flex w-100 justify-content-between align-items-center">
  19. {{ item.label }}
  20. <h4 class="mb-1">{{ item.count }}</h4>
  21. </div>
  22. </a>
  23. {% endif %}
  24. {% endfor %}
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. {% endfor %}
  30. </div>
  31. {# Changelog #}
  32. <div class="row my-4 flex-grow-1 changelog-container">
  33. <div class="col">
  34. <div class="card">
  35. <h4 class="card-header">Changelog</h4>
  36. <div class="card-body">
  37. {% if changelog and perms.extras.view_objectchange %}
  38. {# TODO: Replace this with a django-tables2 Table #}
  39. <table class="table align-middle table-hover">
  40. <thead>
  41. <tr>
  42. <th scope="col">User</th>
  43. <th scope="col">Action</th>
  44. <th scope="col">Type</th>
  45. <th scope="col">Object</th>
  46. <th scope="col">Time</th>
  47. <th scope="col" align="right"></th>
  48. </tr>
  49. </thead>
  50. <tbody>
  51. {% for change in changelog %}
  52. <tr class="{% get_status change.get_action_display %}">
  53. <th scope="row">{{ change.user|default:change.user_name }}</th>
  54. <td>{{ change.get_action_display|bettertitle }}</td>
  55. <td>{{ change.changed_object_type.name|bettertitle }}</td>
  56. <td>
  57. {% if change.changed_object.get_absolute_url %}
  58. <a class="text-body" href="{{ change.changed_object.get_absolute_url }}">{{ change.changed_object }}</a>
  59. {% else %} {{ change.changed_object|default:change.object_repr }} {% endif %}
  60. </td>
  61. <td>{{ change.time|date:'SHORT_DATETIME_FORMAT' }}</td>
  62. <td>
  63. <a role="button" class="text-body" href="{{ change.get_absolute_url }}">
  64. <i class="mdi mdi-dots-horizontal" data-bs-toggle="tooltip" data-bs-placement="left" title="View Change Details"></i>
  65. </a>
  66. </td>
  67. </tr>
  68. {% endfor %}
  69. </tbody>
  70. </table>
  71. {% elif perms.extras.view_objectchange %}
  72. <div class="alert alert-secondary mt-4" role="alert">
  73. No change history found.
  74. </div>
  75. {% endif %}
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. {% endblock content %}