Merge pull request 'nim_style 8' (#11) from nim_style into master

Reviewed-on: #11
master
nimtaurel 2025-04-28 13:54:50 +00:00
commit faa33860ae
10 changed files with 292 additions and 58 deletions

View File

@ -1,5 +1,119 @@
<?php
use \Illuminate\Support\Carbon;
use \A7kz\Platform\Models\UniModel;
use A7kz\Platform\Modules\Platform\Acl\Facades\Acl;
use \App\Modules\applications\Enum\ApplicationStatus;
// Заявки с утвержденным статусом
$approvedApplications = UniModel::model('pipi_applications', Acl::connection())
->where('user_id', auth()->user()->id)
->where('status', ApplicationStatus::approved)
->get();
// Заявки с ожидающим статусом
$pendingApplications = UniModel::model('pipi_applications', Acl::connection())
->where('user_id', auth()->user()->id)
->where('status', ApplicationStatus::reserved)
->get();
?>
<div class="row">
<div class="col-12 col-lg-3 col-md-5 col-sm-5">
<div class="col-12 col-sm-3">
@include('platform.user_profile::user',['name'=>$user->name, 'about'=>$user->about])
</div>
<div class="card col-12 col-sm-8 ms-sm-5 applications-history">
<div class="card-body">
<ul class="nav nav-tabs" id="applicationsTab" role="tablist">
<li class="nav-item me-4" role="presentation">
<a class="nav-link active" id="applications-tab" data-bs-toggle="tab" href="#applications" role="tab" aria-controls="applications" aria-selected="true">@lang('История заказов')</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="reserves-tab" data-bs-toggle="tab" href="#reserves" role="tab" aria-controls="reserves" aria-selected="false">@lang('Бронирования')</a>
</li>
</ul>
<div class="tab-content" id="applicationsTabContent">
<div class="tab-pane fade show active" id="applications" role="tabpanel" aria-labelledby="applications-tab">
<div class="card-body">
<div class="table-container">
<table class="table">
<thead>
<tr>
<th><b>@lang('Дата начала')</b></th>
<th><b>@lang('Дата окончания')</b></th>
<th><b>@lang('Дней')</b></th>
<th><b>@lang('Машина')</b></th>
</tr>
</thead>
<tbody>
@foreach($approvedApplications as $applications_item)
<tr>
<td>
{{ $applications_item->started_at ? Carbon::parse($applications_item->started_at)->format('d.m.Y') : '' }}
</td>
<td>
{{ $applications_item->ended_at ? Carbon::parse($applications_item->ended_at)->format('d.m.Y') : '' }}
</td>
<td>
{{ $applications_item->rent_day }}
</td>
<td>
@php
$car = \A7kz\Platform\Models\UniModel::model('pipi_auto')->where('id', $applications_item->car_id)->first();
@endphp
{{ $car->name }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<!-- Бронирования -->
<div class="tab-pane fade" id="reserves" role="tabpanel" aria-labelledby="reserves-tab">
<div class="card-body">
<div class="table-container">
<table class="table">
<thead>
<tr>
<th><b>@lang('Дата начала')</b></th>
<th><b>@lang('Дата окончания')</b></th>
<th><b>@lang('Дней')</b></th>
<th><b>@lang('Машина')</b></th>
</tr>
</thead>
<tbody>
@foreach($pendingApplications as $applications_item)
<tr>
<td>
{{ $applications_item->started_at ? Carbon::parse($applications_item->started_at)->format('d.m.Y') : '' }}
</td>
<td>
{{ $applications_item->ended_at ? Carbon::parse($applications_item->ended_at)->format('d.m.Y') : '' }}
</td>
<td>
{{ $applications_item->rent_day }}
</td>
<td>
@php
$car = \A7kz\Platform\Models\UniModel::model('pipi_auto')->where('id', $applications_item->car_id)->first();
@endphp
{{ $car->name }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var myTab = new bootstrap.Tab(document.getElementById('applications-tab'))
myTab.show()
</script>

View File

@ -1,10 +1,9 @@
<div class="row">
<div class="col">
<div class="card mb-4 profile-info">
<div class="card profile-info">
<div class="card-body">
@php($profile_image = auth()->user()->profile_image)
<div class="d-flex flex-column justify-content-center align-content-center profile-content">
<div class="profile-img d-flex justify-content-center align-content-center mb-3">
<div class="d-flex flex-column justify-content-center align-items-center profile-content">
<div class="profile-img d-flex justify-content-center align-items-center mb-3">
<img src="@if($profile_image == null) {{asset("img/avatar.png") }} @else {{ asset("storage/$profile_image") }} @endif" id="image_preview_container" alt="profile_image">
</div>
<div class="d-flex flex-column justify-content-center align-items-center">
@ -24,6 +23,5 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -16,11 +16,11 @@
<button name="back" value="back" class="btn btn-primary" id="back_btn" type="button"><i class="bi bi-back"></i>{{__(" Закрыть")}}</button>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-2 d-flex align-items-center justify-content-center">
<div class="d-flex flex-column align-items-center text-center">
<div class="card user-edit-card">
<div class="card-body user-edit">
<div class="row justify-content-center align-content-center">
<div class="col-12 col-lg-3 col-xl-2 d-flex align-items-center justify-content-center me-md-0 me-xl-3">
<div class="d-flex flex-column align-items-center text-center img-container">
@php($profile_image = auth()->user()->profile_image)
<label class="img-profile-edit">
<img src="@if($profile_image == null) {{ asset("img/avatar.png") }} @else {{ asset("storage/$profile_image") }} @endif" id="image_preview_container">
@ -29,26 +29,26 @@
</div>
</div>
@csrf
<div class="col-md-10 mt-3">
<div class="col-12 col-md-9 col-xl-9 mt-3">
<div class="d-flex justify-content-center align-items-center flex-column">
<label class="labels"><span style="width: 20px; height: 20px; background-color: #01b0e8; color: white; border-radius: 50%; padding: 5px 7px"><i class="bi bi-pen"></i></span>{{__(" Редактировать профиль")}}</label>
</div>
<div class="row mt-3">
<div class="col-md-6 mb-3">
<div class="col-lg-6 mb-3">
<label class="labels">{{__("Имя")}}</label>
<input type="text" name="name" class="form-control" placeholder="first name" value="{{ auth()->user()->name }}">
</div>
<div class="col-md-6 mb-3">
<div class="col-lg-6 mb-3">
<label class="labels"> {{__("Почта")}}</label>
<input type="text" name="email" class="form-control" value="{{ auth()->user()->email }}" placeholder="Email">
</div>
</div>
<div class="row mt-2">
<div class="col-md-6 mb-3">
<div class="col-lg-6 mb-3">
<label class="labels">{{__("Телефон")}}</label>
<input type="text" name="phone" id="phone" class="form-control mobile" placeholder="" value="{{ auth()->user()->phone }}">
</div>
<div class="col-md-6 mb-3">
<div class="col-lg-6 mb-3">
<label class="labels">{{__("О себе")}}</label>
<input type="text" name="about" class="form-control" value="{{ auth()->user()->about }}" placeholder="About">
</div>
@ -57,11 +57,11 @@
<label class="labels"><span style="width: 20px; height: 20px; background-color: #01b0e8; color: white; border-radius: 50%; padding: 7px 5px 3px 5px"><i class="bi bi-key"></i></span>{{__(" Сменить пароль")}}</label>
</div>
<div class="row mt-2">
<div class="col-md-6 mb-3">
<div class="col-lg-6 mb-3">
<label for="current_password" class="col-form-label">{{ __('Текущий пароль') }}</label>
<input id="current_password" type="password" class="form-control" name="current_password" autocomplete="off-current-password">
</div>
<div class="col-md-6 mb-3">
<div class="col-lg-6 mb-3">
<label for="new_password" class="col-form-label">{{ __('Новый пароль') }}</label>
<input id="new_password" type="password" class="form-control" name="new_password" autocomplete="new-password">
</div>

View File

@ -7,4 +7,6 @@ enum ApplicationStatus: string
case pending = 'pending';
case approved = 'approved';
case rejected = 'rejected';
case reserved = 'reserved'; //статус брони
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,7 @@ body {
}
.main-container {
margin: 50px;
margin: 57px 50px 50px;
padding: 20px;
}
@ -303,3 +303,7 @@ body {
}
}
}
.bi::before {
line-height: 1.4;
}

View File

@ -256,16 +256,17 @@ iframe {
}
.profile-info {
padding: 0;
padding: 50px 20px;
margin: 0;
.card-body {
.profile-content {
.profile-img {
width: 100%;
height: 100%;
width: 80%;
height: 80%;
padding: 50px 50px 20px;
img {
border-radius: 50%;
padding: 10px;
}
}
@ -276,3 +277,119 @@ iframe {
}
}
}
.user-edit-card {
padding: 7vh 10vh;
margin: 3vh 10vh;
.user-edit {
.img-container {
min-width: 170px;
.img-profile-edit {
border-radius: 50%;
}
img {
border-radius: 50%;
}
}
label {
text-align: center;
}
}
}
.applications-history {
margin: 0;
.card-body {
padding: 0;
.nav-tabs {
border: none;
margin-bottom: 40px;
.nav-item {
.nav-link {
position: relative;
color: $text-color;
font-size: 1rem;
border: none;
border-bottom: 1px solid transparent;
transition: border-color 0.3s;
padding: 15px;
&:focus, &:hover {
border: none;
box-shadow: none
}
&::after {
content: '';
position: absolute;
left: 0;
bottom: -1px;
width: 100%;
height: 2px;
background-color: $primary-color;
transform: scaleX(0);
transform-origin: bottom right;
transition: transform 0.3s ease-out;
}
&:hover {
color: lighten($primary-color, 10%);
&::after {
transform: scaleX(1);
transform-origin: bottom left;
background-color: lighten($primary-color, 10%)
}
}
&:focus {
box-shadow: none;
}
}
.nav-link.active {
color: $primary-color;
&::after {
transform: scaleX(1);
transform-origin: bottom left;
background-color: $primary-color;
}
}
}
}
.table-container {
box-shadow: none;
.table {
thead {
border-color: $light-color;
th {
b {
color: $primary-color;
text-decoration: none;
white-space: nowrap;
}
}
}
tbody {
tr {
td {
// Обычные стили для ячеек
}
&:last-child {
td:last-child,
td:first-child
{
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
}
}
}
}
}
}
}

View File

@ -78,38 +78,6 @@
border-bottom: 0;
border-left: .3em solid transparent;
}
.dropdown-menu {
.dropdown-menu {
position: absolute;
z-index: 1000;
display: none;
min-width: 10rem;
padding: .5rem 0;
margin: 0;
font-size: 1rem;
color: #212529;
text-align: left;
list-style: none;
background-color: #fff;
background-clip: padding-box;
border: 1px solid rgba(0, 0, 0, .15);
border-radius: .25rem;
}
.dropdown-item {
padding: 5px 10px 5px 17px;
display: flex;
align-items: center;
color: $gray-color;
font-weight: 700;
transition: 0.15s all ease;
&:hover {
background-color: #01b0e836;
color: $text-color;
}
}
}
}
.header-phone {
font-size: 16px;
@ -188,3 +156,35 @@
max-width: 1320px;
}
}
.dropdown-menu {
.dropdown-menu {
position: absolute;
z-index: 1000;
display: none;
min-width: 10rem;
padding: .5rem 0;
margin: 0;
font-size: 1rem;
color: #212529;
text-align: left;
list-style: none;
background-color: #fff;
background-clip: padding-box;
border: 1px solid rgba(0, 0, 0, .15);
border-radius: .25rem;
}
.dropdown-item {
padding: 5px 10px 5px 17px;
display: flex;
align-items: center;
color: $gray-color;
font-weight: 700;
transition: 0.15s all ease;
&:hover {
background-color: #01b0e836;
color: $text-color;
}
}
}

View File

@ -19,6 +19,5 @@ $secondary-bg-color: rgba(66, 75, 75, 0.2);
//ouline-btn
$outline-text-color: #00465C;
$light-color: #eeeeee;
$white: white;
$outine-border: #007BA2;