Neuigkeiten/News/Blog-Editing und Bugfixes

This commit is contained in:
2026-03-26 01:16:56 +01:00
parent b0d7b97c46
commit 351c73778a
10 changed files with 300 additions and 44 deletions

View File

@@ -0,0 +1,63 @@
@extends('layout.app')
@section('scripts')
<link rel="stylesheet" href="{{ asset("css/blog/edit.css") . "?rnd=" . rand(0, 1000000000) }}">
<script src="{{ asset('/js/blog/blog.js') }}"></script>
@endsection
@section('content')
<h2>Post hinzufügen</h2>
<div class="blogEdit">
Veröffentlichen? <input type="checkbox" id="blogPublished_new" checked><br /><br />
Sprache:
<select id="blogLanguage_new" name="language" autocomplete="off">
<option value="de">Deutsch</option>
<option value="en">Englisch</option>
</select><br /><br />
<label for="blogTitle_new">Titel:<br />
</label><input id="blogTitle_new" type="text" value="" placeholder="Titel eingeben...">
<br /><br />
<label for="blogBody_new">Inhalt:</label><br />
<textarea cols="64" rows="8" maxlength="2000" id="blogBody_new" placeholder="Text/HTML eingeben..."></textarea>
<br />
<br />
<button onclick="addBlog()" id="blogEdit_new">Hinzufügen</button><br /><br />
</div>
<h2>Posts ändern/löschen</h2>
<br />
@foreach($blogs as $blog)
<div class="blogEdit">
<b>Erstellt von: {{$blog->byUser()->first()->name}} - Erstellt am: {{ $blog->created_at }} - Verändert am: {{ $blog->updated_at }}</b><br /><br />
Veröffentlicht: <input type="checkbox" id="blogPublished_{{$blog->id}}"{{ $blog->published ? " checked" : "" }}><br /><br />
Sprache:
<select id="blogLanguage_{{ $blog->id }}" name="language" autocomplete="off">
<option value="de"{{ ($blog->language == "de" ? " selected" : "") }}>Deutsch</option>
<option value="en"{{ ($blog->language == "en" ? " selected" : "") }}>Englisch</option>
</select><br /><br />
<button onclick="deleteBlog({{ $blog->id }})" id="blogDelete_{{ $blog->id }}">Löschen</button><br /><br />
<label for="blogTitle_{{ $blog->id }}">Titel:<br />
</label><input id="blogTitle_{{ $blog->id }}" type="text" value="{{ $blog->title }}">
<br /><br />
<label for="blogBody_{{$blog->id}}">Inhalt:</label><br />
<textarea cols="64" rows="8" maxlength="2000" id="blogBody_{{$blog->id}}">{!! $blog->body !!}</textarea>
<br />
<br />
<button onclick="editBlog({{ $blog->id }})" id="blogEdit_{{ $blog->id }}">Speichern</button><br /><br />
</div>
@endforeach
<br /><br />
{{ $blogs->links() }}
<br /><br />
@endsection