# HG changeset patch # User Thierry Florac # Date 1496761871 -7200 # Node ID 3e37d4dd8e3bb0a986be88ada10883751a53bade # Parent bebdf1365369e3ddd41fc08b677a959640264d29 Version 0.1.4 diff -r bebdf1365369 -r 3e37d4dd8e3b buildout.cfg --- a/buildout.cfg Tue May 16 11:07:15 2017 +0200 +++ b/buildout.cfg Tue Jun 06 17:11:11 2017 +0200 @@ -1,5 +1,7 @@ [buildout] eggs-directory = /var/local/env/pyams/eggs +extends = http://download.ztfy.org/pyams/pyams-dev.cfg +find-links = http://download.ztfy.org/eggs socket-timeout = 3 show-picked-versions = true @@ -11,7 +13,6 @@ *.sourceforge.net github.com -#extends = http://download.ztfy.org/webapp/ztfy.webapp.dev.cfg versions = versions newest = false #allow-picked-versions = false @@ -20,11 +21,14 @@ develop = . /var/local/src/pyams/pyams_catalog + /var/local/src/pyams/pyams_default_theme /var/local/src/pyams/pyams_file /var/local/src/pyams/pyams_form /var/local/src/pyams/pyams_i18n + /var/local/src/pyams/pyams_mail /var/local/src/pyams/pyams_media /var/local/src/pyams/pyams_pagelet + /var/local/src/pyams/pyams_portal /var/local/src/pyams/pyams_security /var/local/src/pyams/pyams_sequence /var/local/src/pyams/pyams_skin @@ -53,6 +57,7 @@ pyams_i18n pyams_media pyams_pagelet + pyams_portal pyams_security pyams_sequence pyams_skin @@ -87,4 +92,4 @@ eggs = pyams_content [test] [versions] -pyams_content = 0.1.3 +pyams_content = 0.1.4 diff -r bebdf1365369 -r 3e37d4dd8e3b docs/HISTORY.txt --- a/docs/HISTORY.txt Tue May 16 11:07:15 2017 +0200 +++ b/docs/HISTORY.txt Tue Jun 06 17:11:11 2017 +0200 @@ -1,6 +1,16 @@ History ======= +0.1.4 +----- + - added content review features + - added image map content type + - added attributes on default workflow transactions to handle notifications (used by "pyams_notify" package) + - added UserSkinnableContent as base class for site root and blog manager + - changed admin view name to "admin" instead of "admin.html" + - changed vocabularies declarations + - changed widgets CSS class attribute + 0.1.3 ----- - added subscribers for media files events diff -r bebdf1365369 -r 3e37d4dd8e3b setup.py --- a/setup.py Tue May 16 11:07:15 2017 +0200 +++ b/setup.py Tue Jun 06 17:11:11 2017 +0200 @@ -22,7 +22,7 @@ README = os.path.join(DOCS, 'README.txt') HISTORY = os.path.join(DOCS, 'HISTORY.txt') -version = '0.1.3' +version = '0.1.4' long_description = open(README).read() + '\n\n' + open(HISTORY).read() tests_require = [] @@ -57,12 +57,16 @@ install_requires=[ 'setuptools', # -*- Extra requirements: -*- + 'fanstatic', + 'hypatia', + 'persistent', 'pyams_catalog', 'pyams_file', 'pyams_form', 'pyams_i18n', - 'pyams_media', + 'pyams_mail', 'pyams_pagelet', + 'pyams_portal', 'pyams_security', 'pyams_sequence', 'pyams_skin', @@ -72,8 +76,24 @@ 'pyams_viewlet', 'pyams_workflow', 'pyams_zmi', + 'pyramid', + 'pyramid_chameleon', + 'pyramid_mailer', + 'z3c.form', + 'z3c.table', + 'zope.annotation', 'zope.component', + 'zope.container', + 'zope.contentprovider', + 'zope.copy', + 'zope.dublincore', 'zope.interface', + 'zope.intid', + 'zope.lifecycleevent', + 'zope.location', + 'zope.schema', + 'zope.site', + 'zope.traversing' ], entry_points={ 'fanstatic.libraries': [ diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content.egg-info/PKG-INFO --- a/src/pyams_content.egg-info/PKG-INFO Tue May 16 11:07:15 2017 +0200 +++ b/src/pyams_content.egg-info/PKG-INFO Tue Jun 06 17:11:11 2017 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pyams-content -Version: 0.1.3 +Version: 0.1.4 Summary: PyAMS base content interfaces and classes Home-page: http://hg.ztfy.org/pyams/pyams_content Author: Thierry Florac @@ -11,6 +11,16 @@ History ======= + 0.1.4 + ----- + - added content review features + - added image map content type + - added attributes on default workflow transactions to handle notifications (used by "pyams_notify" package) + - added UserSkinnableContent as base class for site root and blog manager + - changed admin view name to "admin" instead of "admin.html" + - changed vocabularies declarations + - changed widgets CSS class attribute + 0.1.3 ----- - added subscribers for media files events diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content.egg-info/SOURCES.txt --- a/src/pyams_content.egg-info/SOURCES.txt Tue May 16 11:07:15 2017 +0200 +++ b/src/pyams_content.egg-info/SOURCES.txt Tue Jun 06 17:11:11 2017 +0200 @@ -47,6 +47,8 @@ src/pyams_content/component/links/zmi/templates/container.pt src/pyams_content/component/links/zmi/templates/widget-display.pt src/pyams_content/component/links/zmi/templates/widget-input.pt +src/pyams_content/component/links/zmi/templates/widget-list-display.pt +src/pyams_content/component/links/zmi/templates/widget-list-input.pt src/pyams_content/component/media/__init__.py src/pyams_content/component/paragraph/__init__.py src/pyams_content/component/paragraph/container.py @@ -78,6 +80,7 @@ src/pyams_content/generations/__init__.py src/pyams_content/interfaces/__init__.py src/pyams_content/interfaces/container.py +src/pyams_content/interfaces/review.py src/pyams_content/locales/pyams_content.pot src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po @@ -91,8 +94,14 @@ src/pyams_content/root/zmi/search.py src/pyams_content/root/zmi/templates/dashboard.pt src/pyams_content/shared/__init__.py +src/pyams_content/shared/blog/__init__.py +src/pyams_content/shared/blog/manager.py +src/pyams_content/shared/blog/interfaces/__init__.py +src/pyams_content/shared/blog/zmi/__init__.py +src/pyams_content/shared/blog/zmi/manager.py src/pyams_content/shared/common/__init__.py src/pyams_content/shared/common/manager.py +src/pyams_content/shared/common/review.py src/pyams_content/shared/common/security.py src/pyams_content/shared/common/interfaces/__init__.py src/pyams_content/shared/common/interfaces/zmi.py @@ -103,6 +112,7 @@ src/pyams_content/shared/common/zmi/manager.py src/pyams_content/shared/common/zmi/owner.py src/pyams_content/shared/common/zmi/properties.py +src/pyams_content/shared/common/zmi/review.py src/pyams_content/shared/common/zmi/search.py src/pyams_content/shared/common/zmi/security.py src/pyams_content/shared/common/zmi/summary.py @@ -110,6 +120,10 @@ src/pyams_content/shared/common/zmi/templates/advanced-search.pt src/pyams_content/shared/common/zmi/templates/dashboard.pt src/pyams_content/shared/common/zmi/templates/header.pt +src/pyams_content/shared/common/zmi/templates/review-add-comment.pt +src/pyams_content/shared/common/zmi/templates/review-comments-json.pt +src/pyams_content/shared/common/zmi/templates/review-comments.pt +src/pyams_content/shared/common/zmi/templates/review-notification.pt src/pyams_content/shared/common/zmi/templates/wf-archive-message.pt src/pyams_content/shared/common/zmi/templates/wf-archiving-message.pt src/pyams_content/shared/common/zmi/templates/wf-cancel-archiving-message.pt @@ -127,21 +141,55 @@ src/pyams_content/shared/common/zmi/templates/wf-retire-message.pt src/pyams_content/shared/common/zmi/templates/wf-retiring-message.pt src/pyams_content/shared/common/zmi/templates/wf-transition-info.pt +src/pyams_content/shared/form/__init__.py +src/pyams_content/shared/form/manager.py +src/pyams_content/shared/form/interfaces/__init__.py +src/pyams_content/shared/imagemap/__init__.py +src/pyams_content/shared/imagemap/manager.py +src/pyams_content/shared/imagemap/schema.py +src/pyams_content/shared/imagemap/interfaces/__init__.py +src/pyams_content/shared/imagemap/zmi/__init__.py +src/pyams_content/shared/imagemap/zmi/area.py +src/pyams_content/shared/imagemap/zmi/container.py +src/pyams_content/shared/imagemap/zmi/properties.py +src/pyams_content/shared/imagemap/zmi/summary.py +src/pyams_content/shared/imagemap/zmi/widget.py +src/pyams_content/shared/imagemap/zmi/templates/container.pt +src/pyams_content/shared/imagemap/zmi/templates/summary.pt +src/pyams_content/shared/imagemap/zmi/templates/widget-input.pt src/pyams_content/shared/news/__init__.py src/pyams_content/shared/news/manager.py src/pyams_content/shared/news/interfaces/__init__.py src/pyams_content/shared/news/zmi/__init__.py src/pyams_content/shared/news/zmi/properties.py -src/pyams_content/site/__init__.py -src/pyams_content/site/interfaces/__init__.py +src/pyams_content/shared/site/__init__.py +src/pyams_content/shared/site/interfaces/__init__.py +src/pyams_content/shared/site/zmi/__init__.py +src/pyams_content/shared/view/__init__.py +src/pyams_content/shared/view/manager.py +src/pyams_content/shared/view/reference.py +src/pyams_content/shared/view/interfaces/__init__.py +src/pyams_content/shared/view/zmi/__init__.py +src/pyams_content/shared/view/zmi/properties.py +src/pyams_content/shared/view/zmi/reference.py +src/pyams_content/shared/zmi/__init__.py +src/pyams_content/shared/zmi/sites.py +src/pyams_content/shared/zmi/interfaces/__init__.py src/pyams_content/skin/__init__.py src/pyams_content/skin/routes.py +src/pyams_content/skin/resources/css/pyams_content.css +src/pyams_content/skin/resources/css/pyams_content.min.css +src/pyams_content/skin/resources/js/jquery-canvasAreaDraw.js +src/pyams_content/skin/resources/js/jquery-canvasAreaDraw.min.js +src/pyams_content/skin/resources/js/jquery-imagemapster-1.2.10.js +src/pyams_content/skin/resources/js/jquery-imagemapster-1.2.10.min.js src/pyams_content/skin/resources/js/pyams_content.js src/pyams_content/skin/resources/js/pyams_content.min.js src/pyams_content/skin/resources/js/tinymce/onflinks/plugin.js src/pyams_content/skin/resources/js/tinymce/onflinks/plugin.min.js src/pyams_content/skin/resources/js/tinymce/onflinks/langs/fr.js src/pyams_content/skin/resources/js/tinymce/onflinks/langs/fr.min.js +src/pyams_content/skin/resources/less/pyams_content.less src/pyams_content/tests/__init__.py src/pyams_content/tests/test_utilsdocs.py src/pyams_content/tests/test_utilsdocstrings.py diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content.egg-info/requires.txt --- a/src/pyams_content.egg-info/requires.txt Tue May 16 11:07:15 2017 +0200 +++ b/src/pyams_content.egg-info/requires.txt Tue Jun 06 17:11:11 2017 +0200 @@ -1,10 +1,13 @@ -setuptools +fanstatic +hypatia +persistent pyams_catalog pyams_file pyams_form pyams_i18n -pyams_media +pyams_mail pyams_pagelet +pyams_portal pyams_security pyams_sequence pyams_skin @@ -14,7 +17,24 @@ pyams_viewlet pyams_workflow pyams_zmi +pyramid +pyramid_chameleon +pyramid_mailer +setuptools +z3c.form +z3c.table +zope.annotation zope.component +zope.container +zope.contentprovider +zope.copy +zope.dublincore zope.interface +zope.intid +zope.lifecycleevent +zope.location +zope.schema +zope.site +zope.traversing [test] diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo Binary file src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo has changed diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po --- a/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po Tue May 16 11:07:15 2017 +0200 +++ b/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po Tue Jun 06 17:11:11 2017 +0200 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE 1.0\n" -"POT-Creation-Date: 2017-01-25 11:12+0100\n" +"POT-Creation-Date: 2017-05-16 11:49+0200\n" "PO-Revision-Date: 2015-09-10 10:42+0200\n" "Last-Translator: Thierry Florac \n" "Language-Team: French\n" @@ -110,7 +110,7 @@ #: src/pyams_content/component/paragraph/interfaces/__init__.py:46 #: src/pyams_content/component/links/zmi/container.py:161 #: src/pyams_content/component/links/interfaces/__init__.py:43 -#: src/pyams_content/shared/common/zmi/dashboard.py:104 +#: src/pyams_content/shared/common/zmi/dashboard.py:106 #: src/pyams_content/shared/common/zmi/templates/advanced-search.pt:188 #: src/pyams_content/shared/imagemap/zmi/container.py:121 #: src/pyams_content/interfaces/__init__.py:54 @@ -668,12 +668,12 @@ msgstr "Résultats de la recherche avancée" #: src/pyams_content/shared/common/zmi/search.py:118 -#: src/pyams_content/shared/common/zmi/dashboard.py:194 +#: src/pyams_content/shared/common/zmi/dashboard.py:196 msgid "Owner" msgstr "Propriétaire" #: src/pyams_content/shared/common/zmi/search.py:121 -#: src/pyams_content/shared/common/zmi/dashboard.py:153 +#: src/pyams_content/shared/common/zmi/dashboard.py:155 msgid "Status" msgstr "Statut" @@ -858,7 +858,7 @@ msgstr "Historique de ce contenu" #: src/pyams_content/shared/common/zmi/summary.py:109 -#: src/pyams_content/shared/common/zmi/dashboard.py:142 +#: src/pyams_content/shared/common/zmi/dashboard.py:144 msgid "Version" msgstr "Version" @@ -933,270 +933,270 @@ msgid "Change owner" msgstr "Changer le propriétaire" -#: src/pyams_content/shared/common/zmi/dashboard.py:129 +#: src/pyams_content/shared/common/zmi/dashboard.py:131 msgid "Unique ID" msgstr "N° IN" -#: src/pyams_content/shared/common/zmi/dashboard.py:169 +#: src/pyams_content/shared/common/zmi/dashboard.py:171 msgid "Status date" msgstr "En date du" -#: src/pyams_content/shared/common/zmi/dashboard.py:181 +#: src/pyams_content/shared/common/zmi/dashboard.py:183 msgid "Status principal" msgstr "Intervenant" -#: src/pyams_content/shared/common/zmi/dashboard.py:206 +#: src/pyams_content/shared/common/zmi/dashboard.py:208 msgid "Last modification" msgstr "Dernière modification" -#: src/pyams_content/shared/common/zmi/dashboard.py:224 +#: src/pyams_content/shared/common/zmi/dashboard.py:226 #: src/pyams_content/root/zmi/__init__.py:88 msgid "Dashboard" msgstr "Tableau de bord" -#: src/pyams_content/shared/common/zmi/dashboard.py:234 +#: src/pyams_content/shared/common/zmi/dashboard.py:236 msgid "Contents dashboard" msgstr "Les contenus qui me concernent" -#: src/pyams_content/shared/common/zmi/dashboard.py:268 +#: src/pyams_content/shared/common/zmi/dashboard.py:270 #: src/pyams_content/root/zmi/__init__.py:134 #, python-format msgid "MANAGER - {0} content waiting for your action" msgstr "RESPONSABLE - {0} contenu en attente de votre intervention" -#: src/pyams_content/shared/common/zmi/dashboard.py:269 +#: src/pyams_content/shared/common/zmi/dashboard.py:271 #: src/pyams_content/root/zmi/__init__.py:135 #, python-format msgid "MANAGER - {0} contents waiting for your action" msgstr "RESPONSABLE - {0} contenus en attente de votre intervention" -#: src/pyams_content/shared/common/zmi/dashboard.py:310 +#: src/pyams_content/shared/common/zmi/dashboard.py:312 #: src/pyams_content/root/zmi/__init__.py:179 #, python-format msgid "CONTRIBUTOR - {0} content waiting for action" msgstr "CONTRIBUTEUR - {0} contenu soumis à un responsable" -#: src/pyams_content/shared/common/zmi/dashboard.py:311 +#: src/pyams_content/shared/common/zmi/dashboard.py:313 #: src/pyams_content/root/zmi/__init__.py:180 #, python-format msgid "CONTRIBUTOR - {0} contents waiting for action" msgstr "CONTRIBUTEUR - {0} contenus soumis à un responsable" -#: src/pyams_content/shared/common/zmi/dashboard.py:341 +#: src/pyams_content/shared/common/zmi/dashboard.py:343 #: src/pyams_content/root/zmi/__init__.py:213 #, python-format msgid "CONTRIBUTOR - {0} modified content" msgstr "CONTRIBUTEUR - {0} contenu modifié" -#: src/pyams_content/shared/common/zmi/dashboard.py:380 +#: src/pyams_content/shared/common/zmi/dashboard.py:382 #: src/pyams_content/root/zmi/__init__.py:254 msgid "My contents" msgstr "Tous mes contenus" -#: src/pyams_content/shared/common/zmi/dashboard.py:395 +#: src/pyams_content/shared/common/zmi/dashboard.py:397 #: src/pyams_content/root/zmi/__init__.py:269 msgid "My favorites" msgstr "Mes favoris" -#: src/pyams_content/shared/common/zmi/dashboard.py:404 +#: src/pyams_content/shared/common/zmi/dashboard.py:406 #: src/pyams_content/root/zmi/__init__.py:278 #, python-format msgid "CONTRIBUTOR - {0} favorite" msgstr "CONTRIBUTEUR - {0} contenu favori" -#: src/pyams_content/shared/common/zmi/dashboard.py:405 +#: src/pyams_content/shared/common/zmi/dashboard.py:407 #: src/pyams_content/root/zmi/__init__.py:279 #, python-format msgid "CONTRIBUTOR - {0} favorites" msgstr "CONTRIBUTEUR - {0} contenus favoris" -#: src/pyams_content/shared/common/zmi/dashboard.py:417 -#: src/pyams_content/shared/common/zmi/templates/header.pt:24 +#: src/pyams_content/shared/common/zmi/dashboard.py:419 +#: src/pyams_content/shared/common/zmi/templates/header.pt:23 msgid "Add/remove from favorites" msgstr "Ajouter/enlever des favoris" -#: src/pyams_content/shared/common/zmi/dashboard.py:477 +#: src/pyams_content/shared/common/zmi/dashboard.py:480 #: src/pyams_content/root/zmi/__init__.py:315 msgid "Your favorites" msgstr "Mes favoris" -#: src/pyams_content/shared/common/zmi/dashboard.py:490 +#: src/pyams_content/shared/common/zmi/dashboard.py:493 #: src/pyams_content/root/zmi/__init__.py:328 msgid "My preparations" msgstr "Mes préparations" -#: src/pyams_content/shared/common/zmi/dashboard.py:499 +#: src/pyams_content/shared/common/zmi/dashboard.py:502 #: src/pyams_content/root/zmi/__init__.py:337 #, python-format msgid "CONTRIBUTOR - {0} prepared content" msgstr "CONTRIBUTEUR - {0} contenu en préparation" -#: src/pyams_content/shared/common/zmi/dashboard.py:500 +#: src/pyams_content/shared/common/zmi/dashboard.py:503 #: src/pyams_content/root/zmi/__init__.py:338 #, python-format msgid "CONTRIBUTOR - {0} prepared contents" msgstr "CONTRIBUTEUR - {0} contenus en préparation" -#: src/pyams_content/shared/common/zmi/dashboard.py:538 +#: src/pyams_content/shared/common/zmi/dashboard.py:541 #: src/pyams_content/root/zmi/__init__.py:375 msgid "Your prepared contents" msgstr "Mes contenus en préparation" -#: src/pyams_content/shared/common/zmi/dashboard.py:551 +#: src/pyams_content/shared/common/zmi/dashboard.py:554 #: src/pyams_content/root/zmi/__init__.py:388 msgid "My submissions" msgstr "Mes soumissions" -#: src/pyams_content/shared/common/zmi/dashboard.py:560 +#: src/pyams_content/shared/common/zmi/dashboard.py:563 #: src/pyams_content/root/zmi/__init__.py:397 #, python-format msgid "CONTRIBUTOR - {0} submitted content" msgstr "CONTRIBUTEUR - {0} contenu soumis à un responsable" -#: src/pyams_content/shared/common/zmi/dashboard.py:561 +#: src/pyams_content/shared/common/zmi/dashboard.py:564 #: src/pyams_content/root/zmi/__init__.py:398 #, python-format msgid "CONTRIBUTOR - {0} submitted contents" msgstr "CONTRIBUTEUR - {0} contenus soumis à un responsable" -#: src/pyams_content/shared/common/zmi/dashboard.py:599 +#: src/pyams_content/shared/common/zmi/dashboard.py:602 #: src/pyams_content/root/zmi/__init__.py:435 msgid "Your submitted contents" msgstr "Mes contenus soumis à un responsable" -#: src/pyams_content/shared/common/zmi/dashboard.py:612 +#: src/pyams_content/shared/common/zmi/dashboard.py:615 #: src/pyams_content/root/zmi/__init__.py:448 msgid "My publications" msgstr "Mes publications" -#: src/pyams_content/shared/common/zmi/dashboard.py:621 +#: src/pyams_content/shared/common/zmi/dashboard.py:624 #: src/pyams_content/root/zmi/__init__.py:457 #, python-format msgid "CONTRIBUTOR - {0} published content" msgstr "CONTRIBUTEUR - {0} contenu publié" -#: src/pyams_content/shared/common/zmi/dashboard.py:622 +#: src/pyams_content/shared/common/zmi/dashboard.py:625 #: src/pyams_content/root/zmi/__init__.py:458 #, python-format msgid "CONTRIBUTOR - {0} published contents" msgstr "CONTRIBUTEUR - {0} contenus publiés" -#: src/pyams_content/shared/common/zmi/dashboard.py:660 +#: src/pyams_content/shared/common/zmi/dashboard.py:663 #: src/pyams_content/root/zmi/__init__.py:495 msgid "Your published contents" msgstr "Mes contenus publiés" -#: src/pyams_content/shared/common/zmi/dashboard.py:673 +#: src/pyams_content/shared/common/zmi/dashboard.py:676 #: src/pyams_content/root/zmi/__init__.py:508 msgid "My retired contents" msgstr "Mes contenus retirés" -#: src/pyams_content/shared/common/zmi/dashboard.py:682 +#: src/pyams_content/shared/common/zmi/dashboard.py:685 #: src/pyams_content/root/zmi/__init__.py:517 #, python-format msgid "CONTRIBUTOR - {0} retired content" msgstr "CONTRIBUTEUR - {0} contenu retiré" -#: src/pyams_content/shared/common/zmi/dashboard.py:683 +#: src/pyams_content/shared/common/zmi/dashboard.py:686 #: src/pyams_content/root/zmi/__init__.py:518 #, python-format msgid "CONTRIBUTOR - {0} retired contents" msgstr "CONTRIBUTEUR - {0} contenus retirés" -#: src/pyams_content/shared/common/zmi/dashboard.py:722 +#: src/pyams_content/shared/common/zmi/dashboard.py:725 #: src/pyams_content/root/zmi/__init__.py:556 msgid "Your retired contents" msgstr "Mes contenus retirés" -#: src/pyams_content/shared/common/zmi/dashboard.py:735 +#: src/pyams_content/shared/common/zmi/dashboard.py:738 #: src/pyams_content/root/zmi/__init__.py:569 msgid "My archived contents" msgstr "Mes contenus archivés" -#: src/pyams_content/shared/common/zmi/dashboard.py:744 +#: src/pyams_content/shared/common/zmi/dashboard.py:747 #: src/pyams_content/root/zmi/__init__.py:578 #, python-format msgid "CONTRIBUTOR - {0} archived content" msgstr "CONTRIBUTEUR - {0} contenu archivé" -#: src/pyams_content/shared/common/zmi/dashboard.py:745 +#: src/pyams_content/shared/common/zmi/dashboard.py:748 #: src/pyams_content/root/zmi/__init__.py:579 #, python-format msgid "CONTRIBUTOR - {0} archived contents" msgstr "CONTRIBUTEUR - {0} contenus archivés" -#: src/pyams_content/shared/common/zmi/dashboard.py:790 +#: src/pyams_content/shared/common/zmi/dashboard.py:793 #: src/pyams_content/root/zmi/__init__.py:623 msgid "Your archived contents" msgstr "Mes contenus archivés" -#: src/pyams_content/shared/common/zmi/dashboard.py:804 +#: src/pyams_content/shared/common/zmi/dashboard.py:807 #: src/pyams_content/root/zmi/__init__.py:637 msgid "Other interventions" msgstr "Toutes les interventions" -#: src/pyams_content/shared/common/zmi/dashboard.py:819 +#: src/pyams_content/shared/common/zmi/dashboard.py:822 #: src/pyams_content/root/zmi/__init__.py:652 msgid "Last publications" msgstr "Dernières publications" -#: src/pyams_content/shared/common/zmi/dashboard.py:828 +#: src/pyams_content/shared/common/zmi/dashboard.py:831 #: src/pyams_content/root/zmi/__init__.py:661 #, python-format msgid "CONTRIBUTORS - {0} published content" msgstr "TOUS CONTRIBUTEURS - {0} contenu publié" -#: src/pyams_content/shared/common/zmi/dashboard.py:873 +#: src/pyams_content/shared/common/zmi/dashboard.py:876 #: src/pyams_content/root/zmi/__init__.py:705 msgid "Last published contents" msgstr "Derniers contenus publiés" -#: src/pyams_content/shared/common/zmi/dashboard.py:886 +#: src/pyams_content/shared/common/zmi/dashboard.py:889 #: src/pyams_content/root/zmi/__init__.py:718 msgid "Last updates" msgstr "Dernières modifications" -#: src/pyams_content/shared/common/zmi/dashboard.py:895 +#: src/pyams_content/shared/common/zmi/dashboard.py:898 #: src/pyams_content/root/zmi/__init__.py:727 #, python-format msgid "CONTRIBUTORS - {0} updated content" msgstr "TOUS CONTRIBUTEURS - {0} contenu modifié" -#: src/pyams_content/shared/common/zmi/dashboard.py:938 +#: src/pyams_content/shared/common/zmi/dashboard.py:941 #: src/pyams_content/root/zmi/__init__.py:769 msgid "Last updated contents" msgstr "Derniers contenus modifiés" -#: src/pyams_content/shared/common/zmi/dashboard.py:346 +#: src/pyams_content/shared/common/zmi/dashboard.py:348 #: src/pyams_content/root/zmi/__init__.py:218 #, python-format msgid "CONTRIBUTOR - {0} modified contents" msgstr "CONTRIBUTEUR - {0} contenus modifiés" -#: src/pyams_content/shared/common/zmi/dashboard.py:348 +#: src/pyams_content/shared/common/zmi/dashboard.py:350 #: src/pyams_content/root/zmi/__init__.py:220 #, python-format msgid "CONTRIBUTOR - Last {0} modified contents" msgstr "CONTRIBUTEUR - Les {0} dernières modifications" -#: src/pyams_content/shared/common/zmi/dashboard.py:833 +#: src/pyams_content/shared/common/zmi/dashboard.py:836 #: src/pyams_content/root/zmi/__init__.py:666 #, python-format msgid "CONTRIBUTORS - Last {0} published contents" msgstr "TOUS CONTRIBUTEURS - Les {0} dernières publications" -#: src/pyams_content/shared/common/zmi/dashboard.py:835 +#: src/pyams_content/shared/common/zmi/dashboard.py:838 #: src/pyams_content/root/zmi/__init__.py:668 msgid "CONTRIBUTORS - Last published contents (in the limit of 50)" msgstr "TOUS CONTRIBUTEURS - Les {0} dernières publications" -#: src/pyams_content/shared/common/zmi/dashboard.py:900 +#: src/pyams_content/shared/common/zmi/dashboard.py:903 #: src/pyams_content/root/zmi/__init__.py:732 #, python-format msgid "CONTRIBUTORS - Last {0} updated contents" msgstr "TOUS CONTRIBUTEURS - Les {0} dernières modifications" -#: src/pyams_content/shared/common/zmi/dashboard.py:902 +#: src/pyams_content/shared/common/zmi/dashboard.py:905 #: src/pyams_content/root/zmi/__init__.py:734 msgid "CONTRIBUTORS - Last updated contents (in the limit of 50)" msgstr "TOUS CONTRIBUTEURS - Les {0} dernières modifications" @@ -1805,6 +1805,10 @@ msgid "Given site name doesn't exist!" msgstr "Le nom de site indiqué n'existe pas !" +#: src/pyams_content/shared/form/interfaces/__init__.py:27 +msgid "Form" +msgstr "Formulaire" + #: src/pyams_content/shared/news/zmi/properties.py:38 msgid "Publication settings" msgstr "Paramètres de publication" @@ -1858,6 +1862,94 @@ "au-delà de cette date, mais restera accessible via le moteur de recherche (à " "la différence des contenus retirés ou archivés)" +#: src/pyams_content/shared/view/zmi/properties.py:38 +msgid "Contents search settings" +msgstr "Paramètres de la vue" + +#: src/pyams_content/shared/view/zmi/__init__.py:44 +msgid "This view" +msgstr "Cette vue" + +#: src/pyams_content/shared/view/zmi/__init__.py:63 +#: src/pyams_content/shared/view/zmi/__init__.py:73 +msgid "Add view" +msgstr "Ajouter une vue" + +#: src/pyams_content/shared/view/zmi/__init__.py:54 +#, python-format +msgid "View « {title} »" +msgstr "Vu « {title} »" + +#: src/pyams_content/shared/view/zmi/reference.py:54 +msgid "References..." +msgstr "Références..." + +#: src/pyams_content/shared/view/zmi/reference.py:71 +msgid "View internal references settings" +msgstr "Références internes de la vue" + +#: src/pyams_content/shared/view/zmi/reference.py:62 +msgid "Reset" +msgstr "Annuler" + +#: src/pyams_content/shared/view/zmi/reference.py:63 +msgid "Submit" +msgstr "Enregistrer" + +#: src/pyams_content/shared/view/interfaces/__init__.py:31 +msgid "View" +msgstr "Vue" + +#: src/pyams_content/shared/view/interfaces/__init__.py:39 +#: src/pyams_content/interfaces/__init__.py:66 +#: src/pyams_content/interfaces/review.py:67 +msgid "Creation date" +msgstr "Date de création" + +#: src/pyams_content/shared/view/interfaces/__init__.py:40 +msgid "Last update date" +msgstr "Date de dernière modification" + +#: src/pyams_content/shared/view/interfaces/__init__.py:41 +msgid "Current publication date" +msgstr "Date de publication de la version actuelle" + +#: src/pyams_content/shared/view/interfaces/__init__.py:42 +msgid "First publication date" +msgstr "Date de première publication" + +#: src/pyams_content/shared/view/interfaces/__init__.py:55 +msgid "Content types" +msgstr "Types de contenus" + +#: src/pyams_content/shared/view/interfaces/__init__.py:56 +msgid "Selected content types; leave empty for all" +msgstr "Types de contenus sélectionnés ; laisser vide pour tous" + +#: src/pyams_content/shared/view/interfaces/__init__.py:60 +msgid "Order by" +msgstr "Ordre de tri" + +#: src/pyams_content/shared/view/interfaces/__init__.py:61 +msgid "Property to use to sort results" +msgstr "Propriété utilisée pour trier les résultats" + +#: src/pyams_content/shared/view/interfaces/__init__.py:66 +msgid "Reversed order?" +msgstr "Ordre inverse ?" + +#: src/pyams_content/shared/view/interfaces/__init__.py:67 +msgid "If 'yes', items order will be reversed" +msgstr "Si 'oui', le tri se fera en ordre descendant" + +#: src/pyams_content/shared/view/interfaces/__init__.py:97 +msgid "Internal references" +msgstr "Référence internes" + +#: src/pyams_content/shared/view/interfaces/__init__.py:98 +msgid "List of internal references" +msgstr "Liste de références internes imposées dans la vue" + #: src/pyams_content/shared/imagemap/zmi/properties.py:38 msgid "Background image" msgstr "Image de fond" @@ -2360,11 +2452,6 @@ "Affiché lorsque le contenu est consulté depuis son site d'origine (s'il a " "été identifié)" -#: src/pyams_content/interfaces/__init__.py:66 -#: src/pyams_content/interfaces/review.py:67 -msgid "Creation date" -msgstr "Date de création" - #: src/pyams_content/interfaces/__init__.py:70 msgid "Modification date" msgstr "Dernière modification apportée" diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content/locales/pyams_content.pot --- a/src/pyams_content/locales/pyams_content.pot Tue May 16 11:07:15 2017 +0200 +++ b/src/pyams_content/locales/pyams_content.pot Tue Jun 06 17:11:11 2017 +0200 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE 1.0\n" -"POT-Creation-Date: 2017-01-25 11:12+0100\n" +"POT-Creation-Date: 2017-05-16 11:49+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" @@ -111,7 +111,7 @@ #: ./src/pyams_content/component/paragraph/interfaces/__init__.py:46 #: ./src/pyams_content/component/links/zmi/container.py:161 #: ./src/pyams_content/component/links/interfaces/__init__.py:43 -#: ./src/pyams_content/shared/common/zmi/dashboard.py:104 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:106 #: ./src/pyams_content/shared/common/zmi/templates/advanced-search.pt:188 #: ./src/pyams_content/shared/imagemap/zmi/container.py:121 #: ./src/pyams_content/interfaces/__init__.py:54 @@ -660,12 +660,12 @@ msgstr "" #: ./src/pyams_content/shared/common/zmi/search.py:118 -#: ./src/pyams_content/shared/common/zmi/dashboard.py:194 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:196 msgid "Owner" msgstr "" #: ./src/pyams_content/shared/common/zmi/search.py:121 -#: ./src/pyams_content/shared/common/zmi/dashboard.py:153 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:155 msgid "Status" msgstr "" @@ -850,7 +850,7 @@ msgstr "" #: ./src/pyams_content/shared/common/zmi/summary.py:109 -#: ./src/pyams_content/shared/common/zmi/dashboard.py:142 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:144 msgid "Version" msgstr "" @@ -916,270 +916,270 @@ msgid "Change owner" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:129 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:131 msgid "Unique ID" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:169 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:171 msgid "Status date" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:181 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:183 msgid "Status principal" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:206 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:208 msgid "Last modification" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:224 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:226 #: ./src/pyams_content/root/zmi/__init__.py:88 msgid "Dashboard" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:234 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:236 msgid "Contents dashboard" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:268 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:270 #: ./src/pyams_content/root/zmi/__init__.py:134 #, python-format msgid "MANAGER - {0} content waiting for your action" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:269 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:271 #: ./src/pyams_content/root/zmi/__init__.py:135 #, python-format msgid "MANAGER - {0} contents waiting for your action" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:310 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:312 #: ./src/pyams_content/root/zmi/__init__.py:179 #, python-format msgid "CONTRIBUTOR - {0} content waiting for action" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:311 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:313 #: ./src/pyams_content/root/zmi/__init__.py:180 #, python-format msgid "CONTRIBUTOR - {0} contents waiting for action" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:341 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:343 #: ./src/pyams_content/root/zmi/__init__.py:213 #, python-format msgid "CONTRIBUTOR - {0} modified content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:380 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:382 #: ./src/pyams_content/root/zmi/__init__.py:254 msgid "My contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:395 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:397 #: ./src/pyams_content/root/zmi/__init__.py:269 msgid "My favorites" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:404 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:406 #: ./src/pyams_content/root/zmi/__init__.py:278 #, python-format msgid "CONTRIBUTOR - {0} favorite" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:405 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:407 #: ./src/pyams_content/root/zmi/__init__.py:279 #, python-format msgid "CONTRIBUTOR - {0} favorites" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:417 -#: ./src/pyams_content/shared/common/zmi/templates/header.pt:24 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:419 +#: ./src/pyams_content/shared/common/zmi/templates/header.pt:23 msgid "Add/remove from favorites" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:477 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:480 #: ./src/pyams_content/root/zmi/__init__.py:315 msgid "Your favorites" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:490 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:493 #: ./src/pyams_content/root/zmi/__init__.py:328 msgid "My preparations" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:499 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:502 #: ./src/pyams_content/root/zmi/__init__.py:337 #, python-format msgid "CONTRIBUTOR - {0} prepared content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:500 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:503 #: ./src/pyams_content/root/zmi/__init__.py:338 #, python-format msgid "CONTRIBUTOR - {0} prepared contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:538 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:541 #: ./src/pyams_content/root/zmi/__init__.py:375 msgid "Your prepared contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:551 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:554 #: ./src/pyams_content/root/zmi/__init__.py:388 msgid "My submissions" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:560 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:563 #: ./src/pyams_content/root/zmi/__init__.py:397 #, python-format msgid "CONTRIBUTOR - {0} submitted content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:561 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:564 #: ./src/pyams_content/root/zmi/__init__.py:398 #, python-format msgid "CONTRIBUTOR - {0} submitted contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:599 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:602 #: ./src/pyams_content/root/zmi/__init__.py:435 msgid "Your submitted contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:612 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:615 #: ./src/pyams_content/root/zmi/__init__.py:448 msgid "My publications" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:621 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:624 #: ./src/pyams_content/root/zmi/__init__.py:457 #, python-format msgid "CONTRIBUTOR - {0} published content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:622 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:625 #: ./src/pyams_content/root/zmi/__init__.py:458 #, python-format msgid "CONTRIBUTOR - {0} published contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:660 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:663 #: ./src/pyams_content/root/zmi/__init__.py:495 msgid "Your published contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:673 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:676 #: ./src/pyams_content/root/zmi/__init__.py:508 msgid "My retired contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:682 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:685 #: ./src/pyams_content/root/zmi/__init__.py:517 #, python-format msgid "CONTRIBUTOR - {0} retired content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:683 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:686 #: ./src/pyams_content/root/zmi/__init__.py:518 #, python-format msgid "CONTRIBUTOR - {0} retired contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:722 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:725 #: ./src/pyams_content/root/zmi/__init__.py:556 msgid "Your retired contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:735 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:738 #: ./src/pyams_content/root/zmi/__init__.py:569 msgid "My archived contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:744 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:747 #: ./src/pyams_content/root/zmi/__init__.py:578 #, python-format msgid "CONTRIBUTOR - {0} archived content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:745 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:748 #: ./src/pyams_content/root/zmi/__init__.py:579 #, python-format msgid "CONTRIBUTOR - {0} archived contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:790 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:793 #: ./src/pyams_content/root/zmi/__init__.py:623 msgid "Your archived contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:804 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:807 #: ./src/pyams_content/root/zmi/__init__.py:637 msgid "Other interventions" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:819 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:822 #: ./src/pyams_content/root/zmi/__init__.py:652 msgid "Last publications" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:828 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:831 #: ./src/pyams_content/root/zmi/__init__.py:661 #, python-format msgid "CONTRIBUTORS - {0} published content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:873 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:876 #: ./src/pyams_content/root/zmi/__init__.py:705 msgid "Last published contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:886 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:889 #: ./src/pyams_content/root/zmi/__init__.py:718 msgid "Last updates" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:895 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:898 #: ./src/pyams_content/root/zmi/__init__.py:727 #, python-format msgid "CONTRIBUTORS - {0} updated content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:938 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:941 #: ./src/pyams_content/root/zmi/__init__.py:769 msgid "Last updated contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:346 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:348 #: ./src/pyams_content/root/zmi/__init__.py:218 #, python-format msgid "CONTRIBUTOR - {0} modified contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:348 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:350 #: ./src/pyams_content/root/zmi/__init__.py:220 #, python-format msgid "CONTRIBUTOR - Last {0} modified contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:833 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:836 #: ./src/pyams_content/root/zmi/__init__.py:666 #, python-format msgid "CONTRIBUTORS - Last {0} published contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:835 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:838 #: ./src/pyams_content/root/zmi/__init__.py:668 msgid "CONTRIBUTORS - Last published contents (in the limit of 50)" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:900 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:903 #: ./src/pyams_content/root/zmi/__init__.py:732 #, python-format msgid "CONTRIBUTORS - Last {0} updated contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:902 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:905 #: ./src/pyams_content/root/zmi/__init__.py:734 msgid "CONTRIBUTORS - Last updated contents (in the limit of 50)" msgstr "" @@ -1704,6 +1704,10 @@ msgid "Given site name doesn't exist!" msgstr "" +#: ./src/pyams_content/shared/form/interfaces/__init__.py:27 +msgid "Form" +msgstr "" + #: ./src/pyams_content/shared/news/zmi/properties.py:38 msgid "Publication settings" msgstr "" @@ -1753,6 +1757,94 @@ "will still be available via the search engine" msgstr "" +#: ./src/pyams_content/shared/view/zmi/properties.py:38 +msgid "Contents search settings" +msgstr "" + +#: ./src/pyams_content/shared/view/zmi/__init__.py:44 +msgid "This view" +msgstr "" + +#: ./src/pyams_content/shared/view/zmi/__init__.py:63 +#: ./src/pyams_content/shared/view/zmi/__init__.py:73 +msgid "Add view" +msgstr "" + +#: ./src/pyams_content/shared/view/zmi/__init__.py:54 +#, python-format +msgid "View « {title} »" +msgstr "" + +#: ./src/pyams_content/shared/view/zmi/reference.py:54 +msgid "References..." +msgstr "" + +#: ./src/pyams_content/shared/view/zmi/reference.py:71 +msgid "View internal references settings" +msgstr "" + +#: ./src/pyams_content/shared/view/zmi/reference.py:62 +msgid "Reset" +msgstr "" + +#: ./src/pyams_content/shared/view/zmi/reference.py:63 +msgid "Submit" +msgstr "" + +#: ./src/pyams_content/shared/view/interfaces/__init__.py:31 +msgid "View" +msgstr "" + +#: ./src/pyams_content/shared/view/interfaces/__init__.py:39 +#: ./src/pyams_content/interfaces/__init__.py:66 +#: ./src/pyams_content/interfaces/review.py:67 +msgid "Creation date" +msgstr "" + +#: ./src/pyams_content/shared/view/interfaces/__init__.py:40 +msgid "Last update date" +msgstr "" + +#: ./src/pyams_content/shared/view/interfaces/__init__.py:41 +msgid "Current publication date" +msgstr "" + +#: ./src/pyams_content/shared/view/interfaces/__init__.py:42 +msgid "First publication date" +msgstr "" + +#: ./src/pyams_content/shared/view/interfaces/__init__.py:55 +msgid "Content types" +msgstr "" + +#: ./src/pyams_content/shared/view/interfaces/__init__.py:56 +msgid "Selected content types; leave empty for all" +msgstr "" + +#: ./src/pyams_content/shared/view/interfaces/__init__.py:60 +msgid "Order by" +msgstr "" + +#: ./src/pyams_content/shared/view/interfaces/__init__.py:61 +msgid "Property to use to sort results" +msgstr "" + +#: ./src/pyams_content/shared/view/interfaces/__init__.py:66 +msgid "Reversed order?" +msgstr "" + +#: ./src/pyams_content/shared/view/interfaces/__init__.py:67 +msgid "If 'yes', items order will be reversed" +msgstr "" + +#: ./src/pyams_content/shared/view/interfaces/__init__.py:97 +msgid "Internal references" +msgstr "" + +#: ./src/pyams_content/shared/view/interfaces/__init__.py:98 +msgid "List of internal references" +msgstr "" + #: ./src/pyams_content/shared/imagemap/zmi/properties.py:38 msgid "Background image" msgstr "" @@ -2248,11 +2340,6 @@ msgid "Short name used in breadcrumbs" msgstr "" -#: ./src/pyams_content/interfaces/__init__.py:66 -#: ./src/pyams_content/interfaces/review.py:67 -msgid "Creation date" -msgstr "" - #: ./src/pyams_content/interfaces/__init__.py:70 msgid "Modification date" msgstr "" diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content/shared/form/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/form/__init__.py Tue Jun 06 17:11:11 2017 +0200 @@ -0,0 +1,42 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_content.component.links.interfaces import ILinkContainerTarget +from pyams_content.shared.form.interfaces import IWfForm, IForm, FORM_CONTENT_TYPE, FORM_CONTENT_NAME + +# import packages +from pyams_content.shared.common import WfSharedContent, register_content_type, SharedContent +from zope.interface import implementer +from zope.schema.fieldproperty import FieldProperty + + +@implementer(IWfForm, ILinkContainerTarget) +class WfForm(WfSharedContent): + """Base form""" + + content_type = FORM_CONTENT_TYPE + content_name = FORM_CONTENT_NAME + +register_content_type(WfForm) + + +@implementer(IForm) +class Form(SharedContent): + """Workflow managed form class""" + + content_class = WfForm diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content/shared/form/interfaces/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/form/interfaces/__init__.py Tue Jun 06 17:11:11 2017 +0200 @@ -0,0 +1,39 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_content.shared.common.interfaces import ISharedTool, IWfSharedContent, ISharedContent + +# import packages + +from pyams_content import _ + + +FORM_CONTENT_TYPE = 'form' +FORM_CONTENT_NAME = _('Form') + + +class IFormsManager(ISharedTool): + """Formq manager interface""" + + +class IWfForm(IWfSharedContent): + """Form interface""" + + +class IForm(ISharedContent): + """Workflow managed form interface""" diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content/shared/form/manager.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/form/manager.py Tue Jun 06 17:11:11 2017 +0200 @@ -0,0 +1,46 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_content.shared.form.interfaces import IFormsManager, FORM_CONTENT_TYPE +from zope.annotation.interfaces import IAttributeAnnotatable +from zope.component.interfaces import ISite +from zope.lifecycleevent.interfaces import IObjectAddedEvent + +# import packages +from pyams_content.shared.common.manager import SharedTool +from pyams_content.shared.form import Form +from pyams_utils.traversing import get_parent +from pyramid.events import subscriber +from zope.interface import implementer + + +@implementer(IFormsManager, IAttributeAnnotatable) +class FormsManager(SharedTool): + """Forms manager class""" + + shared_content_type = FORM_CONTENT_TYPE + shared_content_factory = Form + + +@subscriber(IObjectAddedEvent, context_selector=IFormsManager) +def handle_added_forms_manager(event): + """Register forms manager when added""" + site = get_parent(event.newParent, ISite) + registry = site.getSiteManager() + if registry is not None: + registry.registerUtility(event.object, IFormsManager) diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content/shared/view/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/view/__init__.py Tue Jun 06 17:11:11 2017 +0200 @@ -0,0 +1,47 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_content.component.links.interfaces import ILinkContainerTarget +from pyams_content.shared.view.interfaces import IWfView, IView, VIEW_CONTENT_TYPE, VIEW_CONTENT_NAME + +# import packages +from pyams_content.shared.common import WfSharedContent, register_content_type, SharedContent +from zope.interface import implementer +from zope.schema.fieldproperty import FieldProperty + + +@implementer(IWfView) +class WfView(WfSharedContent): + """Base view""" + + content_type = VIEW_CONTENT_TYPE + content_name = VIEW_CONTENT_NAME + + selected_content_types = FieldProperty(IWfView['selected_content_types']) + order_by = FieldProperty(IWfView['order_by']) + reversed_order =FieldProperty(IWfView['reversed_order']) + +register_content_type(WfView) + + +@implementer(IView) +class View(SharedContent): + """Workflow managed view class""" + + content_class = WfView diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content/shared/view/interfaces/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/view/interfaces/__init__.py Tue Jun 06 17:11:11 2017 +0200 @@ -0,0 +1,99 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_content.shared.common.interfaces import ISharedContent, IWfSharedContent, ISharedTool + +# import packages +from pyams_sequence.schema import InternalReferencesList +from zope.interface import Interface, Attribute +from zope.schema import List, Choice, Bool +from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm + +from pyams_content import _ + + +VIEW_CONTENT_TYPE = 'view' +VIEW_CONTENT_NAME = _('View') + + +CREATION_DATE_ORDER = 'creation_datetime' +UPDATE_DATE_ORDER = 'update_datetime' +PUBLICATION_DATE_ORDER = 'publication_datetime' +FIRSTPUBLICATION_DATE_ORDER = 'first_publication_datetime' + +VIEW_ORDER = {CREATION_DATE_ORDER: _("Creation date"), + UPDATE_DATE_ORDER: _("Last update date"), + PUBLICATION_DATE_ORDER: _("Current publication date"), + FIRSTPUBLICATION_DATE_ORDER: _("First publication date")} + +VIEW_ORDER_VOCABULARY = SimpleVocabulary([SimpleTerm(v, title=t) + for v, t in VIEW_ORDER.items()]) + + +class IViewsManager(ISharedTool): + """Views manager interface""" + + +class IWfView(IWfSharedContent): + """View interface""" + + selected_content_types = List(title=_("Content types"), + description=_("Selected content types; leave empty for all"), + value_type=Choice(vocabulary='PyAMS content types'), + required=False) + + order_by = Choice(title=_("Order by"), + description=_("Property to use to sort results"), + required=True, + vocabulary=VIEW_ORDER_VOCABULARY, + default=FIRSTPUBLICATION_DATE_ORDER) + + reversed_order = Bool(title=_("Reversed order?"), + description=_("If 'yes', items order will be reversed"), + required=True, + default=True) + + +class IView(ISharedContent): + """Workflow managed view interface""" + + +class IViewExtension(Interface): + """View query extension interface + + This interface is used to add features to views from external packages + """ + + def get_params(self, context): + """Add params to catalog query""" + + weight = Attribute("Extension weight") + + def filter(self, context, items): + """Filter items after catalog query""" + + +VIEW_REFERENCES_SETTINGS_KEY = 'pyams_content.view.references' + + +class IViewInternalReferencesSettings(Interface): + """View internal references settings""" + + references = InternalReferencesList(title=_("Internal references"), + description=_("List of internal references"), + required=False) diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content/shared/view/manager.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/view/manager.py Tue Jun 06 17:11:11 2017 +0200 @@ -0,0 +1,46 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_content.shared.view.interfaces import IViewsManager, VIEW_CONTENT_TYPE +from zope.annotation.interfaces import IAttributeAnnotatable +from zope.component.interfaces import ISite +from zope.lifecycleevent.interfaces import IObjectAddedEvent + +# import packages +from pyams_content.shared.common.manager import SharedTool +from pyams_content.shared.view import View +from pyams_utils.traversing import get_parent +from pyramid.events import subscriber +from zope.interface import implementer + + +@implementer(IViewsManager, IAttributeAnnotatable) +class ViewsManager(SharedTool): + """Views manager class""" + + shared_content_type = VIEW_CONTENT_TYPE + shared_content_factory = View + + +@subscriber(IObjectAddedEvent, context_selector=IViewsManager) +def handle_added_views_manager(event): + """Register views manager when added""" + site = get_parent(event.newParent, ISite) + registry = site.getSiteManager() + if registry is not None: + registry.registerUtility(event.object, IViewsManager) diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content/shared/view/reference.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/view/reference.py Tue Jun 06 17:11:11 2017 +0200 @@ -0,0 +1,63 @@ +# +# Copyright (c) 2008-2017 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library +from persistent import Persistent + +# import interfaces +from pyams_content.shared.view.interfaces import IViewInternalReferencesSettings, IWfView, VIEW_REFERENCES_SETTINGS_KEY, \ + IViewExtension +from zope.annotation.interfaces import IAnnotations + +# import packages +from pyams_utils.adapter import adapter_config, ContextAdapter +from pyramid.threadlocal import get_current_registry +from zope.container.contained import Contained +from zope.interface import implementer +from zope.lifecycleevent import ObjectCreatedEvent +from zope.location import locate +from zope.schema.fieldproperty import FieldProperty + + +@implementer(IViewInternalReferencesSettings) +class ViewInternalReferencesSettings(Persistent, Contained): + """View internal references settings""" + + references = FieldProperty(IViewInternalReferencesSettings['references']) + + +@adapter_config(context=IWfView, provides=IViewInternalReferencesSettings) +def ViewInternalReferencesSettingsFactory(view): + """View internal references settings factory""" + annotations = IAnnotations(view) + settings = annotations.get(VIEW_REFERENCES_SETTINGS_KEY) + if settings is None: + settings = annotations[VIEW_REFERENCES_SETTINGS_KEY] = ViewInternalReferencesSettings() + get_current_registry().notify(ObjectCreatedEvent(settings)) + locate(settings, view, '++view:references++') + return settings + + +@adapter_config(name='references', context=IWfView, provides=IViewExtension) +class ViewInternalReferencesExtension(ContextAdapter): + """View internal references extension""" + + def get_param(self, context): + pass + + weight = 999 + + def filter(self, context, items): + return items diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content/shared/view/zmi/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/view/zmi/__init__.py Tue Jun 06 17:11:11 2017 +0200 @@ -0,0 +1,79 @@ +# +# Copyright (c) 2008-2017 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_content.interfaces import CREATE_CONTENT_PERMISSION +from pyams_content.shared.view.interfaces import IWfView, IViewsManager +from pyams_i18n.interfaces import II18n +from pyams_skin.interfaces import IContentTitle +from pyams_skin.interfaces.viewlet import IMenuHeader, IWidgetTitleViewletManager +from pyams_skin.layer import IPyAMSLayer +from pyams_zmi.layer import IAdminLayer + +# import packages +from pyams_content.shared.common.zmi import SharedContentAddForm, SharedContentAJAXAddForm +from pyams_pagelet.pagelet import pagelet_config +from pyams_skin.viewlet.toolbar import ToolbarAction +from pyams_utils.adapter import adapter_config, ContextRequestAdapter, ContextRequestViewAdapter +from pyams_viewlet.viewlet import viewlet_config +from pyams_zmi.interfaces.menu import IContentManagementMenu +from pyramid.view import view_config +from zope.interface import Interface + +from pyams_content import _ + + +@adapter_config(context=(IWfView, IContentManagementMenu), provides=IMenuHeader) +class ViewContentMenuHeader(ContextRequestAdapter): + """View menu header adapter""" + + header = _("This view") + + +@adapter_config(context=(IWfView, IPyAMSLayer, Interface), provides=IContentTitle) +class ViewTitleAdapter(ContextRequestViewAdapter): + """View title adapter""" + + @property + def title(self): + translate = self.request.localizer.translate + return translate(_("View « {title} »")).format( + title=II18n(self.context).query_attribute('title', request=self.request)) + + +@viewlet_config(name='add-shared-content.action', context=IViewsManager, layer=IAdminLayer, view=Interface, + manager=IWidgetTitleViewletManager, permission=CREATE_CONTENT_PERMISSION, weight=1) +class ViewAddAction(ToolbarAction): + """View adding action""" + + label = _("Add view") + url = 'add-shared-content.html' + modal_target = True + + +@pagelet_config(name='add-shared-content.html', context=IViewsManager, layer=IPyAMSLayer, + permission=CREATE_CONTENT_PERMISSION) +class ViewAddForm(SharedContentAddForm): + """View add form""" + + legend = _("Add view") + + +@view_config(name='add-shared-content.json', context=IViewsManager, request_type=IPyAMSLayer, + permission=CREATE_CONTENT_PERMISSION, renderer='json', xhr=True) +class ViewAJAXAddForm(SharedContentAJAXAddForm, ViewAddForm): + """View add form, JSON renderer""" diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content/shared/view/zmi/properties.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/view/zmi/properties.py Tue Jun 06 17:11:11 2017 +0200 @@ -0,0 +1,41 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_content.shared.view.interfaces import IWfView +from pyams_form.interfaces.form import IInnerSubForm +from pyams_skin.layer import IPyAMSLayer + +# import packages +from pyams_content.shared.common.zmi.properties import SharedContentPropertiesEditForm +from pyams_utils.adapter import adapter_config +from pyams_zmi.form import InnerAdminEditForm +from z3c.form import field + +from pyams_content import _ + + +@adapter_config(name='publication', + context=(IWfView, IPyAMSLayer, SharedContentPropertiesEditForm), + provides=IInnerSubForm) +class ViewPropertiesEditForm(InnerAdminEditForm): + """View properties edit form extension""" + + legend = _("Contents search settings") + fieldset_class = 'bordered no-x-margin margin-y-10' + + fields = field.Fields(IWfView).select('selected_content_types', 'order_by', 'reversed_order') diff -r bebdf1365369 -r 3e37d4dd8e3b src/pyams_content/shared/view/zmi/reference.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/view/zmi/reference.py Tue Jun 06 17:11:11 2017 +0200 @@ -0,0 +1,88 @@ +# +# Copyright (c) 2008-2017 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION +from pyams_content.shared.view.interfaces import IWfView, IViewInternalReferencesSettings +from pyams_form.interfaces.form import IWidgetForm +from pyams_skin.interfaces import IInnerPage +from pyams_skin.layer import IPyAMSLayer +from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION +from pyams_zmi.interfaces.menu import IPropertiesMenu +from pyams_zmi.layer import IAdminLayer +from z3c.form.interfaces import INPUT_MODE + +# import packages +from pyams_form.form import AJAXEditForm +from pyams_form.schema import ResetButton +from pyams_pagelet.pagelet import pagelet_config +from pyams_skin.viewlet.menu import MenuItem, MenuDivider +from pyams_viewlet.viewlet import viewlet_config +from pyams_zmi.form import AdminEditForm +from pyramid.view import view_config +from z3c.form import field, button +from zope.interface import Interface, implementer + +from pyams_content import _ + + +@viewlet_config(name='references.divider', context=IWfView, layer=IAdminLayer, + manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=289) +class ReferencesMenuDivider(MenuDivider): + """References menu divider""" + + +@viewlet_config(name='references.menu', context=IWfView, layer=IAdminLayer, + manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=290) +class ReferencesMenu(MenuItem): + """References menu""" + + label = _("References...") + icon_class = 'fa-link' + url = '#references.html' + + +class IReferencesEditButtons(Interface): + """References settings form buttons""" + + reset = ResetButton(name='reset', title=_("Reset")) + submit = button.Button(name='submit', title=_("Submit")) + + +@pagelet_config(name='references.html', context=IWfView, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION) +@implementer(IWidgetForm, IInnerPage) +class ReferencesEditForm(AdminEditForm): + """References settings edit form""" + + legend = _("View internal references settings") + + fields = field.Fields(IViewInternalReferencesSettings) + + @property + def buttons(self): + if self.mode == INPUT_MODE: + return button.Buttons(IReferencesEditButtons) + else: + return button.Buttons(Interface) + + ajax_handler = 'references.json' + + +@view_config(name='references.json', context=IWfView, request_type=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True) +class ReferencesAJAXEditForm(AJAXEditForm, ReferencesEditForm): + """References settings edit form, JSON renderer"""