Browse Source

Acoes do usuario e administracao consolidadas no menu de ferramentas

O menu de administracao foi "hardcoded" sem usar o django-treemenus,
que não aceita gerar menus com template diferente.
producao
Marcio Mazza 10 years ago
parent
commit
796e66d66d
  1. 7
      templates/admin/app_index.html
  2. 14
      templates/admin/base_site.html
  3. 7
      templates/index.html
  4. 32
      templates/snippets/modules/actions.html
  5. 9
      templates/snippets/modules/user.html

7
templates/admin/app_index.html

@ -8,10 +8,3 @@
{% endblock %} {% endblock %}
{% block breadcrumbs %}{% endblock %} {% block breadcrumbs %}{% endblock %}
{% block sidebar %}
<div id="content-related">
{% include "snippets/modules/user.html" %}
{% include "snippets/modules/actions.html" %}
</div>
{% endblock %}

14
templates/admin/base_site.html

@ -33,6 +33,20 @@
<a class="navbar-brand" href="/">Sistema de Informações Gerenciais do Interlegis</a> <a class="navbar-brand" href="/">Sistema de Informações Gerenciais do Interlegis</a>
{% endblock %} {% endblock %}
{% block nav-global %}
{% if user.is_superuser %}
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="#">Administração <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/auth/">Usuários &amp; Grupos</a></li>
<li><a href="/treemenus/menu/">Menus</a></li>
<li><a href="/sites/site/">Sites</a></li>
<li><a href="/diagnosticos/">Diagnósticos</a></li>
</ul>
</li>
{% endif %}
{% endblock %}
{% block footer %} {% block footer %}
{% if not is_popup %} {% if not is_popup %}

7
templates/index.html

@ -205,10 +205,3 @@
{% include "snippets/modules/charts-convenios.html" %} {% include "snippets/modules/charts-convenios.html" %}
</div> </div>
{% endblock %} {% endblock %}
{% block sidebar %}
<div id="content-related">
{% include "snippets/modules/user.html" %}
{% include "snippets/modules/actions.html" %}
</div>
{% endblock %}

32
templates/snippets/modules/actions.html

@ -1,32 +0,0 @@
{% load i18n log %}
<div class="module" id="recent-actions-module">
<h2>Atividades recentes</h2>
<h3>Últimas atividades</h3>
{% get_admin_log 10 as admin_log %}
{% if not admin_log %}
<p>Não disponível.</p>
{% else %}
<ul class="actionlist">
{% for entry in admin_log %}
<li class="{% if entry.is_addition %}addlink{% endif %}
{% if entry.is_change %}changelink{% endif %}
{% if entry.is_deletion %}deletelink{% endif %}">
{% if not entry.is_deletion %}<a href="{{ entry.get_admin_url }}">{% endif %}
{{ entry.object_repr|escape|truncatewords_html:3 }}
{% if not entry.is_deletion %}</a>{% endif %}
<br />
<span class="mini quiet">
{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}, por
<i>
{% if entry.user.first_name %}
{{ entry.user.first_name }}
{% else %}
{{ entry.user.username }}
{% endif %}
</i>
</span>
</li>
{% endfor %}
</ul>
{% endif %}
</div>

9
templates/snippets/modules/user.html

@ -1,9 +0,0 @@
{% load i18n tree_menu_tags %}
{% if user.is_superuser %}
<div class="module" id="user-module">
<h3>{{ user.get_full_name }}</h3>
<h3>Administração</h3>
{% show_menu "Administrador" "unordered-list" %}
</div>
{% endif %}
Loading…
Cancel
Save