Use header button instead of link for "touch" instance
This commit is contained in:
parent
91ac1a9031
commit
bda05aed86
|
@ -7,6 +7,18 @@
|
||||||
${instance_title}
|
${instance_title}
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
|
<%def name="render_instance_header_title_extras()">
|
||||||
|
<span style="width: 2rem;"></span>
|
||||||
|
% if master.touchable and master.has_perm('touch'):
|
||||||
|
<b-button title=""Touch" this record to trigger sync"
|
||||||
|
icon-pack="fas"
|
||||||
|
icon-left="hand-pointer"
|
||||||
|
@click="touchRecord()"
|
||||||
|
:disabled="touchSubmitting">
|
||||||
|
</b-button>
|
||||||
|
% endif
|
||||||
|
</%def>
|
||||||
|
|
||||||
<%def name="object_helpers()">
|
<%def name="object_helpers()">
|
||||||
${parent.object_helpers()}
|
${parent.object_helpers()}
|
||||||
${self.render_xref_helper()}
|
${self.render_xref_helper()}
|
||||||
|
@ -37,9 +49,6 @@
|
||||||
% if master.has_versions and request.rattail_config.versioning_enabled() and request.has_perm('{}.versions'.format(permission_prefix)):
|
% 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>
|
<li>${h.link_to("Version History", action_url('versions', instance))}</li>
|
||||||
% endif
|
% endif
|
||||||
% if master.touchable and request.has_perm('{}.touch'.format(permission_prefix)):
|
|
||||||
<li>${h.link_to("\"Touch\" this {}".format(model_title), master.get_action_url('touch', instance))}</li>
|
|
||||||
% endif
|
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
<%def name="render_row_grid_tools()">
|
<%def name="render_row_grid_tools()">
|
||||||
|
@ -83,6 +92,22 @@
|
||||||
${parent.render_this_page_template()}
|
${parent.render_this_page_template()}
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
|
<%def name="modify_whole_page_vars()">
|
||||||
|
${parent.modify_whole_page_vars()}
|
||||||
|
% if master.touchable and master.has_perm('touch'):
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
WholePageData.touchSubmitting = false
|
||||||
|
|
||||||
|
WholePage.methods.touchRecord = function() {
|
||||||
|
this.touchSubmitting = true
|
||||||
|
location.href = '${master.get_action_url('touch', instance)}'
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
% endif
|
||||||
|
</%def>
|
||||||
|
|
||||||
<%def name="finalize_this_page_vars()">
|
<%def name="finalize_this_page_vars()">
|
||||||
${parent.finalize_this_page_vars()}
|
${parent.finalize_this_page_vars()}
|
||||||
% if master.has_rows:
|
% if master.has_rows:
|
||||||
|
|
Loading…
Reference in a new issue