From 065a912b37e83c3b5e5f990b76ff17821f456aa8 Mon Sep 17 00:00:00 2001 From: Tom Talbot Date: Thu, 2 Oct 2014 11:26:33 +0100 Subject: [PATCH 1/4] Fix page reordering in Wagtail Admin --- .../templates/wagtailadmin/pages/index.html | 11 ++++++----- wagtail/wagtailadmin/views/pages.py | 9 +++++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/pages/index.html b/wagtail/wagtailadmin/templates/wagtailadmin/pages/index.html index 3a3aa49a77..0f1011f1d4 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/pages/index.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/pages/index.html @@ -9,12 +9,12 @@ {% include "wagtailadmin/shared/breadcrumb.html" with page=parent_page %} - +
{% csrf_token %} {% page_permissions parent_page as parent_page_perms %} - {% include "wagtailadmin/pages/list.html" with sortable=1 allow_navigation=1 full_width=1 parent_page=parent_page orderable=parent_page_perms.can_reorder_children %} + {% include "wagtailadmin/pages/list.html" with sortable=1 allow_navigation=1 full_width=1 parent_page=parent_page orderable=parent_page_perms.can_reorder_children %}
{% endblock %} @@ -30,9 +30,10 @@ var orderform = $('#page-reorder-form'); $('.listing tbody').sortable({ - cursor: "move", - containment: "parent", - handle: ".handle", + cursor: "move", + tolerance: "pointer", + containment: "parent", + handle: ".handle", items: "> tr", axis: "y", placeholder: "dropzone", diff --git a/wagtail/wagtailadmin/views/pages.py b/wagtail/wagtailadmin/views/pages.py index 53810fa3cc..bad91a990d 100644 --- a/wagtail/wagtailadmin/views/pages.py +++ b/wagtail/wagtailadmin/views/pages.py @@ -634,8 +634,13 @@ def set_page_position(request, page_to_move_id): # so don't bother to catch InvalidMoveToDescendant if position_page: - # Move page into this position - page_to_move.move(position_page, pos='left') + # If the page has been moved to the right, insert it to the + # right. If left, then left. + old_position = list(parent_page.get_children()).index(page_to_move) + if int(position) < old_position: + page_to_move.move(position_page, pos='left') + elif int(position) > old_position: + page_to_move.move(position_page, pos='right') else: # Move page to end page_to_move.move(parent_page, pos='last-child') From 48324eab72e484f393c568dcd58040ec7dc5d36b Mon Sep 17 00:00:00 2001 From: Dave Cranwell Date: Fri, 3 Oct 2014 16:04:38 +0100 Subject: [PATCH 2/4] removed conflicting state for open submenus --- .../static/wagtailadmin/scss/components/main-nav.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/wagtail/wagtailadmin/static/wagtailadmin/scss/components/main-nav.scss b/wagtail/wagtailadmin/static/wagtailadmin/scss/components/main-nav.scss index bc4c67d0a4..d2cb8e8580 100644 --- a/wagtail/wagtailadmin/static/wagtailadmin/scss/components/main-nav.scss +++ b/wagtail/wagtailadmin/static/wagtailadmin/scss/components/main-nav.scss @@ -328,7 +328,6 @@ body.explorer-open { background:$submenu-color; > a{ - border-left-color:$color-salmon; text-shadow:-1px -1px 0px rgba(0,0,0,0.3); &:hover{ From 0b544bfb0a877fc6e299b1a18a39e78c79192296 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Fri, 3 Oct 2014 16:14:02 +0100 Subject: [PATCH 3/4] Changelog for #665 --- CHANGELOG.txt | 1 + docs/releases/0.7.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b91c9430dc..5e3b80de2b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -17,6 +17,7 @@ Changelog * Fix: 'wagtail start' command now works on Windows * Fix: The external image URL generator no longer stores generated images in Django's cache * Fix: Elasticsearch backend can now search querysets that have been filtered with an 'in' clause of a non-list type (such as a ValuesListQuerySet) + * Fix: It is now easier to move pages to the beginning and end of their section 0.6 (11.09.2014) ~~~~~~~~~~~~~~~~ diff --git a/docs/releases/0.7.rst b/docs/releases/0.7.rst index e0d7e18c9a..6efe0f5867 100644 --- a/docs/releases/0.7.rst +++ b/docs/releases/0.7.rst @@ -39,6 +39,7 @@ Bug fixes * The 'wagtail start' command now works on Windows and other environments where the ``django-admin.py`` executable is not readily accessible. * The external image URL generator no longer stores generated images in Django's cache; this was an unintentional side-effect of setting cache control headers. * The Elasticsearch backend can now search querysets that have been filtered with an 'in' clause of a non-list type (such as a ``ValuesListQuerySet``). + * It is now easier to move pages to the beginning and end of their section Upgrade considerations From e21c54e7d0cc02ebf906d5a55a3c2a558f8e0e9b Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Fri, 3 Oct 2014 17:11:35 +0100 Subject: [PATCH 4/4] Translation setup for wagtailsites --- .tx/config | 6 + .../locale/en/LC_MESSAGES/django.po | 109 ++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 wagtail/wagtailsites/locale/en/LC_MESSAGES/django.po diff --git a/.tx/config b/.tx/config index b3b2e98bef..4312d6d790 100644 --- a/.tx/config +++ b/.tx/config @@ -60,3 +60,9 @@ file_filter = wagtail/wagtailforms/locale//LC_MESSAGES/django.po source_file = wagtail/wagtailforms/locale/en/LC_MESSAGES/django.po source_lang = en type = PO + +[wagtail.wagtailsites] +file_filter = wagtail/wagtailsites/locale//LC_MESSAGES/django.po +source_file = wagtail/wagtailsites/locale/en/LC_MESSAGES/django.po +source_lang = en +type = PO diff --git a/wagtail/wagtailsites/locale/en/LC_MESSAGES/django.po b/wagtail/wagtailsites/locale/en/LC_MESSAGES/django.po new file mode 100644 index 0000000000..2f3beaf52a --- /dev/null +++ b/wagtail/wagtailsites/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,109 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-03 16:23+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: views.py:31 +msgid "Site '{0}' created." +msgstr "" + +#: views.py:34 +msgid "The site could not be created due to errors." +msgstr "" + +#: views.py:51 +msgid "Site '{0}' updated." +msgstr "" + +#: views.py:54 +msgid "The site could not be saved due to errors." +msgstr "" + +#: views.py:70 +msgid "Site '{0}' deleted." +msgstr "" + +#: wagtail_hooks.py:24 templates/wagtailsites/index.html:3 +#: templates/wagtailsites/index.html:5 +msgid "Sites" +msgstr "" + +#: templates/wagtailsites/confirm_delete.html:3 +#: templates/wagtailsites/confirm_delete.html:7 +#: templates/wagtailsites/edit.html:36 +msgid "Delete site" +msgstr "" + +#: templates/wagtailsites/confirm_delete.html:11 +msgid "Are you sure you want to delete this site?" +msgstr "" + +#: templates/wagtailsites/confirm_delete.html:14 +msgid "Yes, delete" +msgstr "" + +#: templates/wagtailsites/create.html:4 templates/wagtailsites/create.html:9 +msgid "Add site" +msgstr "" + +#: templates/wagtailsites/create.html:20 +msgid "Choose a different root page" +msgstr "" + +#: templates/wagtailsites/create.html:21 +msgid "Choose a root page" +msgstr "" + +#: templates/wagtailsites/create.html:31 templates/wagtailsites/edit.html:34 +msgid "Save" +msgstr "" + +#: templates/wagtailsites/edit.html:4 templates/wagtailsites/edit.html.py:9 +msgid "Editing" +msgstr "" + +#: templates/wagtailsites/edit.html:21 +msgid "Change page" +msgstr "" + +#: templates/wagtailsites/edit.html:22 +msgid "Choose page" +msgstr "" + +#: templates/wagtailsites/index.html:7 +msgid "Add a site" +msgstr "" + +#: templates/wagtailsites/index.html:19 +msgid "Site" +msgstr "" + +#: templates/wagtailsites/index.html:26 +msgid "Port" +msgstr "" + +#: templates/wagtailsites/index.html:27 +msgid "Root page" +msgstr "" + +#: templates/wagtailsites/index.html:28 +msgid "Default?" +msgstr "" + +#: templates/wagtailsites/index.html:41 +msgid "Default" +msgstr ""