v0.5.2 - Made the new menuplan, so you now can use CKeditor.

This commit is contained in:
Neerholt 2020-08-05 14:59:41 +02:00
parent 5fa22d748a
commit a04c38636b
3 changed files with 20 additions and 21 deletions

View File

@ -381,7 +381,7 @@ class UserController extends Controller
foreach ($roles as $role) {
if($user->hasRole($role)) {
array_push($users, $user);
break 1;
break 2;
}
}
}

View File

@ -29,20 +29,13 @@
<script>
ClassicEditor
.create( document.querySelector( '#editor' ), {
toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote' ],
heading: {
options: [
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
{ model: 'heading1', view: 'h3', title: 'Heading 1', class: 'sde-blue' },
{ model: 'heading2', view: 'h4', title: 'Heading 2', class: 'sde-blue' }
]
}
.create( document.querySelector( '#editor' ) )
.then( editor => {
console.log( editor );
} )
.catch( error => {
console.log( error );
console.error( error );
} );
</script>
@endsection

View File

@ -10,20 +10,26 @@
@endsection
@section("content")
<script src="https://cdn.ckeditor.com/ckeditor5/21.0.0/classic/ckeditor.js"></script>
<h1>Opret Menuplan:</h1>
<form action="{{ action('MenuPlanController@store') }}" method="post">
@csrf
<label for="week">Uge nr.</label>
<input type="number" name="week" id="week" min="1" max="53" placeholder="1" required>
<label for="monday">Mandag:</label>
<input type="text" name="monday" id="monday" placeholder="Hawaii Pizza" required>
<label for="tuesday">Tirsdag:</label>
<input type="text" name="tuesday" id="tuesday" placeholder="Pasta Bolognese" required>
<label for="wednesday">Onsdag:</label>
<input type="text" name="wednesday" id="wednesday" placeholder="Pandekager" required>
<label for="thursday">Torsdag:</label>
<input type="text" name="thursday" id="thursday" placeholder="Bøf med løg" required>
<textarea name="menuPlan" id="editor"></textarea>
<input type="submit" class="btn btn-dark text-white" value="Opret Menuplan">
</form>
<script>
ClassicEditor
.create( document.querySelector( '#editor' ) )
.then( editor => {
console.log( editor );
} )
.catch( error => {
console.error( error );
} );
</script>
@endsection