| Server IP : 172.67.168.138 / Your IP : 216.73.216.227 [ Web Server : Apache System : Linux frog 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web13 ( 5017) PHP Version : 8.3.31 Disable Function : NONE Domains : 41 Domains MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/clients/client12/web13/web/ahelos/resources/views/layouts/backend/blogs/ |
Upload File : |
@extends('layouts.backend.index', ['module_title' => 'Редактиране на блог'])
@section('content')
<div class="card ">
<div class="card-body">
<form class="" action="{{ route('blogs.update', $blog->id) }}" method="post" autocomplete="off" id="blog-form" enctype="multipart/form-data">
@csrf
@method('PATCH')
@if (session('success'))
<div class="alert alert-success form-group">
{{ session('success') }}
</div>
@endif
<div class="tab-content mt-3">
<div class="row">
<div class="col-sm-6 mx-auto">
<div class="form-group">
<label for="">
Език <strong class="text-danger">*</strong>
</label>
<select class="form-control" name="language" id="language">
<option value="">-Избери-</option>
@foreach ($languages as $key => $language)
<option value="{{ $language->code }}" @if($blog->translation->language == $language->code) {{ 'selected' }} @endif>{{ $language->title }}</option>
@endforeach
</select>
@error('language')
<span class="text-danger">{{ $message }}</span>
@enderror
</div>
<div class="form-group">
<label for="">
Картинка <strong class="text-danger">*</strong>
</label>
<input type="file" name="image" value="" class="form-control">
@if($blog->image != '')
<img src="{{ asset('storage/blogs/resized/'.$blog->image) }}" alt="" width="200">
@endif
</div>
<div class="form-group">
<label for="">
Заглавие <strong class="text-danger">*</strong>
</label>
<input type="text" name="title" value="{{ $blog->translation->title }}" class="form-control">
@error('title')
<span class="text-danger">{{ $message }}</span>
@enderror
</div>
<div class="form-group">
<label for="">
Описание <strong class="text-danger">*</strong>
</label>
<textarea id="ckeditor_{{ $language->code }}" name="text" rows="8" cols="80" class="form-control ">{{ $blog->translation->text }}</textarea>
@error('text')
<span class="text-danger">{{ $message }}</span>
@enderror
</div>
<div class="form-group">
<label for="">
Meta Заглавие
</label>
<input type="text" name="meta_title" value="{{ $blog->translation->meta_title }}" class="form-control">
</div>
<div class="form-group">
<label for="">
Meta Описание
</label>
<textarea name="meta_description" rows="8" cols="80" class="form-control">{{ $blog->translation->meta_description }}</textarea>
</div>
<div class="form-group">
<label for="">
Статус
</label>
<select class="form-control" name="status">
<option value="1" @if($blog->status == '1') {{ 'selected' }} @endif>Активна</option>
<option value="0" @if($blog->status == '0') {{ 'selected' }} @endif>Неактивна</option>
</select>
</div>
</div>
</div>
</div>
<div class="row justify-content-center">
<div class="form-group col-sm-6">
<button type="submit" name="update" class="btn btn-lg btn-warning">
Редактирай
</button>
</div>
</div>
</form>
</div>
</div>
@endsection
@section('ckeditor')
<script type="text/javascript">
$(function(){
CKEDITOR.dtd.$removeEmpty['ins'] = false;
CKEDITOR.config.extraAllowedContent = 'iframe[*] script';
CKEDITOR.config.allowedContent =
'h1 h2 h3 p{text-align}; blockquote strong b em ul li hr;' +
'a[!href];' +
'img(left,right)[!src,alt,width,height,align];';
CKEDITOR.config.toolbarGroups =[
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
{ name: 'forms', groups: [ 'forms' ] },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },
{ name: 'links', groups: [ 'links' ] },
{ name: 'insert', groups: [ 'insert' ] },
{ name: 'styles', groups: [ 'styles' ] },
{ name: 'colors', groups: [ 'colors' ] },
{ name: 'tools', groups: [ 'tools' ] },
{ name: 'others', groups: [ 'others' ] },
{ name: 'about', groups: [ 'about' ] }
];
CKEDITOR.config.removeButtons = 'Save,NewPage,ExportPdf,Preview,Print,Templates,Copy,Paste,PasteFromWord,Cut,Undo,Redo,Find,Replace,SelectAll,Scayt,Form,Radio,Checkbox,TextField,Textarea,Select,Button,ImageButton,HiddenField,Outdent,Indent,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,Anchor,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,Styles,Font,FontSize,TextColor,BGColor,ShowBlocks,About';
CKEDITOR.config.filebrowserUploadMethod = 'form';
CKEDITOR.config.height = 400;
CKEDITOR.plugins.addExternal( 'oembed', '{{ asset("backend/plugins/ckeditor/plugins/oembed/") }}', 'plugin.js' );
CKEDITOR.plugins.addExternal( 'widget', '{{ asset("backend/plugins/ckeditor/plugins/widget/") }}');
})
@foreach ($languages as $key => $language)
$(function(){
CKEDITOR.replace( 'ckeditor_{{ $language->code }}',
{
filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
filebrowserUploadMethod: 'form',
});
})
@endforeach
</script>
@endsection