PageRenderTime 138ms CodeModel.GetById 134ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/django/contrib/admin/templates/mako/admin/includes/fieldset.html

https://code.google.com/p/mango-py/
HTML | 70 lines | 44 code | 26 blank | 0 comment | 0 complexity | 8f9ec16468e45183c43a3fb39fd46377 MD5 | raw file
 1<%def name="fieldsets(fieldset)">
 2<fieldset class="module aligned ${fieldset.classes}">
 3  
 4% if fieldset.name:
 5<h2>${fieldset.name}</h2>
 6% endif
 7
 8% if fieldset.description:
 9<div class="description">${fieldset.description}</div>
10% endif
11
12  
13% for line in fieldset:
14
15      <div class="form-row${' errors' if line.errors() else ''} ${' '.join([field.field.name for field in line])}">
16      ${line.errors()}
17      
18% for field in line:
19      <div ${'class="field-box"' if len(line.fields)!=1 else ''}>
20       
21% if field.is_checkbox:
22
23              ${field.field}${field.label_tag()}
24
25% elif field.is_inline:
26
27    % for i, informset in enumerate(inline_admin_formsets):
28        % if informset.opts.__class__.__name__ == field.field.name:
29
30            <%namespace name="tabular" file="admin/edit_inline/tabular.html"/>
31            <%namespace name="stacked" file="admin/edit_inline/stacked.html"/>
32
33            % if informset.opts.template == "admin/edit_inline/tabular.html":
34                ${tabular.inline_edit(informset, i)}
35            % else:
36                ${stacked.inline_edit(informset, i)}
37            % endif
38
39        % endif
40    % endfor
41         
42% else:
43
44              ${field.label_tag()}
45
46% if getattr(field, 'is_readonly', False):
47            <p>${field.contents()}</p>
48
49% else:
50            ${field.field}
51          
52% endif
53
54% endif
55          
56% if hasattr(field.field.field, "help_text") and field.field.field.help_text:
57<p class="help">${field.field.field.help_text}</p>
58% endif
59
60      </div>
61      
62% endfor
63
64      </div>
65  
66% endfor
67
68</fieldset>
69</%def>
70