[views] Replace poorly named "invisible" class with "list-unstyled" stable
authorRémi Cardona <remi.cardona@logilab.fr>
Mon, 02 Jun 2014 12:29:37 +0200
branchstable
changeset 9870 d30ff49d4a94
parent 9869 e2f96b16c3bd
child 9871 3d3aa4dd6a32
[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.
web/data/cubicweb.css
web/data/cubicweb.old.css
web/views/ajaxedit.py
web/views/autoform.py
--- 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+=\'&amp;__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>')