[view] breadcrumbs layout broken with long elements (closes #1347486)

authorKatia Saurfelt <katia.saurfelt@logilab.fr>
changeset2e793b2cdb57
branchdefault
phasepublic
hiddenno
parent revision#7f2337d7937f [static-file] return Unauthorized on blocked directory listing
child revision#c53bbeea7870 Add missing with_statement import for python2.5 compat
files modified by this revision
web/data/cubicweb.css
web/data/cubicweb.old.css
web/views/basecomponents.py
web/views/basetemplates.py
# HG changeset patch
# User Katia Saurfelt <katia.saurfelt@logilab.fr>
# Date 1332324511 -3600
# Wed Mar 21 11:08:31 2012 +0100
# Node ID 2e793b2cdb5718f1ecc08b4c0f39d96a1d24877c
# Parent 7f2337d7937fcbfc5cecf57b44d0f42449066e80
[view] breadcrumbs layout broken with long elements (closes #1347486)

diff --git a/web/data/cubicweb.css b/web/data/cubicweb.css
@@ -237,17 +237,25 @@
1    color: %(defaultColor)s;
2  }
3 
4  table#header td#header-right {
5    padding-top: 1em;
6 -  float: right;
7 +  white-space: nowrap;
8  }
9 
10  table#header img#logo{
11    vertical-align: middle;
12  }
13 
14 +table#header td#headtext {
15 +  white-space: nowrap;
16 +}
17 +
18 +table#header td#header-center{
19 + width: 100%;
20 +}
21 +
22  span#appliName {
23    font-weight: bold;
24    color: %(defaultColor)s;
25    white-space: nowrap;
26  }
diff --git a/web/data/cubicweb.old.css b/web/data/cubicweb.old.css
@@ -251,14 +251,20 @@
27  }
28 
29  table#header a {
30    color: #000;
31  }
32 +table#header td#headtext {
33 +  white-space: nowrap;
34 +}
35 
36  table#header td#header-right {
37    padding-top: 1em;
38 -  float: right;
39 +  white-space: nowrap;
40 +}
41 +table#header td#header-center{
42 +  width: 100%;
43  }
44 
45  span#appliName {
46    font-weight: bold;
47    color: #000;
diff --git a/web/views/basecomponents.py b/web/views/basecomponents.py
@@ -75,21 +75,22 @@
48      with user'action (preference, logout, etc...)
49      """
50      __abstract__ = True
51      cw_property_defs = component.override_ctx(
52          component.CtxComponent,
53 -        vocabulary=['header-left', 'header-right'])
54 +        vocabulary=['header-center', 'header-left', 'header-right', ])
55      # don't want user to hide this component using an cwproperty
56      site_wide = True
57 -    context = _('header-left')
58 +    context = _('header-center')
59 
60 
61  class ApplLogo(HeaderComponent):
62      """build the instance logo, usually displayed in the header"""
63      __regid__ = 'logo'
64      __select__ = yes() # no need for a cnx
65      order = -1
66 +    context = _('header-left')
67 
68      def render(self, w):
69          w(u'<a href="%s"><img id="logo" src="%s" alt="logo"/></a>'
70            % (self._cw.base_url(), self._cw.uiprops['LOGO']))
71 
diff --git a/web/views/basetemplates.py b/web/views/basetemplates.py
@@ -327,11 +327,13 @@
72  class HTMLPageHeader(View):
73      """default html page header"""
74      __regid__ = 'header'
75      main_cell_components = ('appliname', 'breadcrumbs')
76      headers = (('headtext', 'header-left'),
77 -               ('header-right', 'header-right'))
78 +               ('header-center', 'header-center'),
79 +               ('header-right', 'header-right')
80 +               )
81 
82      def call(self, view, **kwargs):
83          self.main_header(view)
84          self.w(u'<div id="stateheader">')
85          self.state_header()