Add some standard CRUD buttons for buefy themes
finally! also disable the permalink "feature" since it seems not useful
This commit is contained in:
parent
30f95e2f08
commit
31dff0d353
8 changed files with 89 additions and 27 deletions
|
@ -11,7 +11,7 @@
|
|||
% if master.editable and request.has_perm('{}.edit'.format(permission_prefix)):
|
||||
<li>${h.link_to("Edit this {}".format(model_title), action_url('edit', instance))}</li>
|
||||
% endif
|
||||
% if master.creatable and master.show_create_link and request.has_perm('{}.create'.format(permission_prefix)):
|
||||
% if not use_buefy and master.creatable and master.show_create_link and master.has_perm('create'):
|
||||
% if master.creates_multiple:
|
||||
<li>${h.link_to("Create new {}".format(model_title_plural), url('{}.create'.format(route_prefix)))}</li>
|
||||
% else:
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<li>${h.link_to("View this {}".format(model_title), action_url('view', instance))}</li>
|
||||
% endif
|
||||
${self.context_menu_item_delete()}
|
||||
% if master.creatable and master.show_create_link and request.has_perm('{}.create'.format(permission_prefix)):
|
||||
% if not use_buefy and master.creatable and master.show_create_link and master.has_perm('create'):
|
||||
% if master.creates_multiple:
|
||||
<li>${h.link_to("Create new {}".format(model_title_plural), url('{}.create'.format(route_prefix)))}</li>
|
||||
% else:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<%inherit file="/form.mako" />
|
||||
|
||||
<%def name="context_menu_item_delete()">
|
||||
% if master.deletable and instance_deletable and request.has_perm('{}.delete'.format(permission_prefix)):
|
||||
% if not use_buefy and master.deletable and instance_deletable and master.has_perm('delete'):
|
||||
% if master.delete_confirm == 'simple':
|
||||
<li>
|
||||
## note, the `ref` here is for buefy only
|
||||
|
|
|
@ -155,7 +155,7 @@
|
|||
% if master.results_downloadable_xlsx and request.has_perm('{}.results_xlsx'.format(permission_prefix)):
|
||||
<li>${h.link_to("Download results as XLSX", url('{}.results_xlsx'.format(route_prefix)))}</li>
|
||||
% endif
|
||||
% if master.creatable and master.show_create_link and request.has_perm('{}.create'.format(permission_prefix)):
|
||||
% if not use_buefy and master.creatable and master.show_create_link and master.has_perm('create'):
|
||||
% if master.creates_multiple:
|
||||
<li>${h.link_to("Create new {}".format(model_title_plural), url('{}.create'.format(route_prefix)))}</li>
|
||||
% else:
|
||||
|
|
|
@ -48,22 +48,24 @@
|
|||
</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
<li>${h.link_to("Permalink for this {}".format(model_title), action_url('view', instance))}</li>
|
||||
## TODO: either make this configurable, or just lose it.
|
||||
## nobody seems to ever find it useful in practice.
|
||||
## <li>${h.link_to("Permalink for this {}".format(model_title), action_url('view', instance))}</li>
|
||||
% if master.has_versions and request.rattail_config.versioning_enabled() and request.has_perm('{}.versions'.format(permission_prefix)):
|
||||
<li>${h.link_to("Version History", action_url('versions', instance))}</li>
|
||||
% endif
|
||||
% if master.editable and instance_editable and request.has_perm('{}.edit'.format(permission_prefix)):
|
||||
% if not use_buefy and master.editable and instance_editable and master.has_perm('edit'):
|
||||
<li>${h.link_to("Edit this {}".format(model_title), action_url('edit', instance))}</li>
|
||||
% endif
|
||||
${self.context_menu_item_delete()}
|
||||
% if master.creatable and master.show_create_link and request.has_perm('{}.create'.format(permission_prefix)):
|
||||
% if not use_buefy and master.creatable and master.show_create_link and master.has_perm('create'):
|
||||
% 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>
|
||||
% endif
|
||||
% endif
|
||||
% if master.cloneable and request.has_perm('{}.clone'.format(permission_prefix)):
|
||||
% if not use_buefy and master.cloneable and master.has_perm('clone'):
|
||||
<li>${h.link_to("Clone this as new {}".format(model_title), url('{}.clone'.format(route_prefix), uuid=instance.uuid))}</li>
|
||||
% endif
|
||||
% if master.touchable and request.has_perm('{}.touch'.format(permission_prefix)):
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
% if master.rows_editable and instance_editable and request.has_perm('{}.edit'.format(permission_prefix)):
|
||||
<li>${h.link_to("Edit this {}".format(model_title), action_url('edit', instance))}</li>
|
||||
% endif
|
||||
% if instance_deletable and master.has_perm('delete_row'):
|
||||
% if not use_buefy and instance_deletable and master.has_perm('delete_row'):
|
||||
<li>${h.link_to("Delete this {}".format(model_title), action_url('delete', instance))}</li>
|
||||
% endif
|
||||
% if rows_creatable and request.has_perm('{}.create'.format(permission_prefix)):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue