allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kentontay...@apache.org
Subject allura git commit: SF-8243 Allow for optional wrapping of all content within additional outer container elements
Date Fri, 12 Oct 2018 13:55:49 GMT
Repository: allura
Updated Branches:
  refs/heads/kt/8243 [created] 48048b413


SF-8243 Allow for optional wrapping of all content within additional outer container elements


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/48048b41
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/48048b41
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/48048b41

Branch: refs/heads/kt/8243
Commit: 48048b41383c7f11fce28eca24175417848911cc
Parents: cd8321c
Author: Kenton Taylor <ktaylor@slashdotmedia.com>
Authored: Fri Oct 12 13:54:30 2018 +0000
Committer: Kenton Taylor <ktaylor@slashdotmedia.com>
Committed: Fri Oct 12 13:54:30 2018 +0000

----------------------------------------------------------------------
 .../allura/templates/jinja_master/master.html   | 118 ++++++++++---------
 .../templates/jinja_master/theme_macros.html    |   8 ++
 2 files changed, 70 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/48048b41/Allura/allura/templates/jinja_master/master.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/master.html b/Allura/allura/templates/jinja_master/master.html
index 649699c..b1cc5ca 100644
--- a/Allura/allura/templates/jinja_master/master.html
+++ b/Allura/allura/templates/jinja_master/master.html
@@ -42,6 +42,8 @@
 {% endif %}
 {% do g.register_forge_js('js/memorable.js') %}
 {% do g.resource_manager.register_widgets(c) %}
+
+
 {# paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ #}
 <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
 <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
@@ -87,66 +89,70 @@
         {{ blob }}
     {% endfor %}
 {% endblock %}
-{{ theme_macros.header(g.login_url, '/auth/logout') }}
-{{ theme_macros.site_notification() }}
-{% set flash = tg.flash_obj.render('flash', use_js=False) %}
-{% block masthead %}{% endblock %}
-<section id="page-body" class="{{ g.document_class(neighborhood) }} {% block page_body_classes
%}{% endblock %}">
-<div id="nav_menu_holder">
-    {% if c.project and c.project.is_nbhd_project %}
-        {% set neighborhood=c.project.neighborhood %}
-            {% include 'allura:templates/jinja_master/neigh_nav_menu.html' with context %}
-    {% else %}
-        {% block nav_menu %}
-            {% include g.theme.nav_menu %}
-        {% endblock %}
-    {% endif %}
-</div>
-    <div id="top_nav" class="">
-        {% block top_nav %}
-            {% include g.theme.top_nav %}
-        {% endblock %}
-    </div>
-    <div id="content_base">
-        {% block content_base %}
-            {% if not hide_left_bar %}
-                {% block sidebar_menu %}
-                    {% include g.theme.sidebar_menu %}
-                {% endblock %}
-                {% set outer_width = 20 %}
-            {% else %}
-                {% set outer_width = 24 %}
-            {% endif %}
-            {% if show_right_bar %}
-                {% set inner_width = outer_width - 8 %}
+
+{% call all_content_wrapper() %}
+    {{ theme_macros.header(g.login_url, '/auth/logout') }}
+    {{ theme_macros.site_notification() }}
+    {% set flash = tg.flash_obj.render('flash', use_js=False) %}
+    {% block masthead %}{% endblock %}
+    <section id="page-body" class="{{ g.document_class(neighborhood) }} {% block page_body_classes
%}{% endblock %}">
+        <div id="nav_menu_holder">
+            {% if c.project and c.project.is_nbhd_project %}
+                {% set neighborhood=c.project.neighborhood %}
+                    {% include 'allura:templates/jinja_master/neigh_nav_menu.html' with context
%}
             {% else %}
-                {% set inner_width = outer_width %}
+                {% block nav_menu %}
+                    {% include g.theme.nav_menu %}
+                {% endblock %}
             {% endif %}
-            <div class="grid-{{ outer_width }} pad">
-                <h2 class="dark{% block header_classes %} title{% endblock %}">{% block
header %}{% endblock %}
-                    <!-- actions -->
-                    <small>
-                        {% block actions %}{% endblock %}
-                    </small>
-                    <!-- /actions -->
-                </h2>
-                {% block edit_box %}{% endblock %}
-                <div{% if show_right_bar %}
-                    class="{% block inner_grid scoped %}grid-{{ inner_width }}{% endblock
%}"{% endif %}>
-                    {% block before_content %}{% endblock %}
-                    {% block content %}{% endblock %}
-                </div>
+        </div>
+        <div id="top_nav" class="">
+            {% block top_nav %}
+                {% include g.theme.top_nav %}
+            {% endblock %}
+        </div>
+        <div id="content_base">
+            {% block content_base %}
+                {% if not hide_left_bar %}
+                    {% block sidebar_menu %}
+                        {% include g.theme.sidebar_menu %}
+                    {% endblock %}
+                    {% set outer_width = 20 %}
+                {% else %}
+                    {% set outer_width = 24 %}
+                {% endif %}
                 {% if show_right_bar %}
-                    <div id="sidebar-right" class="grid-6 fright">
-                        {% block right_content %}{% endblock %}
-                    </div>
+                    {% set inner_width = outer_width - 8 %}
+                {% else %}
+                    {% set inner_width = outer_width %}
                 {% endif %}
-                {% block after_content %}{% endblock %}
-            </div>
-        {% endblock %}
-    </div>
-</section>
-{{ theme_macros.footer(g.year(), g.theme_href('')) }}
+                <div class="grid-{{ outer_width }} pad">
+                    <h2 class="dark{% block header_classes %} title{% endblock %}">{%
block header %}{% endblock %}
+                        <!-- actions -->
+                        <small>
+                            {% block actions %}{% endblock %}
+                        </small>
+                        <!-- /actions -->
+                    </h2>
+                    {% block edit_box %}{% endblock %}
+                    <div{% if show_right_bar %}
+                        class="{% block inner_grid scoped %}grid-{{ inner_width }}{% endblock
%}"{% endif %}>
+                        {% block before_content %}{% endblock %}
+                        {% block content %}{% endblock %}
+                    </div>
+                    {% if show_right_bar %}
+                        <div id="sidebar-right" class="grid-6 fright">
+                            {% block right_content %}{% endblock %}
+                        </div>
+                    {% endif %}
+                    {% block after_content %}{% endblock %}
+                </div>
+            {% endblock %}
+        </div>
+    </section>
+    {{ theme_macros.footer(g.year(), g.theme_href('')) }}
+{% endcall %}
+
 <div id="messages">
     {% for n in h.pop_user_notifications() %}
         <section class="message {{ n.subject or 'info' }}">

http://git-wip-us.apache.org/repos/asf/allura/blob/48048b41/Allura/allura/templates/jinja_master/theme_macros.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/theme_macros.html b/Allura/allura/templates/jinja_master/theme_macros.html
index 3b8e844..f403243 100644
--- a/Allura/allura/templates/jinja_master/theme_macros.html
+++ b/Allura/allura/templates/jinja_master/theme_macros.html
@@ -54,6 +54,14 @@ http://stackoverflow.com/questions/26582731/redefining-imported-jinja-macros
 {%- endmacro %}
 {% endif %}
 
+
+{% if not all_content_wrapper %}
+{% macro all_content_wrapper() -%}
+{{- caller(**kwargs) -}}
+{%- endmacro %}
+{% endif %}
+
+
 {% if not footer %}
 {%- macro footer(year, path_to_static='') %}
 <footer id="site-footer">


Mime
View raw message