changeset 2795:5e5b0b454e1d

remove redundant nested DIVs with class=row and class=col-md-12
author RogerHaase <haaserd@gmail.com>
date Thu, 25 Sep 2014 14:43:21 -0700
parents 1f7d8cc15805
children eb4595aea80b
files MoinMoin/themes/basic/templates/itemviews.html MoinMoin/themes/basic/templates/layout.html
diffstat 2 files changed, 190 insertions(+), 225 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/basic/templates/itemviews.html	Thu Sep 25 14:33:09 2014 -0700
+++ b/MoinMoin/themes/basic/templates/itemviews.html	Thu Sep 25 14:43:21 2014 -0700
@@ -1,23 +1,18 @@
 {% set exists = storage.has_item(item_name) %}
 {% set current_endpoint = request.endpoint %}
-
 {% set navtabs = theme_supp.get_action_tabs(fqname, current_endpoint) %}
 
 {% block views %}
     {% if navtabs %}
-        <div class="row">
-            <div class="col-md-12">
-                <ul class="moin-nav nav-tabs moin-shadow">
-                    {% for endpoint, href, maincls, iconcls, linkcls, title, label in navtabs %}
-                        <li {% if maincls %}class="{{ maincls }}"{% endif %}>
-                            <a {% if linkcls %}class="{{ linkcls }}"{% endif %} href="{{ href }}" title="{{ title }}" rel="nofollow">
-                                <span class="{{ iconcls }}"></span>
-                                {{ label }}
-                            </a>
-                        </li>
-                    {% endfor %}
-                </ul>
-            </div>
-        </div>
+        <ul class="moin-nav nav-tabs moin-shadow">
+            {% for endpoint, href, maincls, iconcls, linkcls, title, label in navtabs %}
+                <li {% if maincls %}class="{{ maincls }}"{% endif %}>
+                    <a {% if linkcls %}class="{{ linkcls }}"{% endif %} href="{{ href }}" title="{{ title }}" rel="nofollow">
+                        <span class="{{ iconcls }}"></span>
+                        {{ label }}
+                    </a>
+                </li>
+            {% endfor %}
+        </ul>
     {% endif %}
 {% endblock %}
--- a/MoinMoin/themes/basic/templates/layout.html	Thu Sep 25 14:33:09 2014 -0700
+++ b/MoinMoin/themes/basic/templates/layout.html	Thu Sep 25 14:43:21 2014 -0700
@@ -1,12 +1,12 @@
 {% extends theme("base.html") %}
 
 {% import theme("snippets.html") as snippets %}
+
 {% set logo = snippets.logo() %}
 {% set footer_logos = snippets.creditlogos() %}
 {% set credits = snippets.credits() %}
 {% 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) %}
@@ -50,237 +50,207 @@
                 {% endif %}
             </div>
             <div class="col-md-10">
-                <div class="row">
-                    <div class="col-md-12">
-                        <nav class="navbar moin-navbar-inverse">
-                            <div class="container">
-                                <div class="col-md-3">
-                                    <div class="moin-navbar-header">
-                                        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#target">
-                                          <span class="sm-only"></span>
-                                          <span class="icon-bar"></span>
-                                          <span class="icon-bar"></span>
-                                          <span class="icon-bar"></span>
-                                        </button>
-                                        {% if cfg.sitename %}
-                                            <a class="navbar-brand" href="{{ url_for('frontend.show_item', item_name=cfg.item_root) }}">
-                                                {{ cfg.sitename }}
-                                            </a>
-                                        {% endif %}
-                                    </div>
-                                </div>
-                                <div class="col-md-6 moin-loginsettings">
-                                    <div class="moin-navbar-collapse navbar-collapse collapse in" id="target">
-                                        <ul class="nav navbar-nav moin-pull-right">
-
-                                            {% if user.valid -%}
-                                                {% set avatar = user.avatar(20) %}
-                                                {% if avatar %}
-                                                    <li><img id="moin-avatar" src="{{ avatar }}" /></li>
-                                                {%- endif %}
-                                                {% if user.name -%}
-                                                    {% set wiki_href, aliasname, title, exists = theme_supp.userhome() %}
-                                                    <li>
-                                                        {{ hyperlink(wiki_href, title, exists, aliasname, "icon-user icon-white", None) }}
-                                                    </li>
-                                                    {% if 'frontend.usersettings' not in cfg.endpoints_excluded -%}
-                                                        <li>
-                                                            {{ hyperlink(url_for('frontend.usersettings'), None, True,
-                                                                _('Settings'), "icon-cog icon-white", None) }}
-                                                        </li>
-                                                    {%- endif %}
-                                                {%- endif %}
-                                                {% if user.auth_method in cfg.auth_can_logout %}
-                                                    <li>
-                                                        {{ hyperlink(url_for('frontend.logout', logout_submit=1), None, True,
-                                                                _('Logout'), "icon-off icon-white", None) }}
-                                                    </li>
-                                                {% endif %}
-                                            {% else %}
-                                                {% set login_url = theme_supp.login_url() %}
-                                                {% if login_url %}
-                                                    <li>
-                                                        {{ hyperlink(login_url, None, True, _('Login'), None, None) }}
-                                                    </li>
-                                                {% endif %}
-                                            {%- endif %}
-                                        </ul>
-                                    </div>
-                                </div>
-                                {% if search_form %}
-                                    <div class="col-md-3">
-                                        <form class="moin-navbar-form" action="{{ url_for('frontend.search') }}" method="get" role="search">
-                                            <div class="input-group">
-                                                <input name='q' type="text" class="form-control" placeholder="Search ...">
-                                                <div class="input-group-btn">
-                                                    <button class="btn btn-primary" type="submit">
-                                                        <i class="icon-search"></i>
-                                                    </button>
-                                                </div>
-                                            </div>
-                                        </form>
-                                    </div>
+                <nav class="navbar moin-navbar-inverse">
+                    <div class="container">
+                        <div class="col-md-3">
+                            <div class="moin-navbar-header">
+                                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#target">
+                                  <span class="sm-only"></span>
+                                  <span class="icon-bar"></span>
+                                  <span class="icon-bar"></span>
+                                  <span class="icon-bar"></span>
+                                </button>
+                                {% if cfg.sitename %}
+                                    <a class="navbar-brand" href="{{ url_for('frontend.show_item', item_name=cfg.item_root) }}">
+                                        {{ cfg.sitename }}
+                                    </a>
                                 {% endif %}
                             </div>
-                        </nav> <!-- navbar-inverse-->
-                    </div> <!-- column-12 -->
-                </div> <!-- row for top-navbar -->
-                <div class="row">
-                    <div class="col-md-12">
-                        <ul class="moin-breadcrumb">
-                            {% set trail_items = theme_supp.path_breadcrumbs() %}
-                            {% if trail_items %}
-                                {% for wiki_name, fqname, item_href, exists, err in trail_items %}
-                                    {% if not loop.last %}
-                                        <li>
-                                            {%- if wiki_name -%}
-                                                <a href="{{ item_href }}"{{ " " }}
-                                                    title="{{ wiki_name }}"
-                                                    class="{% if err %}moin-badinterwiki{% else %}moin-interwiki{% endif %}">
-                                                    {{ fqname|shorten_fqname }}
-                                                </a>
-                                                <i class="icon-double-angle-right icon-fixed-width"></i>
-                                            {%- else -%}
-                                                <a href="{{ url_for('frontend.show_item', item_name=fqname) }}"{{ " " }}
-                                                    {% if not exists -%}class="moin-nonexistent"{%- endif -%}>
-                                                    {{ fqname|shorten_fqname }}
-                                                </a>
-                                                <i class="icon-double-angle-right icon-fixed-width"></i>
+                        </div>
+                        <div class="col-md-6 moin-loginsettings">
+                            <div class="moin-navbar-collapse navbar-collapse collapse in" id="target">
+                                <ul class="nav navbar-nav moin-pull-right">
+                                    {% if user.valid -%}
+                                        {% set avatar = user.avatar(20) %}
+                                        {% if avatar %}
+                                            <li><img id="moin-avatar" src="{{ avatar }}" /></li>
+                                        {%- endif %}
+                                        {% if user.name -%}
+                                            {% set wiki_href, aliasname, title, exists = theme_supp.userhome() %}
+                                            <li>
+                                                {{ hyperlink(wiki_href, title, exists, aliasname, "icon-user icon-white", None) }}
+                                            </li>
+                                            {% if 'frontend.usersettings' not in cfg.endpoints_excluded -%}
+                                                <li>
+                                                    {{ hyperlink(url_for('frontend.usersettings'), None, True,
+                                                        _('Settings'), "icon-cog icon-white", None) }}
+                                                </li>
                                             {%- endif %}
-                                            <ul class="moin-bcs-subitems">
-                                                {% for fq_name in theme_supp.get_fqnames(fqname) -%}
-                                                    <li>
-                                                        <a href="{{ url_for('frontend.show_item', item_name=fq_name) }}">
-                                                            {{ fq_name|shorten_fqname(length=25) }}
-                                                        </a>
-                                                    </li>
-                                                {%- endfor %}
-                                            </ul>
-                                        </li>
+                                        {%- endif %}
+                                        {% if user.auth_method in cfg.auth_can_logout %}
+                                            <li>
+                                                {{ hyperlink(url_for('frontend.logout', logout_submit=1), None, True,
+                                                        _('Logout'), "icon-off icon-white", None) }}
+                                            </li>
+                                        {% endif %}
                                     {% else %}
-                                        <li>
-                                            <h4 class="moin-location-breadcrumb">
-                                                {% for segment_name, segment_path, exists in theme_supp.location_breadcrumbs(fqname) -%}
-                                                    {% if loop.first %}
-                                                        <small>~ /</small>
-                                                    {% elif not loop.last %}
-                                                        <a href="{{ url_for('frontend.show_item', item_name=segment_path) }}" {% if not exists %}class="moin-nonexistent"{% endif %}>
-                                                            {{ segment_name|shorten_fqname }}
-                                                        </a>
-                                                        <small>/</small>
-                                                    {%- endif %}
-                                                    {% if loop.last %}
-                                                        {% if title_name %}
-                                                            {{ title_name }}
-                                                        {% else %}
-                                                            <a href="{{ url_for('frontend.show_item', item_name=segment_path) }}" {% if not exists %}class="moin-nonexistent"{% endif %}>
-                                                                {{ segment_name|shorten_fqname }}
-                                                            </a>
-                                                        {%- endif %}
-                                                    {%- endif %}
-                                                {% endfor %}
-                                            </h4>
-                                            <ul class="moin-bcs-subitems">
-                                                {% for fq_name in theme_supp.get_fqnames(fqname) -%}
-                                                    <li>
-                                                        <a href="{{ url_for('frontend.show_item', item_name=fq_name) }}">
-                                                            {{ fq_name|shorten_fqname(length=25) }}
-                                                        </a>
-                                                    </li>
-                                                {%- endfor %}
-                                            </ul>
-                                        </li>
-                                    {% endif %}
-                                {% endfor %}
+                                        {% set login_url = theme_supp.login_url() %}
+                                        {% if login_url %}
+                                            <li>
+                                                {{ hyperlink(login_url, None, True, _('Login'), None, None) }}
+                                            </li>
+                                        {% endif %}
+                                    {%- endif %}
+                                </ul>
+                            </div>
+                        </div>
+                        {% if search_form %}
+                            <div class="col-md-3">
+                                <form class="moin-navbar-form" action="{{ url_for('frontend.search') }}" method="get" role="search">
+                                    <div class="input-group">
+                                        <input name='q' type="text" class="form-control" placeholder="Search ...">
+                                        <div class="input-group-btn">
+                                            <button class="btn btn-primary" type="submit">
+                                                <i class="icon-search"></i>
+                                            </button>
+                                        </div>
+                                    </div>
+                                </form>
+                            </div>
+                        {% endif %}
+                    </div>
+                </nav> <!-- navbar-inverse-->
+
+                <ul class="moin-breadcrumb">
+                    {% set trail_items = theme_supp.path_breadcrumbs() %}
+                    {% if trail_items %}
+                        {% for wiki_name, fqname, item_href, exists, err in trail_items %}
+                            {% if not loop.last %}
+                                <li>
+                                    {%- if wiki_name -%}
+                                        <a href="{{ item_href }}"{{ " " }}
+                                            title="{{ wiki_name }}"
+                                            class="{% if err %}moin-badinterwiki{% else %}moin-interwiki{% endif %}">
+                                            {{ fqname|shorten_fqname }}
+                                        </a>
+                                        <i class="icon-double-angle-right icon-fixed-width"></i>
+                                    {%- else -%}
+                                        <a href="{{ url_for('frontend.show_item', item_name=fqname) }}"{{ " " }}
+                                            {% if not exists -%}class="moin-nonexistent"{%- endif -%}>
+                                            {{ fqname|shorten_fqname }}
+                                        </a>
+                                        <i class="icon-double-angle-right icon-fixed-width"></i>
+                                    {%- endif %}
+                                    <ul class="moin-bcs-subitems">
+                                        {% for fq_name in theme_supp.get_fqnames(fqname) -%}
+                                            <li>
+                                                <a href="{{ url_for('frontend.show_item', item_name=fq_name) }}">
+                                                    {{ fq_name|shorten_fqname(length=25) }}
+                                                </a>
+                                            </li>
+                                        {%- endfor %}
+                                    </ul>
+                                </li>
+                            {% else %}
+                                <li>
+                                    <h4 class="moin-location-breadcrumb">
+                                        {% for segment_name, segment_path, exists in theme_supp.location_breadcrumbs(fqname) -%}
+                                            {% if loop.first %}
+                                                <small>~ /</small>
+                                            {% elif not loop.last %}
+                                                <a href="{{ url_for('frontend.show_item', item_name=segment_path) }}" {% if not exists %}class="moin-nonexistent"{% endif %}>
+                                                    {{ segment_name|shorten_fqname }}
+                                                </a>
+                                                <small>/</small>
+                                            {%- endif %}
+                                            {% if loop.last %}
+                                                {% if title_name %}
+                                                    {{ title_name }}
+                                                {% else %}
+                                                    <a href="{{ url_for('frontend.show_item', item_name=segment_path) }}" {% if not exists %}class="moin-nonexistent"{% endif %}>
+                                                        {{ segment_name|shorten_fqname }}
+                                                    </a>
+                                                {%- endif %}
+                                            {%- endif %}
+                                        {% endfor %}
+                                    </h4>
+                                    <ul class="moin-bcs-subitems">
+                                        {% for fq_name in theme_supp.get_fqnames(fqname) -%}
+                                            <li>
+                                                <a href="{{ url_for('frontend.show_item', item_name=fq_name) }}">
+                                                    {{ fq_name|shorten_fqname(length=25) }}
+                                                </a>
+                                            </li>
+                                        {%- endfor %}
+                                    </ul>
+                                </li>
                             {% endif %}
+                        {% endfor %}
+                    {% endif %}
+                </ul><!-- complete list of breadcrumbs -->
 
-                        </ul><!-- complete list of breadcrumbs -->
-                    </div>
-                </div>
             </div> <!-- col-md-10 -->
         </div> <!-- row-topnavbar -->
 
         <div class="row moin-content">
             <div class="col-md-2">
-                <div class="row">
-                    <div class="col-md-12">
-                        <div class="moin-sidebar">
-                            {% set navibar_items = theme_supp.navibar(item_name) %}
-                            {% set quicklinks = 'false' %}
-                            {% if navibar_items %}
-
-                                <div class="list-group-item moin-list-heading"> {{ _("Site Navigation") }} </div>
-                                {% for cls, url, text, title in navibar_items if cls != 'userlink' %}
-                                    <a class="list-group-item {{ cls }}
-                                        {% if url in [current_url, current_path, current_url_showview] %} active{% endif %}" href="{{ url }}"
-                                        {% if title %}title="{{ title }}"{% endif %}>
-                                        {{ text|shorten_item_name }}
-                                    </a>
-                                {% endfor %}
-
-                                {% if item_navigation %}
-                                    <div class="list-group-item moin-list-heading"> {{ _("Supplementation") }} </div>
-                                    {{ local_panel_main(item_navigation) }}
-                                {% endif %}
+                <div class="moin-sidebar">
+                    {% set navibar_items = theme_supp.navibar(item_name) %}
+                    {% set quicklinks = 'false' %}
+                    {% if navibar_items %}
+                        <div class="list-group-item moin-list-heading"> {{ _("Site Navigation") }} </div>
+                        {% for cls, url, text, title in navibar_items if cls != 'userlink' %}
+                            <a class="list-group-item {{ cls }}
+                                {% if url in [current_url, current_path, current_url_showview] %} active{% endif %}" href="{{ url }}"
+                                {% if title %}title="{{ title }}"{% endif %}>
+                                {{ text|shorten_item_name }}
+                            </a>
+                        {% endfor %}
+                        {% if item_navigation %}
+                            <div class="list-group-item moin-list-heading"> {{ _("Supplementation") }} </div>
+                            {{ local_panel_main(item_navigation) }}
+                        {% endif %}
+                    {% endif %}
 
