Permalink
Browse files

Remove template tag truncchar and stop using it, it's overkill

  • Loading branch information...
1 parent 0e61dcc commit 29c8128d9ac4508b8fd03effae71adceb827ccca @souen souen committed Mar 12, 2012
Showing with 1 addition and 40 deletions.
  1. +1 −2 massadmin/templates/admin/mass_change_form.html
  2. +0 −38 massadmin/templatetags/truncchar.py
@@ -1,6 +1,5 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_modify adminmedia massadmin_tags %}
-{% load truncchar %}
{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="../../../jsi18n/"></script>
@@ -18,7 +17,7 @@
<a href="../../../">{% trans "Home" %}</a> &rsaquo;
<a href="../../">{{ app_label|capfirst|escape }}</a> &rsaquo;
{% if has_change_permission %}<a href="../../{{ opts.object_name.lower }}/">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} &rsaquo;
- {% if add %}{% trans "Add" %} {{ opts.verbose_name }}{% else %}{{ object_ids|truncchar:50 }}{% endif %}
+ {% trans "Mass change" %} {{ opts.verbose_name }}
</div>
{% endif %}{% endblock %}
@@ -1,38 +0,0 @@
-'''
-Copyright (c) 2010, Stanislaw Adaszewski
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of Stanislaw Adaszewski nor the
- names of any contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Stanislaw Adaszewski BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-'''
-
-from django import template
-
-register = template.Library()
-
-@register.filter('truncchar')
-# truncate after a certain number of characters
-def truncchar(value, arg):
- if len(value) < arg:
- return value
- else:
- return value[:arg] + '...'

0 comments on commit 29c8128

Please sign in to comment.