Ticket #4094: databrowse.diff

File databrowse.diff, 2.8 KB (added by Nick Efford, 16 years ago)

New, refreshed version of the patch

  • django/contrib/databrowse/plugins/calendars.py

     
    3939                easy_instance_field.model.url(),
    4040                plugin_name, easy_instance_field.field.name,
    4141                d.year,
    42                 datetime_safe.new_date(d).strftime('%b').lower(),
     42                datetime_safe.new_date(d).month,
    4343                d.day))]
    4444
    4545    def model_view(self, request, model_databrowse, url):
     
    7575        elif month is not None:
    7676            return date_based.archive_month(request, year, month, queryset, field.name,
    7777                template_name='databrowse/calendar_month.html', allow_empty=False, allow_future=True,
    78                 extra_context=extra_context)
     78                extra_context=extra_context, month_format='%m')
    7979        elif year is not None:
    8080            return date_based.archive_year(request, year, queryset, field.name,
    8181                template_name='databrowse/calendar_year.html', allow_empty=False, allow_future=True,
  • django/contrib/databrowse/templates/databrowse/calendar_month.html

     
    66
    77<div id="breadcrumbs"><a href="{{ root_url }}">Home</a> / <a href="{{ model.url }}">{{ model.verbose_name_plural|capfirst }}</a> / <a href="../../../">Calendars</a> / <a href="../../">By {{ field.verbose_name }}</a> / <a href="../">{{ month.year }}</a> / {{ month|date:"F" }}</div>
    88
    9 <h1>{{ object_list.count }} {% if object_list.count|pluralize %}{{ model.verbose_name_plural|escape }}{% else %}{{ model.verbose_name|escape }}{% endif %} with {{ field.verbose_name }} on {{ day|date:"F Y" }}</h1>
     9<h1>{{ object_list.count }} {% if object_list.count|pluralize %}{{ model.verbose_name_plural|escape }}{% else %}{{ model.verbose_name|escape }}{% endif %} with {{ field.verbose_name }} in {{ month|date:"F Y" }}</h1>
    1010
    1111<ul class="objectlist">
    1212{% for object in object_list %}
  • django/contrib/databrowse/templates/databrowse/calendar_year.html

     
    1010
    1111<ul class="objectlist">
    1212{% for month in date_list %}
    13 <li class="{% cycle 'odd' 'even' %}"><a href="{{ month|date:"M"|lower }}/">{{ month|date:"F" }}</a></li>
     13<li class="{% cycle 'odd' 'even' %}"><a href="{{ month|date:"n" }}/">{{ month|date:"F" }}</a></li>
    1414{% endfor %}
    1515</ul>
    1616
Back to Top