From 888611fc160b21d8e759e36595ee114b99651013 Mon Sep 17 00:00:00 2001 From: Keryn Knight Date: Sun, 5 Jun 2011 19:40:39 +0100 Subject: [PATCH 01/36] brief message about actually loading menu_tags in your templates, referencing issue #777 --- docs/getting_started/navigation.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/getting_started/navigation.rst b/docs/getting_started/navigation.rst index b53b4ee7cff..93bfc46d446 100644 --- a/docs/getting_started/navigation.rst +++ b/docs/getting_started/navigation.rst @@ -12,6 +12,9 @@ menu: * :ttag:`show_sub_menu` * :ttag:`show_breadcrumb` +To use any of these templatetags, you need to have ``{% load menu_tags %}`` in +your template before the line on which you call the templatetag. + .. note:: Please note that menus were originally implemented to be From 02d9b3ff8d68f8a400601d660646ecb291403b80 Mon Sep 17 00:00:00 2001 From: Keryn Knight Date: Sun, 5 Jun 2011 19:44:34 +0100 Subject: [PATCH 02/36] fix typo "non" -> "none" --- docs/advanced/templatetags.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced/templatetags.rst b/docs/advanced/templatetags.rst index eabbe725256..ffbf680d6f7 100644 --- a/docs/advanced/templatetags.rst +++ b/docs/advanced/templatetags.rst @@ -50,7 +50,7 @@ This will walk the page tree up till the root page and will show the first placeholde it can find with content. It's also possible to combine this with the ``or`` argument to show an -ultimate fallback if the placeholder and non of the placeholders on parent +ultimate fallback if the placeholder and none of the placeholders on parent pages have plugins that generate content:: {% placeholder "content" inherit or %}There is no spoon.{% endplaceholder %} From 29eaa07d498ea916bc82052124a2b203ff2bad74 Mon Sep 17 00:00:00 2001 From: Keryn Knight Date: Mon, 6 Jun 2011 18:43:06 +0100 Subject: [PATCH 03/36] fix typo "placeholde" -> "placeholder" --- docs/advanced/templatetags.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced/templatetags.rst b/docs/advanced/templatetags.rst index ffbf680d6f7..211dfc27dcd 100644 --- a/docs/advanced/templatetags.rst +++ b/docs/advanced/templatetags.rst @@ -47,7 +47,7 @@ same name on parent pages, simply pass the ``inherit`` argument:: {% placeholder "content" inherit %} This will walk the page tree up till the root page and will show the first -placeholde it can find with content. +placeholder it can find with content. It's also possible to combine this with the ``or`` argument to show an ultimate fallback if the placeholder and none of the placeholders on parent From 95649dcf4618f657fdfffc366c9c0e401f9ce281 Mon Sep 17 00:00:00 2001 From: Keryn Knight Date: Mon, 6 Jun 2011 19:37:37 +0100 Subject: [PATCH 04/36] Updating docs since #814 was merged in and I entirely forgot to note the change from None to () --- docs/getting_started/configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started/configuration.rst b/docs/getting_started/configuration.rst index 804b1be3ba9..bfcba2cf27c 100644 --- a/docs/getting_started/configuration.rst +++ b/docs/getting_started/configuration.rst @@ -16,7 +16,7 @@ Required Settings CMS_TEMPLATES ============= -Default: ``None`` (Not a valid setting!) +Default: ``()`` (Not a valid setting!) A list of templates you can select for a page. From eb6148f39a819e31ab405b5c518c0a9aa9e62aaf Mon Sep 17 00:00:00 2001 From: Keryn Knight Date: Mon, 6 Jun 2011 19:46:13 +0100 Subject: [PATCH 05/36] change CMS_CACHE_PREFIX documented default, as according to global_settings it is not None, but 'cms-', rightly or wrongly. --- docs/getting_started/configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started/configuration.rst b/docs/getting_started/configuration.rst index bfcba2cf27c..57c0f7abddf 100644 --- a/docs/getting_started/configuration.rst +++ b/docs/getting_started/configuration.rst @@ -565,7 +565,7 @@ Cache expiration (in seconds) for view and other permissions. CMS_CACHE_PREFIX ================ -Default: ``None`` +Default: ``cms-`` The CMS will prepend the value associated with this key to every cache access (set and get). From 3ebf32e74a51a2c7faabcf690aa5e894b7eb691b Mon Sep 17 00:00:00 2001 From: Keryn Knight Date: Mon, 6 Jun 2011 19:47:51 +0100 Subject: [PATCH 06/36] remove cache from load token. It isn't used, so adds nothing except perhaps a loss of clarity. --- docs/getting_started/navigation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started/navigation.rst b/docs/getting_started/navigation.rst index 93bfc46d446..ce709523a7d 100644 --- a/docs/getting_started/navigation.rst +++ b/docs/getting_started/navigation.rst @@ -49,7 +49,7 @@ Some Examples Complete navigation (as a nested list):: - {% load cache menu_tags %} + {% load menu_tags %}
    {% show_menu 0 100 100 100 %}
