From bc716e7b2058b3bbcf49b7b5431a1d9e7ed23f02 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Benoi=CC=82t=20Pin?= <benoit.pin@gmail.com>
Date: Wed, 11 Dec 2013 21:38:14 +0100
Subject: [PATCH] =?utf8?q?Ajout=20du=20slot=20=C2=AB=C2=A0body=C2=A0=C2=BB?=
 =?utf8?q?=20en=20alias=20=C3=A0=20=C2=AB=C2=A0main=5Fno=5Ftabs=C2=A0?=
 =?utf8?q?=C2=BB=20car=20il=20est=20utile=20pour=20afficher=20les=20pages?=
 =?utf8?q?=20de=20configuration=20des=20tools=20CMF.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

---
 .../custom_generic/main_template_standard.pt  | 197 +++++++++---------
 skins/generic/main_template_ajax.pt           |  32 +--
 skins/photo_theme/main_template_standard.pt   |   2 +
 3 files changed, 118 insertions(+), 113 deletions(-)

diff --git a/skins/custom_generic/main_template_standard.pt b/skins/custom_generic/main_template_standard.pt
index 995ee43..31d94dd 100755
--- a/skins/custom_generic/main_template_standard.pt
+++ b/skins/custom_generic/main_template_standard.pt
@@ -17,11 +17,11 @@
 
       <link rel="Shortcut Icon" type="image/x-icon" href="favicon.ico" tal:attributes="href string:$portal_url/favicon.ico" />
       <link rel="alternate" type="application/rss+xml"
-      			tal:define="stool nocall:here/portal_syndication"
-      			tal:attributes="title here/title_or_id ; href string:${here/absolute_url}/RSS"
-      			tal:condition="python:stool.isSyndicationAllowed(here)" />
-			
-			<link rel="stylesheet" media="screen" tal:attributes="href here/global_plinn_style.css/absolute_url" />
+            tal:define="stool nocall:here/portal_syndication"
+            tal:attributes="title here/title_or_id ; href string:${here/absolute_url}/RSS"
+            tal:condition="python:stool.isSyndicationAllowed(here)" />
+      
+      <link rel="stylesheet" media="screen" tal:attributes="href here/global_plinn_style.css/absolute_url" />
       <style type="text/css" media="all" tal:content="string:@import url(${here/calendar-system.css/absolute_url});"></style>
 
       <link metal:define-slot="css_slot" tal:replace="nothing" />
@@ -29,46 +29,46 @@
       <script type="text/javascript" tal:attributes="src here/javascript_events_api.js/absolute_url"></script>
       <script type="text/javascript" tal:attributes="src here/sarissa.js/absolute_url"></script>
       <script type="text/javascript">
-      	//<!--
-				function absolute_url() {
-					var e = document.getElementById("Object_URL");
-					if (e)
-						return e.innerHTML;
-					else {
-						e = document.getElementById("BC_Object_URL");
-						if (e)
-							return e.innerHTML;
-						else
-							return document.location.href;
-					}
-				}
-
-				function portal_url() {
-					var e = document.getElementById("Portal_URL");
-					return e.innerHTML;
-				}
-
-      	var startupFunctions = new Array();
-
-				function registerStartupFunction(fct) {
-					startupFunctions.push(fct);
-				}
-
-				function runAjaxStartup() {
-					for (var i = 0 ; i < startupFunctions.length ; i++)
-						startupFunctions[i]();
-				}
-
-				addListener(window, 'load', runAjaxStartup);
-				
-				var progressImage;
-				function _initLoadingStatus() {
-					progressImage = document.getElementById('loading_progress');
-				}
-				registerStartupFunction(_initLoadingStatus);
-				
-				function showProgressImage() { progressImage.style.display = 'inline'; }
-				function hideProgressImage() { progressImage.style.display = 'none'; }
+        //<!--
+        function absolute_url() {
+          var e = document.getElementById("Object_URL");
+          if (e)
+            return e.innerHTML;
+          else {
+            e = document.getElementById("BC_Object_URL");
+            if (e)
+              return e.innerHTML;
+            else
+              return document.location.href;
+          }
+        }
+
+        function portal_url() {
+          var e = document.getElementById("Portal_URL");
+          return e.innerHTML;
+        }
+
+        var startupFunctions = new Array();
+
+        function registerStartupFunction(fct) {
+          startupFunctions.push(fct);
+        }
+
+        function runAjaxStartup() {
+          for (var i = 0 ; i < startupFunctions.length ; i++)
+            startupFunctions[i]();
+        }
+
+        addListener(window, 'load', runAjaxStartup);
+        
+        var progressImage;
+        function _initLoadingStatus() {
+          progressImage = document.getElementById('loading_progress');
+        }
+        registerStartupFunction(_initLoadingStatus);
+        
+        function showProgressImage() { progressImage.style.display = 'inline'; }
+        function hideProgressImage() { progressImage.style.display = 'none'; }
 
 
         // -->
