adjsut sign yourself
This commit is contained in:
@@ -81,7 +81,7 @@
|
||||
/>
|
||||
<template v-else>
|
||||
<form
|
||||
v-if="withSignYourselfButton && template.submitters.length < 2"
|
||||
v-if="withSignYourselfButton && undefinedSubmitters.length < 2"
|
||||
target="_blank"
|
||||
data-turbo="false"
|
||||
class="inline"
|
||||
@@ -938,6 +938,16 @@ export default {
|
||||
language () {
|
||||
return this.locale.split('-')[0].toLowerCase()
|
||||
},
|
||||
undefinedSubmitters () {
|
||||
return this.template.submitters.filter((submitter) => {
|
||||
return !submitter.invite_by_uuid &&
|
||||
!submitter.optional_invite_by_uuid &&
|
||||
!submitter.invite_via_field_uuid &&
|
||||
!submitter.linked_to_uuid &&
|
||||
!submitter.is_requester &&
|
||||
!submitter.email
|
||||
})
|
||||
},
|
||||
withPrefillable () {
|
||||
if (this.template.fields) {
|
||||
return this.template.fields.some((f) => f.prefillable)
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
<span class="mr-1"><%= t('send_to_recipients') %></span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @template.submitters.size == 1 %>
|
||||
<% if Templates.filter_undefined_submitters(@template.submitters).size == 1 %>
|
||||
<%= button_to start_form_path(@template.slug), params: { selfsign: true }, method: :put, class: 'white-button w-full', form: { style: 'display: inline', target: '_blank', data: { turbo: false } } do %>
|
||||
<%= svg_icon('writing', class: 'w-6 h-6') %>
|
||||
<span class="mr-1"><%= t('sign_it_yourself') %></span>
|
||||
|
||||
Reference in New Issue
Block a user