Created
January 4, 2013 12:20
-
-
Save anonymous/4452240 to your computer and use it in GitHub Desktop.
django–grappelli and django–mptt workaround. We need to add the 2 mptt templates to grappelli (see files). But since mptt has hardcoded paddings defined with Python, this will never look like it should (and it´s the reason we currently don´t support mptt). See https://github.com/sehmaschine/django-grappelli/issues/243
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "admin/change_list.html" %} | |
{% load admin_list i18n mptt_admin %} | |
{% block result_list %} | |
{% mptt_result_list cl %} | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load i18n admin_static %} | |
{% if result_hidden_fields %} | |
<div class="hiddenfields"> {# DIV for HTML validation #} | |
{% for item in result_hidden_fields %}{{ item }}{% endfor %} | |
</div> | |
{% endif %} | |
{% if results %} | |
<div class="grp-module grp-changelist-results"> | |
<table id="result_list" cellspacing="0" class="grp-sortable"> | |
<thead> | |
<tr> | |
{% for header in result_headers %} | |
<th scope="col" {{ header.class_attrib }}> | |
{% if header.sortable %} | |
{% if header.sort_priority > 0 %} | |
<div class="grp-sortoptions"> | |
<a class="grp-sortremove" href="{{ header.url_remove }}" title="{% trans "Remove from sorting" %}"></a> | |
{% if num_sorted_fields > 1 %}<span class="grp-sortpriority" title="{% blocktrans with priority_number=header.sort_priority %}Sorting priority: {{ priority_number }}{% endblocktrans %}">{{ header.sort_priority }}</span>{% endif %} | |
<a href="{{ header.url_toggle }}" class="grp-toggle {% if header.ascending %}grp-ascending{% else %}grp-descending{% endif %}" title="{% trans "Toggle sorting" %}"></a> | |
</div> | |
{% endif %} | |
{% endif %} | |
<div class="grp-text">{% if header.sortable %}<a href="{{ header.url_primary }}">{{ header.text|capfirst }}</a>{% else %}<span>{{ header.text|capfirst }}</span>{% endif %}</div> | |
</th> | |
{% endfor %} | |
</tr> | |
</thead> | |
<tbody> | |
{% for result in results %} | |
{% if result.form.non_field_errors %} | |
<tr class="grp-errors"><td colspan="{{ result|length }}">{{ result.form.non_field_errors }}</td></tr> | |
{% endif %} | |
<tr class="grp-row {% cycle 'grp-row-even' 'grp-row-odd' %}">{% for item in result %}{{ item }}{% endfor %}</tr> | |
{% endfor %} | |
</tbody> | |
</table> | |
</div> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment