From e361a96c60319b088ee61263b1aa45c31ff96bf5 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Tue, 22 Aug 2023 18:54:56 +0200 Subject: [PATCH 1/4] Fix css glitch --- cms/static/cms/sass/components/_dialog.scss | 2 +- cms/static/cms/sass/components/_pluginpicker.scss | 11 ++++++++++- cms/templates/admin/cms/page/tree/base.html | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cms/static/cms/sass/components/_dialog.scss b/cms/static/cms/sass/components/_dialog.scss index 734fee543e1..02a80cc3737 100644 --- a/cms/static/cms/sass/components/_dialog.scss +++ b/cms/static/cms/sass/components/_dialog.scss @@ -23,7 +23,7 @@ padding: 0; } form { - margin: 0 -$padding-large; + margin: 0 (-$padding-large); padding: 0 $padding-large !important; border-top: 1px solid $gray-lighter; label { diff --git a/cms/static/cms/sass/components/_pluginpicker.scss b/cms/static/cms/sass/components/_pluginpicker.scss index 27e71a89aa1..912bfb17571 100644 --- a/cms/static/cms/sass/components/_pluginpicker.scss +++ b/cms/static/cms/sass/components/_pluginpicker.scss @@ -91,5 +91,14 @@ padding-left: 20px; border: 2px solid $color-primary; border-radius: $border-radius-base; - background-color: rgba($color-primary-fallback, 20%); + background-color: $white; + &:after { + content: ""; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right:0 ; + background-color: rgba($color-primary-fallback, 40%); + } } diff --git a/cms/templates/admin/cms/page/tree/base.html b/cms/templates/admin/cms/page/tree/base.html index 35b1ee996f9..b1bd3193d7e 100644 --- a/cms/templates/admin/cms/page/tree/base.html +++ b/cms/templates/admin/cms/page/tree/base.html @@ -295,7 +295,7 @@

{% trans "Main Navigation" %}

}] }' data-settings-url="{% cms_admin_url "cms_usersettings_session_store" %}"> {% url opts|admin_urlname:'add' as add_url %} - {% blocktrans with object='page' %} + {% blocktrans with object=_('page') %} There is no {{ object }} around yet.
Add {{ object }} now. From 826c3841a2f9dd07a84683be035a02bd63d5625e Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Tue, 22 Aug 2023 12:55:08 +0200 Subject: [PATCH 2/4] Update translations source fill which was missing strings --- cms/locale/en/LC_MESSAGES/django.po | 941 ++++++---------------------- cms/models/contentmodels.py | 2 + 2 files changed, 193 insertions(+), 750 deletions(-) diff --git a/cms/locale/en/LC_MESSAGES/django.po b/cms/locale/en/LC_MESSAGES/django.po index 0cf35b395af..4c680caa39e 100644 --- a/cms/locale/en/LC_MESSAGES/django.po +++ b/cms/locale/en/LC_MESSAGES/django.po @@ -71,10 +71,8 @@ msgstr "Overwrite URL" msgid "Keep this field empty if standard path should be used." msgstr "Keep this field empty if standard path should be used." -#, fuzzy -#| msgid "softroot" msgid "Soft root" -msgstr "softroot" +msgstr "Soft root" msgid "All ancestors will not be displayed in the navigation" msgstr "All ancestors will not be displayed in the navigation" @@ -94,15 +92,11 @@ msgstr "menu visibility" msgid "limit when this page is visible in the menu" msgstr "limit when this page is visible in the menu" -#, fuzzy -#| msgid "Copy options" msgid "URL options" -msgstr "Copy options" +msgstr "URL options" -#, fuzzy -#| msgid "Copy options" msgid "Menu options" -msgstr "Copy options" +msgstr "Menu options" msgid "Application" msgstr "Application" @@ -116,10 +110,8 @@ msgstr "Application configurations" msgid "A page with this reverse URL id exists already." msgstr "A page with this reverse URL id exists already." -#, fuzzy -#| msgid "Application configurations" msgid "Invalid application config value" -msgstr "Application configurations" +msgstr "Invalid application config value" msgid "An application instance using this configuration already exists." msgstr "An application instance using this configuration already exists." @@ -128,13 +120,13 @@ msgid "An application instance with this name already exists." msgstr "An application instance with this name already exists." msgid "You can't move the home page inside another page" -msgstr "" +msgstr "You can't move the home page inside another page" msgid "Yes" -msgstr "" +msgstr "Yes" msgid "No" -msgstr "" +msgstr "No" msgid "user" msgstr "user" @@ -155,35 +147,47 @@ msgid "" "Users can't create a page without permissions to change the created page. " "Edit permissions required." msgstr "" +"Users can't create a page without permissions to change the created page. " +"Edit permissions required." msgid "" "Users can't delete a page without permissions to change the page. Edit " "permissions required." msgstr "" +"Users can't delete a page without permissions to change the page. Edit " +"permissions required." msgid "" "Users can't set page permissions without permissions to change a page. Edit " "permissions required." msgstr "" +"Users can't set page permissions without permissions to change a page. Edit " +"permissions required." msgid "" "Users can't delete page permissions without permissions to change a page. " "Edit permissions required." msgstr "" +"Users can't delete page permissions without permissions to change a page. " +"Edit permissions required." msgid "" "Users can't create page permissions without permissions to change the " "created permission. Edit permissions required." msgstr "" +"Users can't create page permissions without permissions to change the " +"created permission. Edit permissions required." msgid "" "Users can't delete page permissions without permissions to change " "permissions. Edit permissions required." msgstr "" +"Users can't delete page permissions without permissions to change " +"permissions. Edit permissions required." #, python-format msgid "Invalid plugin type '%s'" -msgstr "" +msgstr "Invalid plugin type '%s'" msgid "Language must be set to a supported language!" msgstr "Language must be set to a supported language!" @@ -191,25 +195,22 @@ msgstr "Language must be set to a supported language!" msgid "Parent plugin language must be same as language!" msgstr "Parent plugin language must be same as language!" -#, fuzzy -#| msgid "Parent plugin language must be same as language!" msgid "Parent plugin placeholder must be same as placeholder!" -msgstr "Parent plugin language must be same as language!" +msgstr "Parent plugin placeholder must be same as placeholder!" #, python-format msgid "Plugin position must be greater than %(position)d" -msgstr "" +msgstr "Plugin position must be greater than %(position)d" msgid "Advanced Settings" msgstr "Advanced Settings" msgid "The page is not eligible to be home." -msgstr "" +msgstr "The page is not eligible to be home." -#, fuzzy, python-format -#| msgid "The %(name)s plugin \"%(obj)s\" was deleted successfully." +#, python-format msgid "The %(name)s \"%(obj)s\" was deleted successfully." -msgstr "The %(name)s plugin \"%(obj)s\" was deleted successfully." +msgstr "The %(name)s \"%(obj)s\" was deleted successfully." #, python-format msgid "Cannot delete %(name)s" @@ -227,15 +228,15 @@ msgid "" msgstr "" "Error! You don't have permissions to move this page. Please reload the page" -#, fuzzy -#| msgid "You do not have permission to clear this placeholder" msgid "Error! You don't have permissions to copy this page." -msgstr "You do not have permission to clear this placeholder" +msgstr "Error! You don't have permissions to copy this page." msgid "" "Error! The page you're pasting is not translated in any of the languages " "configured by the target site." msgstr "" +"Error! The page you're pasting is not translated in any of the languages " +"configured by the target site." msgid "You do not have permission to edit this page" msgstr "You do not have permission to edit this page" @@ -261,39 +262,27 @@ msgstr "The template was successfully changed" msgid "You do not have permission to copy these plugins." msgstr "You do not have permission to copy these plugins." -#, fuzzy -#| msgid "You do not have permission to delete this plugin" msgid "You do not have permission to delete this page" -msgstr "You do not have permission to delete this plugin" +msgstr "You do not have permission to delete this page" #, python-format msgid "Title and plugins with language %(language)s was deleted" msgstr "Title and plugins with language %(language)s was deleted" -#, fuzzy -#| msgid "" -#| "You do not have permission to change this page's in_navigation status" msgid "You do not have permission to change a page's navigation status" -msgstr "You do not have permission to change this page's in_navigation status" +msgstr "You do not have permission to change a page's navigation status" -#, fuzzy -#| msgid "" -#| "You do not have permission to change this page's in_navigation status" msgid "You cannot change this page's navigation status" -msgstr "You do not have permission to change this page's in_navigation status" +msgstr "You cannot change this page's navigation status" -#, fuzzy -#| msgid "no content" msgid "Public content" -msgstr "no content" +msgstr "Public content" msgid "Empty" msgstr "Empty" -#, fuzzy -#| msgid "Content" msgid "Create Content" -msgstr "Content" +msgstr "Create Content" msgid "View restriction" msgstr "View restriction" @@ -311,10 +300,8 @@ msgstr "You do not have permission to edit this item" msgid "You do not have permission to add a plugin" msgstr "You do not have permission to add a plugin" -#, fuzzy -#| msgid "You do not have permission to clear this placeholder" msgid "You do not have permission to copy this placeholder." -msgstr "You do not have permission to clear this placeholder" +msgstr "You do not have permission to copy this placeholder." msgid "Plugin not found" msgstr "Plugin not found" @@ -322,23 +309,17 @@ msgstr "Plugin not found" msgid "You do not have permission to edit this plugin" msgstr "You do not have permission to edit this plugin" -#, fuzzy -#| msgid "You have no permission to move this plugin" msgid "You have no permission to paste this plugin" -msgstr "You have no permission to move this plugin" +msgstr "You have no permission to paste this plugin" -#, fuzzy -#| msgid "You have no permission to move this plugin" msgid "You have no permission to paste this placeholder" -msgstr "You have no permission to move this plugin" +msgstr "You have no permission to paste this placeholder" msgid "You have no permission to move this plugin" msgstr "You have no permission to move this plugin" -#, fuzzy -#| msgid "You have no permission to move this plugin" msgid "You have no permission to cut this plugin" -msgstr "You have no permission to move this plugin" +msgstr "You have no permission to cut this plugin" msgid "You do not have permission to delete this plugin" msgstr "You do not have permission to delete this plugin" @@ -366,60 +347,54 @@ msgstr "User & Group permissions" msgid "Page permissions management" msgstr "Page permissions management" -#, fuzzy -#| msgid "Actions" msgid "Actions" msgstr "Actions" -#, fuzzy -#| msgid "no content" msgid "Empty content" -msgstr "no content" +msgstr "Empty content" #, python-format msgid "%(object_name)s Properties" -msgstr "" +msgstr "%(object_name)s Properties" -#, fuzzy, python-format -#| msgid "Add %(name)s" +#, python-format msgid "Add new %(object_name)s" -msgstr "Add %(name)s" +msgstr "Add new %(object_name)s" -#, fuzzy -#| msgid "no content" msgid "Add content" -msgstr "no content" +msgstr "Add content" msgid "" "Content for the current language has been changed. Click \"Cancel\" to " "return to the form and save changes. Click \"OK\" to discard changes." msgstr "" +"Content for the current language has been changed. Click \"Cancel\" to " +"return to the form and save changes. Click \"OK\" to discard changes." -#, fuzzy, python-format -#| msgid "Add %(name)s" +#, python-format msgid "Add %(language)s content" -msgstr "Add %(name)s" +msgstr "Add %(language)s content" msgid "Preview" -msgstr "" +msgstr "Preview" -#, fuzzy -#| msgid "UserSettings" msgid "Settings" -msgstr "UserSettings" +msgstr "Settings" #, python-format msgid "" "Invalid language %(value)s. This form cannot be processed. Try changing " "languages." msgstr "" +"Invalid language %(value)s. This form cannot be processed. Try changing " +"languages." msgid "" -msgstr "" +msgstr "" #, python-format msgid "No registered apphook \"%r\" found" -msgstr "" +msgstr "No registered apphook \"%r\" found" msgid "django CMS" msgstr "django CMS" @@ -438,6 +413,8 @@ msgid "" "This is an alias reference, you can edit the content only on the %(page_title)s page." msgstr "" +"This is an alias reference, you can edit the content only on the %(page_title)s page." msgid "Create" msgstr "Create" @@ -473,7 +450,7 @@ msgid "Disable toolbar" msgstr "Disable toolbar" msgid "Shortcuts..." -msgstr "" +msgstr "Shortcuts..." msgid "Users" msgstr "Users" @@ -488,29 +465,22 @@ msgstr "Logout" msgid "Language" msgstr "Language" -#, fuzzy -#| msgid "Add %(language)s Translation" msgid "Add Translation" -msgstr "Add %(language)s Translation" +msgstr "Add Translation" -#, fuzzy -#| msgid "Delete %(language)s Translation" msgid "Delete Translation" -msgstr "Delete %(language)s Translation" +msgstr "Delete Translation" -#, fuzzy -#| msgid "Copy all plugins from %s" msgid "Copy all plugins" -msgstr "Copy all plugins from %s" +msgstr "Copy all plugins" #, python-format msgid "from %s" -msgstr "" +msgstr "from %s" -#, fuzzy, python-format -#| msgid "Are you sure you want copy all plugins from %s?" +#, python-format msgid "Are you sure you want to copy all plugins from %s?" -msgstr "Are you sure you want copy all plugins from %s?" +msgstr "Are you sure you want to copy all plugins from %s?" msgid "Pages" msgstr "Pages" @@ -518,10 +488,8 @@ msgstr "Pages" msgid "Page" msgstr "Page" -#, fuzzy -#| msgid "Create" msgid "Create Page" -msgstr "Create" +msgstr "Create Page" msgid "New Page" msgstr "New Page" @@ -565,29 +533,17 @@ msgstr "Select a valid site" msgid "Select a valid page" msgstr "Select a valid page" -#, fuzzy, python-format -#| msgid "" -#| "Page %(pages)s has the same url '%(url)s' as current page " -#| "\"%(instance)s\"." -#| msgid_plural "" -#| "Pages %(pages)s have the same url '%(url)s' as current page " -#| "\"%(instance)s\"." +#, python-format msgid "" "Page %(conflict_page)s has the same url '%(url)s' as current page " "\"%(instance)s\"." msgstr "" -"Page %(pages)s has the same url '%(url)s' as current page \"%(instance)s\"." - -#, fuzzy, python-format -#| msgid "" -#| "Page %(pages)s has the same url '%(url)s' as current page " -#| "\"%(instance)s\"." -#| msgid_plural "" -#| "Pages %(pages)s have the same url '%(url)s' as current page " -#| "\"%(instance)s\"." +"Page %(conflict_page)s has the same url '%(url)s' as current page " +"\"%(instance)s\"." + +#, python-format msgid "Page %(conflict_page)s has the same url '%(url)s' as current page." -msgstr "" -"Page %(pages)s has the same url '%(url)s' as current page \"%(instance)s\"." +msgstr "Page %(conflict_page)s has the same url '%(url)s' as current page." msgid "" "Optional. If supplied, will be automatically added within a new text plugin." @@ -598,12 +554,16 @@ msgid "Provide a title for the new page." msgstr "Provide a title for the new page." msgid "Leave empty for automatic slug, or override as required." -msgstr "" +msgstr "Leave empty for automatic slug, or override as required." + +msgid "Cannot automatically create slug. Please provide one manually." +msgstr "Cannot automatically create slug. Please provide one manually." + +msgid "Please provide a valid slug." +msgstr "Please provide a valid slug." -#, fuzzy -#| msgid "You do not have permission to add a plugin" msgid "You don't have the permissions required to add a page." -msgstr "You do not have permission to add a plugin" +msgstr "You don't have the permissions required to add a page." msgid "ID" msgstr "ID" @@ -699,7 +659,7 @@ msgid "page" msgstr "page" msgid "no limit set" -msgstr "" +msgstr "no limit set" msgid "for logged in users only" msgstr "for logged in users only" @@ -740,6 +700,12 @@ msgstr "redirect" msgid "The template used to render the content." msgstr "The template used to render the content." +msgid "page content" +msgstr "page content" + +msgid "page contents" +msgstr "page contents" + msgid "default" msgstr "default" @@ -780,30 +746,36 @@ msgstr "on page level" msgid "frontend view restriction" msgstr "frontend view restriction" -#, fuzzy -#| msgid "Please select user or group first." msgid "Please select user or group." -msgstr "Please select user or group first." +msgstr "Please select user or group." msgid "" "Users can't publish a page without permissions to change the page. Edit " "permissions required." msgstr "" +"Users can't publish a page without permissions to change the page. Edit " +"permissions required." msgid "" "Users can't change page advanced settings without permissions to change the " "page. Edit permissions required." msgstr "" +"Users can't change page advanced settings without permissions to change the " +"page. Edit permissions required." msgid "" "Users can't change page permissions without permissions to change the page. " "Edit permissions required." msgstr "" +"Users can't change page permissions without permissions to change the page. " +"Edit permissions required." msgid "" "Users can't move a page without permissions to change the page. Edit " "permissions required." msgstr "" +"Users can't move a page without permissions to change the page. Edit " +"permissions required." msgid "can recover any deleted page" msgstr "can recover any deleted page" @@ -898,92 +870,63 @@ msgstr "Advanced options" msgid "Generic" msgstr "Generic" -#, fuzzy, python-format -#| msgid "The %(name)s plugin \"%(obj)s\" was deleted successfully." +#, python-format msgid "The %(name)s \"%(obj)s\" was changed successfully." -msgstr "The %(name)s plugin \"%(obj)s\" was deleted successfully." +msgstr "The %(name)s \"%(obj)s\" was changed successfully." msgid "There are no further settings for this plugin. Please press save." msgstr "There are no further settings for this plugin. Please press save." msgid "Moved" -msgstr "" +msgstr "Moved" -#, fuzzy -#| msgid "Change" msgid "Changed" -msgstr "Change" +msgstr "Changed" -#, fuzzy -#| msgid "Delete" msgid "Deleted" -msgstr "Delete" +msgstr "Deleted" -#, fuzzy -#| msgid "Add %(language)s Translation" msgid "Added Page Translation" -msgstr "Add %(language)s Translation" +msgstr "Added Page Translation" -#, fuzzy -#| msgid "Delete %(language)s Translation" msgid "Changed Page Translation" -msgstr "Delete %(language)s Translation" +msgstr "Changed Page Translation" -#, fuzzy -#| msgid "Delete %(language)s Translation" msgid "Deleted Page Translation" -msgstr "Delete %(language)s Translation" +msgstr "Deleted Page Translation" -#, fuzzy -#| msgid "Add plugin" msgid "Added Plugin" -msgstr "Add plugin" +msgstr "Added Plugin" -#, fuzzy -#| msgid "Change" msgid "Changed Plugin" -msgstr "Change" +msgstr "Changed Plugin" -#, fuzzy -#| msgid "Add plugin" msgid "Moved Plugin" -msgstr "Add plugin" +msgstr "Moved Plugin" -#, fuzzy -#| msgid "Delete page" msgid "Deleted Plugin" -msgstr "Delete page" +msgstr "Deleted Plugin" -#, fuzzy -#| msgid "Add plugin" msgid "Cut Plugin" -msgstr "Add plugin" +msgstr "Cut plugin" -#, fuzzy -#| msgid "Add plugin" msgid "Paste Plugin" -msgstr "Add plugin" +msgstr "Paste Plugin" -#, fuzzy -#| msgid "static placeholder" msgid "Paste to Placeholder" -msgstr "static placeholder" +msgstr "Paste to Placeholder" -#, fuzzy -#| msgid "Copied plugins to %(placeholder)s" msgid "Added plugins to placeholder from clipboard" -msgstr "Copied plugins to %(placeholder)s" +msgstr "Added plugins to placeholder from clipboard" -#, fuzzy -#| msgid "Placeholder" msgid "Cleared Placeholder" -msgstr "Placeholder" +msgstr "Cleared Placeholder" msgid "Save" msgstr "Save" -msgid "Some fields cannot be changed since they are not draft content." -msgstr "" +msgid "Some fields cannot be changed since they are read-only content." +msgstr "Some fields cannot be changed since they are read-only content." #, python-format msgid "Log in to administration here." @@ -999,10 +942,8 @@ msgstr "Username:" msgid "Password:" msgstr "Password:" -#, fuzzy -#| msgid "Add Page" msgid "Add a page" -msgstr "Add Page" +msgstr "Add a Page" msgid "Change a page" msgstr "Change a page" @@ -1081,10 +1022,8 @@ msgstr "Cut" msgid "Paste" msgstr "Paste" -#, fuzzy -#| msgid "Save as new" msgid "Set as home" -msgstr "Save as new" +msgstr "Set as home" msgid "is restricted" msgstr "is restricted" @@ -1092,8 +1031,11 @@ msgstr "is restricted" msgid "last change by" msgstr "last change by" +msgid "last change on" +msgstr "last change on" + msgid "meta" -msgstr "" +msgstr "meta" msgid "List of pages" msgstr "List of pages" @@ -1101,13 +1043,11 @@ msgstr "List of pages" msgid "Search" msgstr "Search" -#, fuzzy -#| msgid "Page Title" msgid "Page Tree" -msgstr "Page Title" +msgstr "Page Tree" msgid "Reset filter" -msgstr "" +msgstr "Reset filter" #, python-format msgid "" @@ -1115,16 +1055,15 @@ msgid "" " Restore deleted %(name)s\n" " " msgstr "" +"\n" +" Restore deleted %(name)s\n" +" " -#, fuzzy -#| msgid "in navigation" msgid "Main Navigation" -msgstr "in navigation" +msgstr "Main Navigation" -#, fuzzy -#| msgid "Actions" msgid "Options" -msgstr "Actions" +msgstr "Options" msgid "Successfully moved" msgstr "Successfully moved" @@ -1133,26 +1072,26 @@ msgid "Changes within the tree might require a refresh." msgstr "Changes within the tree might require a refresh." msgid "Error:" -msgstr "" +msgstr "Error:" msgid "" "This page cannot be copied because an application is attached to it. See the " "Page's Advanced settings to manage apphooks." msgstr "" +"This page cannot be copied because an application is attached to it. See the " +"Page's Advanced settings to manage apphooks." msgid "Are you sure you want to § this page?" msgstr "Are you sure you want to § this page?" msgid "Reload" -msgstr "" +msgstr "Reload" -#, fuzzy -#| msgid "New Page" msgid "New node" -msgstr "New Page" +msgstr "New node" msgid "nodes" -msgstr "" +msgstr "nodes" msgid "View" msgstr "View" @@ -1160,13 +1099,7 @@ msgstr "View" msgid "Menu" msgstr "Menu" -#, fuzzy, python-format -#| msgid "" -#| "\n" -#| " JavaScript seems to be disabled so please\n" -#| " add a page manually.\n" -#| " " +#, python-format msgid "" "\n" " There is no %(object)s around yet.\n" @@ -1176,10 +1109,11 @@ msgid "" " " msgstr "" "\n" -" JavaScript seems to be disabled so please\n" -" add a page manually.\n" -" " +" There is no %(object)s around yet.\n" +"
\n" +" Add " +"%(object)s now.\n" +" " msgid "Copy options" msgstr "Copy options" @@ -1191,30 +1125,22 @@ msgid "Close" msgstr "Close" msgid "Legend" -msgstr "" +msgstr "Legend" -#, fuzzy -#| msgid "in menu" msgid "In menu" -msgstr "in menu" +msgstr "In menu" -#, fuzzy -#| msgid "not in menu" msgid "Not in menu" -msgstr "not in menu" +msgstr "Not in menu" -#, fuzzy -#| msgid "New page" msgid "View page" -msgstr "New page" +msgstr "View page" -#, fuzzy -#| msgid "softroot" msgid "Softroot" -msgstr "softroot" +msgstr "Softroot" msgid "Apphook" -msgstr "" +msgstr "Apphook" #, python-format msgid "Application: %(apphook)s" @@ -1226,10 +1152,8 @@ msgstr "in menu" msgid "not in menu" msgstr "not in menu" -#, fuzzy -#| msgid "Page settings (SHIFT-click for advanced settings)" msgid "Page settings (SHIFT click for advanced settings)" -msgstr "Page settings (SHIFT-click for advanced settings)" +msgstr "Page settings (SHIFT click for advanced settings)" msgid "Permissions" msgstr "Permissions" @@ -1239,6 +1163,7 @@ msgstr "This page has no preview!" msgid "Potentially the attached apphook does not provide content for its root." msgstr "" +"Potentially the attached apphook does not provide content for its root." msgid "It is being redirected to:" msgstr "It is being redirected to:" @@ -1286,15 +1211,13 @@ msgid "This plugin cannot have nested plugins." msgstr "This plugin cannot have nested plugins." msgid "Highlight" -msgstr "" +msgstr "Highlight" msgid "Available plugins" msgstr "Available plugins" -#, fuzzy -#| msgid "Structure" msgid "Toggle structure" -msgstr "Structure" +msgstr "Toggle structure" msgid "Login" msgstr "Login" @@ -1305,12 +1228,13 @@ msgstr "Add plugin to" msgid "More" msgstr "More" -#, fuzzy, python-format -#| msgid "Development version using django CMS %(cms_version)s" +#, python-format msgid "" "Development version using django CMS %(cms_version)s, Django " "%(django_version)s, Python %(python_version)s" -msgstr "Development version using django CMS %(cms_version)s" +msgstr "" +"Development version using django CMS %(cms_version)s, Django " +"%(django_version)s, Python %(python_version)s" msgid "Cancel" msgstr "Cancel" @@ -1318,10 +1242,8 @@ msgstr "Cancel" msgid "The following error occured:" msgstr "The following error occured:" -#, fuzzy -#| msgid "Action successfull... reloading." msgid "Action successful." -msgstr "Action successfull... reloading." +msgstr "Action successful." msgid "Are you sure you want to delete this plugin?" msgstr "Are you sure you want to delete this plugin?" @@ -1332,84 +1254,69 @@ msgstr "Are you sure you want to publish this page?" msgid "Plugin will be added here" msgstr "Plugin will be added here" -#, fuzzy -#| msgid "This page has unpublished changes." msgid "You have unsaved changes." -msgstr "This page has unpublished changes." +msgstr "You have unsaved changes." -#, fuzzy -#| msgid "Loading..." msgid "Loading" -msgstr "Loading..." +msgstr "Loading" -#, fuzzy -#| msgid "Are you sure you want to § this page?" msgid "Are you sure you want to abandon these changes?" -msgstr "Are you sure you want to § this page?" +msgstr "Are you sure you want to abandon these changes?" msgid "" "The form could not be loaded. Please check that the server is running " "correctly." msgstr "" +"The form could not be loaded. Please check that the server is running " +"correctly." -#, fuzzy -#| msgid "Notify user" msgid "Most used" -msgstr "Notify user" +msgstr "Most used" msgid "Shortcuts" -msgstr "" +msgstr "Shortcuts" msgid "The page was changed in the meantime, reloading..." -msgstr "" +msgstr "The page was changed in the meantime, reloading..." + +msgid "CMS-wide Shortcuts" +msgstr "CMS-wide Shortcuts" msgid "Bring up this help dialog" -msgstr "" +msgstr "Bring up this help dialog" -#, fuzzy -#| msgid "Cancel" msgid "Close/cancel" -msgstr "Cancel" +msgstr "Close/cancel" msgid "Toggle structure mode" -msgstr "" +msgstr "Toggle structure mode" msgid "Toggle structure mode and highlight hovered-over plugin" -msgstr "" +msgstr "Toggle structure mode and highlight hovered-over plugin" msgid "Open \"Create\" dialog" -msgstr "" +msgstr "Open \"Create\" dialog" msgid "Focus on Toolbar" -msgstr "" +msgstr "Focus on Toolbar" -#, fuzzy -#| msgid "static placeholders" msgid "Focus on placeholders" -msgstr "static placeholders" +msgstr "Focus on placeholders" msgid "Move to next/previous element" -msgstr "" +msgstr "Move to next/previous element" -#, fuzzy -#| msgid "Add plugin to placeholder" msgid "Focus on plugins of placeholder" -msgstr "Add plugin to placeholder" +msgstr "Focus on plugins of placeholder" -#, fuzzy -#| msgid "Add plugin" msgid "Edit plugin" -msgstr "Add plugin" +msgstr "Edit plugin" -#, fuzzy -#| msgid "not in menu" msgid "Open actions menu" -msgstr "not in menu" +msgstr "Open actions menu" -#, fuzzy -#| msgid "Expand all" msgid "Expand/collapse" -msgstr "Expand all" +msgstr "Expand/collapse" msgid "" "Login failed. Please check your credentials and try again." @@ -1493,21 +1400,6 @@ msgstr "Support" msgid "Documentation" msgstr "Documentation" -#, fuzzy -#| msgid "" -#| "\n" -#| "

If you don't see the " -#| "django CMS logo at the top, make sure\n" -#| " you linked the static/cms folder to " -#| "your\n" -#| " static files.

\n" -#| "

You're seeing this message " -#| "because you have\n" -#| " DEBUG = True in your django settings " -#| "file and\n" -#| " haven't added any pages yet.\n" -#| "

\n" -#| " " msgid "" "\n" "

If you don't see the django " @@ -1521,29 +1413,8 @@ msgstr "" "CMS logo at the top, make sure\n" " you linked the static/cms folder to your\n" " static files.

\n" -"

You're seeing this message " -"because you have\n" -" DEBUG = True in your django settings file " -"and\n" -" haven't added any pages yet.\n" -"

\n" " " -#, fuzzy -#| msgid "" -#| "\n" -#| "

If you don't see the " -#| "django CMS logo at the top, make sure\n" -#| " you linked the static/cms folder to " -#| "your\n" -#| " static files.

\n" -#| "

You're seeing this message " -#| "because you have\n" -#| " DEBUG = True in your django settings " -#| "file and\n" -#| " haven't added any pages yet.\n" -#| "

\n" -#| " " msgid "" "\n" "

You're seeing this " @@ -1555,17 +1426,13 @@ msgid "" " " msgstr "" "\n" -"

