Ticket #620: admin_limit_choices.2.patch
File admin_limit_choices.2.patch, 2.4 KB (added by , 19 years ago) |
---|
-
media/js/admin/RelatedObjectLookups.js
3 3 4 4 function showRelatedObjectLookupPopup(triggeringLink) { 5 5 var name = triggeringLink.id.replace(/^lookup_/, ''); 6 var win = window.open(triggeringLink.href + '?pop=1', name, 'height=500,width=740,resizable=yes,scrollbars=yes'); 6 var href 7 if (triggeringLink.href.search(/\?/) >= 0) { 8 href = triggeringLink.href + '&pop=1'; 9 } else { 10 href = triggeringLink.href + '?pop=1' 11 } 12 var win = window.open(href, name, 'height=500,width=740,resizable=yes,scrollbars=yes'); 7 13 win.focus(); 8 14 return false; 9 15 } -
templates/widget/foreign.html
1 1 {% load admin_modify adminmedia %} 2 2 {% output_all bound_field.form_fields %} 3 3 {% if bound_field.raw_id_admin %} 4 {% if bound_field.field.rel.limit_choices_to %} 5 <a href="../../../{{ bound_field.field.rel.to.app_label }}/{{ bound_field.field.rel.to.module_name }}/?{% for limit_choice in bound_field.field.rel.limit_choices_to.items %}{% if not forloop.first %}{{"&"|escape}}{% endif %}{{ limit_choice|join:"=" }}{% endfor %}" 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> 6 {% else %} 4 7 <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> 8 {% endif %} 5 9 {% else %} 6 10 {% if bound_field.needs_add_label %} 7 11 <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>