[PATCH 3 of 5 sherpa] Drop breadcrumbs at once

Sylvain Thenault sylvain.thenault at logilab.fr
Fri Feb 24 16:11:04 CET 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1487941029 -3600
#      Fri Feb 24 13:57:09 2017 +0100
# Node ID 8ed008dd8cd45a3c9f77272dc0da4d3d78f82881
# Parent  17d53257e1689e312577a5b2df823086eb135837
Drop breadcrumbs at once

This is an attempt to make UI lighter and clearer. This makes sense once
top-level links works properly (high-lighting, at least).

While the parent entity information misses sometimes, it's not the case for the
most proeminent cases of this application: archive transfer / units have a tree
indicating the context of the viewed element, and authority record don't propose
navigation to sub-objects.

The only remaning thing is for a concept, but those are still 2nd class citizen
in sherpa, so I think we can move that way.

diff --git a/cubicweb_sherpa/data/cubes.sherpa.css b/cubicweb_sherpa/data/cubes.sherpa.css
--- a/cubicweb_sherpa/data/cubes.sherpa.css
+++ b/cubicweb_sherpa/data/cubes.sherpa.css
@@ -89,30 +89,10 @@ hr {
 
 .navbar-sherpa #search_box input {
   border-radius: 0;
 }
 
-/*breadcrumbs */
-
-.breadcrumb {
-  background-color: #0b6ba8;
-  color: #fff;
-  border-radius: 0;
-  list-style: none;
-  font-size: 1.3em;
-  padding-top: 0.8em;
-  padding-bottom: 0.8em;
-  margin-bottom: 0;
-}
-
-.breadcrumb a {
-  color: #fff;
-}
-
-.breadcrumbs_wrapper {
-  background-color: #0b6ba8;
-}
 
 /* aside */
 #aside-main-left {
   margin-top : 3em;
 }
@@ -557,14 +537,10 @@ table { font-size: 1em;}
 
 @media (min-width: 990px) {
   .page-content {
     padding : 0 5em 0 5em;
   }
-
-  .breadcrumb {
-    padding-left: 4.1em;
-  }
 }
 
 @media(min-width: 760px){
   #pagefooter #sherpa-navigation {
     float: left;
diff --git a/cubicweb_sherpa/views/templates.py b/cubicweb_sherpa/views/templates.py
--- a/cubicweb_sherpa/views/templates.py
+++ b/cubicweb_sherpa/views/templates.py
@@ -70,27 +70,18 @@ class SherpaMainTemplate(basetemplates.T
         right_header_component = stream.getvalue()
         # application message
         msgcomp = self._cw.vreg['components'].select_or_none(
             'applmessages', self._cw, rset=self.cw_rset)
         application_message = msgcomp.render() if msgcomp else u''
-        # breadcrumbs
-        stream = UStringIO()
-        w = stream.write
-        components = self.get_components(view, context='header-center')
-        if components:
-            for component in components:
-                component.render(w=w)
-        breadcrumbs = stream.getvalue()
         # contextual components
         contextual_components = self._cw.view('contentheader', rset=self.cw_rset, view=view)
 
         ctx = self.base_context()
         url = self._cw.build_url
         ctx.update({
             'title': view.page_title(),
             'page_content': view.render(),
-            'breadcrumbs': breadcrumbs,
             'application_message': application_message,
             'contextual_components': contextual_components,
             'right_header_component': right_header_component,
             'left_boxes': left_boxes_html,
             'side_box': {
diff --git a/cubicweb_sherpa/views/templates/maintemplate.jinja2.html b/cubicweb_sherpa/views/templates/maintemplate.jinja2.html
--- a/cubicweb_sherpa/views/templates/maintemplate.jinja2.html
+++ b/cubicweb_sherpa/views/templates/maintemplate.jinja2.html
@@ -17,17 +17,10 @@
       <div class="col-md-3 col-xs-4">
         {{ right_header_component|safe }}
       </div>
     </div>
   </nav>
-  {% if breadcrumbs %}
-  <nav role="navigation" class="breadcrumbs_wrapper">
-    <div class="col-md-offset-2">
-      {{ breadcrumbs|safe }}
-    </div>
-  </nav>
-  {% endif %}
   <div id="{{page_id}}" class="container-fluid" role="main">
     <aside id="aside-main-left" class="col-md-2 cwjs-aside">
       {{ left_boxes|safe }}
       <div class="panel panel-default contextFreeBox facet_filterbox" id="facet_filterbox">
         <div class="panel-heading">


More information about the saem-devel mailing list