Browse Source

More simple templates

Julio Montoya 13 years ago
parent
commit
c28e572bdd

+ 2 - 12
main/template/default/layout/layout_1_col.tpl

@@ -1,18 +1,15 @@
 {% extends "default/layout/main.tpl" %}
-{#  Header  #}
-{% block header %}
-{% include "default/layout/main_header.tpl" %}
-{% endblock %}
 
 {#  1 column  #}
 {% block body %}
-    {#  Plugin top  #}
 
+    {#  Plugin top  #}
     {% if plugin_content_top is not null %}
         <div id="plugin_content_top" class="span12">
             {{ plugin_content_top}}
         </div>
     {% endif %}
+
     <div class="span12">            
         {% include "default/layout/page_body.tpl" %}
         
@@ -30,11 +27,4 @@
             {{ plugin_content_bottom }}
         </div>
     {% endif %}
-{% endblock %}
-
-{#  Footer  #}
-{% block footer %}
-	{% if show_footer == 1 %}
-		{% include "default/layout/main_footer.tpl" %}
-	{% endif %}	
 {% endblock %}

+ 0 - 13
main/template/default/layout/layout_2_col.tpl

@@ -1,13 +1,6 @@
 {% extends "default/layout/main.tpl" %}
 
-{% block header %}
-    {% if show_header == 1 %}
-        {% include "default/layout/main_header.tpl" %}
-    {% endif %}
-{% endblock %}
-
 {% block body %}	
-
 	{# Main content #}
 	
 	{% if show_sniff == 1 %}
@@ -112,10 +105,4 @@
             </div>
         {% endif %}        
 	</div>
-{% endblock %}
-
-{% block footer %}
-    {% if show_footer == 1 %}
-        {% include "default/layout/main_footer.tpl" %}
-    {% endif %}
 {% endblock %}

+ 9 - 1
main/template/default/layout/main.tpl

@@ -1,8 +1,16 @@
-{% block header %}
+{% block header %}{% include "default/layout/main_header.tpl" %}    
 {% endblock %}
 
 {% block body %}
 {% endblock %}
 
 {% block footer %}
+    {#  Footer  #}
+    {% if show_footer == true %}
+            </div> <!-- end of #row" -->
+        </div> <!-- end of #main" -->
+        <div class="push"></div>
+    </div> <!-- end of #wrapper section -->
+    {% endif %}
+{% include "default/layout/main_footer.tpl" %}
 {% endblock %}

+ 3 - 5
main/template/default/layout/main_footer.tpl

@@ -1,7 +1,5 @@
-        </div> <!-- end of #row" -->
-    </div> <!-- end of #main" -->
-    <div class="push"></div>
-</div> <!-- end of #wrapper section -->
-{% include "default/layout/footer.tpl" %}
+{% if show_footer == true %}
+    {% include "default/layout/footer.tpl" %}
+{% endif %}
 </body>
 </html>

+ 79 - 77
main/template/default/layout/main_header.tpl

@@ -8,100 +8,102 @@
 </head>
 <body dir="{{ text_direction }}" class="{{ section_name }}">
 <noscript>{{"NoJavascript"|get_lang}}</noscript>
-{% if show_header %}    
-<div class="skip">
-    <ul>
-        <li><a href="#menu">{{"WCAGGoMenu"|get_lang}}</a></li>
-        <li><a href="#content" accesskey="2">{{"WCAGGoContent"|get_lang}}</a></li>
-    </ul>
-</div>    
-<div id="wrapper">    
-    {# Bug and help notifications #}		
-    <ul id="navigation" class="notification-panel">
-        {{ help_content }}
-        {{ bug_notification_link }}
-    </ul>    
-    {# topbar #}
-    {% include "default/layout/topbar.tpl" %}
-    
-    <div id="main" class="container">     
-        <header>
-            <div class="row">                
-                <div id="header_left" class="span4">                
-                    {# logo #}
-                    {{ logo }}
-                    
-                    {# plugin_header #}                            
-                    {% if plugin_header_left is not null %}
-                        <div id="plugin_header_left">
-                            {{ plugin_header_left }}
-                        </div>
-                    {% endif %}
-                </div>
-                
-                <div id="header_center" class="span3">                
-                    {# plugin_header #}        
-                    {% if plugin_header_center is not null %}
-                        <div id="plugin_header_center">
-                            {{ plugin_header_center }}
-                        </div>
-                    {% endif %}
-                    &nbsp;
-                </div>                                
-                <div id="header_right" class="span5">   
-                    {# header right (notifications) #}    
-                    <ul id="notifications" class="nav nav-pills pull-right">        
-                        {{ notification_menu }}
-                    </ul>
 
-                    {# plugin_header #}        
-                    {% if plugin_header_right is not null %}
-                        <div id="plugin_header_right">
-                            {{ plugin_header_right }}
-                        </div>
-                    {% endif %}
-                    &nbsp;
+{% if show_header == true %}
+    <div class="skip">
+        <ul>
+            <li><a href="#menu">{{"WCAGGoMenu"|get_lang}}</a></li>
+            <li><a href="#content" accesskey="2">{{"WCAGGoContent"|get_lang}}</a></li>
+        </ul>
+    </div>
+    <div id="wrapper">    
+        {# Bug and help notifications #}		
+        <ul id="navigation" class="notification-panel">
+            {{ help_content }}
+            {{ bug_notification_link }}
+        </ul>    
+        {# topbar #}
+        {% include "default/layout/topbar.tpl" %}
+
+        <div id="main" class="container">     
+            <header>
+                <div class="row">                
+                    <div id="header_left" class="span4">                
+                        {# logo #}
+                        {{ logo }}
+
+                        {# plugin_header #}                            
+                        {% if plugin_header_left is not null %}
+                            <div id="plugin_header_left">
+                                {{ plugin_header_left }}
+                            </div>
+                        {% endif %}
+                    </div>
+
+                    <div id="header_center" class="span3">                
+                        {# plugin_header #}        
+                        {% if plugin_header_center is not null %}
+                            <div id="plugin_header_center">
+                                {{ plugin_header_center }}
+                            </div>
+                        {% endif %}
+                        &nbsp;
+                    </div>                                
+                    <div id="header_right" class="span5">   
+                        {# header right (notifications) #}    
+                        <ul id="notifications" class="nav nav-pills pull-right">        
+                            {{ notification_menu }}
+                        </ul>
+
+                        {# plugin_header #}        
+                        {% if plugin_header_right is not null %}
+                            <div id="plugin_header_right">
+                                {{ plugin_header_right }}
+                            </div>
+                        {% endif %}
+                        &nbsp;
+                    </div>
                 </div>
-            </div>
-                
-            {% if plugin_header_main is not null %}
-                <div class="row">
-                    <div class="span12">
-                        <div id="plugin_header_main">
-                            {{ plugin_header_main }}
+
+                {% if plugin_header_main is not null %}
+                    <div class="row">
+                        <div class="span12">
+                            <div id="plugin_header_main">
+                                {{ plugin_header_main }}
+                            </div>
                         </div>
                     </div>
-                </div>
+                {% endif %}
+            </header>
+
+            {# menu #}
+            {% if menu is not null %}
+                <div class="subnav">        
+                    {{ menu }} 
+                </div>        
             {% endif %}
-        </header>
-        
-        {# menu #}
-        {% if menu is not null %}
-            <div class="subnav">        
-                {{ menu }} 
-            </div>        
-        {% endif %}
 
-        {# breadcrumb #}
-        {{ breadcrumb}}
-        
-        <div class="row">            
+            {# breadcrumb #}
+            {{ breadcrumb}}
+
+            <div class="row">
+                
             {% if show_course_shortcut is not null %}
                 <div class="span12">
                     {{ show_course_shortcut }}
                 </div>
             {% endif %}
-                        
+
             {% if show_course_navigation_menu is not null %}    
-                 <script type="text/javascript">
-                     
+                <script type="text/javascript">
+
                     /* <![CDATA[ */
                     $(document).ready( function() {
                         if (readCookie('menu_state') == 0) {
                             swap_menu();
                         }
                     });
-                    
+
                     /* ]]> */
 
                     /* <![CDATA[ */
@@ -150,5 +152,5 @@
                     /* ]]> */
                     </script>                    
                     {{ show_course_navigation_menu }}                    
-            {% endif %}            
+            {% endif %}
 {% endif %}

+ 9 - 1
main/template/default/layout/show_footer.tpl

@@ -2,7 +2,7 @@
     show_header and show_footer templates are only called when using the Display::display_header and Display::display_footer
     for backward compatibility we suppose that the default layout is one column which means using a div with class span12
  #}
-{% if show_header is not null %}
+{% if show_header == true %}
     </section>
 </div>
 {% endif %}
@@ -13,4 +13,12 @@
         {{ plugin_content_bottom}}
     </div>
 {% endif %}
+
+{% if show_footer == true %}
+        </div> <!-- end of #row" -->
+    </div> <!-- end of #main" -->
+    <div class="push"></div>
+</div> <!-- end of #wrapper section -->
+{% endif %}
+
 {% include "default/layout/main_footer.tpl" %}

+ 4 - 3
main/template/default/layout/show_header.tpl

@@ -1,15 +1,16 @@
+{% include "default/layout/main_header.tpl" %}
 {#
     show_header and show_footer templates are only called when using the Display::display_header and Display::display_footer
     for backward compatibility we suppose that the default layout is one column which means using a div with class span12
 #}
-{% include "default/layout/main_header.tpl" %}
-{% if show_header == 1 %}
+
+{% if show_header == true %}
         {% if plugin_content_top is not null %}
             <div id="plugin_content_top" class="span12">
                 {{ plugin_content_top }}
             </div>
         {% endif %}
-        <div class="span12">            
+        <div class="span12">
             {% include "default/layout/page_body.tpl" %}
             <section id="main_content">
 {% endif %}