mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Display message and update checkbox depending on EULA status
This commit is contained in:
parent
2bc4235368
commit
af681d8190
|
@ -73,10 +73,12 @@
|
|||
{{ Form::checkbox('checkin_email', '1', old('checkin_email', $item->checkin_email), ['aria-label'=>'checkin_email']) }}
|
||||
{{ trans('admin/categories/general.checkin_email') }}
|
||||
</label>
|
||||
<span id="email_will_be_sent_message" class="help-block">
|
||||
An email will be sent to the user because a EULA is set for this category.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('categories_upload_path')])
|
||||
|
||||
|
||||
|
@ -109,3 +111,31 @@
|
|||
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
let textarea = $('textarea[name="eula_text"]');
|
||||
let shouldSendEmail = $('input[name="checkin_email"]')
|
||||
let message = $('#email_will_be_sent_message');
|
||||
|
||||
function handleEulaChange() {
|
||||
if (textarea.val().trim() !== '') {
|
||||
shouldSendEmail.prop('checked', true);
|
||||
shouldSendEmail.prop('disabled', true);
|
||||
message.show();
|
||||
} else {
|
||||
shouldSendEmail.prop('checked', false);
|
||||
shouldSendEmail.prop('disabled', false);
|
||||
message.hide();
|
||||
}
|
||||
}
|
||||
|
||||
textarea.on('change keyup', function() {
|
||||
handleEulaChange();
|
||||
});
|
||||
|
||||
handleEulaChange();
|
||||
});
|
||||
</script>
|
||||
@stop
|
||||
|
|
Loading…
Reference in a new issue