list_vacancy.blade.php 6.08 KB
@if ($vacancy_list->count())
    <div class="table__scroll">
        <div class="table__body table__body_min-width">
            <table>
                <thead>
                <tr>
                    <th>№</th>
                    <th>Название</th>
                    <th>Дата добавления<br>/&nbsp;обновления</th>
                    <th style="display:none">Должности</th>
                    <th>Статус</th>
                    <th>Действия</th>
                </tr>
                </thead>
                <tbody>
                @foreach($vacancy_list as $it)
                    <tr>
                        <td>{{ $it->id }}</td>
                        <td>{{ $it->name }}</td>
                        <td>{{ date('d.m.Y H:i:s', strtotime($it->created_at)) }} <br>/ {{ date('d.m.Y H:i:s', strtotime($it->updated_at)) }}</td>
                        <td style="display:none"> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a>

                            @if ($it->jobs->count())
                                @foreach ($it->jobs as $key => $it_um)
                                    <p>@if (isset($it->jobs_code[$key]))
                                            <a href="{{ route('employer.edit_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id, 'ad_employer' => $it->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">{{$it_um->name}}</a>
                                            <a href="{{ route('employer.delete_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a>
                                        @endif
                                    </p>
                                @endforeach
                            @else
                                Нет связанных <br> с вакансией должностей
                            @endif
                        </td>
                        <td>
                            @if ($it->active_is)
                                <span class="table__status green"><i></i>Опубликовано</span>
                            @else
                                <span class="table__status"><i></i>Не опубликовано</span>
                            @endif
                        </td>
                        <td>
                                                    <span class="table__controls">
                                                        <a class="table__controls-item up-it" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}">
                                                            <svg>
                                                                <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use>
                                                            </svg>
                                                        </a>
                                                        <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" class="table__controls-item">
                                                            <svg>
                                                                <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
                                                            </svg>
                                                        </a>
                                                        <a class="table__controls-item" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}">
                                                            <svg>
                                                                <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use>
                                                            </svg>
                                                        </a>
                                                        @if ($it->active_is)
                                                            <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" class="table__controls-item">
                                                                <svg>
                                                                    <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use>
                                                                </svg>
                                                            </a>
                                                        @else
                                                            <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" class="table__controls-item">
                                                                <svg>
                                                                    <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use>
                                                                </svg>
                                                            </a>
                                                    @endif

                                                    <!--<button type="button" class="table__controls-item">
                                                            <svg>
                                                                <use xlink:href=" asset('images/sprite.svg#tg') }}"></use>
                                                            </svg>
                                                        </button>
                                                        -->
                                                    </span>
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div><br>
        {{ $vacancy_list->appends($_GET)->links('paginate') }}
    </div>
@else

    <div class="notify">
        <svg>
            <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
        </svg>
        <span>Вы ещё не разместили ни одной вакансии</span>
    </div>
@endif