home.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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="stats-container">
  9. <div class="row masonry">
  10. {% for section in stats %}
  11. <div class="col col-sm-12 col-md-4 my-2 masonry-item">
  12. <div class="card">
  13. <h5 class="card-header text-primary">{{ section.label }}</h5>
  14. <div class="card-body">
  15. <div class="list-group list-group-flush">
  16. {% for item in section.items %}
  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. <div class="d-flex flex-column align-items-start">
  20. <h6 class="mb-1">{{ item.label }}</h6>
  21. {% if item.description %}
  22. <small class="mb-1 text-muted">{{ item.description }}</small>
  23. {% endif %}
  24. </div>
  25. <span class="badge stat-badge rounded-pill">
  26. {% if item.count == None %}
  27. <i class="mdi mdi-lock"></i>
  28. {% else %}
  29. {{ item.count }}
  30. {% endif %}
  31. </span>
  32. </div>
  33. </a>
  34. {% endfor %}
  35. </div>
  36. <div class="display-4 font-weight-normal text-primary">
  37. {{ item.count }}
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. {% endfor %}
  43. </div>
  44. </div>
  45. {# Changelog #}
  46. <div class="row my-4 flex-grow-1 changelog-container">
  47. <div class="col">
  48. <div class="card">
  49. <h4 class="card-header">Changelog</h4>
  50. <div class="card-body">
  51. {% if changelog and perms.extras.view_objectchange %}
  52. {# TODO: Replace this with a django-tables2 Table #}
  53. <table class="table align-middle table-hover">
  54. <thead>
  55. <tr>
  56. <th scope="col">User</th>
  57. <th scope="col">Action</th>
  58. <th scope="col">Type</th>
  59. <th scope="col">Object</th>
  60. <th scope="col">Time</th>
  61. <th scope="col" align="right"></th>
  62. </tr>
  63. </thead>
  64. <tbody>
  65. {% for change in changelog %}
  66. <tr class="{% get_status change.get_action_display %}">
  67. <th scope="row">{{ change.user|default:change.user_name }}</th>
  68. <td>{{ change.get_action_display|bettertitle }}</td>
  69. <td>{{ change.changed_object_type.name|bettertitle }}</td>
  70. <td>
  71. {% if change.changed_object.get_absolute_url %}
  72. <a class="text-body" href="{{ change.changed_object.get_absolute_url }}">{{ change.changed_object }}</a>
  73. {% else %} {{ change.changed_object|default:change.object_repr }} {% endif %}
  74. </td>
  75. <td>{{ change.time|date:'SHORT_DATETIME_FORMAT' }}</td>
  76. <td>
  77. <a role="button" class="text-body" href="{{ change.get_absolute_url }}">
  78. <i class="mdi mdi-dots-horizontal" data-bs-toggle="tooltip" data-bs-placement="left" title="View Change Details"></i>
  79. </a>
  80. </td>
  81. </tr>
  82. {% endfor %}
  83. </tbody>
  84. </table>
  85. {% elif perms.extras.view_objectchange %}
  86. <div class="alert alert-secondary mt-4" role="alert">
  87. No change history found.
  88. </div>
  89. {% endif %}
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. {% endblock content %}