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

Add site column to redirects listing (and show redirects from all sites, not just current one)

This commit is contained in:
Matt Westcott 2015-10-27 00:42:21 +00:00
parent b0878b1534
commit 1033897146
2 changed files with 8 additions and 3 deletions

View File

@ -1,7 +1,8 @@
{% load i18n %} {% load i18n %}
<table class="listing"> <table class="listing">
<col width="50%"/> <col width="35%"/>
<col width="40%"/> <col width="30%"/>
<col width="25%"/>
<col /> <col />
<thead> <thead>
<tr> <tr>
@ -14,6 +15,7 @@
{% trans "From" %} {% trans "From" %}
{% endif %} {% endif %}
</th> </th>
<th>{% trans "Site" %}</th>
<th>{% trans "To" %}</th> <th>{% trans "To" %}</th>
<th class="type">{% trans "Type" %}</th> <th class="type">{% trans "Type" %}</th>
</tr> </tr>
@ -24,6 +26,9 @@
<td class="title"> <td class="title">
<h2><a href="{% url 'wagtailredirects:edit' redirect.id %}" title="{% trans 'Edit this redirect' %}">{{ redirect.title }}</a></h2> <h2><a href="{% url 'wagtailredirects:edit' redirect.id %}" title="{% trans 'Edit this redirect' %}">{{ redirect.title }}</a></h2>
</td> </td>
<td>
{% if redirect.site %}{{ redirect.site }}{% endif %}
</td>
<td> <td>
{% if redirect.redirect_page %} {% if redirect.redirect_page %}
<a href="{% url 'wagtailadmin_pages:edit' redirect.redirect_page.id %}" class="nolink">{{ redirect.redirect_page.title }}</a> <a href="{% url 'wagtailadmin_pages:edit' redirect.redirect_page.id %}" class="nolink">{{ redirect.redirect_page.title }}</a>

View File

@ -18,7 +18,7 @@ def index(request):
query_string = request.GET.get('q', "") query_string = request.GET.get('q', "")
ordering = request.GET.get('ordering', 'old_path') ordering = request.GET.get('ordering', 'old_path')
redirects = models.Redirect.get_for_site(site=request.site).prefetch_related('redirect_page') redirects = models.Redirect.objects.prefetch_related('redirect_page', 'site')
# Search # Search
if query_string: if query_string: