Added back URL and target in page header
authorThierry Florac <thierry.florac@onf.fr>
Tue, 14 Apr 2015 16:34:46 +0200
changeset 41 c2adb9c9c4f0
parent 40 e550ff884799
child 42 975b545f5ae5
Added back URL and target in page header
src/pyams_skin/interfaces/__init__.py
src/pyams_skin/templates/header.pt
--- a/src/pyams_skin/interfaces/__init__.py	Wed Apr 01 10:44:47 2015 +0200
+++ b/src/pyams_skin/interfaces/__init__.py	Tue Apr 14 16:34:46 2015 +0200
@@ -91,7 +91,12 @@
 class IPageHeader(Interface):
     """Page header interface used by 'header' content provider"""
 
-    back_url = TextLine(title="Back URL target")
+    back_url = TextLine(title="Back URL",
+                        required=False)
+
+    back_target = TextLine(title="Back URL target",
+                           description="HTML target selector, or None for full page target",
+                           required=False)
 
     icon_class = TextLine(title='Icon CSS class')
 
--- a/src/pyams_skin/templates/header.pt	Wed Apr 01 10:44:47 2015 +0200
+++ b/src/pyams_skin/templates/header.pt	Tue Apr 14 16:34:46 2015 +0200
@@ -4,7 +4,8 @@
 		<a class="font-xs hint" data-ams-target="#content"
 		   title="Back to previous page"
 		   tal:condition="back_url"
-		   tal:attributes="href back_url">
+		   tal:attributes="href back_url;
+						   data-ams-target header.back_target | default;">
 			<i class="fa fa-fw fa-step-backward"></i>
 		</a>
 		<i tal:attributes="class header.icon_class"></i>
@@ -15,4 +16,4 @@
 			</span>
 		</tal:if>
 	</h1>
-</tal:if>
\ No newline at end of file
+</tal:if>