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:
Adrian Holovaty 2006-01-19 03:12:40 +00:00
parent 71e2df77d3
commit 06d23144bc
4 changed files with 5 additions and 21 deletions

View File

@ -9,9 +9,9 @@
{% 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 %}
<div class="breadcrumbs">
{% if add %}{% path_breadcrumbs path "Home" "1" "0" %}{% endif %}
{% if change %}{% path_breadcrumbs path "Home" "1" "1" %}{% endif %}
{% if add %}{% trans "Add" %} {{ bound_manipulator.verbose_name }}{% else %}{{ bound_manipulator.original|striptags|truncatewords:"18" }}{% endif %}
<a href="../../../">{% trans "Home" %}</a> &rsaquo;
<a href="../">{{ bound_manipulator.verbose_name_plural|capfirst }}</a> &rsaquo;
{% if add %}{% trans "Add" %} {{ bound_manipulator.verbose_name }}{% else %}{{ bound_manipulator.original|striptags|truncatewords:"18" }}{% endif %}
</div>
{% endif %}{% endblock %}
{% block content %}<div id="content-main">

View File

@ -2,7 +2,7 @@
{% load adminmedia admin_list i18n breadcrumbs %}
{% 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 %}
{% 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> &rsaquo; {{ cl.opts.verbose_name_plural|capfirst }}</div>{% endblock %}{% endif %}
{% block coltype %}flex{% endblock %}
{% block content %}
<div id="content-main">

View File

@ -1,6 +1,6 @@
{% load i18n %}
<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_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 %}

View File

@ -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> &rsaquo; \n" % ("../" * backs, label))
backs -= 1
return "".join(text)
path_breadcrumbs = register.simple_tag(path_breadcrumbs)