El miércoles, 26 de diciembre de 2012 09:01:51 UTC-3, Jose escribió:
>
>
>
> El martes, 25 de diciembre de 2012 17:44:01 UTC-3, Alan Etkin escribió:
>>
>> 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.
>>>
>>>
>> Oops! That would never work (sorry, I didn't know the library requires
>> special html input). This new patch instead uses helpers for creating the
>> model image. Forget about the css diff (it's useless).
>>
>
> Hi Alan
>
> in your patch [*1], face = "Helvetica Bold", it always makes it bold.
> Originally this was not so, there in bold text (fields, pk, fk) and
> standard texts (field type, length).
>
> regards
> Jose
>
>
> [*1]
> rows = []
> cellpadding = 4
> color = "#7B7B7B"
> bgcolor = "#F1F2AD"
> face = "Helvetica Bold"
> border = 0
> ...
>
this patches it.
Jose
--
--- web2py/applications/welcome/controllers/appadmin.py 2012-12-26 08:53:40.000000000 -0300
+++ web2py/applications/borro3/controllers/appadmin.py 2012-12-26 11:19:52.000000000 -0300
@@ -469,8 +469,10 @@
def table_template(table):
from gluon.html import TR, TD, TABLE, TAG
+
def FONT(*args, **kwargs):
return TAG.font(*args, **kwargs)
+
def types(field):
f_type = field.type
if not isinstance(f_type,str):
@@ -478,7 +480,7 @@
elif f_type == 'string':
return field.length
elif f_type == 'id':
- return B('pk')
+ return B('pk')
elif f_type.startswith('reference') or \
f_type.startswith('list:reference'):
return B('fk')
@@ -490,14 +492,15 @@
cellpadding = 4
color = "#7B7B7B"
bgcolor = "#F1F2AD"
- face = "Helvetica Bold"
+ face = "Helvetica"
+ face_bold = "Helvetica Bold"
border = 0
- rows.append(TR(TD(FONT(table, _face=face, _color="white"),
+ rows.append(TR(TD(FONT(table, _face=face_bold, _color="white"),
_colspan=3, _cellpadding=cellpadding,
_align="center", _bgcolor="#FFA21F")))
for row in db[table]:
- rows.append(TR(TD(FONT(row.name, _color=color, _face=face),
+ rows.append(TR(TD(FONT(row.name, _color=color, _face=face_bold),
_align="left", _cellpadding=cellpadding,
_border=border),
TD(FONT(row.type, _color=color, _face=face),