Fixed - Guides
Added - contacts visual (controller coming soon)
This commit is contained in:
parent
b4634d4933
commit
a78e7d90f6
skolehjem
app
database/migrations
resources/views
admin
app
|
@ -15,6 +15,6 @@ class Contact extends Model
|
||||||
{
|
{
|
||||||
//protected variable which contains name of database field(s) to be filled.
|
//protected variable which contains name of database field(s) to be filled.
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'contactname', "title", 'email', 'phone'
|
'contactname', "title", 'email', 'phone', 'phonetimes'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,10 +64,10 @@ class GuideController extends Controller
|
||||||
$saved = $guide->save();
|
$saved = $guide->save();
|
||||||
|
|
||||||
if(!$saved){
|
if(!$saved){
|
||||||
return Response::detect("guides.store");
|
return redirect()->route("guides.store");
|
||||||
}else{
|
}else{
|
||||||
$guide = Guide::query()->paginate($request->input("limit", 20));
|
$guide = Guide::query()->paginate($request->input("limit", 20));
|
||||||
return Response::detect("guides.index", ['guides' => $guide]);
|
return redirect()->route("guides.index", ['guides' => $guide]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ class CreateContact extends Migration
|
||||||
$table->string('title', 255);
|
$table->string('title', 255);
|
||||||
$table->string('email', 255);
|
$table->string('email', 255);
|
||||||
$table->integer('phone');
|
$table->integer('phone');
|
||||||
//$table->unique('email');
|
$table->string('phonetimes');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,13 @@
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section("content")
|
@section("content")
|
||||||
|
<style>
|
||||||
|
.ck-editor__main {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script src="https://cdn.ckeditor.com/ckeditor5/21.0.0/classic/ckeditor.js"></script>
|
||||||
|
|
||||||
<h1>Opret Kontakt:</h1>
|
<h1>Opret Kontakt:</h1>
|
||||||
<form method="post" action="{{ route("contacts.store") }}">
|
<form method="post" action="{{ route("contacts.store") }}">
|
||||||
@csrf
|
@csrf
|
||||||
|
@ -21,6 +28,26 @@
|
||||||
<input type="email" name="email" id="email" placeholder="x@y.z" required>
|
<input type="email" name="email" id="email" placeholder="x@y.z" required>
|
||||||
<label for="tel">Telefon nr:</label>
|
<label for="tel">Telefon nr:</label>
|
||||||
<input type="tel" name="phone" id="tel" placeholder="12345678" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}" required>
|
<input type="tel" name="phone" id="tel" placeholder="12345678" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}" required>
|
||||||
|
<label for="teltimes">Telefon tider: (Forblives blank, hvis der ikke er nogen bestemte tider)</label>
|
||||||
|
<textarea name="phonetimes" id="editor"></textarea>
|
||||||
<input type="submit" class="btn btn-dark text-white" value="Opret">
|
<input type="submit" class="btn btn-dark text-white" value="Opret">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<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' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
} )
|
||||||
|
.catch( error => {
|
||||||
|
console.log( error );
|
||||||
|
} );
|
||||||
|
|
||||||
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
@ -10,6 +10,13 @@
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section("content")
|
@section("content")
|
||||||
|
<style>
|
||||||
|
.ck-editor__main {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script src="https://cdn.ckeditor.com/ckeditor5/21.0.0/classic/ckeditor.js"></script>
|
||||||
|
|
||||||
<h1>Rediger Kontakt:</h1>
|
<h1>Rediger Kontakt:</h1>
|
||||||
<form method="post" action="{{ route("contacts.update", ['contact' => $contact]) }}">
|
<form method="post" action="{{ route("contacts.update", ['contact' => $contact]) }}">
|
||||||
@csrf
|
@csrf
|
||||||
|
@ -22,6 +29,26 @@
|
||||||
<input type="email" name="email" id="email" placeholder="x@y.z" value="{{ $contact->email }}" required>
|
<input type="email" name="email" id="email" placeholder="x@y.z" value="{{ $contact->email }}" required>
|
||||||
<label for="tel">Telefon nr:</label>
|
<label for="tel">Telefon nr:</label>
|
||||||
<input type="tel" name="phone" id="tel" placeholder="12345678" value="{{ $contact->phone }}" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}" required>
|
<input type="tel" name="phone" id="tel" placeholder="12345678" value="{{ $contact->phone }}" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}" required>
|
||||||
|
<label for="teltimes">Telefon tider: (Forblives blank, hvis der ikke er nogen bestemte tider)</label>
|
||||||
|
<textarea name="phonetimes" id="editor">{{ $contact->phonetimes }}</textarea>
|
||||||
<input type="submit" class="btn btn-dark text-white" value="Opret">
|
<input type="submit" class="btn btn-dark text-white" value="Opret">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<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' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
} )
|
||||||
|
.catch( error => {
|
||||||
|
console.log( error );
|
||||||
|
} );
|
||||||
|
|
||||||
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<label for="title">Navn</label>
|
<label for="title">Navn</label>
|
||||||
<input value="{{$guide->name}}" type="text" name="name" id="title" required>
|
<input value="{{$guide->name}}" type="text" name="name" id="title" required>
|
||||||
<label for="editor">Vejledning</label>
|
<label for="editor">Vejledning</label>
|
||||||
<textarea name="guide_articles" id="editor">{{$guide->guideArticles}}</textarea>
|
<textarea name="guide_articles" id="editor">{{$guide->guide_articles}}</textarea>
|
||||||
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,22 @@
|
||||||
|
|
||||||
@section("content")
|
@section("content")
|
||||||
<main>
|
<main>
|
||||||
|
<h1 class="text-center sde-blue mt-0">Kontakt</h1>
|
||||||
|
@if(!$contacts->isEmpty())
|
||||||
|
@foreach($contacts as $contact)
|
||||||
|
<h4 class="mt-0">Navn: {{ $contact->contactname }}</h4>
|
||||||
|
<h4 class="mt-0">Email: {{ $contact->email }}</h4>
|
||||||
|
<h4 class="mt-0">{{ $contact->title }}</h4>
|
||||||
|
@if($contact->phonetimes)
|
||||||
|
<h4 class="mt-0 mb-0">Telefontid:</h4>
|
||||||
|
{!! $contact->phonetimes !!}
|
||||||
|
@endif
|
||||||
|
<span class="text-center sde-black-20 mt-1">+45 {{ chunk_split($contact->phone, 2, ' ') }}</span>
|
||||||
|
<a class="btn text-center btn-sde-blue mt-1" href="tel:+45{{ $contact->phone }}">Ring</a>
|
||||||
|
@endforeach
|
||||||
|
@else
|
||||||
|
<p class="text-center">Der er ingen kontakter!</p>
|
||||||
|
@endif
|
||||||
<h1 class="text-center sde-blue mt-0">Kontakt</h1>
|
<h1 class="text-center sde-blue mt-0">Kontakt</h1>
|
||||||
<h4 class="mt-0">Navn: Claus Trasbo</h4>
|
<h4 class="mt-0">Navn: Claus Trasbo</h4>
|
||||||
<h4 class="mt-0">Email: ctr@sde.dk</h4>
|
<h4 class="mt-0">Email: ctr@sde.dk</h4>
|
||||||
|
|
|
@ -12,12 +12,13 @@
|
||||||
</style>
|
</style>
|
||||||
<main>
|
<main>
|
||||||
<h1 class="text-center sde-blue mt-0">Vejledninger</h1>
|
<h1 class="text-center sde-blue mt-0">Vejledninger</h1>
|
||||||
|
@if(!$guides->isEmpty())
|
||||||
@foreach($guides as $guide)
|
@foreach($guides as $guide)
|
||||||
<h2 class="text-center sde-blue mt-0">{{ $guide->name }}</h2>
|
<h2 class="text-center sde-blue mt-0">{{ $guide->name }}</h2>
|
||||||
{!! $guide->guide_articles !!}
|
{!! $guide->guide_articles !!}
|
||||||
<hr class="w-100">
|
<hr class="w-100">
|
||||||
@endforeach
|
@endforeach
|
||||||
@if(count($guides) < 1)
|
@else
|
||||||
<p style="margin: 0 18px;">Der er ingen vejledninger.</p>
|
<p style="margin: 0 18px;">Der er ingen vejledninger.</p>
|
||||||
@endif
|
@endif
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
</a>
|
</a>
|
||||||
<a href="{{ route("guides.index") }}">
|
<a href="{{ route("guides.index") }}">
|
||||||
<img src="{{URL::asset('/images/icons/Vejledninger.svg')}}" alt="Guide">
|
<img src="{{URL::asset('/images/icons/Vejledninger.svg')}}" alt="Guide">
|
||||||
Vejledning
|
Vejledninger
|
||||||
</a>
|
</a>
|
||||||
<a href="{{ route("users.account") }}">
|
<a href="{{ route("users.account") }}">
|
||||||
<img src="{{URL::asset('/images/icons/user-hvid.svg')}}" alt="Konto">
|
<img src="{{URL::asset('/images/icons/user-hvid.svg')}}" alt="Konto">
|
||||||
|
|
Loading…
Reference in New Issue