[css] cleanup and fix by removing display: block on <a> in boxes
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 19 Oct 2010 13:19:50 +0200
changeset 6548 fd36c1049eed
parent 6547 6be127941760
child 6549 be6d49623207
[css] cleanup and fix by removing display: block on <a> in boxes also, add class a.action to ease action links like [+] in boxes like bookmark box without having to refine css per box id.
web/component.py
web/data/cubicweb.css
web/data/cubicweb.old.css
web/views/bookmark.py
--- a/web/component.py	Tue Oct 19 13:17:10 2010 +0200
+++ b/web/component.py	Tue Oct 19 13:19:50 2010 +0200
@@ -366,8 +366,8 @@
         args = {role(self)[0] : entity.eid, target(self)[0] : etarget.eid}
         url = self._cw.user_rql_callback((rql, args))
         # for each target, provide a link to edit the relation
-        return u'[<a href="%s">%s</a>] %s' % (xml_escape(url), label,
-                                              etarget.view('incontext'))
+        return u'[<a href="%s" class="action">%s</a>] %s' % (
+            xml_escape(url), label, etarget.view('incontext'))
 
     def related_boxitems(self, entity):
         rql = 'DELETE S %s O WHERE S eid %%(s)s, O eid %%(o)s' % self.rtype
--- a/web/data/cubicweb.css	Tue Oct 19 13:17:10 2010 +0200
+++ b/web/data/cubicweb.css	Tue Oct 19 13:19:50 2010 +0200
@@ -471,10 +471,13 @@
 
 ul.boxListing a {
   color: %(defaultColor)s;
-  display: block;
   padding: 1px 9px 1px 3px;
 }
 
+ul.boxListing a.action {
+  padding: 0;
+}
+
 ul.boxListing li {
   margin: 0px;
   padding: 0px;
@@ -531,12 +534,7 @@
   background: #f0eff0 url("gradient-grey-up.png") left top repeat-x;
 }
 
-.bookmarks_box ul.boxListing div a{
-  background: #fff;
-  display: inline;
-  padding: 0;
-}
-.bookmarks_box ul.boxListing div a:hover{
+.bookmarks_box ul.boxListing div a:hover {
   border-bottom: 1px solid #000;
 }
 
--- a/web/data/cubicweb.old.css	Tue Oct 19 13:17:10 2010 +0200
+++ b/web/data/cubicweb.old.css	Tue Oct 19 13:19:50 2010 +0200
@@ -490,10 +490,13 @@
 
 ul.boxListing a {
   color: %(defaultColor)s;
-  display: block;
   padding: 1px 3px;
 }
 
+ul.boxListing a.action {
+  padding: 0;
+}
+
 ul.boxListing li {
   margin: 0px;
   padding: 0px;
@@ -551,12 +554,6 @@
   background: #f0eff0 url("gradient-grey-up.png") left top repeat-x;
 }
 
-.bookmarks_box ul.boxListing div a {
-  background: #fff;
-  display: inline;
-  padding: 0;
-}
-
 .bookmarks_box ul.boxListing div {
   padding-bottom: 0.3em;
 }
--- a/web/views/bookmark.py	Tue Oct 19 13:17:10 2010 +0200
+++ b/web/views/bookmark.py	Tue Oct 19 13:19:50 2010 +0200
@@ -99,7 +99,7 @@
         for bookmark in self.bookmarks_rset.entities():
             label = self.build_link(bookmark.title, bookmark.action_url())
             if self.can_delete:
-                dlink = u'[<a href="javascript:removeBookmark(%s)" title="%s">-</a>]' % (
+                dlink = u'[<a class="action" href="javascript:removeBookmark(%s)" title="%s">-</a>]' % (
                     bookmark.eid, _('delete this bookmark'))
                 label = '<div>%s %s</div>' % (dlink, label)
             self.append(label)