Ticket #2569: adminforeign.2.rev6000.diff
File adminforeign.2.rev6000.diff, 3.1 KB (added by , 17 years ago) |
---|
-
contrib/admin/media/js/admin/RelatedObjectLookups.js
61 61 } 62 62 win.close(); 63 63 } 64 65 function showEditPopup(triggeringLink) { 66 var name = triggeringLink.id.replace(/^edit_/,''); 67 name = name.replace(/\./g,'___'); 68 var elem = document.getElementById(name); 69 if (elem) { 70 if (elem.nodeName == 'SELECT') { 71 var id = elem.options[elem.selectedIndex].value 72 var win = window.open(triggeringLink.href + id + '?_popup=1',name, 'height=500,width=800,resizable=yes,scrollbars=yes'); 73 } 74 } 75 return false; 76 } 77 78 function dismissEditPopup(win, newId, newRepr) { 79 var name = win.name.replace(/___/g, '.'); 80 var elem = document.getElementById(name); 81 if(elem) { 82 if( elem.nodeName == 'SELECT') { 83 var o = new Option(newRepr, newId); 84 elem.options[elem.selectedIndex] = o; 85 o.selected = true; 86 } 87 } 88 win.close(); 89 } -
contrib/admin/templates/widget/one_to_one.html
1 {% load admin_modify adminmedia %} 1 2 {% if add %}{% include "widget/foreign.html" %}{% endif %} 2 {% if change %}{% if bound_field.existing_display %} <strong>{{ bound_field.existing_display|truncatewords:"14"|escape }}</strong>{% endif %}{% endif %} 3 {% if change %} 4 {% if bound_field.existing_display %} <a href="{{ bound_field.related_url }}{{ bound_field.existing_display}}"><strong>{{ bound_field.existing_display|truncatewords:"14"|escape }}</strong></a>{% endif %}{% endif %} -
contrib/admin/templates/widget/foreign.html
8 8 {% endif %} 9 9 {% else %} 10 10 {% if bound_field.needs_add_label %} 11 <a href="{{ bound_field.related_url }}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> 12 {% endif %}{% endif %} 11 <a href="{{ bound_field.related_url }}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> 12 <a href="{{ bound_field.related_url }}" class="related-lookup" id="edit_{{ bound_field.element_id }}" onclick="return showEditPopup(this);"> <img src="{% admin_media_prefix %}img/admin/selector-search.gif" width="16" height="16" alt="Lookup"></a> 13 14 {% endif %} 15 {% endif %} 13 16 {% if change %} 14 17 {% if bound_field.field.primary_key %} 15 18 {{ bound_field.original_value }}