-                            {% endif %}
+                    {% for cls, url, text, title in navibar_items if cls == 'userlink' %}
+                        {% if loop.first %}
+                            <div class="list-group-item moin-list-heading">Quick Links</div>
+                        {% endif %}
+                        <div class="moin-quicklink">
+                            <a class="moin-quicklink-label {{ cls }}" href="{{ url }}" {% if title %}title="{{ title }} : {{ url|safe }}"{% else %}"{{ url|safe }}"{% endif %}>{{ text|shorten_item_name(20) }}
+                            </a>
+                        </div>
+                    {% endfor %}
 
-                            {% for cls, url, text, title in navibar_items if cls == 'userlink' %}
-                                {% if loop.first %}
-                                    <div class="list-group-item moin-list-heading">Quick Links</div>
-                                {% endif %}
-                                <div class="moin-quicklink">
-                                    <a class="moin-quicklink-label {{ cls }}" href="{{ url }}" {% if title %}title="{{ title }} : {{ url|safe }}"{% else %}"{{ url|safe }}"{% endif %}>{{ text|shorten_item_name(20) }}
-                                    </a>
-                                </div>
-                            {% endfor %}
-                        </div>
-                    </div>
-                </div><!--first row of sidebar-->
-
-                <div class="row">
-                    <div class="col-md-12">
-                        {% if self.local_panel %}
-                            {{ self.local_panel() }}
-                        {% endif %}
-                    </div>
-                </div><!--second row of sidebar-->
-
+                    {% if self.local_panel %}
+                        {{ self.local_panel() }}
+                    {% endif %}
+                </div>
             </div><!--/span-->
 
             <div class="col-md-10">
-                <div class="row">
-                    <div class="col-md-12">
-                        {# id -> moin-flash is used to add special alerts for ex. for changes to User Settings via JS, see common.js #}
-                        <div id="moin-flash">
-                            {% for category, msg in get_flashed_messages(with_categories=true) %}
-                                <div class="moin-flash moin-flash-{{ category }}">
-                                    {{ msg }}
-                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
-                                </div>
-                            {% endfor %}
+
+                {# id -> moin-flash is used to add special alerts for ex. for changes to User Settings via JS, see common.js #}
+                <div id="moin-flash">
+                    {% for category, msg in get_flashed_messages(with_categories=true) %}
+                        <div class="moin-flash moin-flash-{{ category }}">
+                            {{ msg }}
+                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                         </div>
-                    </div>
-                </div> <!-- moin-flash-message -->
+                    {% endfor %}
+                </div>
 
                 {% block views %}
-
                 {% endblock %}
 
-                <div class="row">
-                    {% set width = "col-md-12" %}
+                {% set content_id = self.local_panel and 'moin-content' or 'moin-content-no-panel' %}
+                <div id="{{ content_id }}" lang="{{ theme_supp.content_lang }}" dir="{{ theme_supp.content_dir }}">
+                    {% block content %}
+                        {# All content templates should implement this block. #}
+                    {% endblock %}
+                </div>
 
-                    <div class="{{width}}">
-                        {% set content_id = self.local_panel and 'moin-content' or 'moin-content-no-panel' %}
-                        <div id="{{ content_id }}" lang="{{ theme_supp.content_lang }}" dir="{{ theme_supp.content_dir }}">
-                            {% block content %}
-                                {# All content templates should implement this block. #}
-                            {% endblock %}
-                        </div>
-                    </div><!--/span-->
-                </div><!--/row-->
-
-            </div><!--/span-->
+            </div><!--/col-md-10-->
         </div> <!--/row sidebar, tabs, content - main-->
 
         {% block footer %}