Merge pull request 'nim_style' (#4) from nim_style into master

Reviewed-on: #4
pull/5/head
Rustem 2025-03-10 16:37:25 +00:00
commit 21a7ebff2f
13 changed files with 334 additions and 32 deletions

25
app/components/Form.php Normal file
View File

@ -0,0 +1,25 @@
<?php
/*
* Copyright (c) 2023.
*
* A.Сапаргалиев
* ТОО "Дизайн лаборатория А7"
* Астана
*/
namespace App\components;
use A7kz\Platform\Modules\Platform\Core\Services\Base\Component;
class Form extends Component
{
public function __construct(array $params = [])
{
parent::__construct($params, '');
$this->template = "components.form";
}
public function render(){
return view($this->template, $this->params)->render();
}
}

25
app/components/Show.php Normal file
View File

@ -0,0 +1,25 @@
<?php
/*
* Copyright (c) 2023.
*
* A.Сапаргалиев
* ТОО "Дизайн лаборатория А7"
* Астана
*/
namespace App\components;
use A7kz\Platform\Modules\Platform\Core\Services\Base\Component;
class Show extends Component
{
public function __construct(array $params = [])
{
parent::__construct($params, '');
$this->template = "components.show";
}
public function render(){
return view($this->template, $this->params)->render();
}
}

View File

@ -1,12 +1,18 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Reset Password') }}</div>
<div class="card reset-card">
<div class="card-header">
<h5>
{{ __('Забыли пароль?') }}
</h5>
<p>
{!! __('Для получения инструкции по восстановлению<br>пароля введите адрес Вашей электронной почты') !!}
</p>
</div>
<div class="card-body">
@if (session('status'))
<div class="alert alert-success" role="alert">
@ -17,11 +23,9 @@
<form method="POST" action="{{ lurl('password/email') }}">
@csrf
<div class="row mb-3">
<label for="email" class="col-md-4 col-form-label text-md-end">{{ __('Email Address') }}</label>
<div class="row mb-3" style="text-align: center;justify-content: center;">
<div class="col-md-6">
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
<input placeholder="{{ __('Email Address') }}" id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
@error('email')
<span class="invalid-feedback" role="alert">
@ -32,9 +36,9 @@
</div>
<div class="row mb-0">
<div class="col-md-6 offset-md-4">
<div class="reset-btn">
<button type="submit" class="btn btn-primary">
{{ __('Send Password Reset Link') }}
{{ __('Отправить') }}
</button>
</div>
</div>

View File

@ -5,7 +5,7 @@
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Reset Password') }}</div>
<div class="card-header">{{ __('Восстановить пароль') }}</div>
<div class="card-body">
<form method="POST" action="{{ lurl('/password/reset') }}">

View File

@ -1,7 +1,8 @@
{
"module": "pipicar",
"name": "pipicar.auto",
"type": "crud",
"type": "custom",
"class": "App.components.show",
"title": "Автомобили",
"withHeader": false,
"data": {
@ -226,6 +227,7 @@
"add": {
"title": "Добавление автомобиля",
"template": "app.base.crud.form",
"component": "App.components.show",
"form": {
"submits": "struct:crud.form.edit.submits",
"rows": [
@ -310,6 +312,7 @@
"edit": {
"title": "Редактирование автомобиля",
"template": "app.base.crud.form",
"component": "App.components.show",
"form": {
"rows": [
{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -70,6 +70,15 @@
}
}
&.btn-outline {
background-color: $light-color;
color: $outline-text-color;
border: 1px solid #00465c57!important;
&:hover {
background-color: white;
}
}
&.btn-action {
border-radius: 50%;

View File

@ -1,7 +1,39 @@
.card{
border-radius: 6px;
border: 1px solid $border-color;
background-color: #fff;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 50px;
overflow: auto;
border-radius: 25px;
-webkit-box-shadow: 1px -2px 17px -5px rgba(179, 179, 179, 0.76);
-moz-box-shadow: 1px -2px 17px -5px rgba(179, 179, 179, 0.76);
box-shadow: 1px -2px 17px -5px rgba(179, 179, 179, 0.76);
border: none;
.card-body{
padding: 20px;
}
.card-header {
background-color: $white;
}
}
.reset-card {
padding: 30px;
.card-header {
text-align: center;
h5 {
text-align: center;
font-size: 1.5rem;
}
p {
font-size: 0.875rem;
}
}
.reset-btn {
display: flex;
align-content: center;
justify-content: center;
}
}

View File

@ -15,3 +15,10 @@ $primary-bg-color: rgba(11, 107, 251, 0.2);
$success-bg-color: rgba(7, 179, 133, 0.2);
$danger-bg-color: rgba(220, 53, 69, 0.2);
$secondary-bg-color: rgba(66, 75, 75, 0.2);
//ouline-btn
$outline-text-color: #00465C;
$light-color: #eeeeee;
$white: white;
$outine-border: #007BA2;

View File

@ -0,0 +1,104 @@
<?php
/*
* Copyright (c) 2022.
* Aidyn Sapargaliyev
* Nur-Sultan (Astana), Kazakhstan
* ТОО Дизайн лаборатория А7
* https://a7.kz
*/
/**
* @var \A7kz\Platform\Modules\Platform\Core\Services\Application\BaseApplication $app
* @var \A7kz\Platform\Modules\Platform\Core\Services\UI\FormBuilder $form
*/
?>
@if($app->withHeader())
<x-component name="Tabs" :module="$module"/>
@endif
{!! $app->show_message() !!}
<x-component name="Js.Before" :params="['app'=>$app, 'form'=>$form]" :module="$module"/>
<div class="@if($form->hasContainer()){{$form->container()}}@endif">
<form method="post"
action="{{$app->getPath()}}/{{$form->action()}}@if($app->data->hasPkValue())?pk={{$app->data->getPkValue()}}@endif"
onsubmit="return submit_prepare()">
<div class="global-actions">
<div class="left-content">
<h5 class="global-title">@lang($form->title())</h5>
</div>
<div class="right-content">
@if(count($form->submits()))
<x-component name="Form.Submits" :params="['app'=>$app, 'form'=>$form]"
:module="$module"/>
@endif
</div>
</div>
<div class="card">
<div class="card-body">
@if($form->action() == "show")
@if(!isset($form->getConfig()->hide_prev_next_pk))
<div class="row">
<div class="col text-center">
<?php $next = $app->data->getNextPkValue(); $prev = $app->data->getPrevPkValue(); ?>
@if($prev) <a class="btn btn-primary" href="{{$app->getPath()}}/{{$form->action()}}?pk={{$prev}}"><i class="bi bi-caret-left-fill"></i></a> @endif
@if($next) <a class="btn btn-primary" href="{{$app->getPath()}}/{{$form->action()}}?pk={{$next}}"><i class="bi bi-caret-right-fill"></i></a> @endif
</div>
</div>
@endif
@endif
<div class="row">
<div class="@if($app->isProcess()) col-md-8 col-xs-12 @else col @endif">
@if($app->data->isAutoincrement() && $app->data->getPkValue())
<input type="hidden" name="{{$app->data->getPk()}}" value="{{$app->data->getPkValue()}}">
@endif
@if($app->data->getParentValue())
<input type="hidden" id="{{$app->data->getParentField()}}" value="{{$app->data->getParentValue()}}">
@endif
<x-component name="Form.Row" :params="['rows'=>$form->rows(),'app'=>$app, 'form'=>$form]"
:module="$module"/>
@if(count($form->tabs()))
<x-component name="Form.Tab" :params="['app'=>$app, 'form'=>$form]"
:module="$module"/>
@endif
@if($app->hasComments())
{!! $app->comment->getComments() !!}
@endif
</div>
@if($app->isProcess())
<div class="col-md-4 col-xs-12">
{!! $app->documentState->form(); !!}
</div>
@endif
</div>
</div>
</div>
{{ csrf_field() }}
<x-component name="Form.CFCinput" :params="['app'=>$app, 'form'=>$form]"
:module="$module"/>
</form>
</div>
<x-component name="Additional.Modal" :module="$module"/>
<x-component name="Js.After" :params="['app'=>$app]" :module="$module"/>
<x-component name="Additional.ImportAction" :params="['app'=>$app]" :module="$module"/>
@foreach($form->getInjectComponent() as $inject_component)
<x-component :name="$inject_component" :module="$module" :params="['app'=>$app]"/>
@endforeach
@if(!empty($form->getOnRenderEmitFunctions()))
<x-component name="Js.OnRenderEmitFunctions" :module="$module"
:params="['app' => $app, 'emitFunctions' => $form->getOnRenderEmitFunctions()]"
/>
@endif
@if($app->withHeader())
<div class="row mt-5">
<div class="col">
<hr>
<div class="text-end"><span style="color: #e00b0b">*</span> - @lang('Поля обязательные к заполнению')</div>
</div>
</div>
@endif

View File

@ -0,0 +1,86 @@
<?php
/*
* Copyright (c) 2022.
* Aidyn Sapargaliyev
* Nur-Sultan (Astana), Kazakhstan
* ТОО Дизайн лаборатория А7
* https://a7.kz
*/
/**
* @var \A7kz\Platform\Modules\Platform\Core\Services\Application\CrudApplication $app
*/
?>
@if($app->withHeader())
<x-component name="Tabs" :module="$module"/>
@endif
{!! $app->show_message() !!}
<x-component name="Js.Before" :params="['app'=>$app, 'form'=>$form]" :module="$module"/>
<div class="@if($form->hasContainer()){{$form->container()}}@endif">
<form method="post"
action="{{$app->getPath()}}/{{$form->action()}}@if($app->data->hasPkValue())?pk={{$app->data->getPkValue()}}@endif"
onsubmit="return submit_prepare(event)">
<div class="global-actions">
<div class="left-content">
<h5 class="global-title">{{$form->title()}}</h5>
</div>
<div class="right-content">
@if(count($form->submits()))
<x-component name="Form.Submits" :params="['app'=>$app, 'form'=>$form]"
:module="$module"/>
@endif
</div>
</div>
<hr class="global-line">
<div class="card">
<div class="card-body">
@if(!isset($form->getConfig()->form->hide_prev_next_pk))
<div class="row">
<div class="col text-center">
<?php $next = $app->data->getNextPkValue(); $prev = $app->data->getPrevPkValue(); ?>
@if($prev) <a class="btn btn-outline" href="{{$app->getPath()}}/{{$form->action()}}?pk={{$prev}}"><i class="bi bi-caret-left-fill">123</i></a> @endif
@if($next) <a class="btn btn-primary" href="{{$app->getPath()}}/{{$form->action()}}?pk={{$next}}"><i class="bi bi-caret-right-fill"></i></a> @endif
</div>
</div>
@endif
<div class="row">
<div class="@if($app->isProcess()) col-md-8 col-xs-12 @else col @endif">
@if($app->data->isAutoincrement() && $app->data->getPkValue())
<input type="hidden" name="{{$app->data->getPk()}}" value="{{$app->data->getPkValue()}}">
@endif
<x-component name="Form.Row" :params="['rows'=>$form->rows(),'app'=>$app, 'form'=>$form]"
:module="$module"/>
@if(count($form->tabs()))
<x-component name="Form.Tab" :params="['app'=>$app, 'form'=>$form]"
:module="$module"/>
@endif
@if($app->hasComments())
{!! $app->comment->getComments() !!}
@endif
</div>
@if($app->isProcess())
<div class="col-md-4 col-xs-12">
{!! $app->documentState->form(); !!}
</div>
@endif
</div>
</div>
</div>
{{ csrf_field() }}
</form>
</div>
<x-component name="Additional.Modal" :module="$module"/>
<x-component name="Js.After" :params="['app'=>$app]" :module="$module" />
<x-component name="Additional.ImportAction" :params="['app'=>$app]" :module="$module"/>
@foreach($form->getInjectComponent() as $inject_component)
<x-component :name="$inject_component" :module="$module" :params="['app'=>$app]"/>
@endforeach
@if(!empty($form->getOnRenderEmitFunctions()))
<x-component name="Js.OnRenderEmitFunctions" :module="$module"
:params="['app' => $app, 'emitFunctions' => $form->getOnRenderEmitFunctions()]"
/>
@endif

View File

@ -29,29 +29,20 @@
<div id="web_content">
<div id="app"
@if(isset($_COOKIE['a7platform_open_window']) && $_COOKIE['a7platform_open_window']) class="menu-open" @endif>
@include('platform.navigation::sidebar')
@auth
@include('platform.navigation::sidebar')
@endauth
<main class="main-container">
<header class="navbar">
<div class="nav-container py-1">
<div class="left-cont d-flex">
@auth
<i class="bi bi-list menu-trigger"></i>
@endauth
<a class="navbar-brand">
<img src="{{asset('img/logo.png')}}" alt="logo" class="logo">
</a>
@guest
@if (Route::has('login'))
<a class="item-nav" href="{{ lurl('login') }}">
<i class="bi bi-box-arrow-in-right"></i>
{{ __('Login') }}
</a>
@endif
@if (Route::has('register'))
<a class="item-nav" href="{{ lurl('register') }}">
<i class="bi bi-person-plus-fill"></i>
{{ __('Register') }}
</a>
@endif
@else
<div class="item-nav lang">
<div class="dropdown">
<span class="dropdown-trigger" data-bs-toggle="dropdown">
@ -87,6 +78,22 @@
</div>
<a class="header-phone" href="tel:87763504141"><i class="bi bi-telephone-fill"></i> +7 776 350 41 41</a>
</div>
@guest
<div class="right-cont d-flex justify-end align-center">
@if (Route::has('login'))
<a class="item-nav btn btn-primary waves-effect" href="{{ lurl('login') }}">
<i class="bi bi-box-arrow-in-right"></i>
{{ __('Войти') }}
</a>
@endif
@if (Route::has('register'))
<a class="item-nav btn btn-outline waves-effect" href="{{ lurl('register') }}">
<i class="bi bi-person-plus-fill"></i>
{{ __('Регистрация') }}
</a>
@endif
</div>
@else
<div class="right-cont">
<a class="item-nav user"