[ui] nicer ajax edit relation table (tags box for instance)
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 12 Oct 2010 12:12:05 +0200
changeset 6452 6b6a2fa28069
parent 6451 f64899fa0b5c
child 6453 7fdd780d87e4
[ui] nicer ajax edit relation table (tags box for instance)
web/component.py
web/data/cubicweb.css
web/data/cubicweb.old.css
--- a/web/component.py	Mon Oct 11 19:45:15 2010 +0200
+++ b/web/component.py	Tue Oct 12 12:12:05 2010 +0200
@@ -479,7 +479,7 @@
             req.add_js(('cubicweb.ajax.js', 'cubicweb.ajax.box.js'))
         _ = req._
         if related:
-            w(u'<table>')
+            w(u'<table class="ajaxEditRelationTable">')
             for rentity in related.entities():
                 # for each related entity, provide a link to remove the relation
                 subview = rentity.view(self.item_vid)
@@ -488,11 +488,11 @@
                         self.__regid__, entity.eid, rentity.eid,
                         self.fname_remove,
                         self.removed_msg and _(self.removed_msg)))
-                    w(u'<tr><td>[<a href="javascript: %s">-</a>]</td>'
-                      '<td class="tagged"> %s</td></tr>' % (xml_escape(jscall),
+                    w(u'<tr><td class="dellink">[<a href="javascript: %s">-</a>]</td>'
+                      '<td class="entity"> %s</td></tr>' % (xml_escape(jscall),
                                                             subview))
                 else:
-                    w(u'<tr><td class="tagged">%s</td></tr>' % (subview))
+                    w(u'<tr><td class="entity">%s</td></tr>' % (subview))
             w(u'</table>')
         else:
             w(_('no related entity'))
--- a/web/data/cubicweb.css	Mon Oct 11 19:45:15 2010 +0200
+++ b/web/data/cubicweb.css	Tue Oct 12 12:12:05 2010 +0200
@@ -819,6 +819,14 @@
   margin-bottom: 0.2em; /* because vertical-align doesn't seems to have any effect */
 }
 
+
+table.ajaxEditRelationTable{
+  margin-bottom: 0.5em;
+}
+table.ajaxEditRelationTable td.entity{
+  padding-left: 0.5em;
+}
+
 /***************************************/
 /* error view (views/management.py)    */
 /***************************************/
--- a/web/data/cubicweb.old.css	Mon Oct 11 19:45:15 2010 +0200
+++ b/web/data/cubicweb.old.css	Tue Oct 12 12:12:05 2010 +0200
@@ -825,6 +825,13 @@
   margin-bottom: 0.2em; /* because vertical-align doesn't seems to have any effect */
 }
 
+table.ajaxEditRelationTable{
+  margin-bottom: 0.5em;
+}
+table.ajaxEditRelationTable td.entity{
+  padding-left: 0.5em;
+}
+
 /***************************************/
 /* error view (views/management.py)    */
 /***************************************/