# HG changeset patch # User Thierry Florac # Date 1484923371 -3600 # Node ID 8c5bbc396670bfe80e4ce7132d5daa32a66f1168 # Parent cf21b8cd6e74faf3e7b91cc4803d1bb5386cbf36 Added ImageMap content type diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/generations/__init__.py --- a/src/pyams_content/generations/__init__.py Fri Jan 20 15:41:23 2017 +0100 +++ b/src/pyams_content/generations/__init__.py Fri Jan 20 15:42:51 2017 +0100 @@ -9,6 +9,7 @@ # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # +from pyams_content.shared.imagemap.manager import ImageMapsManager __docformat__ = 'restructuredtext' @@ -139,3 +140,17 @@ registry.notify(ObjectCreatedEvent(tool)) tools_manager[news_tool_name] = tool tools_configuration.news_tool_name = news_tool_name + # check image maps shared tool + factory = registry.settings.get('pyams_content.config.imagemaps_tool_factory') + if (factory is None) or (factory.upper() not in ('NONE', '--')): + maps_tool_name = tools_configuration.imagemaps_tool_name or \ + registry.settings.get('pyams_content.config.imagemaps_tool_name', 'imgmaps') + if maps_tool_name not in tools_manager: + if factory is not None: + factory = DottedNameResolver().resolve(factory) + else: + factory = ImageMapsManager + tool = factory() + registry.notify(ObjectCreatedEvent(tool)) + tools_manager[maps_tool_name] = tool + tools_configuration.imagemaps_tool_name = maps_tool_name diff -r cf21b8cd6e74 -r 8c5bbc396670 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 cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po --- a/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po Fri Jan 20 15:41:23 2017 +0100 +++ b/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po Fri Jan 20 15:42:51 2017 +0100 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE 1.0\n" -"POT-Creation-Date: 2016-08-09 17:26+0200\n" +"POT-Creation-Date: 2017-01-20 15:26+0100\n" "PO-Revision-Date: 2015-09-10 10:42+0200\n" "Last-Translator: Thierry Florac \n" "Language-Team: French\n" @@ -85,7 +85,7 @@ msgid "Add new images gallery" msgstr "Ajouter une galerie d'images" -#: src/pyams_content/component/gallery/zmi/__init__.py:159 +#: src/pyams_content/component/gallery/zmi/__init__.py:161 msgid "Update gallery properties" msgstr "Propriétés de la galerie d'images" @@ -108,10 +108,11 @@ #: src/pyams_content/component/extfile/interfaces/__init__.py:41 #: src/pyams_content/component/paragraph/zmi/container.py:252 #: src/pyams_content/component/paragraph/interfaces/__init__.py:46 -#: src/pyams_content/component/links/zmi/container.py:145 +#: 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/templates/advanced-search.pt:188 +#: src/pyams_content/shared/imagemap/zmi/container.py:118 #: src/pyams_content/interfaces/__init__.py:54 msgid "Title" msgstr "Titre" @@ -138,21 +139,22 @@ msgid "Add image(s)" msgstr "Ajouter des images" -#: src/pyams_content/component/gallery/zmi/gallery.py:183 -#: src/pyams_content/component/extfile/zmi/__init__.py:186 +#: src/pyams_content/component/gallery/zmi/gallery.py:184 +#: src/pyams_content/component/extfile/zmi/__init__.py:188 msgid "Update image properties" msgstr "Modifier les propriétés d'une image" -#: src/pyams_content/component/gallery/zmi/gallery.py:220 +#: src/pyams_content/component/gallery/zmi/gallery.py:224 msgid "Remove image..." msgstr "Supprimer l'image..." -#: src/pyams_content/component/gallery/zmi/gallery.py:235 +#: src/pyams_content/component/gallery/zmi/gallery.py:239 #: src/pyams_content/shared/zmi/sites.py:124 +#: src/pyams_content/shared/imagemap/zmi/container.py:149 msgid "No provided object_name argument!" msgstr "Argument 'object_name' non fourni !" -#: src/pyams_content/component/gallery/zmi/gallery.py:239 +#: src/pyams_content/component/gallery/zmi/gallery.py:243 msgid "Given image name doesn't exist!" msgstr "L'image spécifiée n'existe pas !" @@ -266,19 +268,20 @@ msgid "List of images galleries linked to this object" msgstr "Liste des galeries d'images associées à cet objet" -#: src/pyams_content/component/extfile/__init__.py:111 +#: src/pyams_content/component/extfile/__init__.py:109 msgid "Standard file" msgstr "Fichier standard" -#: src/pyams_content/component/extfile/__init__.py:120 +#: src/pyams_content/component/extfile/__init__.py:118 +#: src/pyams_content/shared/imagemap/interfaces/__init__.py:59 msgid "Image" msgstr "Image" -#: src/pyams_content/component/extfile/__init__.py:129 +#: src/pyams_content/component/extfile/__init__.py:127 msgid "Video" msgstr "Vidéo" -#: src/pyams_content/component/extfile/__init__.py:138 +#: src/pyams_content/component/extfile/__init__.py:136 msgid "Audio file" msgstr "Fichier audio" @@ -291,7 +294,7 @@ msgid "Add new external file" msgstr "Ajouter un fichier joint" -#: src/pyams_content/component/extfile/zmi/__init__.py:153 +#: src/pyams_content/component/extfile/zmi/__init__.py:154 msgid "Update file properties" msgstr "Modifier les propriétés d'un fichier" @@ -373,6 +376,7 @@ msgstr "Liste des fichiers joints associés à cet objet" #: src/pyams_content/component/paragraph/zmi/summary.py:46 +#: src/pyams_content/shared/imagemap/zmi/summary.py:44 msgid "Quick preview" msgstr "Aperçu" @@ -448,11 +452,11 @@ msgid "Add new HTML paragraph" msgstr "Ajouter un paragraphe HTML" -#: src/pyams_content/component/paragraph/zmi/html.py:111 +#: src/pyams_content/component/paragraph/zmi/html.py:112 msgid "Edit HTML paragraph properties" msgstr "Modifier les propriétés d'un paragraphe HTML" -#: src/pyams_content/component/paragraph/zmi/html.py:135 +#: src/pyams_content/component/paragraph/zmi/html.py:137 msgid "HTML paragraph" msgstr "Paragraphe HTML" @@ -514,31 +518,31 @@ msgid "Add new internal link" msgstr "Ajouter un lien interne" -#: src/pyams_content/component/links/zmi/__init__.py:122 +#: src/pyams_content/component/links/zmi/__init__.py:123 msgid "Edit internal link properties" msgstr "Modifier les propriétés d'un lien interne" -#: src/pyams_content/component/links/zmi/__init__.py:157 +#: src/pyams_content/component/links/zmi/__init__.py:159 msgid "Add external link" msgstr "Ajouter un lien externe" -#: src/pyams_content/component/links/zmi/__init__.py:169 +#: src/pyams_content/component/links/zmi/__init__.py:171 msgid "Add new external link" msgstr "Ajouter un lien externe" -#: src/pyams_content/component/links/zmi/__init__.py:227 +#: src/pyams_content/component/links/zmi/__init__.py:230 msgid "Edit external link properties" msgstr "Modifier les propriétés d'un lien externe" -#: src/pyams_content/component/links/zmi/__init__.py:263 +#: src/pyams_content/component/links/zmi/__init__.py:267 msgid "Add mailto link" msgstr "Ajouter un lien « mailto »" -#: src/pyams_content/component/links/zmi/__init__.py:275 +#: src/pyams_content/component/links/zmi/__init__.py:279 msgid "Add new mailto link" msgstr "Ajouter un lien « mailto »" -#: src/pyams_content/component/links/zmi/__init__.py:333 +#: src/pyams_content/component/links/zmi/__init__.py:338 msgid "Edit mailto link properties" msgstr "Modifier les propriétés d'un lien « mailto »" @@ -546,19 +550,20 @@ msgid "Useful links..." msgstr "Liens utiles..." -#: src/pyams_content/component/links/zmi/container.py:100 +#: src/pyams_content/component/links/zmi/container.py:116 msgid "Useful links list" msgstr "Liste des liens utiles" -#: src/pyams_content/component/links/zmi/container.py:157 +#: src/pyams_content/component/links/zmi/container.py:173 +#: src/pyams_content/shared/imagemap/interfaces/__init__.py:46 msgid "Link target" msgstr "Cible du lien" -#: src/pyams_content/component/links/zmi/container.py:200 +#: src/pyams_content/component/links/zmi/container.py:216 msgid "Edit useful links links" -msgstr "LIens utiles associés" - -#: src/pyams_content/component/links/zmi/container.py:137 +msgstr "Liens utiles associés" + +#: src/pyams_content/component/links/zmi/container.py:153 msgid "No currently defined link." msgstr "Aucun lien utile asocié à ce contenu." @@ -571,14 +576,17 @@ msgstr "Liens internes vers ce contenu" #: src/pyams_content/component/links/zmi/templates/widget-input.pt:12 +#: src/pyams_content/component/links/zmi/templates/widget-list-input.pt:12 msgid "Add internal link..." msgstr "Ajouter un lien interne..." #: src/pyams_content/component/links/zmi/templates/widget-input.pt:19 +#: src/pyams_content/component/links/zmi/templates/widget-list-input.pt:19 msgid "Add external link..." msgstr "Ajouter un lien externe..." #: src/pyams_content/component/links/zmi/templates/widget-input.pt:26 +#: src/pyams_content/component/links/zmi/templates/widget-list-input.pt:26 msgid "Add mailto link..." msgstr "Ajouter un lien « mailto »..." @@ -654,7 +662,7 @@ msgid "Advanced search" msgstr "Recherche avancée" -#: src/pyams_content/shared/common/zmi/search.py:225 +#: src/pyams_content/shared/common/zmi/search.py:226 msgid "Advanced search results" msgstr "Résultats de la recherche avancée" @@ -717,7 +725,7 @@ #: src/pyams_content/shared/common/zmi/workflow.py:677 #: src/pyams_content/shared/common/zmi/workflow.py:723 #: src/pyams_content/shared/common/zmi/workflow.py:776 -#: src/pyams_content/shared/common/zmi/__init__.py:247 +#: src/pyams_content/shared/common/zmi/__init__.py:249 #: src/pyams_content/shared/common/zmi/owner.py:74 #: src/pyams_content/shared/common/zmi/review.py:90 msgid "Cancel" @@ -807,28 +815,28 @@ msgid "{state} {date}" msgstr "{state} {date}" -#: src/pyams_content/shared/common/zmi/__init__.py:237 +#: src/pyams_content/shared/common/zmi/__init__.py:239 msgid "Duplicate content..." msgstr "Dupliquer le contenu..." -#: src/pyams_content/shared/common/zmi/__init__.py:256 +#: src/pyams_content/shared/common/zmi/__init__.py:258 msgid "Duplicate content" msgstr "Dupliquer ce contenu" -#: src/pyams_content/shared/common/zmi/__init__.py:79 +#: src/pyams_content/shared/common/zmi/__init__.py:80 msgid "This title can be modified afterwards" msgstr "Le titre pourra être modifié ultérieurement" -#: src/pyams_content/shared/common/zmi/__init__.py:248 +#: src/pyams_content/shared/common/zmi/__init__.py:250 msgid "Duplicate this content" msgstr "Dupliquer ce contenu" -#: src/pyams_content/shared/common/zmi/__init__.py:298 +#: src/pyams_content/shared/common/zmi/__init__.py:301 #, python-format msgid "Duplicate content ({oid})" msgstr "Contenu dupliqué ({oid})" -#: src/pyams_content/shared/common/zmi/__init__.py:344 +#: src/pyams_content/shared/common/zmi/__init__.py:347 msgid "Created or modified in this version" msgstr "Créé ou modifié dans cette version" @@ -861,11 +869,11 @@ msgid "Shared tool properties" msgstr "Propriétés de l'outil" -#: src/pyams_content/shared/common/zmi/manager.py:119 +#: src/pyams_content/shared/common/zmi/manager.py:120 msgid "WARNING" msgstr "ATTENTION" -#: src/pyams_content/shared/common/zmi/manager.py:121 +#: src/pyams_content/shared/common/zmi/manager.py:122 msgid "" "Workflow shouldn't be modified if this tool already contains any shared " "content!" @@ -873,11 +881,11 @@ "Le workflow ne devrait pas être modifié si cet outil renferme déjà des " "contenus partagés !" -#: src/pyams_content/shared/common/zmi/manager.py:144 +#: src/pyams_content/shared/common/zmi/manager.py:145 msgid "Content languages" msgstr "Langues proposées" -#: src/pyams_content/shared/common/zmi/manager.py:161 +#: src/pyams_content/shared/common/zmi/manager.py:162 msgid "" "Tool languages are used to translate own tool properties, and newly created " "contents will propose these languages by default" @@ -945,249 +953,249 @@ msgid "Dashboard" msgstr "Tableau de bord" -#: src/pyams_content/shared/common/zmi/dashboard.py:235 +#: src/pyams_content/shared/common/zmi/dashboard.py:234 msgid "Contents dashboard" msgstr "Les contenus qui me concernent" -#: src/pyams_content/shared/common/zmi/dashboard.py:269 +#: src/pyams_content/shared/common/zmi/dashboard.py:268 #: 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:270 +#: src/pyams_content/shared/common/zmi/dashboard.py:269 #: 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:311 +#: src/pyams_content/shared/common/zmi/dashboard.py:310 #: 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:312 +#: src/pyams_content/shared/common/zmi/dashboard.py:311 #: 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:342 +#: src/pyams_content/shared/common/zmi/dashboard.py:341 #: 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:381 +#: src/pyams_content/shared/common/zmi/dashboard.py:380 #: src/pyams_content/root/zmi/__init__.py:254 msgid "My contents" msgstr "Tous mes contenus" -#: src/pyams_content/shared/common/zmi/dashboard.py:396 +#: src/pyams_content/shared/common/zmi/dashboard.py:395 #: src/pyams_content/root/zmi/__init__.py:269 msgid "My favorites" msgstr "Mes favoris" -#: src/pyams_content/shared/common/zmi/dashboard.py:405 +#: src/pyams_content/shared/common/zmi/dashboard.py:404 #: 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:406 +#: src/pyams_content/shared/common/zmi/dashboard.py:405 #: 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:418 +#: src/pyams_content/shared/common/zmi/dashboard.py:417 #: src/pyams_content/shared/common/zmi/templates/header.pt:24 msgid "Add/remove from favorites" msgstr "Ajouter/enlever des favoris" -#: src/pyams_content/shared/common/zmi/dashboard.py:479 +#: src/pyams_content/shared/common/zmi/dashboard.py:477 #: src/pyams_content/root/zmi/__init__.py:315 msgid "Your favorites" msgstr "Mes favoris" -#: src/pyams_content/shared/common/zmi/dashboard.py:492 +#: src/pyams_content/shared/common/zmi/dashboard.py:490 #: src/pyams_content/root/zmi/__init__.py:328 msgid "My preparations" msgstr "Mes préparations" -#: src/pyams_content/shared/common/zmi/dashboard.py:501 +#: src/pyams_content/shared/common/zmi/dashboard.py:499 #: 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:502 +#: src/pyams_content/shared/common/zmi/dashboard.py:500 #: 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:541 +#: src/pyams_content/shared/common/zmi/dashboard.py:538 #: 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:554 +#: src/pyams_content/shared/common/zmi/dashboard.py:551 #: src/pyams_content/root/zmi/__init__.py:388 msgid "My submissions" msgstr "Mes soumissions" -#: src/pyams_content/shared/common/zmi/dashboard.py:563 +#: src/pyams_content/shared/common/zmi/dashboard.py:560 #: 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:564 +#: src/pyams_content/shared/common/zmi/dashboard.py:561 #: 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:603 +#: src/pyams_content/shared/common/zmi/dashboard.py:599 #: 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:616 +#: src/pyams_content/shared/common/zmi/dashboard.py:612 #: src/pyams_content/root/zmi/__init__.py:448 msgid "My publications" msgstr "Mes publications" -#: src/pyams_content/shared/common/zmi/dashboard.py:625 +#: src/pyams_content/shared/common/zmi/dashboard.py:621 #: 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:626 +#: src/pyams_content/shared/common/zmi/dashboard.py:622 #: 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:665 +#: src/pyams_content/shared/common/zmi/dashboard.py:660 #: 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:678 +#: src/pyams_content/shared/common/zmi/dashboard.py:673 #: 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:687 +#: src/pyams_content/shared/common/zmi/dashboard.py:682 #: 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:688 +#: src/pyams_content/shared/common/zmi/dashboard.py:683 #: 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:728 +#: src/pyams_content/shared/common/zmi/dashboard.py:722 #: 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:741 +#: src/pyams_content/shared/common/zmi/dashboard.py:735 #: 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:750 +#: src/pyams_content/shared/common/zmi/dashboard.py:744 #: 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:751 +#: src/pyams_content/shared/common/zmi/dashboard.py:745 #: 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:797 +#: src/pyams_content/shared/common/zmi/dashboard.py:790 #: 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:811 +#: src/pyams_content/shared/common/zmi/dashboard.py:804 #: src/pyams_content/root/zmi/__init__.py:637 msgid "Other interventions" msgstr "Toutes les interventions" -#: src/pyams_content/shared/common/zmi/dashboard.py:826 +#: src/pyams_content/shared/common/zmi/dashboard.py:819 #: src/pyams_content/root/zmi/__init__.py:652 msgid "Last publications" msgstr "Dernières publications" -#: src/pyams_content/shared/common/zmi/dashboard.py:835 +#: src/pyams_content/shared/common/zmi/dashboard.py:828 #: 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:881 +#: src/pyams_content/shared/common/zmi/dashboard.py:873 #: 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:894 +#: src/pyams_content/shared/common/zmi/dashboard.py:886 #: src/pyams_content/root/zmi/__init__.py:718 msgid "Last updates" msgstr "Dernières modifications" -#: src/pyams_content/shared/common/zmi/dashboard.py:903 +#: src/pyams_content/shared/common/zmi/dashboard.py:895 #: 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:947 +#: src/pyams_content/shared/common/zmi/dashboard.py:938 #: 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:347 +#: src/pyams_content/shared/common/zmi/dashboard.py:346 #: 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:349 +#: src/pyams_content/shared/common/zmi/dashboard.py:348 #: 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:840 +#: src/pyams_content/shared/common/zmi/dashboard.py:833 #: 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:842 +#: src/pyams_content/shared/common/zmi/dashboard.py:835 #: 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:908 +#: src/pyams_content/shared/common/zmi/dashboard.py:900 #: 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:910 +#: src/pyams_content/shared/common/zmi/dashboard.py:902 #: 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" @@ -1200,11 +1208,11 @@ msgid "Content review request" msgstr "Demande de relecture" -#: src/pyams_content/shared/common/zmi/review.py:158 +#: src/pyams_content/shared/common/zmi/review.py:159 msgid "Comments" msgstr "Commentaires" -#: src/pyams_content/shared/common/zmi/review.py:178 +#: src/pyams_content/shared/common/zmi/review.py:179 msgid "Review comments" msgstr "Commentaires des relecteurs" @@ -1244,16 +1252,16 @@ msgid "Ask for content review" msgstr "Demander la relecture" -#: src/pyams_content/shared/common/zmi/review.py:144 +#: src/pyams_content/shared/common/zmi/review.py:145 msgid "Request successful. No new notification have been sent" msgstr "" "Votre demande a été transmise. Aucune nouvelle notification n'a été envoyée." -#: src/pyams_content/shared/common/zmi/review.py:248 +#: src/pyams_content/shared/common/zmi/review.py:249 msgid "Message is mandatory!" msgstr "Un commentaire est obligatoire !" -#: src/pyams_content/shared/common/zmi/review.py:138 +#: src/pyams_content/shared/common/zmi/review.py:139 #, python-format msgid "Request successful. {count} new notification(s) have been sent" msgstr "Votre demande a été transmise. {count} notification(s) envoyée(s)." @@ -1849,6 +1857,96 @@ "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/imagemap/zmi/properties.py:38 +msgid "Background image" +msgstr "Image de fond" + +#: src/pyams_content/shared/imagemap/zmi/__init__.py:44 +msgid "This image map" +msgstr "Cette image" + +#: src/pyams_content/shared/imagemap/zmi/__init__.py:63 +msgid "Add image map" +msgstr "Ajouter une image" + +#: src/pyams_content/shared/imagemap/zmi/__init__.py:73 +msgid "Adding image map" +msgstr "Ajout d'une image" + +#: src/pyams_content/shared/imagemap/zmi/__init__.py:54 +#, python-format +msgid "Image map « {title} »" +msgstr "Article de blog « {title} »" + +#: src/pyams_content/shared/imagemap/zmi/container.py:53 +msgid "Image areas" +msgstr "Zones de l'image" + +#: src/pyams_content/shared/imagemap/zmi/container.py:64 +#: src/pyams_content/shared/imagemap/interfaces/__init__.py:63 +msgid "Image map areas" +msgstr "Zones cliquables de l'images" + +#: src/pyams_content/shared/imagemap/zmi/container.py:108 +msgid "No currently defined image." +msgstr "Aucun image de fond n'est actuellement définie." + +#: src/pyams_content/shared/imagemap/zmi/container.py:110 +msgid "No currently defined area." +msgstr "Aucune zone cliquable n'est actuellement définie." + +#: src/pyams_content/shared/imagemap/zmi/container.py:160 +msgid "Given area name doesn't exist!" +msgstr "La zone indiquée n'existe pas !" + +#: src/pyams_content/shared/imagemap/zmi/container.py:156 +msgid "Bad query object_name parameter value!" +msgstr "Valeur incorrecte du paramètre object_name !" + +#: src/pyams_content/shared/imagemap/zmi/area.py:46 +msgid "Add image area" +msgstr "Ajouter une zone" + +#: src/pyams_content/shared/imagemap/zmi/area.py:64 +msgid "Add new image area" +msgstr "Ajout d'une zone cliquable" + +#: src/pyams_content/shared/imagemap/zmi/area.py:94 +msgid "Edit image map properties" +msgstr "Modifier les propriétés d'une image" + +#: src/pyams_content/shared/imagemap/interfaces/__init__.py:32 +msgid "Image map" +msgstr "Image cliquable" + +#: src/pyams_content/shared/imagemap/interfaces/__init__.py:42 +msgid "Area title" +msgstr "Titre de la zone" + +#: src/pyams_content/shared/imagemap/interfaces/__init__.py:43 +msgid "Label associated with this area" +msgstr "Libellé associé à cette zone" + +#: src/pyams_content/shared/imagemap/interfaces/__init__.py:47 +msgid "Internal or external link associated with this map area" +msgstr "Lien interne ou externe associé à cette zone" + +#: src/pyams_content/shared/imagemap/interfaces/__init__.py:51 +msgid "Map area coordinates" +msgstr "Coordonnées" + +#: src/pyams_content/shared/imagemap/interfaces/__init__.py:52 +msgid "List of coordinates of image area" +msgstr "Positionnement de la zone cliquable sur l'image" + +#: src/pyams_content/shared/imagemap/interfaces/__init__.py:60 +msgid "Image supporting map areas" +msgstr "Sélection de l'image qui supportera les zones cliquables" + +#: src/pyams_content/shared/imagemap/interfaces/__init__.py:64 +msgid "List of defined map areas" +msgstr "Liste des zones cliquables définies sur l'image" + #: src/pyams_content/shared/blog/zmi/__init__.py:50 msgid "This blog post" msgstr "Cet article" @@ -2300,9 +2398,6 @@ #~ msgid "Illustration properties" #~ msgstr "Propriétés d'une illustration" -#~ msgid "Edit paragraph properties" -#~ msgstr "Modifier les propriétés d'un paragraphe" - #~ msgid "{date} by {principal}" #~ msgstr "{date} par {principal}" diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/locales/pyams_content.pot --- a/src/pyams_content/locales/pyams_content.pot Fri Jan 20 15:41:23 2017 +0100 +++ b/src/pyams_content/locales/pyams_content.pot Fri Jan 20 15:42:51 2017 +0100 @@ -1,12 +1,12 @@ # # SOME DESCRIPTIVE TITLE # This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , 2016. +# FIRST AUTHOR , 2017. #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE 1.0\n" -"POT-Creation-Date: 2016-08-09 17:26+0200\n" +"POT-Creation-Date: 2017-01-20 15:26+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" @@ -86,7 +86,7 @@ msgid "Add new images gallery" msgstr "" -#: ./src/pyams_content/component/gallery/zmi/__init__.py:159 +#: ./src/pyams_content/component/gallery/zmi/__init__.py:161 msgid "Update gallery properties" msgstr "" @@ -109,10 +109,11 @@ #: ./src/pyams_content/component/extfile/interfaces/__init__.py:41 #: ./src/pyams_content/component/paragraph/zmi/container.py:252 #: ./src/pyams_content/component/paragraph/interfaces/__init__.py:46 -#: ./src/pyams_content/component/links/zmi/container.py:145 +#: ./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/templates/advanced-search.pt:188 +#: ./src/pyams_content/shared/imagemap/zmi/container.py:118 #: ./src/pyams_content/interfaces/__init__.py:54 msgid "Title" msgstr "" @@ -139,21 +140,22 @@ msgid "Add image(s)" msgstr "" -#: ./src/pyams_content/component/gallery/zmi/gallery.py:183 -#: ./src/pyams_content/component/extfile/zmi/__init__.py:186 +#: ./src/pyams_content/component/gallery/zmi/gallery.py:184 +#: ./src/pyams_content/component/extfile/zmi/__init__.py:188 msgid "Update image properties" msgstr "" -#: ./src/pyams_content/component/gallery/zmi/gallery.py:220 +#: ./src/pyams_content/component/gallery/zmi/gallery.py:224 msgid "Remove image..." msgstr "" -#: ./src/pyams_content/component/gallery/zmi/gallery.py:235 -#: ./src/pyams_content/shared/zmi/sites.py:124 -msgid "No provided object_name argument!" -msgstr "" - #: ./src/pyams_content/component/gallery/zmi/gallery.py:239 +#: ./src/pyams_content/shared/zmi/sites.py:124 +#: ./src/pyams_content/shared/imagemap/zmi/container.py:149 +msgid "No provided object_name argument!" +msgstr "" + +#: ./src/pyams_content/component/gallery/zmi/gallery.py:243 msgid "Given image name doesn't exist!" msgstr "" @@ -264,19 +266,20 @@ msgid "List of images galleries linked to this object" msgstr "" -#: ./src/pyams_content/component/extfile/__init__.py:111 +#: ./src/pyams_content/component/extfile/__init__.py:109 msgid "Standard file" msgstr "" -#: ./src/pyams_content/component/extfile/__init__.py:120 +#: ./src/pyams_content/component/extfile/__init__.py:118 +#: ./src/pyams_content/shared/imagemap/interfaces/__init__.py:59 msgid "Image" msgstr "" -#: ./src/pyams_content/component/extfile/__init__.py:129 +#: ./src/pyams_content/component/extfile/__init__.py:127 msgid "Video" msgstr "" -#: ./src/pyams_content/component/extfile/__init__.py:138 +#: ./src/pyams_content/component/extfile/__init__.py:136 msgid "Audio file" msgstr "" @@ -289,7 +292,7 @@ msgid "Add new external file" msgstr "" -#: ./src/pyams_content/component/extfile/zmi/__init__.py:153 +#: ./src/pyams_content/component/extfile/zmi/__init__.py:154 msgid "Update file properties" msgstr "" @@ -369,6 +372,7 @@ msgstr "" #: ./src/pyams_content/component/paragraph/zmi/summary.py:46 +#: ./src/pyams_content/shared/imagemap/zmi/summary.py:44 msgid "Quick preview" msgstr "" @@ -444,11 +448,11 @@ msgid "Add new HTML paragraph" msgstr "" -#: ./src/pyams_content/component/paragraph/zmi/html.py:111 +#: ./src/pyams_content/component/paragraph/zmi/html.py:112 msgid "Edit HTML paragraph properties" msgstr "" -#: ./src/pyams_content/component/paragraph/zmi/html.py:135 +#: ./src/pyams_content/component/paragraph/zmi/html.py:137 msgid "HTML paragraph" msgstr "" @@ -510,31 +514,31 @@ msgid "Add new internal link" msgstr "" -#: ./src/pyams_content/component/links/zmi/__init__.py:122 +#: ./src/pyams_content/component/links/zmi/__init__.py:123 msgid "Edit internal link properties" msgstr "" -#: ./src/pyams_content/component/links/zmi/__init__.py:157 +#: ./src/pyams_content/component/links/zmi/__init__.py:159 msgid "Add external link" msgstr "" -#: ./src/pyams_content/component/links/zmi/__init__.py:169 +#: ./src/pyams_content/component/links/zmi/__init__.py:171 msgid "Add new external link" msgstr "" -#: ./src/pyams_content/component/links/zmi/__init__.py:227 +#: ./src/pyams_content/component/links/zmi/__init__.py:230 msgid "Edit external link properties" msgstr "" -#: ./src/pyams_content/component/links/zmi/__init__.py:263 +#: ./src/pyams_content/component/links/zmi/__init__.py:267 msgid "Add mailto link" msgstr "" -#: ./src/pyams_content/component/links/zmi/__init__.py:275 +#: ./src/pyams_content/component/links/zmi/__init__.py:279 msgid "Add new mailto link" msgstr "" -#: ./src/pyams_content/component/links/zmi/__init__.py:333 +#: ./src/pyams_content/component/links/zmi/__init__.py:338 msgid "Edit mailto link properties" msgstr "" @@ -542,19 +546,20 @@ msgid "Useful links..." msgstr "" -#: ./src/pyams_content/component/links/zmi/container.py:100 +#: ./src/pyams_content/component/links/zmi/container.py:116 msgid "Useful links list" msgstr "" -#: ./src/pyams_content/component/links/zmi/container.py:157 +#: ./src/pyams_content/component/links/zmi/container.py:173 +#: ./src/pyams_content/shared/imagemap/interfaces/__init__.py:46 msgid "Link target" msgstr "" -#: ./src/pyams_content/component/links/zmi/container.py:200 +#: ./src/pyams_content/component/links/zmi/container.py:216 msgid "Edit useful links links" msgstr "" -#: ./src/pyams_content/component/links/zmi/container.py:137 +#: ./src/pyams_content/component/links/zmi/container.py:153 msgid "No currently defined link." msgstr "" @@ -567,14 +572,17 @@ msgstr "" #: ./src/pyams_content/component/links/zmi/templates/widget-input.pt:12 +#: ./src/pyams_content/component/links/zmi/templates/widget-list-input.pt:12 msgid "Add internal link..." msgstr "" #: ./src/pyams_content/component/links/zmi/templates/widget-input.pt:19 +#: ./src/pyams_content/component/links/zmi/templates/widget-list-input.pt:19 msgid "Add external link..." msgstr "" #: ./src/pyams_content/component/links/zmi/templates/widget-input.pt:26 +#: ./src/pyams_content/component/links/zmi/templates/widget-list-input.pt:26 msgid "Add mailto link..." msgstr "" @@ -646,7 +654,7 @@ msgid "Advanced search" msgstr "" -#: ./src/pyams_content/shared/common/zmi/search.py:225 +#: ./src/pyams_content/shared/common/zmi/search.py:226 msgid "Advanced search results" msgstr "" @@ -709,7 +717,7 @@ #: ./src/pyams_content/shared/common/zmi/workflow.py:677 #: ./src/pyams_content/shared/common/zmi/workflow.py:723 #: ./src/pyams_content/shared/common/zmi/workflow.py:776 -#: ./src/pyams_content/shared/common/zmi/__init__.py:247 +#: ./src/pyams_content/shared/common/zmi/__init__.py:249 #: ./src/pyams_content/shared/common/zmi/owner.py:74 #: ./src/pyams_content/shared/common/zmi/review.py:90 msgid "Cancel" @@ -799,28 +807,28 @@ msgid "{state} {date}" msgstr "" -#: ./src/pyams_content/shared/common/zmi/__init__.py:237 +#: ./src/pyams_content/shared/common/zmi/__init__.py:239 msgid "Duplicate content..." msgstr "" -#: ./src/pyams_content/shared/common/zmi/__init__.py:256 +#: ./src/pyams_content/shared/common/zmi/__init__.py:258 msgid "Duplicate content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/__init__.py:79 +#: ./src/pyams_content/shared/common/zmi/__init__.py:80 msgid "This title can be modified afterwards" msgstr "" -#: ./src/pyams_content/shared/common/zmi/__init__.py:248 +#: ./src/pyams_content/shared/common/zmi/__init__.py:250 msgid "Duplicate this content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/__init__.py:298 +#: ./src/pyams_content/shared/common/zmi/__init__.py:301 #, python-format msgid "Duplicate content ({oid})" msgstr "" -#: ./src/pyams_content/shared/common/zmi/__init__.py:344 +#: ./src/pyams_content/shared/common/zmi/__init__.py:347 msgid "Created or modified in this version" msgstr "" @@ -853,21 +861,21 @@ msgid "Shared tool properties" msgstr "" -#: ./src/pyams_content/shared/common/zmi/manager.py:119 +#: ./src/pyams_content/shared/common/zmi/manager.py:120 msgid "WARNING" msgstr "" -#: ./src/pyams_content/shared/common/zmi/manager.py:121 +#: ./src/pyams_content/shared/common/zmi/manager.py:122 msgid "" "Workflow shouldn't be modified if this tool already contains any shared " "content!" msgstr "" -#: ./src/pyams_content/shared/common/zmi/manager.py:144 +#: ./src/pyams_content/shared/common/zmi/manager.py:145 msgid "Content languages" msgstr "" -#: ./src/pyams_content/shared/common/zmi/manager.py:161 +#: ./src/pyams_content/shared/common/zmi/manager.py:162 msgid "" "Tool languages are used to translate own tool properties, and newly created " "contents will propose these languages by default" @@ -928,249 +936,249 @@ msgid "Dashboard" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:235 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:234 msgid "Contents dashboard" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:269 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:268 #: ./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:270 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:269 #: ./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/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/root/zmi/__init__.py:179 -#, python-format -msgid "CONTRIBUTOR - {0} content waiting for action" -msgstr "" - -#: ./src/pyams_content/shared/common/zmi/dashboard.py:312 #: ./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:342 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:341 #: ./src/pyams_content/root/zmi/__init__.py:213 #, python-format msgid "CONTRIBUTOR - {0} modified content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:381 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:380 #: ./src/pyams_content/root/zmi/__init__.py:254 msgid "My contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:396 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:395 #: ./src/pyams_content/root/zmi/__init__.py:269 msgid "My favorites" msgstr "" +#: ./src/pyams_content/shared/common/zmi/dashboard.py:404 +#: ./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/root/zmi/__init__.py:278 -#, python-format -msgid "CONTRIBUTOR - {0} favorite" -msgstr "" - -#: ./src/pyams_content/shared/common/zmi/dashboard.py:406 #: ./src/pyams_content/root/zmi/__init__.py:279 #, python-format msgid "CONTRIBUTOR - {0} favorites" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:418 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:417 #: ./src/pyams_content/shared/common/zmi/templates/header.pt:24 msgid "Add/remove from favorites" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:479 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:477 #: ./src/pyams_content/root/zmi/__init__.py:315 msgid "Your favorites" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:492 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:490 #: ./src/pyams_content/root/zmi/__init__.py:328 msgid "My preparations" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:501 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:499 #: ./src/pyams_content/root/zmi/__init__.py:337 #, python-format msgid "CONTRIBUTOR - {0} prepared content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:502 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:500 #: ./src/pyams_content/root/zmi/__init__.py:338 #, python-format msgid "CONTRIBUTOR - {0} prepared contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:541 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:538 #: ./src/pyams_content/root/zmi/__init__.py:375 msgid "Your prepared contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:554 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:551 #: ./src/pyams_content/root/zmi/__init__.py:388 msgid "My submissions" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:563 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:560 #: ./src/pyams_content/root/zmi/__init__.py:397 #, python-format msgid "CONTRIBUTOR - {0} submitted content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:564 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:561 #: ./src/pyams_content/root/zmi/__init__.py:398 #, python-format msgid "CONTRIBUTOR - {0} submitted contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:603 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:599 #: ./src/pyams_content/root/zmi/__init__.py:435 msgid "Your submitted contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:616 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:612 #: ./src/pyams_content/root/zmi/__init__.py:448 msgid "My publications" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:625 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:621 #: ./src/pyams_content/root/zmi/__init__.py:457 #, python-format msgid "CONTRIBUTOR - {0} published content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:626 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:622 #: ./src/pyams_content/root/zmi/__init__.py:458 #, python-format msgid "CONTRIBUTOR - {0} published contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:665 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:660 #: ./src/pyams_content/root/zmi/__init__.py:495 msgid "Your published contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:678 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:673 #: ./src/pyams_content/root/zmi/__init__.py:508 msgid "My retired contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:687 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:682 #: ./src/pyams_content/root/zmi/__init__.py:517 #, python-format msgid "CONTRIBUTOR - {0} retired content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:688 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:683 #: ./src/pyams_content/root/zmi/__init__.py:518 #, python-format msgid "CONTRIBUTOR - {0} retired contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:728 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:722 #: ./src/pyams_content/root/zmi/__init__.py:556 msgid "Your retired contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:741 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:735 #: ./src/pyams_content/root/zmi/__init__.py:569 msgid "My archived contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:750 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:744 #: ./src/pyams_content/root/zmi/__init__.py:578 #, python-format msgid "CONTRIBUTOR - {0} archived content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:751 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:745 #: ./src/pyams_content/root/zmi/__init__.py:579 #, python-format msgid "CONTRIBUTOR - {0} archived contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:797 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:790 #: ./src/pyams_content/root/zmi/__init__.py:623 msgid "Your archived contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:811 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:804 #: ./src/pyams_content/root/zmi/__init__.py:637 msgid "Other interventions" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:826 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:819 #: ./src/pyams_content/root/zmi/__init__.py:652 msgid "Last publications" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:835 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:828 #: ./src/pyams_content/root/zmi/__init__.py:661 #, python-format msgid "CONTRIBUTORS - {0} published content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:881 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:873 #: ./src/pyams_content/root/zmi/__init__.py:705 msgid "Last published contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:894 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:886 #: ./src/pyams_content/root/zmi/__init__.py:718 msgid "Last updates" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:903 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:895 #: ./src/pyams_content/root/zmi/__init__.py:727 #, python-format msgid "CONTRIBUTORS - {0} updated content" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:947 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:938 #: ./src/pyams_content/root/zmi/__init__.py:769 msgid "Last updated contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:347 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:346 #: ./src/pyams_content/root/zmi/__init__.py:218 #, python-format msgid "CONTRIBUTOR - {0} modified contents" msgstr "" -#: ./src/pyams_content/shared/common/zmi/dashboard.py:349 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:348 #: ./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:840 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:833 #: ./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:842 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:835 #: ./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:908 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:900 #: ./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:910 +#: ./src/pyams_content/shared/common/zmi/dashboard.py:902 #: ./src/pyams_content/root/zmi/__init__.py:734 msgid "CONTRIBUTORS - Last updated contents (in the limit of 50)" msgstr "" @@ -1183,11 +1191,11 @@ msgid "Content review request" msgstr "" -#: ./src/pyams_content/shared/common/zmi/review.py:158 +#: ./src/pyams_content/shared/common/zmi/review.py:159 msgid "Comments" msgstr "" -#: ./src/pyams_content/shared/common/zmi/review.py:178 +#: ./src/pyams_content/shared/common/zmi/review.py:179 msgid "Review comments" msgstr "" @@ -1222,15 +1230,15 @@ msgid "Ask for content review" msgstr "" -#: ./src/pyams_content/shared/common/zmi/review.py:144 +#: ./src/pyams_content/shared/common/zmi/review.py:145 msgid "Request successful. No new notification have been sent" msgstr "" -#: ./src/pyams_content/shared/common/zmi/review.py:248 +#: ./src/pyams_content/shared/common/zmi/review.py:249 msgid "Message is mandatory!" msgstr "" -#: ./src/pyams_content/shared/common/zmi/review.py:138 +#: ./src/pyams_content/shared/common/zmi/review.py:139 #, python-format msgid "Request successful. {count} new notification(s) have been sent" msgstr "" @@ -1744,6 +1752,96 @@ "will still be available via the search engine" msgstr "" +#: ./src/pyams_content/shared/imagemap/zmi/properties.py:38 +msgid "Background image" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/zmi/__init__.py:44 +msgid "This image map" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/zmi/__init__.py:63 +msgid "Add image map" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/zmi/__init__.py:73 +msgid "Adding image map" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/zmi/__init__.py:54 +#, python-format +msgid "Image map « {title} »" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/zmi/container.py:53 +msgid "Image areas" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/zmi/container.py:64 +#: ./src/pyams_content/shared/imagemap/interfaces/__init__.py:63 +msgid "Image map areas" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/zmi/container.py:108 +msgid "No currently defined image." +msgstr "" + +#: ./src/pyams_content/shared/imagemap/zmi/container.py:110 +msgid "No currently defined area." +msgstr "" + +#: ./src/pyams_content/shared/imagemap/zmi/container.py:160 +msgid "Given area name doesn't exist!" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/zmi/container.py:156 +msgid "Bad query object_name parameter value!" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/zmi/area.py:46 +msgid "Add image area" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/zmi/area.py:64 +msgid "Add new image area" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/zmi/area.py:94 +msgid "Edit image map properties" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/interfaces/__init__.py:32 +msgid "Image map" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/interfaces/__init__.py:42 +msgid "Area title" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/interfaces/__init__.py:43 +msgid "Label associated with this area" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/interfaces/__init__.py:47 +msgid "Internal or external link associated with this map area" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/interfaces/__init__.py:51 +msgid "Map area coordinates" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/interfaces/__init__.py:52 +msgid "List of coordinates of image area" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/interfaces/__init__.py:60 +msgid "Image supporting map areas" +msgstr "" + +#: ./src/pyams_content/shared/imagemap/interfaces/__init__.py:64 +msgid "List of defined map areas" +msgstr "" + #: ./src/pyams_content/shared/blog/zmi/__init__.py:50 msgid "This blog post" msgstr "" diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/root/__init__.py --- a/src/pyams_content/root/__init__.py Fri Jan 20 15:41:23 2017 +0100 +++ b/src/pyams_content/root/__init__.py Fri Jan 20 15:42:51 2017 +0100 @@ -111,6 +111,7 @@ tools_name = None news_tool_name = None + imagemaps_tool_name = None SITEROOT_TOOLS_CONFIGURATION_KEY = 'pyams_config.tools.configuration' diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/root/interfaces/__init__.py --- a/src/pyams_content/root/interfaces/__init__.py Fri Jan 20 15:41:23 2017 +0100 +++ b/src/pyams_content/root/interfaces/__init__.py Fri Jan 20 15:42:51 2017 +0100 @@ -56,6 +56,7 @@ tools_name = Attribute("Tools name") news_tool_name = Attribute("News tool name") + imagemaps_tool_name = Attribute("Image maps tool name") class ISiteRootBackOfficeConfiguration(IBackOfficeConfiguration): diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/common/zmi/__init__.py --- a/src/pyams_content/shared/common/zmi/__init__.py Fri Jan 20 15:41:23 2017 +0100 +++ b/src/pyams_content/shared/common/zmi/__init__.py Fri Jan 20 15:42:51 2017 +0100 @@ -344,5 +344,5 @@ translate = self.request.localizer.translate value += ''.format( - translate(_("Created or modified in this version"))) + translate(_("Created or modified in this version"))) return value diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/imagemap/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/__init__.py Fri Jan 20 15:42:51 2017 +0100 @@ -0,0 +1,108 @@ +# +# 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 +from persistent import Persistent +from persistent.mapping import PersistentMapping + +# import interfaces +from pyams_content.component.links.interfaces import ILinkContainerTarget +from pyams_content.shared.imagemap.interfaces import IMAGEMAP_CONTENT_TYPE, IMAGEMAP_CONTENT_NAME, \ + IWfImageMap, IImageMap, IImageMapArea +from zope.location.interfaces import ISublocations +from zope.traversing.interfaces import ITraversable + +# import packages +from pyams_content.shared.common import WfSharedContent, register_content_type, SharedContent +from pyams_i18n.property import I18nFileProperty +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 ObjectModifiedEvent +from zope.location import locate +from zope.schema.fieldproperty import FieldProperty + + +@implementer(IImageMapArea) +class ImageMapArea(Persistent, Contained): + """Image map area class""" + + title = FieldProperty(IImageMapArea['title']) + link = FieldProperty(IImageMapArea['link']) + area = FieldProperty(IImageMapArea['area']) + + +@implementer(IWfImageMap, ILinkContainerTarget) +class WfImageMap(WfSharedContent): + """Base image map""" + + content_type = IMAGEMAP_CONTENT_TYPE + content_name = IMAGEMAP_CONTENT_NAME + + _image = I18nFileProperty(IWfImageMap['image']) + areas = FieldProperty(IWfImageMap['areas']) + + _index = 0 + + def __init__(self): + self.areas = PersistentMapping() + + @property + def image(self): + return self._image + + @image.setter + def image(self, value): + self._image = value + if value: + self.areas = PersistentMapping() + + def add_area(self, area): + self._index += 1 + key = str(self._index) + self.areas[key] = area + locate(area, self, '++areas++{0}'.format(key)) + get_current_registry().notify(ObjectModifiedEvent(self)) + + def remove_area(self, key): + if key in self.areas: + del self.areas[key] + get_current_registry().notify(ObjectModifiedEvent(self)) + +register_content_type(WfImageMap) + + +@implementer(IImageMap) +class ImageMap(SharedContent): + """Workflow managed image map class""" + + content_class = WfImageMap + + +@adapter_config(name='areas', context=IWfImageMap, provides=ITraversable) +class ImapemapAreasNamespace(ContextAdapter): + """++areas++ namespace traverser""" + + def traverse(self, name, furtherpath=None): + return self.context.areas[name] + + +@adapter_config(name='areas', context=IWfImageMap, provides=ISublocations) +class ImagemapAreasSublocations(ContextAdapter): + """Image map area sublocations""" + + def sublocations(self): + return self.context.areas.values() diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/imagemap/interfaces/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/interfaces/__init__.py Fri Jan 20 15:42:51 2017 +0100 @@ -0,0 +1,70 @@ +# +# 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 +from zope.annotation.interfaces import IAttributeAnnotatable + +# import packages +from pyams_content.shared.imagemap.schema import MapArea +from pyams_i18n.schema import I18nTextLineField, I18nImageField +from pyams_utils.schema import PersistentDict +from zope.schema import Object, Choice + +from pyams_content import _ + + +IMAGEMAP_CONTENT_TYPE = 'imagemap' +IMAGEMAP_CONTENT_NAME = _("Image map") + + +class IImageMapManager(ISharedTool): + """Image maps manager interface""" + + +class IImageMapArea(IAttributeAnnotatable): + """Image map area interface""" + + title = I18nTextLineField(title=_("Area title"), + description=_("Label associated with this area"), + required=True) + + link = Choice(title=_("Link target"), + description=_("Internal or external link associated with this map area"), + vocabulary="PyAMS content links", + required=True) + + area = MapArea(title=_("Map area coordinates"), + description=_("List of coordinates of image area"), + required=True) + + +class IWfImageMap(IWfSharedContent): + """Image map interface""" + + image = I18nImageField(title=_("Image"), + description=_("Image supporting map areas"), + required=True) + + areas = PersistentDict(title=_("Image map areas"), + description=_("List of defined map areas"), + value_type=Object(schema=IImageMapArea), + required=False) + + +class IImageMap(ISharedContent): + """Workflow managed image map interface""" diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/imagemap/manager.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/manager.py Fri Jan 20 15:42:51 2017 +0100 @@ -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.imagemap.interfaces import IImageMapManager, IMAGEMAP_CONTENT_TYPE +from zope.annotation.interfaces import IAttributeAnnotatable +from zope.lifecycleevent.interfaces import IObjectAddedEvent + +# import packages +from pyams_content.shared.common.manager import SharedTool +from pyams_content.shared.imagemap import ImageMap +from pyams_utils.traversing import get_parent +from pyramid.events import subscriber +from zope.component.interfaces import ISite +from zope.interface import implementer + + +@implementer(IImageMapManager, IAttributeAnnotatable) +class ImageMapsManager(SharedTool): + """Image maps manager class""" + + shared_content_type = IMAGEMAP_CONTENT_TYPE + shared_content_factory = ImageMap + + +@subscriber(IObjectAddedEvent, context_selector=IImageMapManager) +def handle_added_imagemaps_manager(event): + """Register image maps manager when added""" + site = get_parent(event.newParent, ISite) + registry = site.getSiteManager() + if registry is not None: + registry.registerUtility(event.object, IImageMapManager) diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/imagemap/schema.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/schema.py Fri Jan 20 15:42:51 2017 +0100 @@ -0,0 +1,32 @@ +# +# 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 zope.schema.interfaces import ITextLine + +# import packages +from zope.interface import implementer +from zope.schema import TextLine + + +class IMapArea(ITextLine): + """Map area interface""" + + +@implementer(IMapArea) +class MapArea(TextLine): + """Map area field class""" diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/imagemap/zmi/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/zmi/__init__.py Fri Jan 20 15:42:51 2017 +0100 @@ -0,0 +1,79 @@ +# +# 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.interfaces import CREATE_CONTENT_PERMISSION +from pyams_content.shared.imagemap.interfaces import IImageMapManager, IWfImageMap +from pyams_i18n.interfaces import II18n +from pyams_skin.interfaces.viewlet import IWidgetTitleViewletManager, IMenuHeader +from pyams_skin.layer import IPyAMSLayer +from pyams_zmi.interfaces.menu import IContentManagementMenu +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.interfaces import IContentTitle +from pyams_skin.viewlet.toolbar import ToolbarAction +from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter, ContextRequestAdapter +from pyams_viewlet.viewlet import viewlet_config +from pyramid.view import view_config +from zope.interface import Interface + +from pyams_content import _ + + +@adapter_config(context=(IWfImageMap, IContentManagementMenu), provides=IMenuHeader) +class ImageMapContentMenuHeader(ContextRequestAdapter): + """Image map content menu header adapter""" + + header = _("This image map") + + +@adapter_config(context=(IWfImageMap, IPyAMSLayer, Interface), provides=IContentTitle) +class ImageMapTitleAdapter(ContextRequestViewAdapter): + """Image map title adapter""" + + @property + def title(self): + translate = self.request.localizer.translate + return translate(_("Image map « {title} »")).format( + title=II18n(self.context).query_attribute('title', request=self.request)) + + +@viewlet_config(name='add-shared-content.action', context=IImageMapManager, layer=IAdminLayer, view=Interface, + manager=IWidgetTitleViewletManager, permission=CREATE_CONTENT_PERMISSION, weight=1) +class ImageMapAddAction(ToolbarAction): + """Image map adding action""" + + label = _("Add image map") + url = 'add-shared-content.html' + modal_target = True + + +@pagelet_config(name='add-shared-content.html', context=IImageMapManager, layer=IPyAMSLayer, + permission=CREATE_CONTENT_PERMISSION) +class ImageMapAddForm(SharedContentAddForm): + """Image map add form""" + + legend = _("Adding image map") + + +@view_config(name='add-shared-content.json', context=IImageMapManager, request_type=IPyAMSLayer, + permission=CREATE_CONTENT_PERMISSION, renderer='json', xhr=True) +class ImageMapAJAXAddForm(SharedContentAJAXAddForm, ImageMapAddForm): + """Image map add form, JSON renderer""" diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/imagemap/zmi/area.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/zmi/area.py Fri Jan 20 15:42:51 2017 +0100 @@ -0,0 +1,108 @@ +# +# 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.interfaces import MANAGE_CONTENT_PERMISSION +from pyams_content.shared.imagemap.interfaces import IWfImageMap, IImageMapArea +from pyams_skin.interfaces.viewlet import IWidgetTitleViewletManager +from pyams_skin.layer import IPyAMSLayer + +# import packages +from pyams_content.component.links.zmi.widget import SingleLinkLinkSelectFieldWidget +from pyams_content.shared.imagemap import ImageMapArea +from pyams_content.shared.imagemap.zmi.container import ImagemapAreasContainerView +from pyams_content.shared.imagemap.zmi.widget import ImgareaInputFieldWidget +from pyams_form.form import AJAXAddForm, AJAXEditForm +from pyams_pagelet.pagelet import pagelet_config +from pyams_skin.viewlet.toolbar import ToolbarAction +from pyams_viewlet.viewlet import viewlet_config +from pyams_zmi.form import AdminDialogAddForm, AdminDialogEditForm +from pyramid.view import view_config +from z3c.form import field + +from pyams_content import _ + + +@viewlet_config(name='add-imagemap-area.action', context=IWfImageMap, layer=IPyAMSLayer, + view=ImagemapAreasContainerView, manager=IWidgetTitleViewletManager, + permission=MANAGE_CONTENT_PERMISSION, weight=1) +class ImagemapAreaAddAction(ToolbarAction): + """Image map area add menu""" + + label = _("Add image area") + + url = 'add-area.html' + modal_target = True + + def __new__(cls, context, request, view, manager): + image = context.image + if image: + for value in image.values(): + if value: + return ToolbarAction.__new__(cls) + return None + + +@pagelet_config(name='add-area.html', context=IWfImageMap, layer=IPyAMSLayer, permission=MANAGE_CONTENT_PERMISSION) +class ImagemapAreaAddForm(AdminDialogAddForm): + """Imagemap area add form""" + + legend = _("Add new image area") + dialog_class = 'modal-large' + + fields = field.Fields(IImageMapArea) + fields['link'].widgetFactory = SingleLinkLinkSelectFieldWidget + fields['area'].widgetFactory = ImgareaInputFieldWidget + + ajax_handler = 'add-area.json' + edit_permission = MANAGE_CONTENT_PERMISSION + + def create(self, data): + return ImageMapArea() + + def add(self, object): + self.context.add_area(object) + + def nextURL(self): + return 'areas.html' + + +@view_config(name='add-area.json', context=IWfImageMap, request_type=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True) +class ImagemapAreaAJAXAddForm(AJAXAddForm, ImagemapAreaAddForm): + """Image map area add form, JSON renderer""" + + +@pagelet_config(name='properties.html', context=IImageMapArea, layer=IPyAMSLayer, permission=MANAGE_CONTENT_PERMISSION) +class ImagemapAreaPropertiesEditForm(AdminDialogEditForm): + """Image map area properties edit form""" + + legend = _("Edit image map properties") + dialog_class = 'modal-large' + + fields = field.Fields(IImageMapArea) + fields['link'].widgetFactory = SingleLinkLinkSelectFieldWidget + fields['area'].widgetFactory = ImgareaInputFieldWidget + + ajax_handler = 'properties.json' + edit_permission = MANAGE_CONTENT_PERMISSION + + +@view_config(name='properties.json', context=IImageMapArea, request_type=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True) +class ImagemapAreaPropertiesAJAXEditForm(AJAXEditForm, ImagemapAreaPropertiesEditForm): + """Image map properties edit form, JSON rendener""" diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/imagemap/zmi/container.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/zmi/container.py Fri Jan 20 15:42:51 2017 +0100 @@ -0,0 +1,162 @@ +# +# 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.interfaces import MANAGE_CONTENT_PERMISSION +from pyams_content.shared.imagemap.interfaces import IWfImageMap +from pyams_i18n.interfaces import II18n +from pyams_skin.interfaces import IInnerPage +from pyams_skin.layer import IPyAMSLayer +from pyams_utils.interfaces.data import IObjectData +from pyams_zmi.interfaces.menu import IPropertiesMenu +from pyams_zmi.layer import IAdminLayer +from z3c.table.interfaces import IColumn, IValues +from zope.interface import implementer, alsoProvides + +# import packages +from pyams_content.shared.common.zmi import WfModifiedContentColumnMixin +from pyams_form.security import ProtectedFormObjectMixin +from pyams_pagelet.pagelet import pagelet_config +from pyams_skin.table import BaseTable, I18nColumn, TrashColumn +from pyams_skin.viewlet.menu import MenuItem +from pyams_template.template import template_config +from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter +from pyams_utils.url import absolute_url +from pyams_viewlet.viewlet import viewlet_config +from pyams_zmi.view import AdminView +from pyramid.decorator import reify +from pyramid.view import view_config +from z3c.table.column import GetAttrColumn + +from pyams_content import _ + + +@viewlet_config(name='areas.submenu', context=IWfImageMap, layer=IAdminLayer, + manager=IPropertiesMenu, permission=MANAGE_CONTENT_PERMISSION, weight=20) +class ImagemapAreasMenu(MenuItem): + """Image map areas menu""" + + label = _("Image areas") + icon_class = 'fa-location-arrow' + url = '#areas.html' + + +@pagelet_config(name='areas.html', context=IWfImageMap, layer=IPyAMSLayer, permission=MANAGE_CONTENT_PERMISSION) +@template_config(template='templates/container.pt', layer=IPyAMSLayer) +@implementer(IInnerPage) +class ImagemapAreasContainerView(AdminView): + """Image map areas container view""" + + title = _("Image map areas") + + def __init__(self, context, request): + super(ImagemapAreasContainerView, self).__init__(context, request) + self.areas_table = ImagemapAreasTable(context, request) + + def update(self): + super(ImagemapAreasContainerView, self).update() + self.areas_table.update() + + +class ImagemapAreasTable(BaseTable): + """Image map areas table""" + + hide_header = True + cssClasses = {'table': 'table table-bordered table-striped table-hover table-tight'} + + def __init__(self, context, request): + super(ImagemapAreasTable, self).__init__(context, request) + self.object_data = {'ams-widget-toggle-button': 'false'} + alsoProvides(self, IObjectData) + + @property + def data_attributes(self): + attributes = super(ImagemapAreasTable, self).data_attributes + attributes['table'] = {'data-ams-location': absolute_url(self.context, self.request), + 'data-ams-datatable-sort': 'false', + 'data-ams-datatable-pagination': 'false'} + return attributes + + @reify + def values(self): + return list(super(ImagemapAreasTable, self).values) + + def render(self): + translate = self.request.localizer.translate + has_value = False + image = self.context.image + if image: + for value in image.values(): + if value: + has_value = True + break + if not has_value: + return translate(_("No currently defined image.")) + if not self.values: + return translate(_("No currently defined area.")) + return super(ImagemapAreasTable, self).render() + + +@adapter_config(name='name', context=(IWfImageMap, IPyAMSLayer, ImagemapAreasTable), provides=IColumn) +class ImagemapAreasContainerNameColumn(I18nColumn, WfModifiedContentColumnMixin, GetAttrColumn): + """Image map areas container name column""" + + _header = _("Title") + + weight = 10 + + def getValue(self, obj): + return II18n(obj).query_attribute('title', request=self.request) + + +@adapter_config(name='trash', context=(IWfImageMap, IPyAMSLayer, ImagemapAreasTable), provides=IColumn) +class ImagemapAreasContainerTrashColumn(ProtectedFormObjectMixin, TrashColumn): + """Image map areas container trash column""" + + +@adapter_config(context=(IWfImageMap, IPyAMSLayer, ImagemapAreasTable), provides=IValues) +class ImagemapAreasValues(ContextRequestViewAdapter): + """Image map areas caontainer values""" + + @property + def values(self): + return self.context.areas.values() + + +@view_config(name='delete-element.json', context=IWfImageMap, request_type=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True) +def delete_imagemap_area(request): + """Delete image map area""" + translate = request.localizer.translate + name = request.params.get('object_name') + if not name: + return {'status': 'message', + 'messagebox': {'status': 'error', + 'content': translate(_("No provided object_name argument!"))}} + if '++' in name: + try: + name = name.split('++', 2)[2] + except IndexError: + return {'status': 'message', + 'messagebox': {'status': 'error', + 'content': translate(_("Bad query object_name parameter value!"))}} + if name not in request.context.areas: + return {'status': 'message', + 'messagebox': {'status': 'error', + 'content': translate(_("Given area name doesn't exist!"))}} + request.context.remove_area(name) + return {'status': 'success'} diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/imagemap/zmi/properties.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/zmi/properties.py Fri Jan 20 15:42:51 2017 +0100 @@ -0,0 +1,48 @@ +# +# 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.imagemap.interfaces import IWfImageMap +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='image', + context=(IWfImageMap, IPyAMSLayer, SharedContentPropertiesEditForm), + provides=IInnerSubForm) +class ImageMapPropertiesEditForm(InnerAdminEditForm): + """Image map properties edit form extension""" + + legend = _("Background image") + fieldset_class = 'bordered no-x-margin margin-y-10' + + fields = field.Fields(IWfImageMap).select('image') + + def get_ajax_output(self, changes): + if 'image' in changes.get(IWfImageMap, ()): + translate = self.request.localizer.translate + return {'status': 'reload', + 'smallbox': translate(self.successMessage), + 'smallbox_status': 'success'} diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/imagemap/zmi/summary.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/zmi/summary.py Fri Jan 20 15:42:51 2017 +0100 @@ -0,0 +1,59 @@ +# +# 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 ILinkContainer +from pyams_content.shared.common.interfaces.zmi import IInnerSummaryView +from pyams_content.shared.imagemap.interfaces import IWfImageMap +from pyams_form.interfaces.form import IInnerTabForm +from pyams_skin.layer import IPyAMSLayer +from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION + +# import packages +from pyams_content.shared.common.zmi.summary import SharedContentSummaryForm +from pyams_pagelet.pagelet import pagelet_config +from pyams_template.template import template_config +from pyams_utils.adapter import adapter_config +from pyams_zmi.form import InnerAdminDisplayForm +from zope.interface import implementer + +from pyams_content import _ + + +@adapter_config(name='imagemap-summary', + context=(IWfImageMap, IPyAMSLayer, SharedContentSummaryForm), + provides=IInnerTabForm) +class ImagemapSummary(InnerAdminDisplayForm): + """Image map summary view access tab""" + + weight = 20 + tab_label = _("Quick preview") + tab_target = 'imagemap-summary.html' + + +@pagelet_config(name='imagemap-summary.html', context=IWfImageMap, layer=IPyAMSLayer, + permission=VIEW_SYSTEM_PERMISSION) +@template_config(template='templates/summary.pt', layer=IPyAMSLayer) +@implementer(IInnerSummaryView) +class ImagemapSummaryView(object): + """Image map summary view""" + + def get_url(self, link): + """Get URL of given link""" + link = ILinkContainer(self.context).get(link) + if link is not None: + return link.get_url(self.request) diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/imagemap/zmi/templates/container.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/zmi/templates/container.pt Fri Jan 20 15:42:51 2017 +0100 @@ -0,0 +1,13 @@ +
+
+ + +

+ + +
+
+ +
+
diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/imagemap/zmi/templates/summary.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/zmi/templates/summary.pt Fri Jan 20 15:42:51 2017 +0100 @@ -0,0 +1,12 @@ +
+ + + + +
diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/imagemap/zmi/templates/widget-input.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/zmi/templates/widget-input.pt Fri Jan 20 15:42:51 2017 +0100 @@ -0,0 +1,9 @@ + diff -r cf21b8cd6e74 -r 8c5bbc396670 src/pyams_content/shared/imagemap/zmi/widget.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/zmi/widget.py Fri Jan 20 15:42:51 2017 +0100 @@ -0,0 +1,43 @@ +# +# 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.imagemap.interfaces import IWfImageMap +from pyams_i18n.interfaces import II18n +from pyams_skin.layer import IPyAMSLayer + +# import packages +from pyams_form.widget import widgettemplate_config +from pyams_utils.traversing import get_parent +from pyams_utils.url import absolute_url +from z3c.form.browser.text import TextWidget +from z3c.form.widget import FieldWidget + + +@widgettemplate_config(mode='input', template='templates/widget-input.pt', layer=IPyAMSLayer) +class ImgareaInputWidget(TextWidget): + """Image map area input widget""" + + @property + def image_url(self): + map = get_parent(self.context, IWfImageMap) + return absolute_url(II18n(map).query_attribute('image', request=self.request), self.request) + + +def ImgareaInputFieldWidget(field, request): + """Image map area input widget factory""" + return FieldWidget(field, ImgareaInputWidget(request))