Hide the 'publish copies' checkbox if there is nothing to publish

pull/380/head
Matt Westcott 2014-08-01 14:13:20 +01:00
rodzic f55a00fea9
commit 9a86167f6e
2 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -21,7 +21,7 @@
</li>
{% endif %}
{% if can_publish %}
{% if pages_to_publish.count and can_publish %}
{% include "wagtailadmin/shared/field_as_li.html" with field=form.publish_copies %}
<li class="help">
{% blocktrans with live_page_count=pages_to_copy.live.count %}{{ live_page_count }} of the pages being copied are live. Would you like to publish their copies?{% endblocktrans %}

Wyświetl plik

@ -726,10 +726,13 @@ def copy(request, page_id):
# Redirect to explore of parent page
return redirect('wagtailadmin_explore', parent_page.id)
pages_to_copy = page.get_descendants(inclusive=True)
return render(request, 'wagtailadmin/pages/copy.html', {
'page': page,
'pages_to_copy': page.get_descendants(inclusive=True),
'pages_to_copy': pages_to_copy,
'parent_page': parent_page,
'pages_to_publish': pages_to_copy.live(),
'can_publish': can_publish,
'form': form,
})