@@ -76,24 +76,24 @@
       <script type="text/javascript" tal:attributes="src here/base_properties.js/absolute_url"></script>
       <script type="text/javascript" tal:attributes="src here/fragment_importer.js/absolute_url"></script>
       <script type="text/javascript" tal:attributes="src here/ajax_form_manager.js/absolute_url"></script>
-	    <script type="text/javascript" tal:attributes="src here/root_handlers.js/absolute_url"></script>
-			<script type="text/javascript" tal:attributes="src here/plinn_script_loader.js/absolute_url"></script>
+      <script type="text/javascript" tal:attributes="src here/root_handlers.js/absolute_url"></script>
+      <script type="text/javascript" tal:attributes="src here/plinn_script_loader.js/absolute_url"></script>
 
       <script type="text/javascript" metal:define-slot="javascript_head_slot" tal:replace="nothing"></script>
     </head>
 
     <body>
-    	<span style="display:none">
-	    	<span id="Portal_URL" tal:content="portal_url"></span>
-	    	<span id="ajax_config"  tal:content="python:request.get('ajaxConfig', request.SESSION.get('ajaxConfig', portal_object.getProperty('ajax_config')))"></span>
-	    	<script type="text/javascript">
-	    	// <!--
-	    	  AJAX_CONFIG = document.getElementById('ajax_config');
-					AJAX_CONFIG = parseInt(AJAX_CONFIG.innerHTML);
-	    	// -->
-	    	</script>
-	    </span>
-    	<a href="#documentContent" i18n:translate="" i18n:domain="plinn" class="hidden">Skip to content</a>
+      <span style="display:none">
+        <span id="Portal_URL" tal:content="portal_url"></span>
+        <span id="ajax_config"  tal:content="python:request.get('ajaxConfig', request.SESSION.get('ajaxConfig', portal_object.getProperty('ajax_config')))"></span>
+        <script type="text/javascript">
+        // <!--
+          AJAX_CONFIG = document.getElementById('ajax_config');
+          AJAX_CONFIG = parseInt(AJAX_CONFIG.innerHTML);
+        // -->
+        </script>
+      </span>
+      <a href="#documentContent" i18n:translate="" i18n:domain="plinn" class="hidden">Skip to content</a>
       <div metal:use-macro="main_macros/top_bar">Top bar</div>
       <div metal:use-macro="main_macros/user_menu_bar">User menu bar</div>
       <div id="Breadcrumbs"><div metal:use-macro="main_macros/Breadcrumbs">Breadcrumbs</div></div>
@@ -101,59 +101,60 @@
       <div id="main_body">
         <table id="Forematter" width="100%" cellspacing="0">
           <tr>
-          	<td id="leftCell" class="boxes_container" width="15%">
-            	<span metal:use-macro="main_macros/leftCell">Left cell</span>
+            <td id="leftCell" class="boxes_container" width="15%">
+              <span metal:use-macro="main_macros/leftCell">Left cell</span>
             </td>
 
             <td id="mainCell" width="70%">
 
