[views] Replace poorly named "invisible" class with "list-unstyled"
"li.invisible" actually means "hide bullet". Use a reasonable name
instead, such as bootstrap's "list-unstyled" class.
This patch also changes the DOM element the class is applied to.
"li.invisible" had to be enabled on every "li" tag, whereas the
"list-unstyled" class only needs to be applied to the parent "ul"
element.
--- a/web/data/cubicweb.css Mon Jun 02 12:23:18 2014 +0200
+++ b/web/data/cubicweb.css Mon Jun 02 12:29:37 2014 +0200
@@ -203,9 +203,10 @@
visibility: hidden;
}
-li.invisible {
- background: none;
- padding: 0px 0px 1px 1px;
+/* copied verbatim from bootstrap 3.0 */
+.list-unstyled {
+ padding-left: 0;
+ list-style: none;
}
.caption {
--- a/web/data/cubicweb.old.css Mon Jun 02 12:23:18 2014 +0200
+++ b/web/data/cubicweb.old.css Mon Jun 02 12:29:37 2014 +0200
@@ -219,10 +219,10 @@
visibility: hidden;
}
-li.invisible {
+/* copied verbatim from bootstrap 3.0 */
+.list-unstyled {
+ padding-left: 0;
list-style: none;
- background: none;
- padding: 0px 0px 1px 1px;
}
.caption {
--- a/web/views/ajaxedit.py Mon Jun 02 12:23:18 2014 +0200
+++ b/web/views/ajaxedit.py Mon Jun 02 12:29:37 2014 +0200
@@ -55,9 +55,9 @@
self.w(u'<h1>%s</h1>' % self._cw._('relation %(relname)s of %(ent)s')
% {'relname': rschema.display_name(self._cw, role(self)),
'ent': entity.view('incontext')})
- self.w(u'<ul>')
+ self.w(u'<ul class="list-unstyled">')
for boxitem in self.unrelated_boxitems(entity):
- self.w('<li class="invisible">%s</li>' % boxitem)
+ self.w('<li>%s</li>' % boxitem)
self.w(u'</ul></div>')
def unrelated_entities(self, entity):
--- a/web/views/autoform.py Mon Jun 02 12:23:18 2014 +0200
+++ b/web/views/autoform.py Mon Jun 02 12:29:37 2014 +0200
@@ -504,15 +504,15 @@
label = rschema.display_name(req, role, context=form.edited_entity.cw_etype)
w(u'<tr><th class="labelCol">%s</th>' % label)
w(u'<td>')
- w(u'<ul>')
+ w(u'<ul class="list-unstyled">')
for viewparams in related:
- w(u'<li class="invisible">%s<span id="span%s" class="%s">%s</span></li>'
+ w(u'<li>%s<span id="span%s" class="%s">%s</span></li>'
% (viewparams[1], viewparams[0], viewparams[2], viewparams[3]))
if not form.force_display and form.maxrelitems < len(related):
- link = (u'<span class="invisible">'
+ link = (u'<span>'
'[<a href="javascript: window.location.href+=\'&__force_display=1\'">%s</a>]'
'</span>' % _('view all'))
- w(u'<li class="invisible">%s</li>' % link)
+ w(u'<li>%s</li>' % link)
w(u'</ul>')
w(u'</td>')
w(u'</tr>')