Include new viewlets for flags and search engines
authorThierry Florac <tflorac@ulthar.net>
Tue, 03 Jun 2014 23:47:36 +0200
changeset 40 4961ad396088
parent 39 2c6d47b76a7b
child 41 20b31e6f4729
Include new viewlets for flags and search engines
src/ztfy/myams/templates/layout.pt
--- a/src/ztfy/myams/templates/layout.pt	Tue Jun 03 23:45:55 2014 +0200
+++ b/src/ztfy/myams/templates/layout.pt	Tue Jun 03 23:47:36 2014 +0200
@@ -21,7 +21,7 @@
 	<tal:var replace="context/myams:resources" />
 
 </head>
-<body tal:attributes="class static/body_css_class">
+<body tal:attributes="class static/body_css_class" i18n:domain="ztfy.myams">
 
 	<!-- Page header -->
 	<header id="header">
@@ -33,23 +33,25 @@
 									 alt config/logo_title;" />
 			</span>
 		</div>
+		<!-- end logo -->
 
-		<!-- projects dropdowns -->
+		<!-- projects drop-downs -->
 		<div id="top-links" tal:condition="static/include_top_links">
 			<tal:div replace="structure provider:myams.toplinks" />
 		</div>
+		<!-- end projects drop-downs -->
 
 		<!-- pulled right: nav area -->
 		<div class="pull-right">
 
-			<!-- multiple lang dropdown : find all flags in the image folder -->
+			<!-- multiple langs dropdown -->
 			<ul class="header-dropdown-list hidden-xs" tal:condition="static/include_flags">
 				<li tal:content="structure provider:myams.flags"></li>
 			</ul>
-			<!-- end multiple lang -->
+			<!-- end multiple langs -->
 
 			<!-- collapse menu button -->
-			<div id="hide-menu" class="btn-header pull-right">
+			<div id="hide-menu" class="btn-header pull-right" tal:condition="static/include_menus">
 				<span>
 					<a href="javascript:void(0);" title="Hide menu" class="hint"
 					   data-ams-hint-gravity="n"><i class="fa fa-bars"></i></a>
@@ -93,28 +95,25 @@
 				</span>
 
 			</div>
+			<!-- end user info -->
 
 			<!-- search mobile button (this is hidden till mobile view port) -->
-			<div id="search-mobile" class="btn-header pull-right"
-				 tal:condition="static/include_mobile_search">
-				<span> <a href="javascript:void(0)" title="Search"><i class="fa fa-search"></i></a> </span>
-			</div>
+			<tal:if condition="static/include_mobile_search">
+				<tal:var content="structure provider:myams.mobile_search" />
+			</tal:if>
 			<!-- end search mobile button -->
 
-			<!-- input: search field -->
-			<form method="post" action="#search.html" class="header-search pull-right" data-async=""
-				  tal:condition="static/include_site_search">
-				<input type="text" placeholder="Find reports and more" id="search-fld" name="search-field">
-				<button type="submit">
-					<i class="fa fa-search"></i>
-				</button>
-				<a href="javascript:void(0);" id="cancel-search-js" title="Cancel Search"><i class="fa fa-times"></i></a>
-			</form>
-			<!-- end input: search field -->
+			<!-- site search field -->
+			<tal:if condition="static/include_site_search">
+				<tal:var content="structure provider:myams.site_search" />
+			</tal:if>
+			<!-- end site search field -->
 
 		</div>
+		<!-- end nav area -->
 
 	</header>
+	<!-- end page header -->
 
 	<!-- Menus panel -->
 	<aside id="left-panel">
@@ -130,6 +129,7 @@
 			<tal:var content="static/application_name" /> - version <tal:var content="static/version" />
 		</div>
 	</aside>
+	<!-- end menus panel -->
 
 	<!-- Main panel -->
 	<div id="main" role="main">
@@ -137,10 +137,9 @@
 		<!-- Ribbon -->
 		<div id="ribbon">
 			<span class="ribbon-button-alignment">
-				<span id="refresh" class="btn btn-ribbon hint"
-					  data-ams-hint-gravity="n" data-ams-hint-html="true"
-					  title="&lt;span&gt;&lt;i class=&#39;text-warning fa fa-warning&#39;&gt;&lt;/i&gt; ATTENTION:
-					  ceci va re-initialiser tous vos composants !&lt;/span&gt;">
+				<span id="refresh" class="btn btn-ribbon hint" data-ams-hint-gravity="w" data-ams-hint-html="true"
+					  title="&lt;span&gt;&lt;i class=&#39;text-warning fa fa-warning&#39;&gt;&lt;/i&gt; WARNING: this will reset all your widgets status!&lt;/span&gt;"
+					  i18n:attributes="title">
 					<i class="fa fa-refresh"></i>
 				</span>
 			</span>
@@ -149,6 +148,7 @@
 				<li>Home</li>
 			</ol>
 		</div>
+		<!-- end ribbon -->
 
 		<!-- Content -->
 		<div id="content" style="opacity: 1;">
@@ -157,15 +157,17 @@
 			<![endif]-->
 			<tal:var content="structure provider:pagelet" />
 		</div>
+		<!-- end content -->
 
 	</div>
+	<!-- end main panel -->
 
 	<tal:if condition="config/google_analytics_key">
 		<!-- Google Analytics -->
-		<script type="text/javascript">
+		<script type="text/javascript" tal:content="python:'''
 
 		  var _gaq = _gaq || [];
-		  _gaq.push(['_setAccount', 'UA-xxxxxx-y']);
+		  _gaq.push(['_setAccount', '%(key)s']);
 		  _gaq.push(['_trackPageview']);
 
 		  (function() {
@@ -174,7 +176,8 @@
 			var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
 		  })();
 
-		</script>
+		''' % {'key': config.google_analytics_key}"></script>
+		<!-- end Google Analytics -->
 	</tal:if>
 </body>
 </html>