Django

Code

root/django/branches/newforms-admin/django/contrib/admin/templatetags/admin_modify.py

Revision 7736, 0.9 kB (checked in by lukeplant, 5 months ago)

newforms-admin: Fixed #6604 - removed useless code. Thanks Petr Marhoun, programmerq

  • Property svn:eol-style set to native
Line 
1 from django import template
2
3 register = template.Library()
4
5 def submit_row(context):
6     opts = context['opts']
7     change = context['change']
8     is_popup = context['is_popup']
9     save_as = context['save_as']
10     return {
11         'onclick_attrib': (opts.get_ordered_objects() and change
12                             and 'onclick="submitOrderForm();"' or ''),
13         'show_delete_link': (not is_popup and context['has_delete_permission']
14                               and (change or context['show_delete'])),
15         'show_save_as_new': not is_popup and change and save_as,
16         'show_save_and_add_another': context['has_add_permission'] and
17                             not is_popup and (not save_as or context['add']),
18         'show_save_and_continue': not is_popup and context['has_change_permission'],
19         'show_save': True
20     }
21 submit_row = register.inclusion_tag('admin/submit_line.html', takes_context=True)(submit_row)
Note: See TracBrowser for help on using the browser.