send_worker_new.blade.php 3.6 KB
<script>
    $(document).on('change', '#send_name', function() {
        let dirArray = $(this).val().split('\\')
        $('#send_name_file').html(dirArray[dirArray.length - 1])
    });
</script>
<div id="send" class="modal">
    <div class="modal__body">
        <div class="modal__title">Отправить сообщение работодателю</div>
        <form class="modal__form" id="form_worker" name="form_worker" enctype="multipart/form-data" action="{{ route('worker.new_message') }}" method="POST">
            @csrf
            <div class="modal__form-item" style="display: none">
                Отправитель сообщения:
                <input type="text" id="send_user_id" name="send_user_id" class="input" placeholder="user_id" value="">
                Получатель сообщения:
                <input type="text" id="send_to_user_id" name="send_to_user_id" class="input" placeholder="to_user_id" value="">
                Вакансия:
                <input type="text" id="send_vacancy" name="send_vacancy" class="input" placeholder="vacancy" value="">
                Должность:
                <input type="text" id="send_job_title_id" name="send_job_title_id" class="input" placeholder="vacancy" value="0">
            </div>
            <div class="modal__form-item send_title_div error_">
                <input id="send_title" name="send_title" type="text" class="input" placeholder="Тема" required>
                <label for="title">Не заполнено поле</label>
            </div>
            <div class="modal__form-item send_text_div">
                <textarea id="i2" class="textarea" id="send_text" name="send_text" placeholder="Напишите текст с предложением  о работе" required></textarea>
                <label for="i2">Не заполнено поле</label>
            </div>
            <div class="modal__form-item">
                <div class="file">
                    <label class="file__input" id="btn_send_file" name="btn_send_file">
                        <input type="file" name="send_file" id="send_name" accept=".pdf, .xls, .xlsx">
                        <span class="button button_light">
                            <svg>
                                <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
                            </svg>
                            Прикрепить файл-документ
                        </span>
                    </label>

                    <div class="file__list" id="div_file" name="div_file">
                        <div class="file__list-item">
                            <div class="file__list-item-left">
                                <svg>
                                    <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
                                </svg>
                                <span id="send_name_file" name="send_name_file"></span>
                            </div>
                            <button type="button" class="file__list-item-right js-parent-remove">
                                <svg>
                                    <use xlink:href="{{ asset('images/sprite.svg#cross-bold') }}"></use>
                                </svg>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal__form-item">
                <button type="submit" id="submit_form_worker" name="submit_form_worker" class="button">Отправить</button>
            </div>
        </form>
    </div>
</div>