-	            <div id="DesktopStatusBar" tal:condition="request/portal_status_message|nothing">
-	              <img src="info.gif" alt="Information" tal:attributes="src here/info.gif/absolute_url" i18n:attributes="alt" />
-	              <span tal:content="request/portal_status_message" i18n:translate="">Status message.</span>
-	            </div>
-
-	            <a name="documentContent"></a>
-		          <div metal:define-slot="main_no_tabs" tal:omit-tag="">
-		            <div tal:condition="specialCtxHeader" tal:content="structure specialCtxHeader">special context header</div>
-								<div id="ContentTabs" tal:condition="not:specialCtxHeader">
-									<div class="tabs" metal:use-macro="here/tabs/macros/tabs">Content tabs</div>
-									<div metal:use-macro="here/tabs/macros/additional_tabs">Additional tabs</div>
-								</div>
-	              <div id="ForematterCell">
-	                <div class="header">
-	                  <div tal:omit-tag="" metal:define-slot="header">
-	                    <h1 id="DesktopTitle">
-	                      <span tal:replace="here/title_or_id">Page Title</span>
-	                    </h1>
-	                    <div id="DesktopDescription" tal:content="structure here/Description">
-	                      Description of the resource goes here, perhaps even wrapping lines; this is to make it long enough to test.
-	                    </div>
-	                  </div>
-	                </div>
-
-	                <div id="Desktop">
-	                  <div metal:define-slot="main">
-	                    <h2>Section Header</h2>
-	                    <p>The content of the object is <a href=".">rendered</a>
-	                    hre. Lorem ipsum dolorem. Nihil obstat imprimatur. Semper ubi sub ubi.
-	                    Non illegitimi carborundum. In vino veritas. E pluribus unam.
-	                    </p>
-	                  </div>
-	                </div>
+              <div id="DesktopStatusBar" tal:condition="request/portal_status_message|nothing">
+                <img src="info.gif" alt="Information" tal:attributes="src here/info.gif/absolute_url" i18n:attributes="alt" />
+                <span tal:content="request/portal_status_message" i18n:translate="">Status message.</span>
+              </div>
+
+              <a name="documentContent"></a>
+              <div metal:define-slot="body" tal:omit-tag="">
+              <div metal:define-slot="main_no_tabs" tal:omit-tag="">
+                <div tal:condition="specialCtxHeader" tal:content="structure specialCtxHeader">special context header</div>
+                <div id="ContentTabs" tal:condition="not:specialCtxHeader">
+                  <div class="tabs" metal:use-macro="here/tabs/macros/tabs">Content tabs</div>
+                  <div metal:use-macro="here/tabs/macros/additional_tabs">Additional tabs</div>
+                </div>
+                <div id="ForematterCell">
+                  <div class="header">
+                    <div tal:omit-tag="" metal:define-slot="header">
+                      <h1 id="DesktopTitle">
+                        <span tal:replace="here/title_or_id">Page Title</span>
+                      </h1>
+                      <div id="DesktopDescription" tal:content="structure here/Description">
+                        Description of the resource goes here, perhaps even wrapping lines; this is to make it long enough to test.
+                      </div>
+                    </div>
+                  </div>
+
+                  <div id="Desktop">
+                    <div metal:define-slot="main">
+                      <h2>Section Header</h2>
+                      <p>The content of the object is <a href=".">rendered</a>
+                      hre. Lorem ipsum dolorem. Nihil obstat imprimatur. Semper ubi sub ubi.
+                      Non illegitimi carborundum. In vino veritas. E pluribus unam.
+                      </p>
+                    </div>
+                  </div>
                   <div tal:condition="not:isAnon" tal:omit-tag="">
                     <div id="ContentByLine" metal:use-macro="here/content_byline/macros/byline">
                       Content by me
                     </div>
                   </div>
-	                <div metal:define-slot="footer" tal:replace="nothing">footer slot</div>
-	              </div>
-	            </div>
-
+                  <div metal:define-slot="footer" tal:replace="nothing">footer slot</div>
+                </div>
+              </div>
+              </div>
             </td>
             <!-- end_main_column -->
             
             <td id="rightCell" class="boxes_container" width="15%">
-            	<div metal:use-macro="main_macros/rightCell">Right cell</div>
+              <div metal:use-macro="main_macros/rightCell">Right cell</div>
             </td>
           </tr>
         </table>
diff --git a/skins/generic/main_template_ajax.pt b/skins/generic/main_template_ajax.pt
index f424b43..3301bb6 100644
--- a/skins/generic/main_template_ajax.pt
+++ b/skins/generic/main_template_ajax.pt
@@ -1,23 +1,24 @@
 <fragments metal:define-macro="master">
-	<metal:block use-macro="here/main_template_macros/macros/global_defines"/>
-	<tal:block define="global dummy python:request.RESPONSE.setHeader('Content-Type', 'text/xml;;charset=utf-8')"/>
+  <metal:block use-macro="here/main_template_macros/macros/global_defines"/>
+  <tal:block define="global dummy python:request.RESPONSE.setHeader('Content-Type', 'text/xml;;charset=utf-8')"/>
 
 <fragment id="mainCell"><span tal:replace="structure string:&lt;![CDATA[" />
   <base tal:omit-tag="" metal:define-slot="base" />
   <link metal:define-slot="css_slot" tal:replace="nothing" />
 
-	<div id="Object_URL" tal:content="here/absolute_url" style="display:none"></div>
+  <div id="Object_URL" tal:content="here/absolute_url" style="display:none"></div>
   <script type="text/javascript" metal:define-slot="javascript_head_slot" tal:replace="nothing"></script>
   <div id="DesktopStatusBar" tal:condition="request/portal_status_message|nothing">
     <img src="info.gif" alt="Information" tal:attributes="src here/info.gif/absolute_url" i18n:attributes="alt" />
     <span tal:content="request/portal_status_message" i18n:translate="">Status message.</span>
   </div>
+  <div metal:define-slot="body" tal:omit-tag="">
   <div metal:define-slot="main_no_tabs" tal:omit-tag="">
     <div tal:condition="specialCtxHeader" tal:content="structure specialCtxHeader">special context header</div>
-		<div id="ContentTabs" tal:condition="not:specialCtxHeader">
-			<div class="tabs" metal:use-macro="here/tabs/macros/tabs">Content tabs</div>
-			<div metal:use-macro="here/tabs/macros/additional_tabs">Additional tabs</div>
-		</div>
+    <div id="ContentTabs" tal:condition="not:specialCtxHeader">
+      <div class="tabs" metal:use-macro="here/tabs/macros/tabs">Content tabs</div>
+      <div metal:use-macro="here/tabs/macros/additional_tabs">Additional tabs</div>
+    </div>
     <div id="ForematterCell">
       <div class="header">
         <div tal:omit-tag="" metal:define-slot="header">
@@ -47,17 +48,18 @@
       <div metal:define-slot="footer" tal:replace="nothing">footer slot</div>
     </div>
   </div>
+  </div>
 <span tal:replace="structure string:]]>" /></fragment>
 
 <tal:block define="browserObjectUrl python:request.get('_browserObjectUrl');
-									 fragments python:(browserObjectUrl and browserObjectUrl != here.absolute_url()) and ['Breadcrumbs', 'rightCell'] or request.get('syncFragments', []);"
-					 condition="fragments">
-	<tal:loop define="main_macros here/main_template_macros/macros"
-						repeat="macroName fragments">
-		<fragment tal:attributes="id macroName"><span tal:replace="structure string:&lt;![CDATA[" />
-			<metal:block metal:use-macro="python:main_macros[macroName]" />
-		<span tal:replace="structure string:]]>" /></fragment>
-	</tal:loop>
+                   fragments python:(browserObjectUrl and browserObjectUrl != here.absolute_url()) and ['Breadcrumbs', 'rightCell'] or request.get('syncFragments', []);"
+           condition="fragments">
+  <tal:loop define="main_macros here/main_template_macros/macros"
+            repeat="macroName fragments">
+    <fragment tal:attributes="id macroName"><span tal:replace="structure string:&lt;![CDATA[" />
+      <metal:block metal:use-macro="python:main_macros[macroName]" />
+    <span tal:replace="structure string:]]>" /></fragment>
+  </tal:loop>
 </tal:block>
 
 </fragments>
\ No newline at end of file
diff --git a/skins/photo_theme/main_template_standard.pt b/skins/photo_theme/main_template_standard.pt
index 18a8971..d157ba1 100755
--- a/skins/photo_theme/main_template_standard.pt
+++ b/skins/photo_theme/main_template_standard.pt
@@ -121,6 +121,7 @@
               </div>
 
               <a name="documentContent"></a>
+              <div metal:define-slot="body" tal:omit-tag="">
               <div metal:define-slot="main_no_tabs" tal:omit-tag="">
                 <div tal:condition="specialCtxHeader" tal:content="structure specialCtxHeader">special context header</div>
                 <div id="ContentTabs" tal:condition="not:specialCtxHeader">
@@ -156,6 +157,7 @@
                   <div metal:define-slot="footer" tal:replace="nothing">footer slot</div>
                 </div>
               </div>
+              </div>
 
             </td>
             <!-- end_main_column -->
-- 
2.20.1