Merge lp:~unifield-team/unifield-web/web-uf_848 into lp:unifield-web

Proposed by jftempo
Status: Rejected
Rejected by: jftempo
Proposed branch: lp:~unifield-team/unifield-web/web-uf_848
Merge into: lp:unifield-web
Diff against target: 57 lines (+35/-0)
2 files modified
addons/openerp/widgets/listgrid.py (+4/-0)
addons/openerp/widgets/templates/listgrid/text.mako (+31/-0)
To merge this branch: bzr merge lp:~unifield-team/unifield-web/web-uf_848
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+97874@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

4603. By Quentin THEURET @Amaris

UF-848 [IMP] New version of patch

4602. By Quentin THEURET @Amaris

[REVERT] Revert modification in controllers/actions.py
UF-848 [IMP] Add a template for fields.text in listgrid to process it differently than fields.char

4601. By Quentin THEURET @Amaris

UF-848 [IMP] Try to display carriage returns and tabulation of fields.text in tree view

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/widgets/listgrid.py'
2--- addons/openerp/widgets/listgrid.py 2012-02-20 09:55:45 +0000
3+++ addons/openerp/widgets/listgrid.py 2012-03-16 13:19:37 +0000
4@@ -517,6 +517,9 @@
5 def __str__(self):
6 return ustr(self.text)
7
8+class Text(Char):
9+ template = "/openerp/widgets/templates/listgrid/text.mako"
10+
11 class Reference(Char):
12
13 def get_text(self):
14@@ -744,6 +747,7 @@
15
16 CELLTYPES = {
17 'char':Char,
18+ 'text':Text,
19 'many2one':M2O,
20 'reference': Reference,
21 'datetime':DateTime,
22
23=== added file 'addons/openerp/widgets/templates/listgrid/text.mako'
24--- addons/openerp/widgets/templates/listgrid/text.mako 1970-01-01 00:00:00 +0000
25+++ addons/openerp/widgets/templates/listgrid/text.mako 2012-03-16 13:19:37 +0000
26@@ -0,0 +1,31 @@
27+<%!
28+ def text_escape(text):
29+ p_res = ''
30+ p_text = text.split('\n')
31+ for line in p_text:
32+ p_res += '<p>%s</p>' % line
33+
34+ t_res = ''
35+ t_margin = 0
36+ t_text = p_res.split('\t')
37+ for tab in t_text:
38+ if not tab:
39+ t_margin += 10
40+ else:
41+ t_res += '<span style="margin-left:%spx">%s</span>' % (t_margin, tab)
42+ t_margin = 10
43+
44+ s_res = ''
45+ s_text = t_res.split(' ')
46+ s_margin = 0
47+ for s in s_text:
48+ if not s:
49+ s_margin += 5
50+ else:
51+ s_res += '<span style="margin-left:%spx">%s</span>' % (s_margin, s)
52+ s_margin = 5
53+
54+ return s_res or text
55+%>
56+
57+<span name="${name}" value="${value}">${text | text_escape}</span>

Subscribers

People subscribed via source and target branches

to all changes: