Add creates_multiple
flag for master view
This commit is contained in:
parent
a542cd70da
commit
80e9a9cf1c
|
@ -1,7 +1,7 @@
|
||||||
## -*- coding: utf-8; -*-
|
## -*- coding: utf-8; -*-
|
||||||
<%inherit file="/base.mako" />
|
<%inherit file="/base.mako" />
|
||||||
|
|
||||||
<%def name="title()">New ${model_title}</%def>
|
<%def name="title()">New ${model_title_plural if master.creates_multiple else model_title}</%def>
|
||||||
|
|
||||||
<%def name="extra_javascript()">
|
<%def name="extra_javascript()">
|
||||||
${parent.extra_javascript()}
|
${parent.extra_javascript()}
|
||||||
|
|
|
@ -73,8 +73,12 @@
|
||||||
<li>${h.link_to("Download results as CSV", url('{}.results_csv'.format(route_prefix)))}</li>
|
<li>${h.link_to("Download results as CSV", url('{}.results_csv'.format(route_prefix)))}</li>
|
||||||
% endif
|
% endif
|
||||||
% if master.creatable and request.has_perm('{}.create'.format(permission_prefix)):
|
% if master.creatable and request.has_perm('{}.create'.format(permission_prefix)):
|
||||||
|
% if master.creates_multiple:
|
||||||
|
<li>${h.link_to("Create new {}".format(model_title_plural), url('{}.create'.format(route_prefix)))}</li>
|
||||||
|
% else:
|
||||||
<li>${h.link_to("Create a new {}".format(model_title), url('{}.create'.format(route_prefix)))}</li>
|
<li>${h.link_to("Create a new {}".format(model_title), url('{}.create'.format(route_prefix)))}</li>
|
||||||
% endif
|
% endif
|
||||||
|
% endif
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
<%def name="grid_tools()">
|
<%def name="grid_tools()">
|
||||||
|
|
|
@ -56,8 +56,12 @@
|
||||||
<li>${h.link_to("Delete this {}".format(model_title), action_url('delete', instance))}</li>
|
<li>${h.link_to("Delete this {}".format(model_title), action_url('delete', instance))}</li>
|
||||||
% endif
|
% endif
|
||||||
% if master.creatable and request.has_perm('{}.create'.format(permission_prefix)):
|
% if master.creatable and request.has_perm('{}.create'.format(permission_prefix)):
|
||||||
|
% if master.creates_multiple:
|
||||||
|
<li>${h.link_to("Create new {}".format(model_title_plural), url('{}.create'.format(route_prefix)))}</li>
|
||||||
|
% else:
|
||||||
<li>${h.link_to("Create a new {}".format(model_title), url('{}.create'.format(route_prefix)))}</li>
|
<li>${h.link_to("Create a new {}".format(model_title), url('{}.create'.format(route_prefix)))}</li>
|
||||||
% endif
|
% endif
|
||||||
|
% endif
|
||||||
% if master.cloneable and request.has_perm('{}.clone'.format(permission_prefix)):
|
% if master.cloneable and request.has_perm('{}.clone'.format(permission_prefix)):
|
||||||
<li>${h.link_to("Clone this as new {}".format(model_title), url('{}.clone'.format(route_prefix), uuid=instance.uuid))}</li>
|
<li>${h.link_to("Clone this as new {}".format(model_title), url('{}.clone'.format(route_prefix), uuid=instance.uuid))}</li>
|
||||||
% endif
|
% endif
|
||||||
|
|
|
@ -86,6 +86,7 @@ class MasterView(View):
|
||||||
|
|
||||||
listing = False
|
listing = False
|
||||||
creating = False
|
creating = False
|
||||||
|
creates_multiple = False
|
||||||
viewing = False
|
viewing = False
|
||||||
editing = False
|
editing = False
|
||||||
deleting = False
|
deleting = False
|
||||||
|
|
Loading…
Reference in a new issue