Mercurial > hg
comparison templates/paper/graph.tmpl @ 8236:9f53e203a09b
webcommands: move nonempty logic from JavaScript to Python
This avoids hard-coding the '(none)' string in the JavaScript for each
style and avoids the {nonexisting|nonempty} hack which only works
since the template system don't complain about undefined variables.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Tue, 28 Apr 2009 17:28:00 +0200 |
parents | 89bc3946c8f3 |
children | 6058d291abdf |
comparison
equal
deleted
inserted
replaced
8235:89bc3946c8f3 | 8236:9f53e203a09b |
---|---|
84 var nstyle = 'padding-left: ' + left + 'px;'; | 84 var nstyle = 'padding-left: ' + left + 'px;'; |
85 var item = revlink.replace(/_STYLE/, nstyle); | 85 var item = revlink.replace(/_STYLE/, nstyle); |
86 item = item.replace(/_PARITY/, 'parity' + parity); | 86 item = item.replace(/_PARITY/, 'parity' + parity); |
87 item = item.replace(/_NODEID/, cur[0]); | 87 item = item.replace(/_NODEID/, cur[0]); |
88 item = item.replace(/_NODEID/, cur[0]); | 88 item = item.replace(/_NODEID/, cur[0]); |
89 if (cur[3] != '') | 89 item = item.replace(/_DESC/, cur[3]); |
90 item = item.replace(/_DESC/, cur[3]); | |
91 else | |
92 item = item.replace(/_DESC/, '(none)'); | |
93 item = item.replace(/_USER/, cur[4]); | 90 item = item.replace(/_USER/, cur[4]); |
94 item = item.replace(/_DATE/, cur[5]); | 91 item = item.replace(/_DATE/, cur[5]); |
95 | 92 |
96 var tagspan = ''; | 93 var tagspan = ''; |
97 if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) { | 94 if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) { |