El martes, 25 de diciembre de 2012 12:45:31 UTC-3, Jose escribió:

>
> El miércoles, 19 de diciembre de 2012 19:50:53 UTC-3, Massimo Di Pierro 
> escribió:
>>
>> Not yet. It is the queue.....
>
>
I've moved the table style to web2py.css and changed the xml generation 
with helpers to cleanup appadmin. Attached are the proposed diffs for 
appadmin.py and web2py.css.

Does this feature anything else but model visualization (so far)?. I mean, 
can I manage table definitions with clic and drag, etc?

-- 



diff -r ae21c7198a55 applications/welcome/static/css/web2py.css
--- a/applications/welcome/static/css/web2py.css	Mon Dec 24 16:14:04 2012 -0600
+++ b/applications/welcome/static/css/web2py.css	Tue Dec 25 16:26:51 2012 -0300
@@ -312,3 +312,34 @@
 .ie-lte8 div.flash{ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#222222', endColorstr='#000000', GradientType=0 ); }
 .ie-lte8 div.flash:hover {filter:alpha(opacity=25);}
 .ie9 #w2p_query_panel {padding-bottom:2px}
+
+
+/* appadmin graph model */
+
+table.graph.model{
+  font: "Helvetica Bold";
+  background-color: "#F1F2AD";
+  border: 0.5em;
+}
+
+table.graph.model tbody{
+  color: "#7B7B7B";
+  text-align: "center";
+  padding: 0.5em;
+}
+
+table.graph.model td.left, table.graph.model td.center{
+  text-align: "left";
+}
+
+table.graph.model td.right{
+  text-align: "center";
+}
+
+table.graph.model thead{
+  color: "white";
+  text-align: "center";
+  padding: 0.5em;
+  background-color:"#FFA21F";
+}
+
diff -r ae21c7198a55 applications/welcome/controllers/appadmin.py
--- a/applications/welcome/controllers/appadmin.py	Mon Dec 24 16:14:04 2012 -0600
+++ b/applications/welcome/controllers/appadmin.py	Tue Dec 25 16:25:48 2012 -0300
@@ -481,13 +481,14 @@
             return B('fk')
         else:
             return ' '
-    # this is horribe HTML but the only one graphiz understands
-    header = '<TR><TD COLSPAN="3" CELLPADDING="4" ALIGN="CENTER" BGCOLOR="#F\
-FA21F"><FONT FACE="Helvetica Bold" COLOR="white">%s</FONT></TD></TR>' % table
-    fields = []                                                                
+
+    # This is horribe HTML but the only one graphiz understands
+    header = TR(TD(FONT(table), _colspan=3))
     for field in db[table]:
-        fields.append('<TR><TD ALIGN="LEFT" CELLPADDING="4" BORDER="0"><FONT COLOR="#7B7B7B" FACE="Helvetica Bold">%s</FONT></TD><TD ALIGN="LEFT" CELLPADDING="4" BORDER="0"><FONT COLOR="#7B7B7B" FACE="Helvetica">%s</FONT></TD><TD ALIGN="CENTER" CELLPADDING="4" BORDER="0"><FONT COLOR="#7B7B7B" FACE="Helvetica">%s</FONT></TD></TR>' % (field.name,field.type,types(field)))
-    return '< <TABLE BGCOLOR="#F1F2AD" BORDER="1" CELLBORDER="0" CELLSPACING="0">%s %s</TABLE> >' % (header, ' '.join(fields))
+        fields.append(TR(TD(FONT(field.name), _class="left"),
+                         TD(FONT(field.type), _class="center"),
+                         TD(FONT(types(field)), _class="right")))
+    return TABLE(THEAD(header), TBODY(*fields), _class="graph model")
 
 def bg_graph_model():
     graph = pgv.AGraph(layout='dot', directed=True, strict=False, rankdir='LR')

Reply via email to