author Juliette Belin <>
Thu, 19 Jan 2017 13:04:04 +0100
changeset 33 bad15363460e
child 35 ff97c5bd6509
permissions -rw-r--r--
header view and style

# copyright 2015-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact --
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 2.1 of the License, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
# You should have received a copy of the GNU Lesser General Public License along
# with this program. If not, see <>.

from logilab.common.decorators import monkeypatch
from cubes.squareui.views.basetemplates import basetemplates

# Bootstrap configuration.
basetemplates.TheMainTemplate.twbs_container_cls = 'container'

# Display header-right components in a specific div, not using 'nav' bootstrap style and handle an
# 'active' class in the nav component (main-navigation)

def main_header(self, view):
    w = self.w
    w(u'''<nav class="navbar navbar-default navbar-sherpa" role="banner">
    <div class="container-fluid">
        <div class="col-md-2 hidden-xs hidden-sm">
            <a href="/"><img src="{logo_SIAF}" class="logoSIAF" /></a>
        <div class="col-md-7 col-xs-8">
            <a href="/">
                <div class='col-md-6 col-md-offset-3 col-xs-12 col-sm-12'>
                    <h1>Service Heberg&eacute; pour la R&eacute;daction de Profils d&#39;Archivage</h1>
                <div class='col-md-2  hidden-xs hidden-sm'>
                    <img src="{logo_SHERPA}" class="logoSHERPA"/>
    w(u'''<div class="col-md-2 col-md-offset-1 col-xs-4">
    <div class="pull-left dropdown col-md-12">''')
    components = self.get_components(view, context='header-right')
    for comp in components: