Travel Guide Frontend Backend

This commit is contained in:
Kevin Adametz 2020-08-07 16:00:55 +02:00
parent e6cc042aee
commit 0857a34766
681 changed files with 6680 additions and 1689 deletions

View file

@ -0,0 +1,115 @@
@extends('layouts.layout-2')
@section('content')
{!! Form::open(['url' => route('cms_answer_question_detail', [$id]), 'class' => 'form-horizontal']) !!}
<h4 class="font-weight-bold py-3 mb-1">
Frage &amp; Anwort @if($id === "new") <span class="text-primary">anlegen</span> @else {{"(ID: ".$id.")"}} verwalten @endif
<div class="float-right">
<button type="submit" name="action" value="saveAll" class="btn btn-submit btn-sm">{{ __('save changes') }}</button>&nbsp;
<a href="{{route('cms_answer_question')}}" class="btn btn-default btn-sm">{{ __('back') }}</a>
</div>
</h4>
<div class="clearfix"></div>
<input type="hidden" name="id" id="id" value="{{$id}}">
<!-- draft -->
<div class="card mb-2">
<div class="card-body">
<div class="form-row">
<div class="form-group col-sm-12">
<label for="i_q_content_category_id" class="form-label">Kategorie*</label>
{{ Form::select('i_q_content_category_id', $identifier_options , $model->i_q_content_category_id, array('class'=>'custom-select', 'required'=>true)) }}
</div>
<div class="form-group col-sm-12">
<label class="custom-control custom-checkbox float-right">
{!! Form::checkbox('active', 1, $model->active, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('aktiv')}}</span>
</label>
<label class="form-label" for="question">{{ __('Frage Titel') }} (Text)*</label>
{{ Form::text('question', $model->question, array('placeholder'=>__('max 255 Zeichen'), 'class'=>'form-control', 'id'=>'question', 'required'=>true)) }}
</div>
</div>
{{-- <div class="form-row">
<div class="form-group col-sm-12">
<label class="form-label" for="question_text">{{ __('Frage Text') }} (Nur Text)</label>
{{ Form::textarea('question_text', $model->question_text , ['class' => 'form-control', 'id'=>'question_text']) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-12">
<label class="form-label" for="answer">{{ __('Antwort Titel') }}*</label>
{{ Form::text('answer', $model->answer, array('placeholder'=>__('Antwort'), 'class'=>'form-control', 'id'=>'answer')) }}
</div>
</div>
--}}
<div class="form-row">
<div class="form-group col-sm-12">
<label class="form-label" for="answer_text">{{ __('Antwort') }} (HTML)*</label>
{{ Form::textarea('answer_text', $model->answer_text , ['class' => 'form-control summernote', 'id'=>'answer_text']) }}
</div>
</div>
</div>
</div>
<div class="text-left mt-3">
<button type="submit" name="action" value="saveAll" class="btn btn-submit">{{ __('save changes') }}</button>&nbsp;
<a href="{{route('cms_answer_question')}}" class="btn btn-default">{{ __('back') }}</a>
</div>
{!! Form::close() !!}
@endsection
@section('scripts')
<script>
$(document).ready(function() {
$('.summernote').summernote({
height: 300,
tabsize: 2,
followingToolbar: true,
imageTitle: {
specificAltField: true,
},
lang: 'de-DE',
toolbar: [
['style', ['style']],
['font', ['bold', 'italic', 'clear']],
['para', ['ul', 'ol']],
['insert', ['link', 'hr']],
['view', ['fullscreen', 'codeview']],
['help', ['help']]
],
styleTags: ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
cleaner:{
action: 'both', // both|button|paste 'button' only cleans via toolbar button, 'paste' only clean when pasting content, both does both options.
newline: '<br>', // Summernote's default is to use '<p><br></p>'
notStyle: 'position:absolute;top:0;left:0;right:0', // Position of Notification
icon: '<i class="note-icon">[Your Button]</i>',
keepHtml: false, // Remove all Html formats
keepOnlyTags: ['<p>', '<br>', '<ul>', '<li>', '<b>', '<strong>','<i>', '<a>'], // If keepHtml is true, remove all tags except these
keepClasses: false, // Remove Classes
badTags: ['style', 'script', 'applet', 'embed', 'noframes', 'noscript', 'html'], // Remove full tags with contents
badAttributes: ['style', 'start'], // Remove attributes from remaining tags
limitChars: false, // 0/false|# 0/false disables option
limitDisplay: 'both', // text|html|both
limitStop: false // true/false
}
});
});
</script>
@endsection

View file

@ -0,0 +1,84 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-3 mb-1">
{{ __('Fragen & Antworten') }}
</h4>
<div class="card">
<div class="ui-bordered px-4 pt-3 mb-0">
<div class="form-row align-items-center">
<div class="form-group col-12 col-sm-6">
<select class="custom-select" name="filter_identifier_options" id="filter_identifier_options" style="">
<option value="">Alle Kategorien</option>
@foreach($identifier_options as $id=>$name)
<option value="{{$id}}" >{{$name}}</option>
@endforeach
</select>
</div>
<div class="col-12 col-sm-6">
<div class=" mb-2 text-right">
<a href="{{ route('cms_answer_question_detail', ['new']) }}" class="btn btn-sm btn-primary">Neuen Eintrag anlegen</a>
</div>
</div>
</div>
</div>
<div class="card-datatable table-responsive py-2">
<table class="datatables-faq table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('Frage')}}</th>
<th>{{__('Kategorie')}}</th>
<th>{{__('Date')}}</th>
<th>{{__('sichtbar')}}</th>
<th>#</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div class="mt-4 col">
<a href="{{ route('cms_answer_question_detail', ['new']) }}" class="btn btn-sm btn-primary">Neuen Eintrag anlegen</a>
</div>
</div>
<script>
$( document ).ready(function() {
var oTable = $('.datatables-faq').DataTable({
"processing": true,
"serverSide": true,
ajax: {
url: '{!! route( 'cms_answer_question_datatable' ) !!}',
data: function(d) {
d.filter_identifier_options = $('select[name=filter_identifier_options]').val();
}
},
"order": [[ 0, "desc" ]],
"columns": [
{ data: 'action_edit', orderable: false, searchable: false},
{ data: 'question', name: 'question' },
{ data: 'category', name: 'category'},
{ data: 'created_at', name: 'created_at' },
{ data: 'active', name: 'active' },
{ data: 'delete', name: 'delete' },
],
"bLengthChange": false,
"iDisplayLength": 100,
"language": {
"url": "/js/German.json"
}
});
$('#filter_identifier_options').on('change', function(){
oTable.draw();
});
});
</script>
</div>
@endsection

View file

@ -34,6 +34,7 @@
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('Name')}}</th>
<th>{{__('Beschreibung')}}</th>
<th></th>
</tr>
</thead>
@ -48,6 +49,8 @@
</button>
</td>
<td>{{ $value->name }}</td>
<td>{{ substr($value->description, 0, 50) }} ...</td>
<td><a class="text-danger" href="{{ route('cms_content_author_delete', [$value->id]) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="fa fa-trash-alt"></i></a></td>
</tr>

View file

@ -13,10 +13,14 @@
</div>
<div class="modal-body">
<div class="form-row">
<div class="form-group col">
<div class="form-group col-12">
<label for="name" class="form-label">{{ __('Name') }}</label>
{{ Form::text('name', $value->name, array('placeholder'=>__('Name'), 'class'=>'form-control', 'required')) }}
</div>
<div class="form-group col-12">
<label for="description" class="form-label">{{ __('Beschreibung') }}</label>
{{ Form::textarea('description', $value->description, array('class'=>'form-control')) }}
</div>
</div>

View file

@ -5,6 +5,14 @@
.alert ul {
margin-bottom: 0;
}
.note-video-clip {
max-width: 100%;
width: 600px;
left: 0;
right:0;
margin:auto;
}
</style>
@if ($errors->any())
<div class="row">
@ -36,6 +44,8 @@
<!-- draft -->
<div class="card mb-2">
<div class="card-body">
<h4 class="mb-0 bg-light p-1">Inhalte</h4>
<hr class="mt-0">
<div class="form-row">
<div class="form-group col-12">
@ -67,7 +77,7 @@
&nbsp; &nbsp;<a class="btn btn-default btn-xs" href="?clean=true">Clean Text off</a>
@endif
<br clear="all">
{{ Form::textarea('full_text', $travel_guide->full_text , ['class' => 'form-control summernote']) }}
{{ Form::textarea('full_text', $travel_guide->full_text , ['class' => 'form-control summernote', 'style'=>'height:600px']) }}
</div>
</div>
<div class="form-row">
@ -84,7 +94,8 @@
</select>
</div>
</div>
<hr>
<h4 class="mb-0 bg-light p-1">Tree / Navigation</h4>
<hr class="mt-0">
<button type="button" class="btn btn-primary btn-sm float-right mb-2" data-toggle="modal" data-target="#modals-load-content"
data-id="add"
@ -100,6 +111,7 @@
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('Name')}}</th>
<th>{{__('url')}}</th>
<th>{{__('Zuordnung')}}</th>
<th>{{__('sichtbar')}}</th>
<th>#</th>
</tr>
@ -109,7 +121,7 @@
<tr>
<td style="width: 5%;">
<a href="{{ route('iq_content_tree_detail', [$iq_content_site->iq_content_tree_node->tree_id, $iq_content_site->iq_content_tree_node->id]) }}" class="btn icon-btn btn-sm btn-primary">
<span class="fa fa-edit"></span>
<span class="fa fa-share"></span>
</a>
</td>
<td>{{$iq_content_site->iq_content_tree_node->name}}</td>
@ -118,14 +130,11 @@
</a> {{$iq_content_site->iq_content_tree_node->getUri()}}
</td>
<td>
@if($iq_content_site->iq_content_tree_node->active)
<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>
@else
<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>
@endif
{{$iq_content_site->getTravelType()}}
</td>
<td>{!! get_active_badge($iq_content_site->iq_content_tree_node->active) !!}</td>
<td>
<a class="text-danger" href="{{ route('iq_content_tree_detail_remove_site', [$iq_content_site->iq_content_tree_node->tree_id, $iq_content_site->tree_node_id, $iq_content_site->travel_guide->id, 'g']) }}" onclick="return confirm('{{__('Seite aus Tree entfernen?')}}');"><i class="fa fa-reply"></i></a>
<a class="text-danger" href="{{ route('iq_content_tree_detail_remove', ['guide', $iq_content_site->iq_content_tree_node->tree_id, $iq_content_site->tree_node_id, $iq_content_site->travel_guide->id, 'guide']) }}" onclick="return confirm('{{__('Seite aus Tree entfernen?')}}');"><i class="fa fa-reply"></i></a>
</td>
</tr>
@endforeach
@ -134,6 +143,8 @@
<hr>
@endif
<h4 class="mb-0 bg-light p-1">Meta</h4>
<hr class="mt-0">
<div class="form-row">
<div class="form-group col-md-12">

View file

@ -131,6 +131,19 @@
<input type="hidden" name="model" value="tree">
<input type="hidden" name="action" value="tree-node">
<input type="hidden" name="tree_id" value="{{$model->id}}">
<h4 class="mb-0 bg-light p-1">Name / Link</h4>
<hr class="mt-0">
<div class="form-row mb-2">
<div class="form-group col">
<label class="custom-control custom-checkbox float-right">
{!! Form::checkbox('active', 1, $tree_node->active, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('aktiv')}}</span>
</label>
<label for="name" class="form-label">Name (Navigation)*</label>
{{ Form::text('name', $tree_node->name, array('placeholder'=>'', 'class'=>'form-control', 'required'=>'true')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-10 col-sm-11">
<div class="input-group mb-4">
@ -150,16 +163,9 @@
</a>
</div>
</div>
<div class="form-row mb-2">
<div class="form-group col">
<label class="custom-control custom-checkbox float-right">
{!! Form::checkbox('active', 1, $tree_node->active, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('aktiv')}}</span>
</label>
<label for="name" class="form-label">Name (required)</label>
{{ Form::text('name', $tree_node->name, array('placeholder'=>'', 'class'=>'form-control', 'required'=>'true')) }}
</div>
</div>
<h4 class="mb-0 bg-light p-1">Seiten</h4>
<hr class="mt-0">
<div class="form-row mb-2">
<div class="form-group col">
<button type="button" class="btn btn-primary btn-sm float-right mb-2"
@ -171,14 +177,13 @@
data-route="{{ route('iq_content_modal_load') }}"><i
class="ion ion-ios-add-circle"></i> Seite hinzufügen
</button>
<label for="site_id" class="form-label">Seiten</label>
@if($tree_node->iq_content_sites->count())
<table class="table table-striped border-bottom">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('Name')}}</th>
<th>{{__('Zuordnung')}}</th>
<th>{{__('Keyword')}}</th>
<th>{{__('Langer Text')}}</th>
<th>{{__('sichtbar')}}</th>
@ -195,6 +200,16 @@
</a>
</td>
<td>{{$iq_content_site->travel_guide->name}}</td>
<td><button type="button" class="btn btn-xs btn-secondary"
data-toggle="modal" data-target="#modals-load-content"
data-id="{{$iq_content_site->id}}"
data-model="tree"
data-action="site-travel-identifier"
data-request="{!! array_to_json(['tree_id'=>$model->id,'tree_node_id'=>$tree_node->id]) !!}"
data-route="{{ route('iq_content_modal_load') }}">
<i class="fa fa-edit"></i> {{$iq_content_site->getTravelType()}}</button>
</td>
<td>{{$iq_content_site->travel_guide->keyword}}</td>
<td> @if($iq_content_site->travel_guide->scope)
<span class="badge badge-pill badge-success"><i
@ -215,9 +230,10 @@
</td>
<td>
<a class="text-danger"
href="{{ route('iq_content_tree_detail_remove_site', [$model->id, $tree_node->id, $iq_content_site->travel_guide->id, 't']) }}"
onclick="return confirm('{{__('Seite aus Tree entfernen?')}}');"><i
class="fa fa-reply"></i></a>
href="{{ route('iq_content_tree_detail_remove', ['guide', $model->id, $tree_node->id, $iq_content_site->travel_guide->id, 'tree']) }}"
title="entfernen" data-placement="left" rel="tooltip" onclick="return confirm('{{__('Seite aus Tree entfernen?')}}');">
<i class="fa fa-reply"></i>
</a>
</td>
</tr>
@endforeach
@ -232,6 +248,93 @@
</select>--}}
</div>
</div>
<h4 class="mb-0 bg-light p-1">Hauptbild</h4>
<hr class="mt-0">
<div class="media mx-auto pb-3" id="lfm-data-fill">
<img src="{{$tree_node->getImage('thumb_url')}}" alt="" class="img_thumb_url d-block ui-w-100">
<div class="media-body mt-2 ml-2">
<div class="form-row">
<div class="form-group col-10 col-sm-11" >
{{ Form::hidden('image[slug]', $tree_node->getImage('slug')) }}
{{ Form::hidden('image[thumb_url]', $tree_node->getImage('thumb_url')) }}
{{ Form::hidden('image[url]', $tree_node->getImage('url')) }}
{{ Form::text('image[title]', $tree_node->getImage('title'), array('placeholder'=>'Bildtitel', 'class'=>'form-control mb-2')) }}
{{ Form::text('image[alt]', $tree_node->getImage('alt'), array('placeholder'=>'Bild ALT Tag', 'class'=>'form-control')) }}
</div>
<div class="form-group col-2 col-sm-1">
<button type="button" class="btn btn-sm btn-secondary float-right btn-lfm-open-modal"
data-id="#lfm-data-fill"
data-obj="image"
data-set='["url", "slug", "thumb_url"]'
data-img='.img_thumb_url'
data-title="title"
data-alt="alt">
<i class="fa fa-image"></i>
</button>
</div>
</div>
</div>
</div>
<h4 class="mb-0 bg-light p-1">Fragen &amp; Antworten</h4>
<hr class="mt-0">
<div class="form-row mb-2">
<div class="form-group col">
<button type="button" class="btn btn-primary btn-sm float-right mb-2"
data-toggle="modal" data-target="#modals-load-content"
data-id="add"
data-model="tree"
data-action="add-answer-question"
data-request="{!! array_to_json(['tree_id'=>$model->id,'tree_node_id'=>$tree_node->id]) !!}"
data-route="{{ route('iq_content_modal_load') }}"><i
class="ion ion-ios-add-circle"></i> Eintrag hinzufügen
</button>
<table class="table table-striped border-bottom">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('Frage')}}</th>
<th>{{__('sichtbar')}}</th>
<th>#</th>
</tr>
</thead>
<tbody>
@foreach($tree_node->iq_content_faqs as $iq_content_faq)
<tr>
<td style="width: 5%;">
<a href="{{ route('cms_answer_question_detail', [$iq_content_faq->answer_question->id]) }}"
class="btn icon-btn btn-sm btn-primary">
<span class="fa fa-edit"></span>
</a>
</td>
<td>{{$iq_content_faq->answer_question->question}}</td>
<td>
@if($iq_content_faq->answer_question->active)
<span class="badge badge-pill badge-success"><i
class="fa fa-check"></i></span>
@else
<span class="badge badge-pill badge-danger"><i
class="fa fa-times"></i></span>
@endif
</td>
<td>
<a class="text-danger"
href="{{ route('iq_content_tree_detail_remove', ['faq', $model->id, $tree_node->id, $iq_content_faq->answer_question->id, 'tree']) }}"
title="entfernen" data-placement="left" rel="tooltip" onclick="return confirm('{{__('Eintrag entfernen?')}}');">
<i class="fa fa-reply"></i>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<h4 class="mb-0 bg-light p-1">Meta</h4>
<hr class="mt-0">
<div class="form-row mb-2">
<div class="form-group col">
<label for="identifier" class="form-label">Slug</label>
@ -303,7 +406,16 @@
</div>
@endif
</div>
</div>
@endsection
@section('scripts')
<script>
$(document).ready(function() {
$('.table [rel="tooltip"]').tooltip({trigger: "hover"});
IqLFileManager.init();
});
</script>
@endsection