magic-removal: Fixed breadcrumb links and removed path_breadcrumbs templatetag, which is no longer needed
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2063 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
71e2df77d3
commit
06d23144bc
|
@ -9,8 +9,8 @@
|
||||||
{% block userlinks %}<a href="../../../doc/">{% trans 'Documentation' %}</a> / <a href="../../../password_change/">{% trans 'Change password' %}</a> / <a href="../../../logout/">{% trans 'Log out' %}</a>{% endblock %}
|
{% block userlinks %}<a href="../../../doc/">{% trans 'Documentation' %}</a> / <a href="../../../password_change/">{% trans 'Change password' %}</a> / <a href="../../../logout/">{% trans 'Log out' %}</a>{% endblock %}
|
||||||
{% block breadcrumbs %}{% if not is_popup %}
|
{% block breadcrumbs %}{% if not is_popup %}
|
||||||
<div class="breadcrumbs">
|
<div class="breadcrumbs">
|
||||||
{% if add %}{% path_breadcrumbs path "Home" "1" "0" %}{% endif %}
|
<a href="../../../">{% trans "Home" %}</a> ›
|
||||||
{% if change %}{% path_breadcrumbs path "Home" "1" "1" %}{% endif %}
|
<a href="../">{{ bound_manipulator.verbose_name_plural|capfirst }}</a> ›
|
||||||
{% if add %}{% trans "Add" %} {{ bound_manipulator.verbose_name }}{% else %}{{ bound_manipulator.original|striptags|truncatewords:"18" }}{% endif %}
|
{% if add %}{% trans "Add" %} {{ bound_manipulator.verbose_name }}{% else %}{{ bound_manipulator.original|striptags|truncatewords:"18" }}{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}{% endblock %}
|
{% endif %}{% endblock %}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
{% load adminmedia admin_list i18n breadcrumbs %}
|
{% load adminmedia admin_list i18n breadcrumbs %}
|
||||||
{% block bodyclass %}change-list{% endblock %}
|
{% block bodyclass %}change-list{% endblock %}
|
||||||
{% block userlinks %}<a href="../../doc/">{% trans 'Documentation' %}</a> / <a href="../../password_change/">{% trans 'Change password' %}</a> / <a href="../../logout/">{% trans 'Log out' %}</a>{% endblock %}
|
{% block userlinks %}<a href="../../doc/">{% trans 'Documentation' %}</a> / <a href="../../password_change/">{% trans 'Change password' %}</a> / <a href="../../logout/">{% trans 'Log out' %}</a>{% endblock %}
|
||||||
{% if not is_popup %}{% block breadcrumbs %}<div class="breadcrumbs">BREADCRUMBS</div>{% endblock %}{% endif %}
|
{% if not is_popup %}{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> › {{ cl.opts.verbose_name_plural|capfirst }}</div>{% endblock %}{% endif %}
|
||||||
{% block coltype %}flex{% endblock %}
|
{% block coltype %}flex{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div id="content-main">
|
<div id="content-main">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
<div class="submit-row">
|
<div class="submit-row">
|
||||||
{% if show_delete_link %}<p class="float-left"><a href="../delete/" class="deletelink">{% trans "Delete" %}</a></p>{% endif %}
|
{% if show_delete_link %}<p class="float-left"><a href="delete/" class="deletelink">{% trans "Delete" %}</a></p>{% endif %}
|
||||||
{% if show_save_as_new %}<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" {{ onclick_attrib }}/>{%endif%}
|
{% if show_save_as_new %}<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" {{ onclick_attrib }}/>{%endif%}
|
||||||
{% if show_save_and_add_another %}<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" {{ onclick_attrib }} />{% endif %}
|
{% if show_save_and_add_another %}<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" {{ onclick_attrib }} />{% endif %}
|
||||||
{% if show_save_and_continue %}<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" {{ onclick_attrib }}/>{% endif %}
|
{% if show_save_and_continue %}<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" {{ onclick_attrib }}/>{% endif %}
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
from django.template import Library
|
|
||||||
|
|
||||||
register = Library()
|
|
||||||
|
|
||||||
def path_breadcrumbs(path, overrides="", front=0, back=0):
|
|
||||||
overs = overrides.split('/')
|
|
||||||
comps = [""] * int(front) + path.split('/')[:-1]
|
|
||||||
backs = int(back) + len(comps)
|
|
||||||
overs.extend([None for x in range(len(overs) -1, len(comps))])
|
|
||||||
text = []
|
|
||||||
for comp, ov in zip(comps, overs):
|
|
||||||
label = ov or comp
|
|
||||||
text.append("<a href='%s'>%s</a> › \n" % ("../" * backs, label))
|
|
||||||
backs -= 1
|
|
||||||
return "".join(text)
|
|
||||||
path_breadcrumbs = register.simple_tag(path_breadcrumbs)
|
|
Loading…
Reference in New Issue