mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-10 16:24:49 +00:00
Make the 'X Pages/Images/Documents' stats links
They link to the relevant sections of the admin, allowing for quick jumping around.
This commit is contained in:
parent
da8ee99a3e
commit
66dce8df03
3 changed files with 16 additions and 2 deletions
|
|
@ -46,6 +46,13 @@ header{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a{
|
||||||
|
position:relative;
|
||||||
|
display:block;
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
}
|
||||||
|
|
||||||
span{
|
span{
|
||||||
font-family:Bitter, Georgia, serif;
|
font-family:Bitter, Georgia, serif;
|
||||||
display:block;
|
display:block;
|
||||||
|
|
|
||||||
|
|
@ -3,25 +3,31 @@
|
||||||
<h2 class="visuallyhidden">{% trans "Site summary" %}</h2>
|
<h2 class="visuallyhidden">{% trans "Site summary" %}</h2>
|
||||||
<ul class="stats">
|
<ul class="stats">
|
||||||
<li class="icon icon-doc-empty-inverse">
|
<li class="icon icon-doc-empty-inverse">
|
||||||
|
<a href="{% url 'wagtailadmin_explore' root_page.pk %}">
|
||||||
{% blocktrans count counter=total_pages %}
|
{% blocktrans count counter=total_pages %}
|
||||||
<span>{{ total_pages }}</span> Page
|
<span>{{ total_pages }}</span> Page
|
||||||
{% plural %}
|
{% plural %}
|
||||||
<span>{{ total_pages }}</span> Pages
|
<span>{{ total_pages }}</span> Pages
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="icon icon-image">
|
<li class="icon icon-image">
|
||||||
|
<a href="{% url 'wagtailimages_index' %}">
|
||||||
{% blocktrans count counter=total_images %}
|
{% blocktrans count counter=total_images %}
|
||||||
<span>{{ total_images }}</span> Image
|
<span>{{ total_images }}</span> Image
|
||||||
{% plural %}
|
{% plural %}
|
||||||
<span>{{ total_images }}</span> Images
|
<span>{{ total_images }}</span> Images
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="icon icon-doc-full-inverse">
|
<li class="icon icon-doc-full-inverse">
|
||||||
|
<a href="{% url 'wagtaildocs_index' %}">
|
||||||
{% blocktrans count counter=total_docs %}
|
{% blocktrans count counter=total_docs %}
|
||||||
<span>{{ total_docs }}</span> Document
|
<span>{{ total_docs }}</span> Document
|
||||||
{% plural %}
|
{% plural %}
|
||||||
<span>{{ total_docs }}</span> Documents
|
<span>{{ total_docs }}</span> Documents
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from django.template.loader import render_to_string
|
||||||
from wagtail.wagtailadmin import hooks
|
from wagtail.wagtailadmin import hooks
|
||||||
from wagtail.wagtailadmin.forms import SearchForm
|
from wagtail.wagtailadmin.forms import SearchForm
|
||||||
|
|
||||||
from wagtail.wagtailcore.models import Page, PageRevision, UserPagePermissionsProxy
|
from wagtail.wagtailcore.models import Site, Page, PageRevision, UserPagePermissionsProxy
|
||||||
|
|
||||||
from wagtail.wagtaildocs.models import Document
|
from wagtail.wagtaildocs.models import Document
|
||||||
|
|
||||||
|
|
@ -27,6 +27,7 @@ class SiteSummaryPanel(object):
|
||||||
'total_pages': Page.objects.count() - 1, # subtract 1 because the root node is not a real page
|
'total_pages': Page.objects.count() - 1, # subtract 1 because the root node is not a real page
|
||||||
'total_images': get_image_model().objects.count(),
|
'total_images': get_image_model().objects.count(),
|
||||||
'total_docs': Document.objects.count(),
|
'total_docs': Document.objects.count(),
|
||||||
|
'root_page': Site.find_for_request(self.request).root_page,
|
||||||
'search_form': SearchForm(),
|
'search_form': SearchForm(),
|
||||||
}, RequestContext(self.request))
|
}, RequestContext(self.request))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue