-
-
Notifications
You must be signed in to change notification settings - Fork 32
Include recylebin specific deletion success messages #312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 4 commits
6919923
a66acc9
962ef05
22bdbf3
6a83a04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,3 +40,40 @@ def json_dumps(data): | |
|
|
||
| # can eventually provide custom handling here if we want | ||
| json_loads = simplejson.loads | ||
|
|
||
|
|
||
| def get_recycle_bin_message(title=None, retention_period=0): | ||
|
||
| """Generate appropriate message for recycled items based on retention period. | ||
|
|
||
| Args: | ||
| title: The title of the deleted item (optional, for single item messages) | ||
| retention_period: Number of days to retain items (0 = indefinite) | ||
|
|
||
| Returns: | ||
| Translated message string | ||
| """ | ||
| from plone.base import PloneMessageFactory as _ | ||
|
|
||
| if title: | ||
| # Single item message | ||
| if retention_period == 0: | ||
| return _( | ||
| "${title} has been moved to the recycle bin. It can be restored by administrators.", | ||
| mapping={"title": title}, | ||
| ) | ||
| else: | ||
| return _( | ||
| "${title} has been moved to the recycle bin. It can be restored by administrators and will be permanently deleted after ${days} days.", | ||
| mapping={"title": title, "days": retention_period}, | ||
| ) | ||
| else: | ||
| # Multiple items message | ||
| if retention_period == 0: | ||
| return _( | ||
| "Successfully moved items to recycle bin. Items can be restored by administrators." | ||
| ) | ||
| else: | ||
| return _( | ||
| "Successfully moved items to recycle bin. Items can be restored by administrators and will be permanently deleted after ${days} days.", | ||
| mapping={"days": retention_period}, | ||
| ) | ||
Uh oh!
There was an error while loading. Please reload this page.