More Buefy form cleanup for upgrades, clone/execute
This commit is contained in:
parent
2b6d88105c
commit
7224be9de2
|
@ -1,24 +1,51 @@
|
||||||
## -*- coding: utf-8; -*-
|
## -*- coding: utf-8; -*-
|
||||||
<%inherit file="/base.mako" />
|
<%inherit file="/form.mako" />
|
||||||
|
|
||||||
<%def name="title()">Clone ${model_title}: ${instance_title}</%def>
|
<%def name="title()">Clone ${model_title}: ${instance_title}</%def>
|
||||||
|
|
||||||
|
<%def name="render_buefy_form()">
|
||||||
<br />
|
<br />
|
||||||
|
% if use_buefy:
|
||||||
|
<b-notification :closable="false">
|
||||||
|
You are about to clone the following ${model_title} as a new record:
|
||||||
|
</b-notification>
|
||||||
|
% else:
|
||||||
<p>You are about to clone the following ${model_title} as a new record:</p>
|
<p>You are about to clone the following ${model_title} as a new record:</p>
|
||||||
|
% endif
|
||||||
|
|
||||||
<div class="form-wrapper">
|
${parent.render_buefy_form()}
|
||||||
${form.render()|n}
|
</%def>
|
||||||
</div><!-- form-wrapper -->
|
|
||||||
|
|
||||||
|
<%def name="render_form_buttons()">
|
||||||
<br />
|
<br />
|
||||||
|
% if use_buefy:
|
||||||
|
<b-notification :closable="false">
|
||||||
|
Are you sure about this?
|
||||||
|
</b-notification>
|
||||||
|
% else:
|
||||||
<p>Are you sure about this?</p>
|
<p>Are you sure about this?</p>
|
||||||
|
% endif
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
${h.form(request.current_route_url(), class_='autodisable')}
|
${h.form(request.current_route_url(), class_=None if use_buefy else 'autodisable')}
|
||||||
${h.csrf_token(request)}
|
${h.csrf_token(request)}
|
||||||
${h.hidden('clone', value='clone')}
|
${h.hidden('clone', value='clone')}
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
|
% if use_buefy:
|
||||||
|
<once-button tag="a" href="${form.cancel_url}"
|
||||||
|
text="Whoops, nevermind...">
|
||||||
|
</once-button>
|
||||||
|
<once-button type="is-primary"
|
||||||
|
native-type="submit"
|
||||||
|
text="Yes, please clone away">
|
||||||
|
</once-button>
|
||||||
|
% else:
|
||||||
${h.link_to("Whoops, nevermind...", form.cancel_url, class_='button autodisable')}
|
${h.link_to("Whoops, nevermind...", form.cancel_url, class_='button autodisable')}
|
||||||
${h.submit('submit', "Yes, please clone away")}
|
${h.submit('submit', "Yes, please clone away")}
|
||||||
|
% endif
|
||||||
</div>
|
</div>
|
||||||
${h.end_form()}
|
${h.end_form()}
|
||||||
|
</%def>
|
||||||
|
|
||||||
|
|
||||||
|
${parent.body()}
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
% endif
|
% endif
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
${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)}
|
${h.csrf_token(request)}
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
% if use_buefy:
|
% if use_buefy:
|
||||||
|
|
|
@ -36,14 +36,20 @@
|
||||||
</script>
|
</script>
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
${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 not instance.executed and instance.status_code == enum.UPGRADE_STATUS_PENDING and request.has_perm('{}.execute'.format(permission_prefix)):
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
% if instance.enabled and not instance.executing:
|
% if instance.enabled and not instance.executing:
|
||||||
${h.form(url('{}.execute'.format(route_prefix), uuid=instance.uuid), class_='autodisable')}
|
${h.form(url('{}.execute'.format(route_prefix), uuid=instance.uuid), class_='autodisable')}
|
||||||
${h.csrf_token(request)}
|
${h.csrf_token(request)}
|
||||||
|
% if use_buefy:
|
||||||
|
<once-button type="is-primary"
|
||||||
|
native-type="submit"
|
||||||
|
text="Execute this upgrade">
|
||||||
|
</once-button>
|
||||||
|
% else:
|
||||||
${h.submit('execute', "Execute this upgrade", class_='button is-primary')}
|
${h.submit('execute', "Execute this upgrade", class_='button is-primary')}
|
||||||
|
% endif
|
||||||
${h.end_form()}
|
${h.end_form()}
|
||||||
% elif instance.enabled:
|
% elif instance.enabled:
|
||||||
<button type="button" class="button is-primary" disabled="disabled" title="This upgrade is currently executing">Execute this upgrade</button>
|
<button type="button" class="button is-primary" disabled="disabled" title="This upgrade is currently executing">Execute this upgrade</button>
|
||||||
|
@ -52,3 +58,7 @@ ${parent.body()}
|
||||||
% endif
|
% endif
|
||||||
</div>
|
</div>
|
||||||
% endif
|
% endif
|
||||||
|
</%def>
|
||||||
|
|
||||||
|
|
||||||
|
${parent.body()}
|
||||||
|
|
Loading…
Reference in a new issue