Merge pull request #17376 from grokability/small-tweak-to-acceptance-ui
Better indicate via submit button colors and messaging that something is about to be accepted or declined
This commit is contained in:
@@ -55,7 +55,7 @@ return [
|
||||
'default_eula_text_placeholder' => 'Add your default EULA text',
|
||||
'default_language' => 'Default Language',
|
||||
'default_eula_help_text' => 'You can also associate custom EULAs to specific asset categories.',
|
||||
'acceptance_note' => 'Add a note for your decision (Optional)',
|
||||
'acceptance_note' => 'Add a note for your decision (required if declining)',
|
||||
'display_asset_name' => 'Display Asset Name',
|
||||
'display_checkout_date' => 'Display Checkout Date',
|
||||
'display_eol' => 'Display EOL in table view',
|
||||
|
||||
@@ -346,6 +346,8 @@ return [
|
||||
'audit_overdue' => 'Overdue for Audit',
|
||||
'accept' => 'Accept :asset',
|
||||
'i_accept' => 'I accept',
|
||||
'i_decline_item' => 'I decline this item',
|
||||
'i_accept_item' => 'I accept this item',
|
||||
'i_decline' => 'I decline',
|
||||
'accept_decline' => 'Accept/Decline',
|
||||
'sign_tos' => 'Sign below to indicate that you agree to the terms of service:',
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
</div>
|
||||
|
||||
@if (auth()->user()->email!='')
|
||||
<div class="col-md-12" style="padding-top: 20px; display: none;" id="toggleShow">
|
||||
<div class="col-md-12" style="padding-top: 20px; display: none;" id="showEmailBox">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" value="1" name="send_copy" id="send_copy" checked="checked" aria-label="send_copy">
|
||||
{{ trans('mail.send_pdf_copy') }} ({{ auth()->user()->email }})
|
||||
@@ -99,8 +99,13 @@
|
||||
@endif
|
||||
|
||||
</div> <!-- / box-body -->
|
||||
<div class="box-footer text-right">
|
||||
<button type="submit" class="btn btn-success" id="submit-button"><i class="fa fa-check icon-white" aria-hidden="true"></i> {{ trans('general.submit') }}</button>
|
||||
<div class="box-footer text-right" style="display: none;" id="showSubmit">
|
||||
<button type="submit" class="btn btn-success" id="submit-button">
|
||||
<i class="fa fa-check icon-white" aria-hidden="true" id="submitIcon"></i>
|
||||
<span id="buttonText">
|
||||
{{ trans('general.i_accept_item') }}
|
||||
</span>
|
||||
</button>
|
||||
</div><!-- /.box-footer -->
|
||||
</div> <!-- / box-default -->
|
||||
</div> <!-- / col -->
|
||||
@@ -113,9 +118,6 @@
|
||||
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
|
||||
|
||||
|
||||
|
||||
var wrapper = document.getElementById("signature-pad"),
|
||||
clearButton = wrapper.querySelector("[data-action=clear]"),
|
||||
saveButton = wrapper.querySelector("[data-action=save]"),
|
||||
@@ -153,13 +155,27 @@
|
||||
$('#signature_output').val(signaturePad.toDataURL());
|
||||
}
|
||||
});
|
||||
|
||||
$('[name="asset_acceptance"]').on('change', function() {
|
||||
|
||||
if ($(this).is(':checked') && $(this).attr('id') == 'declined') {
|
||||
$("#showEmailBox").hide();
|
||||
$("#showSubmit").show();
|
||||
$("#submit-button").removeClass("btn-success").addClass("btn-danger").show();
|
||||
$("#submitIcon").removeClass("fa-check").addClass("fa-times");
|
||||
$("#buttonText").text('{{ trans('general.i_decline_item') }}');
|
||||
$("#note").prop('required', true);
|
||||
|
||||
} else if ($(this).is(':checked') && $(this).attr('id') == 'accepted') {
|
||||
$("#showEmailBox").show();
|
||||
$("#showSubmit").show();
|
||||
$("#submit-button").removeClass("btn-danger").addClass("btn-success").show();
|
||||
$("#submitIcon").removeClass("fa-check").addClass("fa-check");
|
||||
$("#buttonText").text('{{ trans('general.i_accept_item') }}');
|
||||
$("#note").prop('required', false);
|
||||
|
||||
|
||||
|
||||
$('[name="asset_acceptance"]').on('change', function(){
|
||||
if ($(this).is(':checked') && $(this).attr('id') == 'accepted' ) {
|
||||
$("#toggleShow").show();
|
||||
}
|
||||
else{
|
||||
$("#toggleShow").hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user