From ff043a158991cfe6fc631fd73dccce11cca1b285 Mon Sep 17 00:00:00 2001 From: Keryn Knight Date: Mon, 6 Jun 2011 19:50:26 +0100 Subject: [PATCH 07/36] Expand description of {{ node.get_absolute_url }} Realistically, we can't know that users will be familiar enough with Django to understand that the convention of get_absolute_url isn't what is commonly thought of as absolute. --- docs/getting_started/navigation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started/navigation.rst b/docs/getting_started/navigation.rst index ce709523a7d..b6f74e44ba3 100644 --- a/docs/getting_started/navigation.rst +++ b/docs/getting_started/navigation.rst @@ -160,7 +160,7 @@ in the next section) the first node still would have 0 as its `menu_level`. {{ node.get_absolute_url }} -The absolute URL of the node. +The absolute URL of the node, without any protocol, domain or port. :: {{ node.get_title }} From df98c31617870e08fd34e1ca188a6fe15c9c4ce0 Mon Sep 17 00:00:00 2001 From: Keryn Knight Date: Mon, 6 Jun 2011 20:11:04 +0100 Subject: [PATCH 08/36] fix typo "independant" -> "independent" --- docs/getting_started/navigation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started/navigation.rst b/docs/getting_started/navigation.rst index b6f74e44ba3..e776ffc6ec6 100644 --- a/docs/getting_started/navigation.rst +++ b/docs/getting_started/navigation.rst @@ -18,7 +18,7 @@ your template before the line on which you call the templatetag. .. note:: Please note that menus were originally implemented to be - application-independant and as such, live in the :mod:`menus` application + application-independent and as such, live in the :mod:`menus` application instead of the "normal" :mod:`cms` ********* From 201cc461ce869adf5031eed1f388f0bbfb566b35 Mon Sep 17 00:00:00 2001 From: Keryn Knight Date: Mon, 6 Jun 2011 20:12:35 +0100 Subject: [PATCH 09/36] I know what "normal" cms means in this context, but the user may not? --- docs/getting_started/navigation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started/navigation.rst b/docs/getting_started/navigation.rst index e776ffc6ec6..e3a4df770e4 100644 --- a/docs/getting_started/navigation.rst +++ b/docs/getting_started/navigation.rst @@ -19,7 +19,7 @@ your template before the line on which you call the templatetag. Please note that menus were originally implemented to be application-independent and as such, live in the :mod:`menus` application - instead of the "normal" :mod:`cms` + instead of the :mod:`cms` application. ********* show_menu From e4eaab762c421ec804e204294ca9131d743907b4 Mon Sep 17 00:00:00 2001 From: Keryn Knight Date: Mon, 6 Jun 2011 20:36:31 +0100 Subject: [PATCH 10/36] fix typo "an other" -> "another" --- docs/getting_started/plugin_reference.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started/plugin_reference.rst b/docs/getting_started/plugin_reference.rst index 03b99ea5585..d961227ce67 100644 --- a/docs/getting_started/plugin_reference.rst +++ b/docs/getting_started/plugin_reference.rst @@ -335,7 +335,7 @@ For installation be sure you have the following in your project's Inherit ******* -Displays all plugins of an other page or an other language. Great if you need +Displays all plugins of another page or another language. Great if you need always the same plugins on a lot of pages. For installation be sure you have the following in your project's From 77fc332f1bb2074121e63d259b21094de6e0cf32 Mon Sep 17 00:00:00 2001 From: Keryn Knight Date: Mon, 6 Jun 2011 20:51:13 +0100 Subject: [PATCH 11/36] fix typo: delete a backtick so MEDIA_ROOT is the same through-out. --- docs/getting_started/plugin_reference.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started/plugin_reference.rst b/docs/getting_started/plugin_reference.rst index d961227ce67..a39f975585f 100644 --- a/docs/getting_started/plugin_reference.rst +++ b/docs/getting_started/plugin_reference.rst @@ -202,7 +202,7 @@ settings in your project's ``settings.py`` file:: You should take care that directory to which :setting:`CMS_PAGE_MEDIA_PATH` setting points (by default ``cms_page_media/`` relative to -:setting:`django:MEDIA_ROOT``) is writable by the user under which django will be +:setting:`django:MEDIA_ROOT`) is writable by the user under which django will be running. .. note:: For more advanced use cases where you would like to upload your media From 1fe153aefc5b4962617a1b1dd1343308e4b33edc Mon Sep 17 00:00:00 2001 From: Keryn Knight Date: Mon, 6 Jun 2011 20:54:24 +0100 Subject: [PATCH 12/36] Update text about needing write permissions in CMS_PAGE_MEDIA_PATH. Was missing words ('the') and was a little convoluted. May be less so now. --- docs/getting_started/plugin_reference.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/getting_started/plugin_reference.rst b/docs/getting_started/plugin_reference.rst index a39f975585f..0e409933e96 100644 --- a/docs/getting_started/plugin_reference.rst +++ b/docs/getting_started/plugin_reference.rst @@ -22,8 +22,8 @@ setting in your project's ``settings.py`` file:: # ... ) -You should take care that directory to which :setting:`CMS_PAGE_MEDIA_PATH` -setting points (by default ``cms_page_media/`` relative to +You should take care that the directory defined by the configuration setting +:setting:`CMS_PAGE_MEDIA_PATH` (by default ``cms_page_media/`` relative to :setting:`django:MEDIA_ROOT`) is writable by the user under which django will be running. @@ -141,8 +141,8 @@ create a file called ``picture.html`` in there. Here is an example In this template the picture is scaled differently based on which placeholder it was placed in. -You should take care that directory to which :setting:`CMS_PAGE_MEDIA_PATH` -setting points (by default ``cms_page_media/`` relative to +You should take care that the directory defined by the configuration setting +:setting:`CMS_PAGE_MEDIA_PATH` (by default ``cms_page_media/`` relative to :setting:`django:MEDIA_ROOT`) is writable by the user under which django will be running. @@ -200,8 +200,8 @@ settings in your project's ``settings.py`` file:: # ... ) -You should take care that directory to which :setting:`CMS_PAGE_MEDIA_PATH` -setting points (by default ``cms_page_media/`` relative to +You should take care that the directory defined by the configuration setting +:setting:`CMS_PAGE_MEDIA_PATH` (by default ``cms_page_media/`` relative to :setting:`django:MEDIA_ROOT`) is writable by the user under which django will be running. @@ -290,8 +290,8 @@ default behavior: * ``VIDEO_BUTTON_OVER_COLOR`` (default: ``"000000"``) * ``VIDEO_BUTTON_HIGHLIGHT_COLOR`` (default: ``"FFFFFF"``) -You should take care that directory to which :setting:`CMS_PAGE_MEDIA_PATH` -setting points (by default ``cms_page_media/`` relative to +You should take care that the directory defined by the configuration setting +:setting:`CMS_PAGE_MEDIA_PATH` (by default ``cms_page_media/`` relative to :setting:`django:MEDIA_ROOT`) is writable by the user under which django will be running. From 4cbe522b6479a28a1cfda25e454bddbd2d02e13e Mon Sep 17 00:00:00 2001 From: Stephan Jaekel Date: Wed, 8 Jun 2011 15:51:25 +0200 Subject: [PATCH 13/36] Show moderate button only if CMS_MODERATOR is active. --- cms/cms_toolbar.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/cms/cms_toolbar.py b/cms/cms_toolbar.py index deb853ca817..4b591bb248a 100644 --- a/cms/cms_toolbar.py +++ b/cms/cms_toolbar.py @@ -93,21 +93,22 @@ def get_items(self, context, request, **kwargs): items.append(self.get_admin_menu(context, request, can_change, is_staff)) if request.current_page and self.edit_mode: - moderator_state = page_moderator_state(request, request.current_page) - should_approve = moderator_state['state'] >= I_APPROVE - has_perms = request.current_page.has_moderate_permission(request) - if should_approve and has_perms: - label = moderator_state['label'] - urlgetter = _get_approve_url - elif has_perms: - label = _("Publish") - urlgetter = _get_publish_url - else: - urlgetter = _get_approve_url - label = _("Request Approval") - items.append( - GetButton(RIGHT, 'moderator', label, urlgetter) - ) + if settings.CMS_MODERATOR: + moderator_state = page_moderator_state(request, request.current_page) + should_approve = moderator_state['state'] >= I_APPROVE + has_perms = request.current_page.has_moderate_permission(request) + if should_approve and has_perms: + label = moderator_state['label'] + urlgetter = _get_approve_url + elif has_perms: + label = _("Publish") + urlgetter = _get_publish_url + else: + urlgetter = _get_approve_url + label = _("Request Approval") + items.append( + GetButton(RIGHT, 'moderator', label, urlgetter) + ) items.append( GetButton(RIGHT, 'logout', _('Logout'), '?cms-toolbar-logout', @@ -205,4 +206,4 @@ def _request_hook_post(self, request): password = login_form.cleaned_data['cms_password'] user = authenticate(username=username, password=password) if user: - login(request, user) \ No newline at end of file + login(request, user) From 2b1da1d0a7340cc42a9441018410ef1419ebb698 Mon Sep 17 00:00:00 2001 From: Angelo Dini Date: Wed, 8 Jun 2011 16:56:29 +0200 Subject: [PATCH 14/36] frontend fix for #806 --- cms/templates/admin/page_submit_line.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cms/templates/admin/page_submit_line.html b/cms/templates/admin/page_submit_line.html index b14b7fe4b43..c513601114f 100644 --- a/cms/templates/admin/page_submit_line.html +++ b/cms/templates/admin/page_submit_line.html @@ -12,3 +12,11 @@ {% if show_save_and_add_another %}{% endif %} {% if show_save_and_continue %}{% endif %} + \ No newline at end of file From 0c4afc3f38abdeff5f5bb7c1095db7ae5004b5c0 Mon Sep 17 00:00:00 2001 From: Jonas Obrist Date: Thu, 9 Jun 2011 10:08:50 +0200 Subject: [PATCH 15/36] fixed failing tests --- cms/tests/toolbar.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cms/tests/toolbar.py b/cms/tests/toolbar.py index 71337971fb5..74abacd2829 100644 --- a/cms/tests/toolbar.py +++ b/cms/tests/toolbar.py @@ -149,9 +149,9 @@ def test_toolbar_staff(self): self.assertEqual(len(pagemenu.raw_items), 4) overview, addchild, addsibling, delete = pagemenu.raw_items self.assertEqual(overview.url, reverse('admin:cms_page_changelist')) - self.assertEqual(addchild.serialize_url({}, request), reverse('admin:cms_page_add') + '?position=last-child&target=%s' % page.pk) - self.assertEqual(addsibling.serialize_url({}, request), reverse('admin:cms_page_add') + '?position=last-child') - self.assertEqual(delete.serialize_url({}, request), reverse('admin:cms_page_delete', args=(page.pk,))) + self.assertEqual(addchild.serialize_url({}, toolbar), reverse('admin:cms_page_add') + '?position=last-child&target=%s' % page.pk) + self.assertEqual(addsibling.serialize_url({}, toolbar), reverse('admin:cms_page_add') + '?position=last-child') + self.assertEqual(delete.serialize_url({}, toolbar), reverse('admin:cms_page_delete', args=(page.pk,))) # check the admin-menu admin = items[4] self.assertTrue(isinstance(admin, List)) From bb1d882692fe8a16b8b6a30338ca3da869e58d5d Mon Sep 17 00:00:00 2001 From: Jonas Obrist Date: Thu, 9 Jun 2011 10:23:10 +0200 Subject: [PATCH 16/36] fixed issues pointed out by kezabelle where our test did bad stuff, fixes #834 --- cms/tests/admin.py | 4 ++-- cms/tests/menu.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cms/tests/admin.py b/cms/tests/admin.py index 87b88e420b7..85e2f08a6f7 100644 --- a/cms/tests/admin.py +++ b/cms/tests/admin.py @@ -622,7 +622,7 @@ def test_too_many_plugins_global(self): } admin = self.get_admin() url = reverse('admin:cms_page_add_plugin') - with SettingsOverride(CMS_MODERATOR=False, CMS_PERMISSIONS=False, + with SettingsOverride(CMS_MODERATOR=False, CMS_PERMISSION=False, CMS_PLACEHOLDER_CONF=conf): page = create_page('somepage', 'nav_playground.html', 'en') body = page.placeholders.get(slot='body') @@ -646,7 +646,7 @@ def test_too_many_plugins_type(self): } admin = self.get_admin() url = reverse('admin:cms_page_add_plugin') - with SettingsOverride(CMS_MODERATOR=False, CMS_PERMISSIONS=False, + with SettingsOverride(CMS_MODERATOR=False, CMS_PERMISSION=False, CMS_PLACEHOLDER_CONF=conf): page = create_page('somepage', 'nav_playground.html', 'en') body = page.placeholders.get(slot='body') diff --git a/cms/tests/menu.py b/cms/tests/menu.py index 0d84bd5adc5..a25b2f309c5 100644 --- a/cms/tests/menu.py +++ b/cms/tests/menu.py @@ -564,7 +564,7 @@ class AdvancedSoftrootTests(SettingsOverrideTestCase): """ settings_overrides = { 'CMS_MODERATOR': False, - 'CMS_PERMISSIONS': False + 'CMS_PERMISSION': False } fixtures = ['advanced_softroot.json'] From 3f83cc0873a3816259c2cf925dedd6acb02afa46 Mon Sep 17 00:00:00 2001 From: Angelo Dini Date: Thu, 9 Jun 2011 10:31:53 +0200 Subject: [PATCH 17/36] fixing #785 and improving syntax as well as some css attribute mistakes --- cms/templates/admin/cms/page/change_form.html | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/cms/templates/admin/cms/page/change_form.html b/cms/templates/admin/cms/page/change_form.html index 4579d0c0e3e..2e9d0f19951 100644 --- a/cms/templates/admin/cms/page/change_form.html +++ b/cms/templates/admin/cms/page/change_form.html @@ -8,7 +8,7 @@ {% if not add %} - + {% endif %} @@ -16,12 +16,12 @@ +