lint fix
Tests & Lint & Deploy to Railway / build (20.x, 8.2) (push) Successful in 2m5s Details
Tests & Lint & Deploy to Railway / deploy (8.1) (push) Failing after 1m18s Details

This commit is contained in:
aslan 2024-01-25 08:59:34 +03:00
parent 49cf4f619a
commit 7d0c12a086
6 changed files with 148 additions and 32 deletions

View File

@ -23,32 +23,33 @@ class ReceptionScreenController extends Controller
if (Auth::guest()) { if (Auth::guest()) {
abort(403); abort(403);
} }
return view('admin-reception-screen.create'); $receptionScreens = ReceptionScreen::all()->sortBy('position');
return view('admin-reception-screen.create', compact('receptionScreens'));
} }
public function store(StoreReceptionScreenRequest $request) public function store(StoreReceptionScreenRequest $request)
{ {
if (Auth::guest()) {
abort(403, 'Вы не авторизованы!');
} }
/** $validated = $request->validated();
* Display the specified resource. $receptionScreen = new ReceptionScreen();
*/ $receptionScreen->name = $validated['name'];
public function show(ReceptionScreen $doceumentsOnline) $receptionScreen->position = $validated['position'];
$receptionScreen->save();
return redirect()->route('admin-reception-screen.index');
}
public function edit(ReceptionScreen $currentOnlineDocument)
{ {
// if (Auth::guest()) {
abort(403, 'Вы не авторизованы!');
}
$onlineDocuments = ReceptionScreen::all()->sortBy('position');
return view('admin-reception-screen.edit', compact('currentOnlineDocument', 'onlineDocuments'));
} }
/**
* Show the form for editing the specified resource.
*/
public function edit(ReceptionScreen $doceumentsOnline)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateReceptionScreenRequest $request, ReceptionScreen $doceumentsOnline) public function update(UpdateReceptionScreenRequest $request, ReceptionScreen $doceumentsOnline)
{ {
// //

View File

@ -11,7 +11,7 @@ class StoreReceptionScreenRequest extends FormRequest
*/ */
public function authorize(): bool public function authorize(): bool
{ {
return false; return true;
} }
/** /**
@ -22,7 +22,8 @@ class StoreReceptionScreenRequest extends FormRequest
public function rules(): array public function rules(): array
{ {
return [ return [
// 'name' => 'required|max:255',
'position' => 'required||int|max:255',
]; ];
} }
} }

View File

@ -11,7 +11,7 @@ class UpdateReceptionScreenRequest extends FormRequest
*/ */
public function authorize(): bool public function authorize(): bool
{ {
return false; return true;
} }
/** /**
@ -22,7 +22,8 @@ class UpdateReceptionScreenRequest extends FormRequest
public function rules(): array public function rules(): array
{ {
return [ return [
// 'name' => 'required|max:255',
'position' => 'required||int|max:255',
]; ];
} }
} }

View File

@ -23,34 +23,29 @@ class PageScrapper
$rez = preg_match_all($strForPregMatch, $page, $arr); $rez = preg_match_all($strForPregMatch, $page, $arr);
return $content = $arr[1][0]; return $content = $arr[1][0];
} }
public function normalizeURLFile($content) public function normalizeURLFile($content)
{ {
$rez = preg_match_all('/<a href="(.*)">/isU',$content,$arr); $rez = preg_match_all('/<a href="(.*)">/isU', $content, $arr);
$arr[1] = array_unique($arr[1]); $arr[1] = array_unique($arr[1]);
foreach ($arr[1] as $el) { foreach ($arr[1] as $el) {
if (!str_starts_with($el, 'https')){ if (!str_starts_with($el, 'https')) {
$content = str_replace($el,'https://mkgtu.ru' . $el,$content); $content = str_replace($el, 'https://mkgtu.ru' . $el, $content);
} }
} }
return $content; return $content;
} }
public function cutHTML($content,$strForScissors) public function cutHTML($content, $strForScissors)
{ {
$arr = []; $arr = [];
$rez = preg_match_all($strForScissors, $content, $arr); $rez = preg_match_all($strForScissors, $content, $arr);
$content = str_replace($arr[1],'',$content); $content = str_replace($arr[1], '', $content);
return $content; return $content;
} }
} }

View File

@ -0,0 +1,59 @@
@extends('layouts.admin-layout')
@section('content')
@auth()
<div class="row">
<div class="col">
<h1 class=""> Создать пункт Экрана приема</h1>
{{ Form::open(['url' => route('admin-reception-screen.store'), 'method' => 'POST', 'class' => '']) }}
<div class="col">
<div>
{{ Form::label('position', 'Позиция') }}
</div>
<div class="mt-2">
{{ Form::text('position', '', ['class' => 'form-control']) }}
</div>
<div>
@if ($errors->any())
{{ $errors->first('position') }}
@endif
</div>
<div>
{{ Form::label('name', 'Название') }}
</div>
<div class="mt-2">
{{ Form::text('name', '', ['class' => 'form-control']) }}
</div>
<div>
@if ($errors->any())
{{ $errors->first('name') }}
@endif
</div>
<div class="mt-4">
{{ Form::submit('создать', ['class' => 'btn btn-primary']) }}
</div>
</div>
{{ Form::close() }}
</div>
<div class="col">
<table class="table">
<thead class="border-b-2 border-solid border-black text-left" style="text-align: left">
<tr>
<th scope="col">Позиция</th>
<th scope="col">Название</th>
</tr>
</thead>
<tbody>
@foreach($onlineDocuments as $onlineDocument)
<tr>
<th scope="row">{{ $onlineDocument->position }}</th>
<td>{{ $onlineDocument->name }}</td>
@endforeach
</tbody>
</table>
</div>
</div>
@endauth
@endsection

View File

@ -0,0 +1,59 @@
@extends('layouts.admin-layout')
@section('content')
@auth()
<div class="row">
<div class="col">
<h1 class=""> Изменить пункт Экрана приема</h1>
{{ Form::open(['url' => route('admin-reception-screen.update', $currentOnlineDocument), 'method' => 'PATCH', 'class' => '']) }}
<div class="col">
<div>
{{ Form::label('position', 'Позиция') }}
</div>
<div class="mt-2">
{{ Form::text('position', $currentOnlineDocument->position, ['class' => 'form-control']) }}
</div>
<div>
@if ($errors->any())
{{ $errors->first('position') }}
@endif
</div>
<div>
{{ Form::label('name', 'Название') }}
</div>
<div class="mt-2">
{{ Form::text('name', '', ['class' => 'form-control']) }}
</div>
<div>
@if ($errors->any())
{{ $errors->first('name') }}
@endif
</div>
<div class="mt-4">
{{ Form::submit('создать', ['class' => 'btn btn-primary']) }}
</div>
</div>
{{ Form::close() }}
</div>
<div class="col">
<table class="table">
<thead class="border-b-2 border-solid border-black text-left" style="text-align: left">
<tr>
<th scope="col">Позиция</th>
<th scope="col">Название</th>
</tr>
</thead>
<tbody>
@foreach($onlineDocuments as $onlineDocument)
<tr>
<th scope="row">{{ $onlineDocument->position }}</th>
<td>{{ $onlineDocument->name }}</td>
@endforeach
</tbody>
</table>
</div>
</div>
@endauth
@endsection