index.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {% extends "admin/base_site.html" %}
  2. {% load i18n admin_static %}
  3. {% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />{% endblock %}
  4. {% block coltype %}colMS{% endblock %}
  5. {% block bodyclass %}{{ block.super }} dashboard{% endblock %}
  6. {% block breadcrumbs %}{% endblock %}
  7. {% block content %}
  8. <div id="content-main">
  9. <div class="module">
  10. <table>
  11. <caption>Custom Admin Pages</caption>
  12. {% if perms.auth.add_user %}
  13. <tr>
  14. <th scope="row"><a href="/devel/newuser/">Create New User</a></th>
  15. <td></td><td></td>
  16. </tr>
  17. {% endif %}
  18. {% if user.is_superuser %}
  19. <tr>
  20. <th scope="row"><a href="/devel/admin_log/">Admin Actions Log</a></th>
  21. <td></td><td></td>
  22. </tr>
  23. {% endif %}
  24. </table>
  25. </div>
  26. {% if app_list %}
  27. {% for app in app_list %}
  28. <div class="app-{{ app.app_label }} module">
  29. <table>
  30. <caption>
  31. <a href="{{ app.app_url }}" class="section" title="{% blocktrans with name=app.name %}Models in the {{ name }} application{% endblocktrans %}">{{ app.name }}</a>
  32. </caption>
  33. {% for model in app.models %}
  34. <tr class="model-{{ model.object_name|lower }}">
  35. {% if model.admin_url %}
  36. <th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th>
  37. {% else %}
  38. <th scope="row">{{ model.name }}</th>
  39. {% endif %}
  40. {% if model.add_url %}
  41. <td><a href="{{ model.add_url }}" class="addlink">{% trans 'Add' %}</a></td>
  42. {% else %}
  43. <td>&nbsp;</td>
  44. {% endif %}
  45. {% if model.admin_url %}
  46. <td><a href="{{ model.admin_url }}" class="changelink">{% trans 'Change' %}</a></td>
  47. {% else %}
  48. <td>&nbsp;</td>
  49. {% endif %}
  50. </tr>
  51. {% endfor %}
  52. </table>
  53. </div>
  54. {% endfor %}
  55. {% else %}
  56. <p>{% trans "You don't have permission to edit anything." %}</p>
  57. {% endif %}
  58. </div>
  59. {% endblock %}
  60. {% block sidebar %}
  61. <div id="content-related">
  62. <div class="module" id="recent-actions-module">
  63. <h2>{% trans 'Recent Actions' %}</h2>
  64. <h3>{% trans 'My Actions' %}</h3>
  65. {% load log %}
  66. {% get_admin_log 10 as admin_log for_user user %}
  67. {% if not admin_log %}
  68. <p>{% trans 'None available' %}</p>
  69. {% else %}
  70. <ul class="actionlist">
  71. {% for entry in admin_log %}
  72. <li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
  73. {% if entry.is_deletion or not entry.get_admin_url %}
  74. {{ entry.object_repr }}
  75. {% else %}
  76. <a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a>
  77. {% endif %}
  78. <br/>
  79. {% if entry.content_type %}
  80. <span class="mini quiet">{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span>
  81. {% else %}
  82. <span class="mini quiet">{% trans 'Unknown content' %}</span>
  83. {% endif %}
  84. </li>
  85. {% endfor %}
  86. </ul>
  87. {% endif %}
  88. </div>
  89. </div>
  90. {% endblock %}