diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-11-25 21:20:09 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-11-25 21:20:09 +0000 |
| commit | 9dda4abee1225db7a7b195b84c915fdd141a7260 (patch) | |
| tree | f64c44db97559f4a3bf091e82fb78c9d321cc8e1 /django/contrib/admin/templates | |
| parent | 4fe5c9b7ee09dc25921918a6dbb7605edb374bc9 (diff) | |
MERGED NEW-ADMIN BRANCH (except for po/mo files, which will come in a separate commit)
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1434 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/admin/templates')
18 files changed, 268 insertions, 10 deletions
diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html new file mode 100644 index 0000000000..b5ae024866 --- /dev/null +++ b/django/contrib/admin/templates/admin/change_form.html @@ -0,0 +1,75 @@ +{% extends "admin/base_site" %} +{% load i18n %} +{% load admin_modify %} +{% load adminmedia %} +{% block extrahead %} +{% for js in bound_manipulator.javascript_imports %}{% include_admin_script js %}{% endfor %} +{% endblock %} +{% block coltype %}{{ bound_manipulator.coltype }}{% endblock %} +{% block bodyclass %}{{ app_label }}-{{ bound_manipulator.object_name.lower }} change-form{% endblock %} +{% block breadcrumbs %}{% if not is_popup %} +<div class="breadcrumbs"> + <a href="../../../">{% trans "Home" %}</a> › + <a href="../">{{ bound_manipulator.verbose_name_plural|capfirst }}</a> › + {% if add %}{% trans "Add" %} {{ bound_manipulator.verbose_name }}{% else %}{{ bound_manipulator.original|striptags|truncatewords:"18" }}{% endif %} +</div> +{% endif %}{% endblock %} +{% block content %}<div id="content-main"> +{% if change %}{% if not is_popup %} + <ul class="object-tools"><li><a href="history/" class="historylink">{% trans "History" %}</a></li> + {% if bound_manipulator.has_absolute_url %}<li><a href="/r/{{ bound_manipulator.content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%} + </ul> +{% endif %}{% endif %} +<form {{ bound_manipulator.form_enc_attrib }} action='{{ form_url }}' method="post">{% block form_top %}{% endblock %} +{% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} +{% if bound_manipulator.save_on_top %}{% submit_row bound_manipulator %}{% endif %} +{% if form.error_dict %} + <p class="errornote"> + {% blocktrans count form.error_dict.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} + </p> +{% endif %} +{% for bound_field_set in bound_manipulator.bound_field_sets %} + <fieldset class="module aligned {{ bound_field_set.classes }}"> + {% if bound_field_set.name %}<h2>{{ bound_field_set.name }}</h2>{% endif %} + {% for bound_field_line in bound_field_set %} + {% admin_field_line bound_field_line %} + {% for bound_field in bound_field_line %} + {% filter_interface_script_maybe bound_field %} + {% endfor %} + {% endfor %} + </fieldset> +{% endfor %} +{% block after_field_sets %}{% endblock %} +{% if change %} + {% if bound_manipulator.ordered_objects %} + <fieldset class="module"><h2>{% trans "Ordering" %}</h2> + <div class="form-row{% if form.order_.errors %} error{% endif %} "> + {% if form.order_.errors %}{{ form.order_.html_error_list }}{% endif %} + <p><label for="id_order_">{% trans "Order:" %}</label> {{ form.order_ }}</p> + </div></fieldset> + {% endif %} +{% endif %} +{% for related_object in bound_manipulator.inline_related_objects %}{% edit_inline related_object %}{% endfor %} +{% block after_related_objects %}{% endblock %} +{% submit_row bound_manipulator %} +{% if add %} + <script type="text/javascript">document.getElementById("{{ bound_manipulator.first_form_field_id }}").focus();</script> +{% endif %} +{% if bound_manipulator.auto_populated_fields %} + <script type="text/javascript"> + {% auto_populated_field_script bound_manipulator.auto_populated_fields change %} + </script> +{% endif %} +{% if change %} + {% if bound_manipulator.ordered_objects %} + {% if form.order_objects %}<ul id="orderthese"> + {% for object in form.order_objects %} + <li id="p{% object_pk bound_manipulator object %}"> + <span id="handlep{% object_pk bound_manipulator object %}">{{ object|truncatewords:"5" }}</span> + </li> + {% endfor %} + </ul>{% endif %} + {% endif %} +{% endif %} +</form></div> +{% endblock %} diff --git a/django/contrib/admin/templates/admin/change_list.html b/django/contrib/admin/templates/admin/change_list.html new file mode 100644 index 0000000000..ccc3990519 --- /dev/null +++ b/django/contrib/admin/templates/admin/change_list.html @@ -0,0 +1,20 @@ +{% load admin_list %} +{% load i18n %} +{% extends "admin/base_site" %} +{% block bodyclass %}change-list{% endblock %} +{% if not is_popup %}{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> › {{ cl.opts.verbose_name_plural|capfirst }} </div>{% endblock %}{% endif %} +{% block coltype %}flex{% endblock %} +{% block content %} +<div id="content-main"> +{% if has_add_permission %} +<ul class="object-tools"><li><a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}</a></li></ul> +{% endif %} +<div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist"> +{% search_form cl %} +{% date_hierarchy cl %} +{% filters cl %} +{% result_list cl %} +{% pagination cl %} +</div> +</div> +{% endblock %} diff --git a/django/contrib/admin/templates/admin/change_list_results.html b/django/contrib/admin/templates/admin/change_list_results.html new file mode 100644 index 0000000000..92e06c5fff --- /dev/null +++ b/django/contrib/admin/templates/admin/change_list_results.html @@ -0,0 +1,13 @@ +<table cellspacing="0"> +<thead> +<tr> +{% for header in result_headers %}<th{{ header.class_attrib }}> +{% if header.sortable %}<a href="{{ header.url }}">{% endif %} +{{ header.text|capfirst }} +{% if header.sortable %}</a>{% endif %}</th>{% endfor %} +</tr> +</thead> +{% for result in results %} +<tr class="{% cycle row1,row2 %}">{% for item in result %}{{ item }}{% endfor %}</tr> +{% endfor %} +</table> diff --git a/django/contrib/admin/templates/admin/date_hierarchy.html b/django/contrib/admin/templates/admin/date_hierarchy.html new file mode 100644 index 0000000000..a53d810f93 --- /dev/null +++ b/django/contrib/admin/templates/admin/date_hierarchy.html @@ -0,0 +1,10 @@ +{% if show %} +<div class="xfull"> +<ul class="toplinks"> +{% if back %}<li class="date-back"><a href="{{ back.link }}">‹ {{ back.title }}</a></li>{% endif %} +{% for choice in choices %} +<li> {% if choice.link %}<a href="{{ choice.link }}">{% endif %}{{ choice.title }}{% if choice.link %}</a>{% endif %}</li> +{% endfor %} +</ul><br class="clear" /> +</div> +{% endif %}
\ No newline at end of file diff --git a/django/contrib/admin/templates/admin/edit_inline_stacked.html b/django/contrib/admin/templates/admin/edit_inline_stacked.html new file mode 100644 index 0000000000..5e5ea8c0fc --- /dev/null +++ b/django/contrib/admin/templates/admin/edit_inline_stacked.html @@ -0,0 +1,15 @@ +<fieldset class="module aligned"> + {% for fcw in bound_related_object.form_field_collection_wrappers %} + <h2>{{ bound_related_object.relation.opts.verbose_name|capfirst }} #{{ forloop.counter }}</h2> + {% if bound_related_object.show_url %}{% if fcw.obj.original %} + <p><a href="/r/{{ fcw.obj.original.content_type_id }}/{{ fcw.obj.original.id }}/">View on site</a></p> + {% endif %}{% endif %} + {% for bound_field in fcw.bound_fields %} + {% if bound_field.hidden %} + {% field_widget bound_field %} + {% else %} + {% admin_field_line bound_field %} + {% endif %} + {% endfor %} + {% endfor %} +</fieldset>
\ No newline at end of file diff --git a/django/contrib/admin/templates/admin/edit_inline_tabular.html b/django/contrib/admin/templates/admin/edit_inline_tabular.html new file mode 100644 index 0000000000..c06ee05df8 --- /dev/null +++ b/django/contrib/admin/templates/admin/edit_inline_tabular.html @@ -0,0 +1,42 @@ +<fieldset class="module"> + <h2>{{ bound_related_object.relation.opts.verbose_name_plural|capfirst }}</h2><table> + <thead><tr> + {% for fw in bound_related_object.field_wrapper_list %} + {% if fw.needs_header %} + <th{{ fw.header_class_attribute }}>{{ fw.field.verbose_name|capfirst }}</th> + {% endif %} + {% endfor %} + {% for fcw in bound_related_object.form_field_collection_wrappers %} + {% if change %}{% if original_row_needed %} + {% if fcw.obj.original %} + <tr class="row-label {% cycle row1,row2 %}"><td colspan="{{ num_headers }}"><strong>{{ fcw.obj.original }}</strong></tr> + {% endif %} + {% endif %}{% endif %} + {% if fcw.obj.errors %} + <tr class="errorlist"><td colspan="{{ num_headers }}"> + {{ fcw.obj.html_combined_error_list }} + </tr> + {% endif %} + <tr class="{% cycle row1,row2 %}"> + {% for bound_field in fcw.bound_fields %} + {% if not bound_field.hidden %} + <td {{ bound_field.cell_class_attribute }}> + {% field_widget bound_field %} + </td> + {% endif %} + {% endfor %} + {% if bound_related_object.show_url %}<td> + {% if fcw.obj.original %}<a href="/r/{{ fcw.obj.original.content_type_id }}/{{ fcw.obj.original.id }}/">View on site</a>{% endif %} + </td>{% endif %} + </tr> + + {% endfor %} </table> + + {% for fcw in bound_related_object.form_field_collection_wrappers %} + {% for bound_field in fcw.bound_fields %} + {% if bound_field.hidden %} + {% field_widget bound_field %} + {% endif %} + {% endfor %} + {% endfor %} +</fieldset> diff --git a/django/contrib/admin/templates/admin/field_line.html b/django/contrib/admin/templates/admin/field_line.html new file mode 100644 index 0000000000..5e526e6fd6 --- /dev/null +++ b/django/contrib/admin/templates/admin/field_line.html @@ -0,0 +1,21 @@ +<div class="{{ class_names }}" > +{% for bound_field in bound_fields %}{{ bound_field.html_error_list }}{% endfor %} +{% for bound_field in bound_fields %} + {% if bound_field.has_label_first %} + {% field_label bound_field %} + {% endif %} + {% field_widget bound_field %} + {% if not bound_field.has_label_first %} + {% field_label bound_field %} + {% endif %} + {% if change %} + {% if bound_field.field.primary_key %} + {{ bound_field.original_value }} + {% endif %} + {% if bound_field.raw_id_admin %} + {% if bound_field.existing_display %} <strong>{{ bound_field.existing_display|truncatewords:"14" }}</strong>{% endif %} + {% endif %} + {% endif %} + {% if bound_field.field.help_text %}<p class="help">{{ bound_field.field.help_text }}</p>{% endif %} +{% endfor %} +</div> diff --git a/django/contrib/admin/templates/admin/filter.html b/django/contrib/admin/templates/admin/filter.html new file mode 100644 index 0000000000..385b1824f2 --- /dev/null +++ b/django/contrib/admin/templates/admin/filter.html @@ -0,0 +1,7 @@ +<h3>{% blocktrans %} By {{ title }} {% endblocktrans %}</h3> +<ul> +{% for choice in choices %} + <li{% if choice.selected %} class="selected"{% endif %}> + <a href="{{ choice.query_string }}">{{ choice.display }}</a></li> +{% endfor %} +</ul> diff --git a/django/contrib/admin/templates/admin/filters.html b/django/contrib/admin/templates/admin/filters.html new file mode 100644 index 0000000000..b3c6a25831 --- /dev/null +++ b/django/contrib/admin/templates/admin/filters.html @@ -0,0 +1,5 @@ +{% if cl.has_filters %}<div id="changelist-filter"> +<h2>Filter</h2> +{% for spec in cl.filter_specs %} + {% filter cl spec %} +{% endfor %}</div>{% endif %} diff --git a/django/contrib/admin/templates/admin/pagination.html b/django/contrib/admin/templates/admin/pagination.html new file mode 100644 index 0000000000..5d80ecdcc4 --- /dev/null +++ b/django/contrib/admin/templates/admin/pagination.html @@ -0,0 +1,9 @@ +<p class="paginator"> +{% if pagination_required %} +{% for i in page_range %} + {% paginator_number cl i %} +{% endfor %} +{% endif %} +{{ cl.result_count }} {% ifequal cl.result_count 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endifequal %} +{% if show_all_url %} <a href="{{ show_all_url }}" class="showall">Show all</a>{% endif %} +</p> diff --git a/django/contrib/admin/templates/admin/search_form.html b/django/contrib/admin/templates/admin/search_form.html new file mode 100644 index 0000000000..19b6b7eb95 --- /dev/null +++ b/django/contrib/admin/templates/admin/search_form.html @@ -0,0 +1,14 @@ +{% if cl.lookup_opts.admin.search_fields %} +<div id="toolbar"><form id="changelist-search" action="" method="get"> +<label><img src="{% admin_media_prefix %}img/admin/icon_searchbox.png" /></label> +<input type="text" size="40" name="{{ search_var }}" value="{{ cl.query|escape }}" id="searchbar" /> +<input type="submit" value="Go" /> +{% if show_result_count %} + <span class="small quiet">{{ cl.result_count }} result{{ cl.result_count|pluralize }} (<a href="?">{{ cl.full_result_count }} total</a>)</span> +{% endif %} +{% for pair in cl.params.items %} + {% ifnotequal pair.0 search_var %}<input type="hidden" name="{{ pair.0|escape }}" value="{{ pair.1|escape }}"/>{% endifnotequal %} +{% endfor %} +</form></div> +<script type="text/javascript">document.getElementById("searchbar").focus();</script> +{% endif %} diff --git a/django/contrib/admin/templates/admin/submit_line.html b/django/contrib/admin/templates/admin/submit_line.html new file mode 100644 index 0000000000..25f581963e --- /dev/null +++ b/django/contrib/admin/templates/admin/submit_line.html @@ -0,0 +1,8 @@ +{% load i18n %} +<div class="submit-row"> +{% if show_delete_link %}<p class="float-left"><a href="delete/" class="deletelink">{% trans "Delete" %}</a></p>{% endif %} +{% if show_save_as_new %}<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" {{ onclick_attrib }}/>{%endif%} +{% if show_save_and_add_another %}<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" {{ onclick_attrib }} />{% endif %} +{% if show_save_and_continue %}<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" {{ onclick_attrib }}/>{% endif %} +{% if show_save %}<input type="submit" value="{% trans 'Save' %}" class="default" {{ onclick_attrib }}/>{% endif %} +</div> diff --git a/django/contrib/admin/templates/admin_doc/bookmarklets.html b/django/contrib/admin/templates/admin_doc/bookmarklets.html index d396ec53b5..c069597219 100644 --- a/django/contrib/admin/templates/admin_doc/bookmarklets.html +++ b/django/contrib/admin/templates/admin_doc/bookmarklets.html @@ -1,30 +1,32 @@ {% extends "admin/base_site" %} -{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> › <a href="../">Documentation</a> › Bookmarklets</div>{% endblock %} +{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> › <a href="../">{% trans "Documentation" %}</a> › {% trans "Bookmarklets" %}</div>{% endblock %} -{% block title %}Documentation bookmarklets{% endblock %} +{% block title %}{% trans "Documentation bookmarklets" %}{% endblock %} {% block content %} +{% blocktrans %} <p class="help">To install bookmarklets, drag the link to your bookmarks toolbar, or right-click the link and add it to your bookmarks. Now you can select the bookmarklet from any page in the site. Note that some of these bookmarklets require you to be viewing the site from a computer designated as "internal" (talk to your system administrator if you aren't sure if your computer is "internal").</p> +{% endblocktrans %} <div id="content-main"> - <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('HEAD',location.href,false);x.send(null);try{view=x.getResponseHeader('x-view');}catch(e){alert('No view found for this page');return;}if(view=="undefined"){alert("No view found for this page");}document.location='{{ admin_url }}/doc/views/'+view+'/';})()">Documentation for this page</a></h3> - <p>Jumps you from any page to the documentation for the view that generates that page.</p> + <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('HEAD',location.href,false);x.send(null);try{view=x.getResponseHeader('x-view');}catch(e){alert('No view found for this page');return;}if(view=="undefined"){alert("No view found for this page");}document.location='{{ admin_url }}/doc/views/'+view+'/';})()">{% trans "Documentation for this page" %}</a></h3> + <p>{% trans "Jumps you from any page to the documentation for the view that generates that page." %}</p> - <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{type=x.getResponseHeader('x-object-type');id=x.getResponseHeader('x-object-id');}catch(e){type='(none)';id='(none)';}d=document;b=d.body;e=d.createElement('div');e.id='xxxhhh';s=e.style;s.position='absolute';s.left='10px';s.top='10px';s.font='10px monospace';s.border='1px black solid';s.padding='4px';s.backgroundColor='#eee';e.appendChild(d.createTextNode('Type: '+type));e.appendChild(d.createElement('br'));e.appendChild(d.createTextNode('ID: '+id));e.appendChild(d.createElement('br'));l=d.createElement('a');l.href='#';l.onclick=function(){b.removeChild(e);};l.appendChild(d.createTextNode('[close]'));l.style.textDecoration='none';e.appendChild(l);b.appendChild(e);})();">Show object ID</a></h3> - <p>Shows the content-type and unique ID for pages that represent a single object.</p> + <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{type=x.getResponseHeader('x-object-type');id=x.getResponseHeader('x-object-id');}catch(e){type='(none)';id='(none)';}d=document;b=d.body;e=d.createElement('div');e.id='xxxhhh';s=e.style;s.position='absolute';s.left='10px';s.top='10px';s.font='10px monospace';s.border='1px black solid';s.padding='4px';s.backgroundColor='#eee';e.appendChild(d.createTextNode('Type: '+type));e.appendChild(d.createElement('br'));e.appendChild(d.createTextNode('ID: '+id));e.appendChild(d.createElement('br'));l=d.createElement('a');l.href='#';l.onclick=function(){b.removeChild(e);};l.appendChild(d.createTextNode('[close]'));l.style.textDecoration='none';e.appendChild(l);b.appendChild(e);})();">{% trans "Show object ID" %}</a></h3> + <p>{% trans "Shows the content-type and unique ID for pages that represent a single object." %}</p> - <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}document.location='{{ admun_url }}/'+type.split('.').join('/')+'/'+id+'/';})()">Edit this object (current window)</a></h3> - <p>Jumps to the admin page for pages that represent a single object.</p> + <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}document.location='{{ admun_url }}/'+type.split('.').join('/')+'/'+id+'/';})()">{% trans "Edit this object (current window)" %}</a></h3> + <p>{% trans "Jumps to the admin page for pages that represent a single object." %}</p> - <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}window.open('{{ admun_url }}/'+type.split('.').join('/')+'/'+id+'/');})()">Edit this object (new window)</a></h3> - <p>As above, but opens the admin page in a new window.</p> + <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}window.open('{{ admun_url }}/'+type.split('.').join('/')+'/'+id+'/');})()">{% trans "Edit this object (new window)" %}</a></h3> + <p>{% trans "As above, but opens the admin page in a new window." %}</p> </div> {% endblock %} diff --git a/django/contrib/admin/templates/widget/date_time.html b/django/contrib/admin/templates/widget/date_time.html new file mode 100644 index 0000000000..2d5126c5bb --- /dev/null +++ b/django/contrib/admin/templates/widget/date_time.html @@ -0,0 +1,4 @@ +<p class="datetime"> + Date: {{ bound_field.form_fields.0 }}<br /> + Time: {{ bound_field.form_fields.1 }} +</p> diff --git a/django/contrib/admin/templates/widget/default.html b/django/contrib/admin/templates/widget/default.html new file mode 100644 index 0000000000..08a82fdbfa --- /dev/null +++ b/django/contrib/admin/templates/widget/default.html @@ -0,0 +1 @@ +{% output_all bound_field.form_fields %} diff --git a/django/contrib/admin/templates/widget/file.html b/django/contrib/admin/templates/widget/file.html new file mode 100644 index 0000000000..f81534b474 --- /dev/null +++ b/django/contrib/admin/templates/widget/file.html @@ -0,0 +1,4 @@ +{% if bound_field.original_value %} +Currently: <a href="{{ bound_field.original_url }}" > {{ bound_field.original_value }} </a><br /> +Change: {% output_all bound_field.form_fields %} +{% else %} {% output_all bound_field.form_fields %} {% endif %} diff --git a/django/contrib/admin/templates/widget/foreign.html b/django/contrib/admin/templates/widget/foreign.html new file mode 100644 index 0000000000..9decb1143c --- /dev/null +++ b/django/contrib/admin/templates/widget/foreign.html @@ -0,0 +1,7 @@ +{% output_all bound_field.form_fields %} +{% if bound_field.raw_id_admin %} + <a href="../../../{{ bound_field.field.rel.to.app_label }}/{{ bound_field.field.rel.to.module_name }}/" class="related-lookup" id="lookup_{{bound_field.element_id}}" onclick="return showRelatedObjectLookupPopup(this);"> <img src="{% admin_media_prefix %}img/admin/selector-search.gif" width="16" height="16" alt="Lookup"></a> +{% else %} +{% if bound_field.needs_add_label %} + <a href="../../../{{ bound_field.field.rel.to.app_label }}/{{ bound_field.field.rel.to.module_name }}/add/" class="add-another" id="add_{{ bound_field.element_id}}" onclick="return showAddAnotherPopup(this);"> <img src="{% admin_media_prefix %}img/admin/icon_addlink.gif" width="10" height="10" alt="Add Another"/></a> +{% endif %} {% endif %} diff --git a/django/contrib/admin/templates/widget/many_to_many.html b/django/contrib/admin/templates/widget/many_to_many.html new file mode 100644 index 0000000000..151fe04f30 --- /dev/null +++ b/django/contrib/admin/templates/widget/many_to_many.html @@ -0,0 +1 @@ +{% include "widget/foreign" %} |
