Updated templates
authorThierry Florac <thierry.florac@onf.fr>
Wed, 13 Jun 2018 14:50:00 +0200
changeset 45 eca8c37969a9
parent 44 c36df3300861
child 46 4a5ec7e82ac8
Updated templates
src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.mo
src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.po
src/pyams_default_theme/locales/pyams_default_theme.pot
src/pyams_default_theme/shared/imagemap/templates/render.pt
src/pyams_default_theme/shared/view/__init__.py
src/pyams_default_theme/shared/view/templates/render.pt
Binary file src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.mo has changed
--- a/src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.po	Wed Jun 13 14:43:41 2018 +0200
+++ b/src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.po	Wed Jun 13 14:50:00 2018 +0200
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-05-24 09:42+0200\n"
+"POT-Creation-Date: 2018-06-13 14:45+0200\n"
 "PO-Revision-Date: 2017-06-07 12:41+0200\n"
 "Last-Translator: Thierry Florac <tflorac@ulthar.net>\n"
 "Language-Team: French\n"
@@ -182,14 +182,28 @@
 msgid "Default associations renderer"
 msgstr "Par défaut"
 
+#: src/pyams_default_theme/shared/view/templates/render.pt:2
+msgid "View result items"
+msgstr "Aperçu du contenu de la vue"
+
+#: src/pyams_default_theme/shared/view/templates/render.pt:3
+msgid "WARNING: items displayed in this preview are out of context!!"
+msgstr ""
+"ATTENTION : la sélection des éléments affichés dans cet aperçu ne tient pas compte du "
+"contexte éventuellement paramétré dans la vue"
+
 #: src/pyams_default_theme/shared/view/portlet/__init__.py:37
 msgid "Simple list view"
 msgstr "Liste simple"
 
-#: src/pyams_default_theme/shared/imagemap/__init__.py:56
+#: src/pyams_default_theme/shared/imagemap/__init__.py:58
 msgid "Default imagemap renderer"
 msgstr "Par défaut"
 
+#: src/pyams_default_theme/shared/imagemap/templates/render.pt:2
+msgid "Image map preview"
+msgstr "Aperçu des zones cliquables"
+
 #: src/pyams_default_theme/shared/logo/__init__.py:39
 msgid "Default logos renderer"
 msgstr "Par défaut"
--- a/src/pyams_default_theme/locales/pyams_default_theme.pot	Wed Jun 13 14:43:41 2018 +0200
+++ b/src/pyams_default_theme/locales/pyams_default_theme.pot	Wed Jun 13 14:50:00 2018 +0200
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-05-24 09:42+0200\n"
+"POT-Creation-Date: 2018-06-13 14:45+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -167,14 +167,26 @@
 msgid "Default associations renderer"
 msgstr ""
 
+#: ./src/pyams_default_theme/shared/view/templates/render.pt:2
+msgid "View result items"
+msgstr ""
+
+#: ./src/pyams_default_theme/shared/view/templates/render.pt:3
+msgid "WARNING: items displayed in this preview are out of context!!"
+msgstr ""
+
 #: ./src/pyams_default_theme/shared/view/portlet/__init__.py:37
 msgid "Simple list view"
 msgstr ""
 
-#: ./src/pyams_default_theme/shared/imagemap/__init__.py:56
+#: ./src/pyams_default_theme/shared/imagemap/__init__.py:58
 msgid "Default imagemap renderer"
 msgstr ""
 
+#: ./src/pyams_default_theme/shared/imagemap/templates/render.pt:2
+msgid "Image map preview"
+msgstr ""
+
 #: ./src/pyams_default_theme/shared/logo/__init__.py:39
 msgid "Default logos renderer"
 msgstr ""
--- a/src/pyams_default_theme/shared/imagemap/templates/render.pt	Wed Jun 13 14:43:41 2018 +0200
+++ b/src/pyams_default_theme/shared/imagemap/templates/render.pt	Wed Jun 13 14:50:00 2018 +0200
@@ -1,20 +1,23 @@
-<div class="padding-y-5" i18n:domain="pyams_content">
-	<img usemap="#imagemap_preview"
-		 tal:define="image i18n:context.image"
-		 tal:attributes="src extension:absolute_url(image);" />
-	<map name="imagemap_preview">
-		<tal:loop repeat="area context.areas.values()">
-			<tal:var define="item context.get_association(area)"
-					 condition="item and item.visible">
-				<area shape="poly"
-					  tal:define="info view.get_item_info(item);
-								  area_title i18n:area.title;
-								  item_title i18n:info.user_title;
-								  title area_title or item_title;"
-					  tal:attributes="coords area.area;
-									  href item.get_url(request);
-									  title title;" />
-			</tal:var>
-		</tal:loop>
-	</map>
-</div>
+<fieldset i18n:domain="pyams_default_theme">
+	<legend class="inner" i18n:translate="">Image map preview</legend>
+	<div>
+		<img usemap="#imagemap_preview"
+			 tal:define="image i18n:context.image"
+			 tal:attributes="src extension:absolute_url(image);" />
+		<map name="imagemap_preview">
+			<tal:loop repeat="area context.areas.values()">
+				<tal:var define="item context.get_association(area)"
+						 condition="item and item.visible">
+					<area shape="poly"
+						  tal:define="info view.get_item_info(item);
+									  area_title i18n:area.title;
+									  item_title i18n:info.user_title;
+									  title area_title or item_title;"
+						  tal:attributes="coords area.area;
+										  href item.get_url(request);
+										  title title;" />
+				</tal:var>
+			</tal:loop>
+		</map>
+	</div>
+</fieldset>
--- a/src/pyams_default_theme/shared/view/__init__.py	Wed Jun 13 14:43:41 2018 +0200
+++ b/src/pyams_default_theme/shared/view/__init__.py	Wed Jun 13 14:50:00 2018 +0200
@@ -16,5 +16,22 @@
 # import standard library
 
 # import interfaces
+from pyams_content.shared.view.interfaces import IWfView
+from pyams_skin.layer import IPyAMSUserLayer
+from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION
 
 # import packages
+from pyams_default_theme.page import BasePreviewPage
+from pyams_pagelet.pagelet import pagelet_config
+from pyams_template.template import template_config
+
+
+@pagelet_config(name='preview.html', context=IWfView, layer=IPyAMSUserLayer,
+                permission=VIEW_SYSTEM_PERMISSION)
+@template_config(template='templates/render.pt', layer=IPyAMSUserLayer)
+class ViewPreviewPage(BasePreviewPage):
+    """Shared view preview page"""
+
+    @property
+    def items(self):
+        return self.context.get_results(self.context)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/shared/view/templates/render.pt	Wed Jun 13 14:50:00 2018 +0200
@@ -0,0 +1,10 @@
+<fieldset i18n:domain="pyams_default_theme">
+	<legend class="inner" i18n:translate="">View result items</legend>
+	<div class="alert alert-info padding-5" i18n:translate="">
+		WARNING: items displayed in this preview are out of context!!
+	</div>
+	<ul>
+		<li tal:repeat="item view.items"
+			tal:content="i18n:item.title"></li>
+	</ul>
+</fieldset>