changeset 2849:22796e5b5361

merge basic snippets.html into templates/snippets.html add missing before header ... after footer to basic theme
author RogerHaase <haaserd@gmail.com>
date Thu, 13 Nov 2014 07:46:51 -0700
parents 5f372df47c94
children 86b747edc4a7
files MoinMoin/static/css/common.css MoinMoin/templates/base.html MoinMoin/templates/layout.html MoinMoin/templates/show.html MoinMoin/templates/snippets.html MoinMoin/themes/basic/static/css/theme.css MoinMoin/themes/basic/static/custom-less/theme.less MoinMoin/themes/basic/templates/layout.html MoinMoin/themes/basic/templates/show.html MoinMoin/themes/basic/templates/snippets.html MoinMoin/themes/modernized/static/css/stylus/theme.styl MoinMoin/themes/modernized/static/css/theme.css
diffstat 12 files changed, 75 insertions(+), 157 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/static/css/common.css	Sun Nov 02 08:10:02 2014 -0700
+++ b/MoinMoin/static/css/common.css	Thu Nov 13 07:46:51 2014 -0700
@@ -217,3 +217,12 @@
 .zebra td form input { box-shadow: none; }
 .zebra tbody tr:nth-child(even),
 .zebra > tr:nth-child(odd) { background-color: #eee; }
+
+/* footers */
+#moin-footer { clear: both; margin: 0 0; width: 100%; }
+#moin-pageinfo,
+#moin-wiki-license,
+#moin-credits,
+#moin-version,
+#moin-timings { margin: 10px 20px; text-align: left; font-size: .7em; color: #737373; float: left; clear: left; }
+#moin-creditlogos { clear: both; float: right; }
--- a/MoinMoin/templates/base.html	Sun Nov 02 08:10:02 2014 -0700
+++ b/MoinMoin/templates/base.html	Thu Nov 13 07:46:51 2014 -0700
@@ -54,9 +54,8 @@
                 {% block theme_stylesheets %}
                     <link media="all" rel="stylesheet" href="{{ url_for('static', filename='css/common.css') }}" />
                     <link media="all" rel="stylesheet" href="{{ theme_static('css/theme.css') }}" />
-
+                    {{ stylesheets }}
                 {% endblock %}
-                {{ stylesheets }}
                 {% if user.valid and user.css_url -%}
                     <link media="all" rel="stylesheet" title="{{ user.name }}'s stylesheet" href="{{ user.css_url }}" />
                 {%- endif %}
--- a/MoinMoin/templates/layout.html	Sun Nov 02 08:10:02 2014 -0700
+++ b/MoinMoin/templates/layout.html	Thu Nov 13 07:46:51 2014 -0700
@@ -166,20 +166,19 @@
         </div>
 
         {{ before_footer }}
+        <div id="moin-footer">
 
-        <div id="moin-footer">
             {% block footer %}
+                {% block footer_hr %}<hr/>{% endblock %}
                 {% block footer_itemviews %}{% endblock %}
-                {% block footer_hr %}<hr/>{% endblock %}
-                {{ creditlogos }}
                 {% block footer_meta %}{% endblock %}
-                {% if license_info %}<p id="moin-wikilicense">{{ license_info }}</p>{% endif %}
+                {{ creditlogos }}
                 {{ credits }}
+                {{ license_info }}
             {% endblock %}
-        </div>
 
+        </div>
         {{ after_footer }}
-
     </div>
 
 {% endblock %}
--- a/MoinMoin/templates/show.html	Sun Nov 02 08:10:02 2014 -0700
+++ b/MoinMoin/templates/show.html	Thu Nov 13 07:46:51 2014 -0700
@@ -1,5 +1,9 @@
 {% extends theme("layout.html") %}
+
 {% import "utils.html" as utils %}
+{% import "snippets.html" as snippets with context %}
+
+{% set footer_meta = snippets.footer_meta() %}
 
 {% block head_links %}
     {{ super() }}
@@ -71,18 +75,7 @@
 {% endblock %}
 
 {% block footer_meta %}
-    {% if rev %}
-        <p id="moin-pageinfo" lang="{{ theme_supp.ui_lang }}" dir="{{ theme_supp.ui_dir }}">
-            {% if cfg.show_interwiki %}{{ cfg.interwikiname }}:{% endif %}{{ item_name }} (rev {{rev.revid | shorten_id}}),
-                {{ _("modified") }} {{ rev.meta['mtime']|datetimeformat }}
-                {{ _("by") }} {{ utils.editor_info(rev.meta) }}{% if rev.tags %},
-                {{ _("tagged") }}
-                {% for tag in rev.tags -%}
-                    <a href="{{ url_for('frontend.tagged_items', tag=tag) }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}
-                {%- endfor -%}
-            {%- endif -%}.
-        </p>
-    {% endif %}
+    {{footer_meta}}
 {% endblock %}
 
 {% block options_for_javascript %}
--- a/MoinMoin/templates/snippets.html	Sun Nov 02 08:10:02 2014 -0700
+++ b/MoinMoin/templates/snippets.html	Thu Nov 13 07:46:51 2014 -0700
@@ -1,4 +1,7 @@
-{# Use the template_dirs configuration option to override this template #}
+{#
+Wiki Administrators may use this template (or a copy of it) to customize a wiki.
+See https://moin-20.readthedocs.org/en/latest/admin/configure.html#using-a-custom-snippets-html-template
+#}
 
 {# Logo in the header #}
 {% macro logo() -%}
@@ -7,10 +10,12 @@
 
 {# Additional HTML tags inside <head> #}
 {% macro head() -%}
+    {# <meta name="description" content="Free Web tutorials"> #}
 {%- endmacro %}
 
 {# Additional HTML before #moin-header #}
 {% macro before_header() -%}
+    {# <p style="background-color:yellow">This is before moin-header.</p> #}
 {%- endmacro %}
 
 {# Additional HTML after #moin-header #}
@@ -27,6 +32,7 @@
 
 {# License information in the footer #}
 {% macro license_info() -%}
+    {# <p id="moin-wiki-license">Copyright by...</p> #}
 {%- endmacro %}
 
 {# Helper macro to create image links #}
@@ -35,11 +41,10 @@
 {% endmacro %}
 
 {# Image links in the footer #}
-{% macro creditlogos(start='<ul id="moin-creditlogos"><li>'|safe, end='</li></ul>'|safe, sep='</li><li>'|safe) %}
+{% macro creditlogos(start='<span id="moin-creditlogos">'|safe, end='</span>'|safe) %}
     {{ start }}
     {{ creditlogo('http://moinmo.in/', url_for('static', filename='logos/moinmoin_powered.png'),
        'MoinMoin powered', 'This site uses the MoinMoin Wiki software.') }}
-    {{ sep }}
     {{ creditlogo('http://moinmo.in/Python', url_for('static', filename='logos/python_powered.png'),
        'Python powered', 'MoinMoin is written in Python.') }}
     {{ end }}
@@ -63,6 +68,25 @@
     {{ end }}
 {% endmacro %}
 
+{% macro footer_meta() %}
+    {% if rev %}
+        <p id="moin-pageinfo" lang="{{ theme_supp.ui_lang }}" dir="{{ theme_supp.ui_dir }}">
+            {% if cfg.show_interwiki %}
+                {{ cfg.interwikiname }}:
+            {% endif %}
+            {{ item_name }} (rev {{rev.revid | shorten_id}}),
+            {{ _("modified") }} {{ rev.meta['mtime']|datetimeformat }}
+            {{ _("by") }} {{ utils.editor_info(rev.meta) }}
+            {% if item.meta['tags'] %}
+                , {{ _("tags:") }}
+                {% for tag in item.meta['tags'] -%}
+                    <a href="{{ url_for('frontend.tagged_items', tag=tag) }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}
+                {%- endfor -%}
+            {%- endif -%}.
+        </p>
+    {% endif %}
+{% endmacro %}
+
 {# Additional Stylesheets (after theme css, before user css #}
 {% macro stylesheets() -%}
 {%- endmacro %}
--- a/MoinMoin/themes/basic/static/css/theme.css	Sun Nov 02 08:10:02 2014 -0700
+++ b/MoinMoin/themes/basic/static/css/theme.css	Thu Nov 13 07:46:51 2014 -0700
@@ -7009,11 +7009,6 @@
 .moin-content {
   padding-bottom: 10%;
 }
-.moin-footer {
-  bottom: 0;
-  position: absolute;
-  width: 100%;
-}
 .moin-search-option-bar {
   padding-left: 10px;
   border: 1px solid #555555;
@@ -7033,13 +7028,6 @@
   .moin-content {
     padding-bottom: 250px;
   }
-  .moin-footer-credits {
-    width: 100%;
-    padding-right: 30px;
-  }
-  .moin-footer-logo {
-    padding-left: 30px;
-  }
 }
 html {
   overflow-y: scroll;
--- a/MoinMoin/themes/basic/static/custom-less/theme.less	Sun Nov 02 08:10:02 2014 -0700
+++ b/MoinMoin/themes/basic/static/custom-less/theme.less	Thu Nov 13 07:46:51 2014 -0700
@@ -622,11 +622,6 @@
 .moin-content {
   padding-bottom: 10%;
 }
-.moin-footer {
-  bottom: 0;
-  position: absolute;
-  width: 100%;
-}
 .moin-search-option-bar {
   padding-left: 10px;
   border: 1px solid @gray;
@@ -647,13 +642,6 @@
   .moin-content {
     padding-bottom: 250px;
   }
-  .moin-footer-credits {
-    width: 100%;
-    padding-right: 30px;
-  }
-  .moin-footer-logo {
-    padding-left: 30px;
-  }
 }
 
 html{
--- a/MoinMoin/themes/basic/templates/layout.html	Sun Nov 02 08:10:02 2014 -0700
+++ b/MoinMoin/themes/basic/templates/layout.html	Thu Nov 13 07:46:51 2014 -0700
@@ -3,10 +3,14 @@
 {% import theme("snippets.html") as snippets %}
 
 {% set logo = snippets.logo() %}
-{% set footer_logos = snippets.creditlogos() %}
+{% set before_header = snippets.before_header() %}
+{% set after_header = snippets.after_header() %}
+{% set before_footer = snippets.before_footer() %}
+{% set after_footer = snippets.after_footer() %}
+{% set license_info = snippets.license_info() %}
 {% set credits = snippets.credits() %}
+{% set creditlogos = snippets.creditlogos() %}
 {% set user_actions, item_navigation, item_actions = theme_supp.get_local_panel(fqname) %}
-{% set basic_scripts = snippets.add_scripts() %}
 {% set current_url = request.url %}
 {% set current_path = request.path %}
 {% set current_url_showview = url_for_item(endpoint='frontend.show_item', item_name=item_name) %}
@@ -117,6 +121,7 @@
             </div> {# moin-sidebar #}
 
             <div class="col-md-10 col-sm-9 col-xs-12">
+                {{ before_header }}
                 <nav class="navbar moin-navbar-inverse">
                     <div class="row">
                         <div class="col-md-3 col-sm-5 col-xs-6">
@@ -180,6 +185,8 @@
                     </div>
                 </nav> {# navbar moin-navbar-inverse #}
 
+                {{ after_header }}
+
                 <ul class="moin-breadcrumb">
                     {% set trail_items = theme_supp.path_breadcrumbs() %}
                     {% if trail_items %}
@@ -269,12 +276,20 @@
                     </div>
                 </div>
 
+                {{ before_footer }}
+
                 {% block footer %}
-                    <div class="navbar">
-                        {{ footer_logos }}
+                    <div class="navbar moin-footer">
+                        {% block footer_hr %}<hr/>{% endblock %}
+                        {% block footer_meta %}{% endblock %}
+                        {{ creditlogos }}
                         {{ credits }}
+                        {{ license_info }}
                     </div>
                 {% endblock %}
+
+                {{ after_footer }}
+
             </div> {# parent of header, breadcrumbs, content, footer #}
         </div>
 
@@ -283,5 +298,5 @@
 
 {% block body_scripts %}
     {{ super() }}
-    {{ basic_scripts }}
+    <script src="{{ url_for('static', filename='js/basic.js') }}"></script>
 {% endblock %}
--- a/MoinMoin/themes/basic/templates/show.html	Sun Nov 02 08:10:02 2014 -0700
+++ b/MoinMoin/themes/basic/templates/show.html	Thu Nov 13 07:46:51 2014 -0700
@@ -1,7 +1,11 @@
 {% extends theme("layout.html") %}
+
 {% import "utils.html" as utils %}
 {% import theme("itemviews.html") as itemviews with context %}
+{% import "snippets.html" as snippets with context %}
+
 {% set exists = storage.has_item(item_name) %}
+{% set footer_meta = snippets.footer_meta() %}
 
 {% block views %}
     {{ itemviews }}
@@ -79,6 +83,10 @@
     {% endif %}
 {% endblock %}
 
+{% block footer_meta %}
+    {{footer_meta }}
+{% endblock %}
+
 {% block options_for_javascript %}
     {%- if item_name and user.edit_on_doubleclick and user.may.write(item_name) -%}
         <br id="moin-edit-on-doubleclick" />
--- a/MoinMoin/themes/basic/templates/snippets.html	Sun Nov 02 08:10:02 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-{# Logo in the header #}
-{% macro logo() -%}
-    <img src="{{ url_for('static', filename='logos/moinmoin.png') }}" id="moin-img-logo" alt="Logo">
-{%- endmacro %}
-
-
-{# Helper macro to create image links #}
-{% macro creditlogo(link, logo, alt, title) %}
-    <a class="navbar-brand moin-footer-logo" href="{{ link }}" title="{{ title }}"><img src="{{ logo }}" alt="{{ alt }}" /></a>
-{% endmacro %}
-
-
-{# Image links in the footer #}
-{% macro creditlogos(start='<div class="navbar-header">'|safe, end='</div>'|safe, sep=''|safe) %}
-    {{ start }}
-    {{ creditlogo('http://moinmo.in/', url_for('static', filename='logos/moinmoin-small.png'),
-       'MoinMoin powered', 'This site uses the MoinMoin Wiki software.') }}
-    {{ end }}
-{% endmacro %}
-
-
-{# Helper macro to generate text links #}
-{% macro credit(link, text, title) -%}
-    <a href="{{ link }}" title="{{ title }}">{{ text }}</a>
-{%- endmacro %}
-
-
-{# Text links in the footer #}
-{% macro credits(start='<ul class="nav navbar-nav pull-right moin-footer-credits"> <li>'|safe, end='</li> </ul>'|safe, sep='</li> <li>'|safe) %}
-    {{ start }}
-    {{ credit('http://moinmo.in/', 'MoinMoin Powered', 'This site uses the MoinMoin Wiki software.') }}
-    {{ sep }}
-    {{ credit('http://moinmo.in/Python', 'Python Powered', 'MoinMoin is written in Python.') }}
-    {{ sep }}
-    {{ credit('http://moinmo.in/GPL', 'GPL licensed', 'MoinMoin is GPL licensed.') }}
-    {{ sep }}
-    {{ credit('http://validator.w3.org/check?uri=referer', 'Valid HTML 5', 'Click here to validate this page.') }}
-    {{ end }}
-{% endmacro %}
-
-{# Additional JavaScript #}
-{% macro add_scripts() -%}
-    <script src="{{ url_for('static', filename='js/basic.js') }}"></script>
-{% endmacro %}
--- a/MoinMoin/themes/modernized/static/css/stylus/theme.styl	Sun Nov 02 08:10:02 2014 -0700
+++ b/MoinMoin/themes/modernized/static/css/stylus/theme.styl	Thu Nov 13 07:46:51 2014 -0700
@@ -1282,52 +1282,6 @@
     box-shadow none
     background url(../img/moin-link.png) no-repeat center center
 
-#moin-footer
-    clear both
-    margin 0 0
-
-#moin-footer hr
-    margin 0
-    background-color border_color
-
-#moin-pageinfo,
-#moin-wikilicense,
-#moin-credits,
-#moin-version,
-#moin-timings
-    margin 10px 20px
-    text-align left
-    font-size 0.7em
-    color footer_color
-    a
-        color footer_color
-
-#moin-pageinfo
-    margin-top 20px
-
-#moin-timings li
-    display inline-block
-    *display: inline; // IE7 hack to display timings in a row ...
-    zoom: 1; // IE7 hack ... rather than a column
-    margin 0 20px 0 0
-
-#moin-credits span
-    display inline-block
-    margin 0 5px
-
-#moin-creditlogos
-    float right
-    list-style none
-    margin 5px 10px
-
-#moin-creditlogos li
-    display inline-block
-    *display: inline; // IE7 hack to display credit logos in a row ...
-    zoom: 1; // IE7 hack ... rather than a column
-    margin 10px 0 10px 10px
-
-
-
 // headings with mouseover permalinks
 a.moin-permalink
     display none
@@ -1357,11 +1311,6 @@
 #moin-page
     padding-bottom 105px
 
-#moin-footer
-    position absolute
-    width 100%
-    bottom 0
-
 .moin-search-option-bar
     width 75%
     padding-left 14px
--- a/MoinMoin/themes/modernized/static/css/theme.css	Sun Nov 02 08:10:02 2014 -0700
+++ b/MoinMoin/themes/modernized/static/css/theme.css	Thu Nov 13 07:46:51 2014 -0700
@@ -554,22 +554,12 @@
 .moin-subitem-navigation li ul{border-left:1px dotted #4e7da9;display:none}
 .moin-subitem-navigation .expander{background:url("../img/moin-expand.png") no-repeat center center;cursor:pointer;height:16px;overflow:hidden;vertical-align:middle;width:16px;border:hidden;text-indent:-9000%}
 .moin-insertname-action{border:hidden;text-indent:-9000%;padding:0;margin:0 -2px;vertical-align:middle;height:16px;width:16px;overflow:hidden;cursor:pointer;box-shadow:none;background:url("../img/moin-link.png") no-repeat center center}
-#moin-footer{clear:both;margin:0 0}
-#moin-footer hr{margin:0;background-color:#4e7da9}
-#moin-pageinfo,#moin-wikilicense,#moin-credits,#moin-version,#moin-timings{margin:10px 20px;text-align:left;font-size:.7em;color:#737373;}
-#moin-pageinfo a,#moin-wikilicense a,#moin-credits a,#moin-version a,#moin-timings a{color:#737373}
-#moin-pageinfo{margin-top:20px}
-#moin-timings li{display:inline-block;*display:inline;zoom:1;margin:0 20px 0 0}
-#moin-credits span{display:inline-block;margin:0 5px}
-#moin-creditlogos{float:right;list-style:none;margin:5px 10px}
-#moin-creditlogos li{display:inline-block;*display:inline;zoom:1;margin:10px 0 10px 10px}
 a.moin-permalink{display:none;cursor:pointer;margin-left:.1em;color:#939393;}
 a.moin-permalink:hover.moin-permalink{color:#1f62ad}
 h1:hover .moin-permalink,h2:hover .moin-permalink,h3:hover .moin-permalink,h4:hover .moin-permalink,h5:hover .moin-permalink,h6:hover .moin-permalink{display:inline;text-decoration:none}
 html,body{height:100%}
 #moin-main-wrapper{position:relative;min-height:100%}
 #moin-page{padding-bottom:105px}
-#moin-footer{position:absolute;width:100%;bottom:0}
 .moin-search-option-bar{width:75%;padding-left:14px;}
 .moin-search-option-bar span{float:right;padding:10px}
 .moin-suggestions{padding-left:14px}