-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fc] Repository: Products.CMFEditions
Branch: refs/heads/master Date: 2018-10-05T13:36:12+02:00 Author: Manuel Reinhardt (reinhardt) <reinhardt@syslab.com> Commit: plone/Products.CMFEditions@76a1185 Replaced usages of getObjSize with human_readable_size. #60 Files changed: A news/60.feature M Products/CMFEditions/browser/configure.zcml M Products/CMFEditions/browser/templates/version_file_view.pt M Products/CMFEditions/browser/templates/version_image_view.pt M Products/CMFEditions/browser/views.py Repository: Products.CMFEditions Branch: refs/heads/master Date: 2018-10-05T20:21:30+02:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/Products.CMFEditions@b839691 Merge pull request #61 from plone/60-skin-scripts-removed Replaced usages of getObjSize with human_readable_size Files changed: A news/60.feature M Products/CMFEditions/browser/configure.zcml M Products/CMFEditions/browser/templates/version_file_view.pt M Products/CMFEditions/browser/templates/version_image_view.pt M Products/CMFEditions/browser/views.py
- Loading branch information
Showing
1 changed file
with
21 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,40 @@ | ||
Repository: Products.ATContentTypes | ||
Repository: Products.CMFEditions | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2018-10-04T14:54:18+02:00 | ||
Date: 2018-10-05T13:36:12+02:00 | ||
Author: Manuel Reinhardt (reinhardt) <reinhardt@syslab.com> | ||
Commit: https://github.com/plone/Products.ATContentTypes/commit/0aacd98d41625211d721f86bedf14cb203c8ca09 | ||
Commit: https://github.com/plone/Products.CMFEditions/commit/76a11854c7dff0d07341dd695b7ecb543c8b8e20 | ||
|
||
Added isExpired.py skin script as it will be removed from CMFPlone. | ||
Replaced usages of getObjSize with human_readable_size. #60 | ||
|
||
Files changed: | ||
A Products/ATContentTypes/skins/ATContentTypes/isExpired.py | ||
A news/58.feature | ||
A news/60.feature | ||
M Products/CMFEditions/browser/configure.zcml | ||
M Products/CMFEditions/browser/templates/version_file_view.pt | ||
M Products/CMFEditions/browser/templates/version_image_view.pt | ||
M Products/CMFEditions/browser/views.py | ||
|
||
b'diff --git a/Products/ATContentTypes/skins/ATContentTypes/isExpired.py b/Products/ATContentTypes/skins/ATContentTypes/isExpired.py\nnew file mode 100644\nindex 00000000..9e68f7df\n--- /dev/null\n+++ b/Products/ATContentTypes/skins/ATContentTypes/isExpired.py\n@@ -0,0 +1,15 @@\n+## Script (Python) "isExpired"\n+##bind container=container\n+##bind context=context\n+##bind namespace=\n+##bind script=script\n+##bind subpath=traverse_subpath\n+##parameters=content=None\n+##title=Find out if the object is expired\n+\n+from Products.CMFPlone.utils import isExpired\n+\n+if not content:\n+ content = context\n+\n+return isExpired(content)\ndiff --git a/news/58.feature b/news/58.feature\nnew file mode 100644\nindex 00000000..223b8b98\n--- /dev/null\n+++ b/news/58.feature\n@@ -0,0 +1 @@\n+Added isExpired.py skin script as it will be removed from CMFPlone.\n' | ||
b'diff --git a/Products/CMFEditions/browser/configure.zcml b/Products/CMFEditions/browser/configure.zcml\nindex b804731..f995fad 100644\n--- a/Products/CMFEditions/browser/configure.zcml\n+++ b/Products/CMFEditions/browser/configure.zcml\n@@ -52,6 +52,7 @@\n <browser:page\n for="*"\n name="version_file_view"\n+ class=".views.VersionView"\n template="templates/version_file_view.pt"\n permission="zope2.View"\n />\n@@ -59,6 +60,7 @@\n <browser:page\n for="*"\n name="version_image_view"\n+ class=".views.VersionView"\n template="templates/version_image_view.pt"\n permission="zope2.View"\n />\ndiff --git a/Products/CMFEditions/browser/templates/version_file_view.pt b/Products/CMFEditions/browser/templates/version_file_view.pt\nindex 81b7531..42039c9 100644\n--- a/Products/CMFEditions/browser/templates/version_file_view.pt\n+++ b/Products/CMFEditions/browser/templates/version_file_view.pt\n@@ -8,7 +8,7 @@\n <metal:main fill-slot="main">\n <tal:main-macro metal:define-macro="main"\n tal:define="size_value context/get_size;\n- size_label python:size_value and context.getObjSize(context) or None;\n+ size_label python:size_value and view.human_readable_size(size_value) or None;\n content_type context/get_content_type|context/Format;\n ">\n \ndiff --git a/Products/CMFEditions/browser/templates/version_image_view.pt b/Products/CMFEditions/browser/templates/version_image_view.pt\nindex 672a3b7..e6295a6 100644\n--- a/Products/CMFEditions/browser/templates/version_image_view.pt\n+++ b/Products/CMFEditions/browser/templates/version_image_view.pt\n@@ -26,7 +26,7 @@\n —\n <span i18n:translate="label_size">Size</span>:\n \n- <span tal:define="size python:here.getObjSize(here)"\n+ <span tal:define="size python:view.human_readable_size(here.get_size())"\n tal:content="size">\n File size\n </span>\ndiff --git a/Products/CMFEditions/browser/views.py b/Products/CMFEditions/browser/views.py\nindex 8db1666..29ab7fb 100644\n--- a/Products/CMFEditions/browser/views.py\n+++ b/Products/CMFEditions/browser/views.py\n@@ -6,6 +6,7 @@\n from Products.CMFEditions.utilities import isObjectChanged\n from Products.CMFEditions.utilities import isObjectVersioned\n from Products.CMFEditions.utilities import maybeSaveVersion\n+from Products.CMFPlone.utils import human_readable_size\n from Products.statusmessages.interfaces import IStatusMessage\n \n class UpdateVersionOnEditView(BrowserView):\n@@ -86,3 +87,9 @@ def __call__(self):\n tag = \'<img src="%s/file_download_version?version_id=%s" %s\' % \\\n (here_url, version_id, working_copy_tag[altPos:])\n return tag\n+\n+\n+class VersionView(BrowserView):\n+\n+ def human_readable_size(self):\n+ return human_readable_size\ndiff --git a/news/60.feature b/news/60.feature\nnew file mode 100644\nindex 0000000..a45935e\n--- /dev/null\n+++ b/news/60.feature\n@@ -0,0 +1 @@\n+Replaced usages of getObjSize with human_readable_size.\n' | ||
|
||
Repository: Products.ATContentTypes | ||
Repository: Products.CMFEditions | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2018-10-05T12:16:31+02:00 | ||
Author: Manuel Reinhardt (reinhardt) <reinhardt@syslab.com> | ||
Commit: https://github.com/plone/Products.ATContentTypes/commit/1f7f19848504d4398c602c4d66b60c5f354c83a4 | ||
|
||
Added getObjSize.py skin script as it will be removed from CMFPlone. #58 | ||
|
||
Files changed: | ||
A Products/ATContentTypes/skins/ATContentTypes/getObjSize.py | ||
M news/58.feature | ||
|
||
b'diff --git a/Products/ATContentTypes/skins/ATContentTypes/getObjSize.py b/Products/ATContentTypes/skins/ATContentTypes/getObjSize.py\nnew file mode 100644\nindex 00000000..69da6bd8\n--- /dev/null\n+++ b/Products/ATContentTypes/skins/ATContentTypes/getObjSize.py\n@@ -0,0 +1,23 @@\n+## Script (Python) "getObjSize"\n+##bind container=container\n+##bind context=context\n+##bind namespace=\n+##bind script=script\n+##bind subpath=traverse_subpath\n+##parameters=obj=None, size=None\n+##title=\n+\n+from Products.CMFPlone.utils import base_hasattr\n+from Products.CMFPlone.utils import human_readable_size\n+\n+if obj is None:\n+ obj = context\n+\n+# allow arbitrary sizes to be passed through,\n+# if there is no size, but there is an object\n+# look up the object, this maintains backwards\n+# compatibility\n+if size is None and base_hasattr(obj, \'get_size\'):\n+ size = obj.get_size()\n+\n+return human_readable_size(size)\ndiff --git a/news/58.feature b/news/58.feature\nindex 223b8b98..e5e6ecc7 100644\n--- a/news/58.feature\n+++ b/news/58.feature\n@@ -1 +1 @@\n-Added isExpired.py skin script as it will be removed from CMFPlone.\n+Added isExpired.py and getObjSize.py skin scripts as they will be removed from CMFPlone.\n' | ||
|
||
Repository: Products.ATContentTypes | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2018-10-05T20:18:12+02:00 | ||
Date: 2018-10-05T20:21:30+02:00 | ||
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> | ||
Commit: https://github.com/plone/Products.ATContentTypes/commit/011b9e2f59ba23bd8976763ef03e745086dd28f0 | ||
Commit: https://github.com/plone/Products.CMFEditions/commit/b8396916e48eec6b203573068f10aea13184b49c | ||
|
||
Merge pull request #59 from plone/58-is-expired | ||
Merge pull request #61 from plone/60-skin-scripts-removed | ||
|
||
Added some skin scripts as they will be removed from CMFPlone. | ||
Replaced usages of getObjSize with human_readable_size | ||
|
||
Files changed: | ||
A Products/ATContentTypes/skins/ATContentTypes/getObjSize.py | ||
A Products/ATContentTypes/skins/ATContentTypes/isExpired.py | ||
A news/58.feature | ||
A news/60.feature | ||
M Products/CMFEditions/browser/configure.zcml | ||
M Products/CMFEditions/browser/templates/version_file_view.pt | ||
M Products/CMFEditions/browser/templates/version_image_view.pt | ||
M Products/CMFEditions/browser/views.py | ||
|
||
b'diff --git a/Products/ATContentTypes/skins/ATContentTypes/getObjSize.py b/Products/ATContentTypes/skins/ATContentTypes/getObjSize.py\nnew file mode 100644\nindex 00000000..69da6bd8\n--- /dev/null\n+++ b/Products/ATContentTypes/skins/ATContentTypes/getObjSize.py\n@@ -0,0 +1,23 @@\n+## Script (Python) "getObjSize"\n+##bind container=container\n+##bind context=context\n+##bind namespace=\n+##bind script=script\n+##bind subpath=traverse_subpath\n+##parameters=obj=None, size=None\n+##title=\n+\n+from Products.CMFPlone.utils import base_hasattr\n+from Products.CMFPlone.utils import human_readable_size\n+\n+if obj is None:\n+ obj = context\n+\n+# allow arbitrary sizes to be passed through,\n+# if there is no size, but there is an object\n+# look up the object, this maintains backwards\n+# compatibility\n+if size is None and base_hasattr(obj, \'get_size\'):\n+ size = obj.get_size()\n+\n+return human_readable_size(size)\ndiff --git a/Products/ATContentTypes/skins/ATContentTypes/isExpired.py b/Products/ATContentTypes/skins/ATContentTypes/isExpired.py\nnew file mode 100644\nindex 00000000..9e68f7df\n--- /dev/null\n+++ b/Products/ATContentTypes/skins/ATContentTypes/isExpired.py\n@@ -0,0 +1,15 @@\n+## Script (Python) "isExpired"\n+##bind container=container\n+##bind context=context\n+##bind namespace=\n+##bind script=script\n+##bind subpath=traverse_subpath\n+##parameters=content=None\n+##title=Find out if the object is expired\n+\n+from Products.CMFPlone.utils import isExpired\n+\n+if not content:\n+ content = context\n+\n+return isExpired(content)\ndiff --git a/news/58.feature b/news/58.feature\nnew file mode 100644\nindex 00000000..e5e6ecc7\n--- /dev/null\n+++ b/news/58.feature\n@@ -0,0 +1 @@\n+Added isExpired.py and getObjSize.py skin scripts as they will be removed from CMFPlone.\n' | ||
b'diff --git a/Products/CMFEditions/browser/configure.zcml b/Products/CMFEditions/browser/configure.zcml\nindex b804731..f995fad 100644\n--- a/Products/CMFEditions/browser/configure.zcml\n+++ b/Products/CMFEditions/browser/configure.zcml\n@@ -52,6 +52,7 @@\n <browser:page\n for="*"\n name="version_file_view"\n+ class=".views.VersionView"\n template="templates/version_file_view.pt"\n permission="zope2.View"\n />\n@@ -59,6 +60,7 @@\n <browser:page\n for="*"\n name="version_image_view"\n+ class=".views.VersionView"\n template="templates/version_image_view.pt"\n permission="zope2.View"\n />\ndiff --git a/Products/CMFEditions/browser/templates/version_file_view.pt b/Products/CMFEditions/browser/templates/version_file_view.pt\nindex 81b7531..42039c9 100644\n--- a/Products/CMFEditions/browser/templates/version_file_view.pt\n+++ b/Products/CMFEditions/browser/templates/version_file_view.pt\n@@ -8,7 +8,7 @@\n <metal:main fill-slot="main">\n <tal:main-macro metal:define-macro="main"\n tal:define="size_value context/get_size;\n- size_label python:size_value and context.getObjSize(context) or None;\n+ size_label python:size_value and view.human_readable_size(size_value) or None;\n content_type context/get_content_type|context/Format;\n ">\n \ndiff --git a/Products/CMFEditions/browser/templates/version_image_view.pt b/Products/CMFEditions/browser/templates/version_image_view.pt\nindex 672a3b7..e6295a6 100644\n--- a/Products/CMFEditions/browser/templates/version_image_view.pt\n+++ b/Products/CMFEditions/browser/templates/version_image_view.pt\n@@ -26,7 +26,7 @@\n —\n <span i18n:translate="label_size">Size</span>:\n \n- <span tal:define="size python:here.getObjSize(here)"\n+ <span tal:define="size python:view.human_readable_size(here.get_size())"\n tal:content="size">\n File size\n </span>\ndiff --git a/Products/CMFEditions/browser/views.py b/Products/CMFEditions/browser/views.py\nindex 8db1666..29ab7fb 100644\n--- a/Products/CMFEditions/browser/views.py\n+++ b/Products/CMFEditions/browser/views.py\n@@ -6,6 +6,7 @@\n from Products.CMFEditions.utilities import isObjectChanged\n from Products.CMFEditions.utilities import isObjectVersioned\n from Products.CMFEditions.utilities import maybeSaveVersion\n+from Products.CMFPlone.utils import human_readable_size\n from Products.statusmessages.interfaces import IStatusMessage\n \n class UpdateVersionOnEditView(BrowserView):\n@@ -86,3 +87,9 @@ def __call__(self):\n tag = \'<img src="%s/file_download_version?version_id=%s" %s\' % \\\n (here_url, version_id, working_copy_tag[altPos:])\n return tag\n+\n+\n+class VersionView(BrowserView):\n+\n+ def human_readable_size(self):\n+ return human_readable_size\ndiff --git a/news/60.feature b/news/60.feature\nnew file mode 100644\nindex 0000000..a45935e\n--- /dev/null\n+++ b/news/60.feature\n@@ -0,0 +1 @@\n+Replaced usages of getObjSize with human_readable_size.\n' | ||
|