If you don't see the django " -"CMS logo at the top, make sure\n" -" you linked the static/cms folder to your\n" -" static files.

\n" -"

You're seeing this message " -"because you have\n" -" DEBUG = True in your django settings file " -"and\n" -" haven't added any pages yet.\n" -"

\n" -" " +"

You're seeing this " +"message because you have\n" +" DEBUG = True in your django settings " +"file and\n" +" haven't added any pages yet.\n" +"

\n" +" " msgid "Welcome to django CMS" msgstr "Welcome to django CMS" @@ -1583,7 +1450,7 @@ msgid "Next" msgstr "Next" msgid "Unknown" -msgstr "" +msgstr "Unknown" #, python-format msgid "Page not found on %(domain)s" @@ -1668,10 +1535,8 @@ msgstr "Articles" msgid "Sample App" msgstr "Sample App" -#, fuzzy -#| msgid "Sample App with excluded permissions" msgid "Sample App with config" -msgstr "Sample App with excluded permissions" +msgstr "Sample App with config" msgid "Sample App with excluded permissions" msgstr "Sample App with excluded permissions" @@ -1679,8 +1544,6 @@ msgstr "Sample App with excluded permissions" msgid "Sample App 2" msgstr "Sample App 2" -#, fuzzy -#| msgid "Sample App 2" msgid "Sample App 3" msgstr "Sample App 2" @@ -1694,7 +1557,7 @@ msgid "Child app" msgstr "Child app" msgid "Variable urls-menus App" -msgstr "" +msgstr "Variable urls-menus App" msgid "sample root page" msgstr "sample root page" @@ -1717,8 +1580,6 @@ msgstr "Static Menu2" msgid "Static Menu3" msgstr "Static Menu3" -#, fuzzy -#| msgid "Static Menu" msgid "Static Menu4" msgstr "Static Menu" @@ -1746,15 +1607,13 @@ msgstr "Inherit the template of the nearest ancestor" msgid "UserSettings" msgstr "UserSettings" -#, fuzzy, python-format -#| msgid "Add plugin to placeholder" +#, python-format msgid "Add plugin to placeholder \"%(placeholder_label)s\"" -msgstr "Add plugin to placeholder" +msgstr "Add plugin to placeholder \"%(placeholder_label)s\"" -#, fuzzy, python-format -#| msgid "Add plugin to placeholder" +#, python-format msgid "Add plugin to %(plugin_name)s" -msgstr "Add plugin to placeholder" +msgstr "Add plugin to %(plugin_name)s" msgid "CMS - your user account was created." msgstr "CMS - your user account was created." @@ -1776,13 +1635,15 @@ msgstr "" #, python-brace-format msgid "Unable to find the specified CMS_REQUEST_IP_RESOLVER module: \"{0}\"." -msgstr "" +msgstr "Unable to find the specified CMS_REQUEST_IP_RESOLVER module: \"{0}\"." #, python-brace-format msgid "" "Unable to find the specified CMS_REQUEST_IP_RESOLVER function: \"{0}\" in " "module \"{1}\"." msgstr "" +"Unable to find the specified CMS_REQUEST_IP_RESOLVER function: \"{0}\" in " +"module \"{1}\"." #, python-format msgid "Create a new %s instance." @@ -1791,423 +1652,3 @@ msgstr "Create a new %s instance." #, python-format msgid "A wizard has already been registered for model: %s" msgstr "A wizard has already been registered for model: %s" - -#, fuzzy -#~| msgid "published" -#~ msgid "Published" -#~ msgstr "published" - -#, fuzzy -#~| msgid "unpublished" -#~ msgid "Unpublished" -#~ msgstr "unpublished" - -#, fuzzy -#~| msgid "no content" -#~ msgid "has contents" -#~ msgstr "no content" - -#~ msgid "X Frame Options" -#~ msgstr "X Frame Options" - -#~ msgid "Whether this page can be embedded in other pages or websites" -#~ msgstr "Whether this page can be embedded in other pages or websites" - -#~ msgid "Language independent options" -#~ msgstr "Language independent options" - -#~ msgid "Publishing dates" -#~ msgstr "Publishing dates" - -#~ msgid "Change Permissions" -#~ msgstr "Change Permissions" - -#, fuzzy -#~| msgid "You do not have permission to edit this page" -#~ msgid "You do not have permission to revert this page." -#~ msgstr "You do not have permission to edit this page" - -#~ msgid "You do not have permission to publish this page" -#~ msgstr "You do not have permission to publish this page" - -#~ msgid "Page not published! A parent page is not published yet." -#~ msgstr "Page not published! A parent page is not published yet." - -#~ msgid "The content was successfully published." -#~ msgstr "The content was successfully published." - -#~ msgid "There was a problem publishing your content" -#~ msgstr "There was a problem publishing your content" - -#~ msgid "You do not have permission to unpublish this page" -#~ msgstr "You do not have permission to unpublish this page" - -#~ msgid "This page was never published" -#~ msgstr "This page was never published" - -#~ msgid "The %(language)s page \"%(page)s\" was successfully unpublished" -#~ msgstr "The %(language)s page \"%(page)s\" was successfully unpublished" - -#, fuzzy -#~| msgid "You do not have permission to change pages." -#~ msgid "You don't have permissions to see page \"%(title)s\"" -#~ msgstr "You do not have permission to change pages." - -#~ msgid "parent must be in the same placeholder" -#~ msgstr "parent must be in the same placeholder" - -#~ msgid "parent must be in the same language as plugin_language" -#~ msgstr "parent must be in the same language as plugin_language" - -#, fuzzy -#~| msgid "Publish changes" -#~ msgid "Publish page changes" -#~ msgstr "Publish changes" - -#~ msgid "Publish page now" -#~ msgstr "Publish page now" - -#~ msgid "Save as Page Type" -#~ msgstr "Save as Page Type" - -#~ msgid "Unpublish page" -#~ msgstr "Unpublish page" - -#~ msgid "Publish page" -#~ msgstr "Publish page" - -#~ msgid "Are you sure you want to revert to live?" -#~ msgstr "Are you sure you want to revert to live?" - -#~ msgid "Revert to live" -#~ msgstr "Revert to live" - -#~ msgid "" -#~ "When the page should go live. Status must be \"Published\" for page to go " -#~ "live." -#~ msgstr "" -#~ "When the page should go live. Status must be \"Published\" for page to go " -#~ "live." - -#~ msgid "When to expire the page. Leave empty to never expire." -#~ msgstr "When to expire the page. Leave empty to never expire." - -#~ msgid "has url overwrite" -#~ msgstr "has url overwrite" - -#~ msgid "is published" -#~ msgstr "is published" - -#~ msgid "Basic Settings" -#~ msgstr "Basic Settings" - -#, fuzzy -#~| msgid "Edit this page in %(language)s " -#~ msgid "Preview this page in %(language)s " -#~ msgstr "Edit this page in %(language)s " - -#~ msgid "Publish" -#~ msgstr "Publish" - -#~ msgid "Unpublish" -#~ msgstr "Unpublish" - -#, fuzzy -#~| msgid "View published" -#~ msgid "View published" -#~ msgstr "View published" - -#~ msgid "This page has unpublished changes." -#~ msgstr "This page has unpublished changes." - -#~ msgid "unpublished changes" -#~ msgstr "unpublished changes" - -#~ msgid "published" -#~ msgstr "published" - -#~ msgid "unpublished parent" -#~ msgstr "unpublished parent" - -#~ msgid "unpublished" -#~ msgstr "unpublished" - -#~ msgid "The current language of the content fields." -#~ msgstr "The current language of the content fields." - -#~ msgid "Another page with this slug already exists" -#~ msgstr "Another page with this slug already exists" - -#~ msgid "Add Page Type" -#~ msgstr "Add Page Type" - -#~ msgid "You do not have permission to change the template" -#~ msgstr "You do not have permission to change the template" - -#~ msgid "You do not have permission to change this page" -#~ msgstr "You do not have permission to change this page" - -#~ msgid "There only exists one translation for this page" -#~ msgstr "There only exists one translation for this page" - -#~ msgid "User does not have permission to add page." -#~ msgstr "User does not have permission to add page." - -#~ msgid "The site the page is accessible at." -#~ msgstr "The site the page is accessible at." - -#, fuzzy -#~| msgid "Edit this Page" -#~ msgid "Edit page" -#~ msgstr "Edit this Page" - -#~ msgid "Toggle toolbar" -#~ msgstr "Toggle toolbar" - -#~ msgid "Invalid URL, use /my/url format." -#~ msgstr "Invalid URL, use /my/url format." - -#~ msgid "Add page permission also requires edit page permission." -#~ msgstr "Add page permission also requires edit page permission." - -#~ msgid "Recover (any) pages" -#~ msgstr "Recover (any) pages" - -#~ msgid "" -#~ "Send email notification to user about username or password change. " -#~ "Requires user email." -#~ msgstr "" -#~ "Send email notification to user about username or password change. " -#~ "Requires user email." - -#~ msgid "New password" -#~ msgstr "New password" - -#~ msgid "New password confirmation" -#~ msgstr "New password confirmation" - -#~ msgid "Email notification requires valid email address." -#~ msgstr "Email notification requires valid email address." - -#~ msgid "" -#~ "The permission to add new pages requires the permission to change pages!" -#~ msgstr "" -#~ "The permission to add new pages requires the permission to change pages!" - -#~ msgid "" -#~ "The permission to add new users requires the permission to change users!" -#~ msgstr "" -#~ "The permission to add new users requires the permission to change users!" - -#~ msgid "To add permissions you also need to edit them!" -#~ msgstr "To add permissions you also need to edit them!" - -#~ msgid "%(plugin_name)s plugin added to %(placeholder)s" -#~ msgstr "%(plugin_name)s plugin added to %(placeholder)s" - -#~ msgid "Copied plugins to %(placeholder)s" -#~ msgstr "Copied plugins to %(placeholder)s" - -#~ msgid "" -#~ "%(plugin_name)s plugin edited at position %(position)s in %(placeholder)s" -#~ msgstr "" -#~ "%(plugin_name)s plugin edited at position %(position)s in %(placeholder)s" - -#~ msgid "" -#~ "%(plugin_name)s plugin at position %(position)s in %(placeholder)s was " -#~ "deleted." -#~ msgstr "" -#~ "%(plugin_name)s plugin at position %(position)s in %(placeholder)s was " -#~ "deleted." - -#~ msgid "All plugins in the placeholder \"%(name)s\" were deleted." -#~ msgstr "All plugins in the placeholder \"%(name)s\" were deleted." - -#~ msgid "Page reverted but slug stays the same because of url collisions." -#~ msgstr "Page reverted but slug stays the same because of url collisions." - -#~ msgid "Template changed to %s" -#~ msgstr "Template changed to %s" - -#~ msgid "Page moved" -#~ msgstr "Page moved" - -#~ msgid "Copied plugins from %(source_language)s to %(target_language)s" -#~ msgstr "Copied plugins from %(source_language)s to %(target_language)s" - -#~ msgid "The page \"%s\" was successfully reverted." -#~ msgstr "The page \"%s\" was successfully reverted." - -#~ msgid "History" -#~ msgstr "History" - -#~ msgid "Undo" -#~ msgstr "Undo" - -#~ msgid "Redo" -#~ msgstr "Redo" - -#~ msgid "View history" -#~ msgstr "View history" - -#, fuzzy -#~| msgid "Recover deleted %(verbose_name)s" -#~ msgid "" -#~ "\n" -#~ " Recover deleted %(verbose_name)s\n" -#~ " " -#~ msgstr "Recover deleted %(verbose_name)s" - -#~ msgid "Press the save button below to recover this version of the object." -#~ msgstr "Press the save button below to recover this version of the object." - -#~ msgid "Revert %(verbose_name)s" -#~ msgstr "Revert %(verbose_name)s" - -#~ msgid "Press the save button below to revert to this version of the object." -#~ msgstr "" -#~ "Press the save button below to revert to this version of the object." - -#~ msgid "home" -#~ msgstr "home" - -#~ msgid "softroot" -#~ msgstr "softroot" - -#~ msgid "({1}) plugin is empty. Remove it?" -#~ msgstr "({1}) plugin is empty. Remove it?" - -#, fuzzy -#~| msgid "sample account page" -#~ msgid "sample second page" -#~ msgstr "sample account page" - -#~ msgid "Plugins were moved" -#~ msgstr "Plugins were moved" - -#~ msgid "Path Overflow from: '%s'" -#~ msgstr "Path Overflow from: '%s'" - -#~ msgid "" -#~ "The new node is too deep in the tree, try increasing the path.max_length " -#~ "property and UPDATE your database" -#~ msgstr "" -#~ "The new node is too deep in the tree, try increasing the path.max_length " -#~ "property and UPDATE your database" - -#~ msgid "An error occured. Please reload the page" -#~ msgstr "An error occured. Please reload the page" - -#~ msgid "Recover deleted %(name)s" -#~ msgstr "Recover deleted %(name)s" - -#~ msgid "Pages on:" -#~ msgstr "Pages on:" - -#~ msgid "%(counter)s result" -#~ msgid_plural "%(counter)s results" -#~ msgstr[0] "%(counter)s result" -#~ msgstr[1] "%(counter)s results" - -#~ msgid "%(full_result_count)s total" -#~ msgstr "%(full_result_count)s total" - -#~ msgid "Show all" -#~ msgstr "Show all" - -#~ msgid "Filter:" -#~ msgstr "Filter:" - -#~ msgid "on" -#~ msgstr "on" - -#~ msgid "off" -#~ msgstr "off" - -#~ msgid "Filter" -#~ msgstr "Filter" - -#~ msgid "Info" -#~ msgstr "Info" - -#~ msgid "" -#~ "There is no page around yet.
Add page now." -#~ msgstr "" -#~ "There is no page around yet.
Add page now." - -#~ msgid "insert above" -#~ msgstr "insert above" - -#~ msgid "insert below" -#~ msgstr "insert below" - -#~ msgid "insert inside" -#~ msgstr "insert inside" - -#~ msgid "Pick an action:" -#~ msgstr "Pick an action:" - -#~ msgid "page settings" -#~ msgstr "page settings" - -#~ msgid "copy" -#~ msgstr "copy" - -#~ msgid "Add Child" -#~ msgstr "Add Child" - -#~ msgid "add" -#~ msgstr "add" - -#~ msgid "cut" -#~ msgstr "cut" - -#~ msgid "delete" -#~ msgstr "delete" - -#~ msgid "info" -#~ msgstr "info" - -#~ msgid "Information" -#~ msgstr "Information" - -#~ msgid "%(icon)s" -#~ msgstr "%(icon)s" - -#~ msgid "English" -#~ msgstr "English" - -#~ msgid "French" -#~ msgstr "French" - -#~ msgid "German" -#~ msgstr "German" - -#~ msgid "Brazilian Portuguese" -#~ msgstr "Brazilian Portuguese" - -#~ msgid "Dutch" -#~ msgstr "Dutch" - -#~ msgid "two columns" -#~ msgstr "two columns" - -#~ msgid "three columns" -#~ msgstr "three columns" - -#~ msgid "navigation examples" -#~ msgstr "navigation examples" - -#~ msgid "sidebar column" -#~ msgstr "sidebar column" - -#~ msgid "left column" -#~ msgstr "left column" - -#~ msgid "Add a link" -#~ msgstr "Add a link" - -#~ msgid "right column" -#~ msgstr "right column" diff --git a/cms/models/contentmodels.py b/cms/models/contentmodels.py index 1f34961be82..c9163ff0e43 100644 --- a/cms/models/contentmodels.py +++ b/cms/models/contentmodels.py @@ -127,6 +127,8 @@ class PageContent(models.Model): """ class Meta: + verbose_name = _("page content") + verbose_name_plural = _("page contents") default_permissions = [] unique_together = (('language', 'page'),) app_label = 'cms' From abb15a4ad9fac8683ea85be63b4d7a9399cdadea Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Thu, 24 Aug 2023 20:39:06 +0200 Subject: [PATCH 3/4] Fix: Remove can_publish permission --- cms/admin/forms.py | 2 -- cms/admin/permissionadmin.py | 8 ++--- cms/api.py | 7 +++-- cms/cache/permissions.py | 2 +- cms/migrations/0035_auto_20230822_2208.py | 18 +++++++++++ cms/models/pagemodel.py | 5 --- cms/models/permissionmodels.py | 8 ----- cms/templates/admin/cms/page/permissions.html | 1 - cms/test_utils/testcases.py | 3 -- cms/tests/test_admin.py | 2 -- cms/tests/test_permissions.py | 9 +++--- cms/tests/test_permmod.py | 9 +----- cms/tests/test_toolbar.py | 1 - cms/utils/page_permissions.py | 31 ------------------- 14 files changed, 32 insertions(+), 74 deletions(-) diff --git a/cms/admin/forms.py b/cms/admin/forms.py index d11a673e99b..a450b41c0b3 100644 --- a/cms/admin/forms.py +++ b/cms/admin/forms.py @@ -1099,7 +1099,6 @@ class Meta: 'can_add', 'can_change', 'can_delete', - 'can_publish', 'can_change_advanced_settings', 'can_change_permissions', 'can_move_page', @@ -1143,7 +1142,6 @@ class Meta: 'can_add', 'can_change', 'can_delete', - 'can_publish', 'can_change_advanced_settings', 'can_change_permissions', 'can_move_page', diff --git a/cms/admin/permissionadmin.py b/cms/admin/permissionadmin.py index 409ae821efd..af981bd8e4e 100644 --- a/cms/admin/permissionadmin.py +++ b/cms/admin/permissionadmin.py @@ -88,7 +88,7 @@ def get_formset(self, request, obj=None, **kwargs): """ Some fields may be excluded here. User can change only permissions which are available for him. E.g. if user does not haves - can_publish flag, he can't change assign can_publish permissions. + can_change flag, he can't change assign can_change permissions. """ exclude = self.exclude or [] if obj: @@ -97,8 +97,6 @@ def get_formset(self, request, obj=None, **kwargs): exclude.append('can_add') if not obj.has_delete_permission(user): exclude.append('can_delete') - if not obj.has_publish_permission(user): - exclude.append('can_publish') if not obj.has_advanced_settings_permission(user): exclude.append('can_change_advanced_settings') if not obj.has_move_page_permission(user): @@ -122,8 +120,8 @@ class ViewRestrictionInlineAdmin(PagePermissionInlineAdmin): class GlobalPagePermissionAdmin(admin.ModelAdmin): - list_display = ['user', 'group', 'can_change', 'can_delete', 'can_publish', 'can_change_permissions'] - list_filter = ['user', 'group', 'can_change', 'can_delete', 'can_publish', 'can_change_permissions'] + list_display = ['user', 'group', 'can_change', 'can_delete', 'can_change_permissions'] + list_filter = ['user', 'group', 'can_change', 'can_delete', 'can_change_permissions'] form = GlobalPagePermissionAdminForm search_fields = [] diff --git a/cms/api.py b/cms/api.py index 6a2f61c3a0c..b4ed9bd1f88 100644 --- a/cms/api.py +++ b/cms/api.py @@ -488,7 +488,7 @@ def create_page_user(created_by, user, def assign_user_to_page(page, user, grant_on=ACCESS_PAGE_AND_DESCENDANTS, can_add=False, can_change=False, can_delete=False, - can_change_advanced_settings=False, can_publish=False, + can_change_advanced_settings=False, can_publish=None, can_change_permissions=False, can_move_page=False, can_recover_page=True, can_view=False, grant_all=False, global_permission=False): @@ -507,13 +507,16 @@ def assign_user_to_page(page, user, grant_on=ACCESS_PAGE_AND_DESCENDANTS, :param can_*: Permissions to grant :param bool grant_all: Grant all permissions to the user """ + if can_publish is not None: + warnings.warn('This API function no longer accepts a "can_publish" argument.', + UserWarning, stacklevel=2) + grant_all = grant_all and not global_permission data = { 'can_add': can_add or grant_all, 'can_change': can_change or grant_all, 'can_delete': can_delete or grant_all, 'can_change_advanced_settings': can_change_advanced_settings or grant_all, - 'can_publish': can_publish or grant_all, 'can_change_permissions': can_change_permissions or grant_all, 'can_move_page': can_move_page or grant_all, 'can_view': can_view or grant_all, diff --git a/cms/cache/permissions.py b/cms/cache/permissions.py index 2956441fb01..2ba2ac13974 100644 --- a/cms/cache/permissions.py +++ b/cms/cache/permissions.py @@ -3,7 +3,7 @@ PERMISSION_KEYS = [ 'add_page', 'change_page', 'change_page_advanced_settings', 'change_page_permissions', 'delete_page', 'move_page', - 'publish_page', 'view_page', + 'view_page', ] diff --git a/cms/migrations/0035_auto_20230822_2208.py b/cms/migrations/0035_auto_20230822_2208.py index 5896df4ef5a..63eae949cda 100644 --- a/cms/migrations/0035_auto_20230822_2208.py +++ b/cms/migrations/0035_auto_20230822_2208.py @@ -14,4 +14,22 @@ class Migration(migrations.Migration): name='pagecontent', options={'default_permissions': [], 'verbose_name': 'page content', 'verbose_name_plural': 'page contents'}, ), + migrations.AlterModelOptions( + name='page', + options={'default_permissions': ('add', 'change', 'delete'), 'permissions': ( + ('view_page', 'Can view page'), ('edit_static_placeholder', 'Can edit static placeholders')), + 'verbose_name': 'page', 'verbose_name_plural': 'pages'}, + ), + migrations.AlterModelOptions( + name='pagecontent', + options={'default_permissions': [], 'verbose_name': 'page content', 'verbose_name_plural': 'page contents'}, + ), + migrations.RemoveField( + model_name='globalpagepermission', + name='can_publish', + ), + migrations.RemoveField( + model_name='pagepermission', + name='can_publish', + ), ] diff --git a/cms/models/pagemodel.py b/cms/models/pagemodel.py index 5c4c24a7f0d..82d11ca5b17 100644 --- a/cms/models/pagemodel.py +++ b/cms/models/pagemodel.py @@ -192,7 +192,6 @@ class Meta: default_permissions = ('add', 'change', 'delete') permissions = ( ('view_page', 'Can view page'), - ('publish_page', 'Can publish page'), ('edit_static_placeholder', 'Can edit static placeholders'), ) verbose_name = _('page') @@ -1001,10 +1000,6 @@ def has_delete_translation_permission(self, user, language): from cms.utils.page_permissions import user_can_delete_page_translation return user_can_delete_page_translation(user, page=self, language=language) - def has_publish_permission(self, user): - from cms.utils.page_permissions import user_can_publish_page - return user_can_publish_page(user, page=self) - def has_advanced_settings_permission(self, user): from cms.utils.page_permissions import ( user_can_change_page_advanced_settings, diff --git a/cms/models/permissionmodels.py b/cms/models/permissionmodels.py index bdb5d677395..d453bdc3d57 100644 --- a/cms/models/permissionmodels.py +++ b/cms/models/permissionmodels.py @@ -84,7 +84,6 @@ class AbstractPagePermission(models.Model): can_add = models.BooleanField(_("can add"), default=True) can_delete = models.BooleanField(_("can delete"), default=True) can_change_advanced_settings = models.BooleanField(_("can change advanced settings"), default=False) - can_publish = models.BooleanField(_("can publish"), default=True) can_change_permissions = models.BooleanField( _("can change permissions"), default=False, help_text=_("on page level") ) @@ -114,11 +113,6 @@ def clean(self): "to change the page. Edit permissions required.") raise ValidationError(message) - if self.can_publish: - message = _("Users can't publish a page without permissions " - "to change the page. Edit permissions required.") - raise ValidationError(message) - if self.can_change_advanced_settings: message = _("Users can't change page advanced settings without permissions " "to change the page. Edit permissions required.") @@ -162,7 +156,6 @@ def get_all_permissions(cls): 'can_add', 'can_change', 'can_delete', - 'can_publish', 'can_change_advanced_settings', 'can_change_permissions', 'can_move_page', @@ -182,7 +175,6 @@ def get_permissions_by_action(cls): 'delete_page': ['can_change', 'can_delete'], 'delete_page_translation': ['can_change', 'can_delete'], 'move_page': ['can_change', 'can_move_page'], - 'publish_page': ['can_change', 'can_publish'], 'view_page': ['can_view'], } return permissions_by_action diff --git a/cms/templates/admin/cms/page/permissions.html b/cms/templates/admin/cms/page/permissions.html index 51db1e50739..fa90c1170c4 100644 --- a/cms/templates/admin/cms/page/permissions.html +++ b/cms/templates/admin/cms/page/permissions.html @@ -38,7 +38,6 @@ {{ permission.can_change|boolean_icon }} {{ permission.can_add|boolean_icon }} {{ permission.can_delete|boolean_icon }} - {{ permission.can_publish|boolean_icon }} {{ permission.can_change_permissions|boolean_icon }} {{ permission.can_move_page|boolean_icon }} {{ permission.can_view|boolean_icon }} diff --git a/cms/test_utils/testcases.py b/cms/test_utils/testcases.py index 049f770986a..38c1a099bdb 100644 --- a/cms/test_utils/testcases.py +++ b/cms/test_utils/testcases.py @@ -121,7 +121,6 @@ def add_global_permission(self, user, **kwargs): 'can_change': False, 'can_delete': False, 'can_change_advanced_settings': False, - 'can_publish': False, 'can_change_permissions': False, 'can_move_page': False, 'can_recover_page': False, @@ -139,7 +138,6 @@ def add_page_permission(self, user, page, **kwargs): 'can_change': False, 'can_delete': False, 'can_change_advanced_settings': False, - 'can_publish': False, 'can_change_permissions': False, 'can_move_page': False, 'page': page, @@ -196,7 +194,6 @@ def _add_default_permissions(self, user): user.user_permissions.add(Permission.objects.get(codename='delete_link')) user.user_permissions.add(Permission.objects.get(codename='change_link')) # Page permissions - user.user_permissions.add(Permission.objects.get(codename='publish_page')) user.user_permissions.add(Permission.objects.get(codename='add_page')) user.user_permissions.add(Permission.objects.get(codename='change_page')) user.user_permissions.add(Permission.objects.get(codename='delete_page')) diff --git a/cms/tests/test_admin.py b/cms/tests/test_admin.py index a7f435b88b6..58c169faf69 100644 --- a/cms/tests/test_admin.py +++ b/cms/tests/test_admin.py @@ -70,7 +70,6 @@ def _get_staff_user(self, use_global_permissions=True): can_change=True, can_delete=True, can_change_advanced_settings=False, - can_publish=True, can_change_permissions=False, can_move_page=True, ) @@ -519,7 +518,6 @@ def _give_cms_permissions(self, user, save=True): can_change=True, can_delete=True, can_change_advanced_settings=False, - can_publish=True, can_change_permissions=False, can_move_page=True, ) diff --git a/cms/tests/test_permissions.py b/cms/tests/test_permissions.py index fe32cf6deeb..c051aaa81fb 100644 --- a/cms/tests/test_permissions.py +++ b/cms/tests/test_permissions.py @@ -11,7 +11,7 @@ from cms.test_utils.testcases import CMSTestCase from cms.utils.page_permissions import ( get_change_id_list, - user_can_publish_page, + user_can_change_page, ) @@ -76,15 +76,14 @@ def test_cached_permission_precedence(self): ) page_permission = GlobalPagePermission.objects.create( can_change=True, - can_publish=True, user=self.user_normal, ) page_permission.sites.add(Site.objects.get_current()) - set_permission_cache(self.user_normal, "publish_page", []) + set_permission_cache(self.user_normal, "change_page", []) - can_publish = user_can_publish_page( + can_change = user_can_change_page( self.user_normal, page, Site.objects.get_current(), ) - self.assertTrue(can_publish) + self.assertTrue(can_change) diff --git a/cms/tests/test_permmod.py b/cms/tests/test_permmod.py index 0b278cc0178..b123d722727 100644 --- a/cms/tests/test_permmod.py +++ b/cms/tests/test_permmod.py @@ -62,15 +62,11 @@ def setUp(self): is_superuser=True) self.user_staff = self._create_user("staff", is_staff=True, add_default_permissions=True) - self.add_permission(self.user_staff, 'publish_page') self.user_master = self._create_user("master", is_staff=True, add_default_permissions=True) - self.add_permission(self.user_master, 'publish_page') self.user_slave = self._create_user("slave", is_staff=True, add_default_permissions=True) self.user_normal = self._create_user("normal", is_staff=False) - self.user_normal.user_permissions.add( - Permission.objects.get(codename='publish_page')) with self.login_user_context(self.user_super): self.home_page = create_page("home", "nav_playground.html", "en", @@ -109,7 +105,7 @@ def setUp(self): page_a = create_page("pageA", "nav_playground.html", "en", created_by=self.user_super) assign_user_to_page(page_a, self.user_master, - can_add=True, can_change=True, can_delete=True, can_publish=True, + can_add=True, can_change=True, can_delete=True, can_move_page=True) def _add_plugin(self, user, page): @@ -218,9 +214,6 @@ def test_user_globalpermission(self): user_global.is_staff = False user_global.save() # Prevent is_staff permission global_page = create_page("global", "nav_playground.html", "en") - # Removed call since global page user doesn't have publish permission - # global_page = publish_page(global_page, user_global) - # it's allowed for the normal user to view the page assign_user_to_page(global_page, user_global, global_permission=True, can_view=True) url = global_page.get_absolute_url('en') diff --git a/cms/tests/test_toolbar.py b/cms/tests/test_toolbar.py index 08ecf00f7ff..9a603481250 100644 --- a/cms/tests/test_toolbar.py +++ b/cms/tests/test_toolbar.py @@ -646,7 +646,6 @@ def test_no_change_button(self): request = self.get_page_request(page, user, edit_url, disable=False) request.toolbar.post_template_populate() self.assertFalse(page.has_change_permission(request.user)) - self.assertFalse(page.has_publish_permission(request.user)) items = request.toolbar.get_left_items() + request.toolbar.get_right_items() # Logo + page-menu + admin-menu + color scheme + logout diff --git a/cms/utils/page_permissions.py b/cms/utils/page_permissions.py index 06b6059df6f..259920337c7 100644 --- a/cms/utils/page_permissions.py +++ b/cms/utils/page_permissions.py @@ -16,7 +16,6 @@ PAGE_ADD_CODENAME = get_model_permission_codename(Page, 'add') PAGE_CHANGE_CODENAME = get_model_permission_codename(Page, 'change') PAGE_DELETE_CODENAME = get_model_permission_codename(Page, 'delete') -PAGE_PUBLISH_CODENAME = get_model_permission_codename(Page, 'publish') PAGE_VIEW_CODENAME = get_model_permission_codename(Page, 'view') @@ -29,8 +28,6 @@ 'delete_page': [PAGE_CHANGE_CODENAME, PAGE_DELETE_CODENAME], 'delete_page_translation': [PAGE_CHANGE_CODENAME, PAGE_DELETE_CODENAME], 'move_page': [PAGE_CHANGE_CODENAME], - 'publish_page': [PAGE_CHANGE_CODENAME, PAGE_PUBLISH_CODENAME], - 'revert_page_to_live': [PAGE_CHANGE_CODENAME] } @@ -199,18 +196,6 @@ def user_can_delete_page_translation(user, page, language, site=None): return True -@cached_func -@auth_permission_required('publish_page') -def user_can_publish_page(user, page, site=None): - has_perm = has_generic_permission( - page=page, - user=user, - action='publish_page', - site=site, - ) - return has_perm - - @cached_func @auth_permission_required('change_page_advanced_settings') def user_can_change_page_advanced_settings(user, page, site=None): @@ -431,21 +416,6 @@ def get_move_page_id_list(user, site, check_global=True, use_cache=True): return page_ids -def get_publish_id_list(user, site, check_global=True, use_cache=True): - """ - Give a list of page where the user has publish rights or the string "All" if - the user has all rights. - """ - page_ids = _get_page_ids_for_action( - user=user, - site=site, - action='publish_page', - check_global=check_global, - use_cache=use_cache, - ) - return page_ids - - def get_view_id_list(user, site, check_global=True, use_cache=True): """Give a list of pages which user can view. """ @@ -472,7 +442,6 @@ def has_generic_permission(page, user, action, site=None, check_global=True): 'delete_page': get_delete_id_list, 'delete_page_translation': get_delete_id_list, 'move_page': get_move_page_id_list, - 'publish_page': get_publish_id_list, 'view_page': get_view_id_list, } From f1d358402c337be31e5de9cdf24b051467cd7d55 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Fri, 8 Sep 2023 14:21:15 +0200 Subject: [PATCH 4/4] Update _toolbar.scss --- cms/static/cms/sass/components/_toolbar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cms/static/cms/sass/components/_toolbar.scss b/cms/static/cms/sass/components/_toolbar.scss index d434620b447..3795a6216d7 100644 --- a/cms/static/cms/sass/components/_toolbar.scss +++ b/cms/static/cms/sass/components/_toolbar.scss @@ -87,7 +87,7 @@ .cms-toolbar .cms-btn-action { background-color: $toolbar-debug-bgcolor; border-color: $toolbar-debug-bgcolor; - color: $black; + color: black; &:active, &:focus { background-color: $toolbar-debug-bgcolor;