PageRenderTime 20ms CodeModel.GetById 17ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/django/contrib/admin/templates/mako/admin/change_form.html

https://code.google.com/p/mango-py/
HTML | 152 lines | 103 code | 49 blank | 0 comment | 0 complexity | d59c1ebe64f4895fd40f38d5a06cbf03 MD5 | raw file
  1<%inherit file="admin/base_site.html"/>
  2<%namespace name="admin" module="django.contrib.admin.templatetags.adminmedia" />
  3
  4<%def name="block_extrahead()">
  5<script type="text/javascript" src="../../../jsi18n/"></script>
  6${ media }
  7</%def>${self.block_extrahead()}
  8
  9${self.block_stylesheet()}<%def name="block_stylesheet()">${admin_media_prefix()}css/forms.css</%def>
 10
 11${self.block_coltype()}<%def name="block_coltype()">
 12% if ordered_objects:
 13colMS
 14% else:
 15colM
 16% endif
 17</%def>
 18
 19${self.block_bodyclass()}<%def name="block_bodyclass()">${opts.app_label}-${opts.object_name.lower()} change-form</%def>
 20
 21${self.block_breadcrumbs()}<%def name="block_breadcrumbs()">
 22% if not is_popup:
 23
 24<div class="breadcrumbs">
 25     <a href="../../../">${trans("Home")}</a> &rsaquo;
 26     <a href="../../">${ capfirst(app_label)|escape }</a> &rsaquo; 
 27     <a href="../">${capfirst(opts.verbose_name_plural)}</a> &rsaquo;
 28     
 29% if add:
 30${trans("Add")} ${opts.verbose_name}
 31% else:
 32${ original }
 33% endif
 34
 35</div>
 36
 37% endif
 38</%def>
 39
 40<%def name="block_content()"><div id="content-main">
 41<%def name="block_object_tools()">
 42% if change:
 43
 44% if not is_popup:
 45
 46  <ul class="object-tools"><li><a href="history/" class="historylink">${trans("History")}</a></li>
 47  
 48% if has_absolute_url:
 49<li><a href="../../../r/${content_type_id}/${object_id}/" class="viewsitelink">${trans("View on site")}</a></li>
 50% endif
 51
 52  </ul>
 53
 54% endif
 55
 56% endif
 57
 58</%def>${ block_object_tools() }
 59<form 
 60% if has_file_field:
 61enctype="multipart/form-data" 
 62% endif
 63action="${form_url or ''}" method="post" id="${opts.module_name}_form">${ csrf_tag(csrf_token) }<%def name="block_form_top()"></%def>${block_form_top()}
 64<div>
 65
 66% if is_popup:
 67<input type="hidden" name="_popup" value="1" />
 68% endif
 69
 70
 71% if save_on_top:
 72<%namespace file="admin/submit_line.html" name="sl"/>
 73<%
 74    from django.contrib.admin.templatetags.mako.admin_modify import submit_row
 75%>
 76
 77${ sl.submit_line( submit_row(context) ) }
 78% endif
 79
 80
 81% if errors:
 82
 83    <p class="errornote">
 84    <%def name="blocktrans()"><!-- blocktrans count errors.items|length as counter -->Please correct the error${'s' if len(errors)>1 else ''} below.</%def>${blocktrans()}
 85    </p>
 86    ${ adminform.form.non_field_errors() }
 87
 88% endif
 89
 90% if adminform:
 91<%namespace file="admin/includes/fieldset.html" name="fs"/>
 92% for fieldset in adminform:
 93    ${ fs.fieldsets(fieldset) }
 94% endfor
 95% endif
 96
 97<%def name="block_after_field_sets()"></%def>${self.block_after_field_sets() if hasattr(self,'block_after_field_sets') else ''}
 98
 99% if inline_admin_formsets:
100
101<%namespace name="tabular" file="admin/edit_inline/tabular.html"/>
102<%namespace name="stacked" file="admin/edit_inline/stacked.html"/>
103
104% for i, inline_admin_formset in enumerate(inline_admin_formsets):
105
106## This ugly condition is true if the inline isn't declared in the fields section of any fieldsets## In this case the inline has already been rendered so it is safe to ignore
107% if inline_admin_formset.opts.__class__.__name__ not in sum([list(f.fields) for f in adminform], []):
108
109% if inline_admin_formset.opts.template == "admin/edit_inline/tabular.html":
110    ${tabular.inline_edit(inline_admin_formset, i)}
111% else:
112    ${stacked.inline_edit(inline_admin_formset, i)}
113% endif
114
115% endif
116
117##${inline_admin_formset.opts.template}
118##{% include inline_admin_formset.opts.template %}
119
120% endfor
121% endif
122
123<%def name="block_after_related_objects()"></%def>${block_after_related_objects()}
124
125
126<%namespace file="admin/submit_line.html" name="sl"/>
127<%
128    from django.contrib.admin.templatetags.mako.admin_modify import submit_row
129%>
130
131
132
133${ sl.submit_line( submit_row(context) ) }
134
135
136
137% if add and adminform:
138
139   <script type="text/javascript">document.getElementById("${adminform.first_field().auto_id}").focus();</script>
140
141% endif
142
143<%namespace file="admin/prepopulated_fields_js.html" name="ppf"/>
144<%
145    from django.contrib.admin.templatetags.mako.admin_modify import prepopulated_fields_js
146%>
147
148${ ppf.prepopulated_fields(*prepopulated_fields_js(context)) }
149
150</div>
151</form></div>
152</%def>