diff --git a/tailbone/templates/master/clone.mako b/tailbone/templates/master/clone.mako index 438421dc..48b5d229 100644 --- a/tailbone/templates/master/clone.mako +++ b/tailbone/templates/master/clone.mako @@ -1,24 +1,51 @@ ## -*- coding: utf-8; -*- -<%inherit file="/base.mako" /> +<%inherit file="/form.mako" /> <%def name="title()">Clone ${model_title}: ${instance_title} -
-

You are about to clone the following ${model_title} as a new record:

+<%def name="render_buefy_form()"> +
+ % if use_buefy: + + You are about to clone the following ${model_title} as a new record: + + % else: +

You are about to clone the following ${model_title} as a new record:

+ % endif -
- ${form.render()|n} -
+ ${parent.render_buefy_form()} + -
-

Are you sure about this?

-
+<%def name="render_form_buttons()"> +
+ % if use_buefy: + + Are you sure about this? + + % else: +

Are you sure about this?

+ % endif +
-${h.form(request.current_route_url(), class_='autodisable')} -${h.csrf_token(request)} -${h.hidden('clone', value='clone')} -
- ${h.link_to("Whoops, nevermind...", form.cancel_url, class_='button autodisable')} - ${h.submit('submit', "Yes, please clone away")} -
-${h.end_form()} + ${h.form(request.current_route_url(), class_=None if use_buefy else 'autodisable')} + ${h.csrf_token(request)} + ${h.hidden('clone', value='clone')} +
+ % if use_buefy: + + + + + % else: + ${h.link_to("Whoops, nevermind...", form.cancel_url, class_='button autodisable')} + ${h.submit('submit', "Yes, please clone away")} + % endif +
+ ${h.end_form()} + + + +${parent.body()} diff --git a/tailbone/templates/master/delete.mako b/tailbone/templates/master/delete.mako index 697eeb47..66ada13f 100644 --- a/tailbone/templates/master/delete.mako +++ b/tailbone/templates/master/delete.mako @@ -44,7 +44,7 @@ % endif
- ${h.form(request.current_route_url(), class_=None if form.use_buefy else 'autodisable')} + ${h.form(request.current_route_url(), class_=None if use_buefy else 'autodisable')} ${h.csrf_token(request)}
% if use_buefy: diff --git a/tailbone/templates/upgrades/view.mako b/tailbone/templates/upgrades/view.mako index 3c064625..3b5ce206 100644 --- a/tailbone/templates/upgrades/view.mako +++ b/tailbone/templates/upgrades/view.mako @@ -36,19 +36,29 @@ -${parent.body()} +<%def name="render_form_buttons()"> + % if not instance.executed and instance.status_code == enum.UPGRADE_STATUS_PENDING and request.has_perm('{}.execute'.format(permission_prefix)): +
+ % if instance.enabled and not instance.executing: + ${h.form(url('{}.execute'.format(route_prefix), uuid=instance.uuid), class_='autodisable')} + ${h.csrf_token(request)} + % if use_buefy: + + + % else: + ${h.submit('execute', "Execute this upgrade", class_='button is-primary')} + % endif + ${h.end_form()} + % elif instance.enabled: + + % else: + + % endif +
+ % endif + -% if not instance.executed and instance.status_code == enum.UPGRADE_STATUS_PENDING and request.has_perm('{}.execute'.format(permission_prefix)): -
- % if instance.enabled and not instance.executing: - ${h.form(url('{}.execute'.format(route_prefix), uuid=instance.uuid), class_='autodisable')} - ${h.csrf_token(request)} - ${h.submit('execute', "Execute this upgrade", class_='button is-primary')} - ${h.end_form()} - % elif instance.enabled: - - % else: - - % endif -
-% endif + +${parent.body()}