0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

added thousands comma to dashboard stats without mandating l10n or installation of more apps

This commit is contained in:
Dave Cranwell 2014-11-25 13:41:15 +00:00
parent dab54416cc
commit e6016f9920
2 changed files with 12 additions and 10 deletions

View File

@ -1,31 +1,31 @@
{% load i18n %}
{% load i18n wagtailadmin_tags %}
<section class="panel summary nice-padding">
<h2 class="visuallyhidden">{% trans "Site summary" %}</h2>
<ul class="stats">
<li class="icon icon-doc-empty-inverse">
<a href="{% url 'wagtailadmin_explore_root' %}">
{% blocktrans count counter=total_pages %}
<span>{{ total_pages }}</span> Page
{% blocktrans count counter=total_pages with total_pages|intcomma as total %}
<span>{{ total }}</span> Page
{% plural %}
<span>{{ total_pages }}</span> Pages
<span>{{ total }}</span> Pages
{% endblocktrans %}
</a>
</li>
<li class="icon icon-image">
<a href="{% url 'wagtailimages_index' %}">
{% blocktrans count counter=total_images %}
<span>{{ total_images }}</span> Image
{% blocktrans count counter=total_images with total_images|intcomma as total %}
<span>{{ total }}</span> Image
{% plural %}
<span>{{ total_images }}</span> Images
<span>{{ total }}</span> Images
{% endblocktrans %}
</a>
</li>
<li class="icon icon-doc-full-inverse">
<a href="{% url 'wagtaildocs_index' %}">
{% blocktrans count counter=total_docs %}
<span>{{ total_docs }}</span> Document
{% blocktrans count counter=total_docs with total_docs|intcomma as total %}
<span>{{ total }}</span> Document
{% plural %}
<span>{{ total_docs }}</span> Documents
<span>{{ total }}</span> Documents
{% endblocktrans %}
</a>
</li>

View File

@ -4,6 +4,7 @@ import re
from django.conf import settings
from django import template
from django.contrib.humanize.templatetags.humanize import intcomma
from wagtail.wagtailcore import hooks
from wagtail.wagtailcore.models import get_navigation_menu_items, UserPagePermissionsProxy, PageViewRestriction
@ -13,6 +14,7 @@ from wagtail.wagtailadmin.menu import admin_menu
register = template.Library()
register.filter('intcomma', intcomma)
@register.inclusion_tag('wagtailadmin/shared/explorer_nav.html')
def explorer_nav():