Add a button to add a child from item view
This commit is contained in:
parent
a65c652647
commit
760f074f49
|
@ -43,8 +43,9 @@ class ItemAdmin(admin.ModelAdmin):
|
|||
|
||||
def get_changeform_initial_data(self, request):
|
||||
data = {
|
||||
'parent': request.session.get('last-parent')
|
||||
'parent': request.GET.get('parent') or request.session.get('last-parent')
|
||||
}
|
||||
|
||||
data.update(super(ItemAdmin, self).get_changeform_initial_data(request))
|
||||
return data
|
||||
|
||||
|
|
|
@ -83,6 +83,9 @@
|
|||
{% empty %}
|
||||
<tr><td colspan=2>No children</td></tr>
|
||||
{% endfor %}
|
||||
<tr><td colspan=2>
|
||||
<a href="/admin/storage/item/add?parent={{ item.uuid }}" %}"><span class="glyphicon glyphicon-plus"></span></a>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue