2021-04-16 01:00:00 +02:00
|
|
|
@extends('layouts.sidebar')
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
|
2023-04-26 15:44:39 +02:00
|
|
|
<div class="conatiner-fluid content-inner mt-n5 py-0">
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="card rounded">
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-12">
|
|
|
|
|
|
|
|
@push('sidebar-stylesheets')
|
|
|
|
<script src="{{ asset('assets/js/jquery.min.js') }}"></script>
|
|
|
|
@endpush
|
|
|
|
|
|
|
|
<section class='text-gray-400'>
|
|
|
|
|
2023-06-06 09:39:24 +02:00
|
|
|
<h3 class="card-header"><i class="bi bi-journal-plus"> @if($LinkID !== 0) {{__('messages.Submit')}} @else {{__('messages.Add')}} @endif {{__('messages.Block')}}</i></h3>
|
2023-04-26 15:44:39 +02:00
|
|
|
|
|
|
|
<div class='card-body'>
|
|
|
|
<form action="{{ route('addLink') }}" method="post" id="my-form">
|
|
|
|
@method('POST')
|
|
|
|
@csrf
|
|
|
|
<input type='hidden' name='linkid' value="{{ $LinkID }}" />
|
|
|
|
|
|
|
|
<div class="form-group col-lg-8 flex justify-around">
|
2023-06-06 09:39:24 +02:00
|
|
|
{{-- <label class='font-weight-bold'>{{__('messages.Blocks')}}</label> --}}
|
2023-04-26 15:44:39 +02:00
|
|
|
<div class="btn-group shadow m-2">
|
2023-06-16 20:20:26 +02:00
|
|
|
<button type="button" id='btnLinkType' class="btn btn-primary rounded-pill" title='{{__('messages.Click to change link blocks')}}' data-toggle="modal" data-target="#SelectLinkType">{{__('messages.Select Block')}}
|
2023-04-26 15:44:39 +02:00
|
|
|
<span class="btn-inner">
|
|
|
|
<i class="bi bi-window-plus"></i>
|
|
|
|
</span>
|
2023-06-16 20:20:26 +02:00
|
|
|
</button>{{infoIcon(__('messages.Click for a list of available link blocks'))}}
|
2023-04-26 15:44:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{{-- <button type="button" class="dropdown-toggle border-0 border-left-1 px-2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
2023-06-06 09:39:24 +02:00
|
|
|
<span class="sr-only">{{__('messages.Toggle Dropdown')}}</span>
|
2023-04-26 15:44:39 +02:00
|
|
|
</button> --}}
|
|
|
|
{{-- <div class="dropdown-menu">
|
|
|
|
@foreach ( $LinkTypes as $lt )
|
2023-06-16 20:06:37 +02:00
|
|
|
<a data-typeid='{{$lt['id']}}' data-typename='{{__('messages.title.'.$ltt)}}' class="dropdown-item doSelectLinkType" href="#">
|
|
|
|
<i class="{{$lt['icon']}}"></i> {{__('messages.title.'.$ltt)}}
|
2023-04-26 15:44:39 +02:00
|
|
|
</a>
|
|
|
|
|
|
|
|
@endforeach
|
|
|
|
</div> --}}
|
|
|
|
<input type='hidden' name='linktype_id' value='{{$linkTypeID}}'>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{-- @include("components.pageitems.".$SelectedLinkType['typename']."-form", ['some' => 'data']) --}}
|
|
|
|
|
|
|
|
|
|
|
|
<div id='link_params' class='col-lg-8'></div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="d-flex align-items-center pt-4">
|
2023-06-06 09:39:24 +02:00
|
|
|
<a class="btn btn-danger me-3" href="{{ url('studio/links') }}">{{__('messages.Cancel')}}</a>
|
|
|
|
<button type="submit" class="btn btn-primary me-3">{{__('messages.Save')}}</button>
|
|
|
|
<button type="button" class="btn btn-soft-primary me-3" onclick="submitFormWithParam('add_more')">{{__('messages.Save and Add More')}}</button>
|
2023-04-26 15:44:39 +02:00
|
|
|
<script>
|
|
|
|
function submitFormWithParam(paramValue) {
|
|
|
|
// get the form element
|
|
|
|
var form = document.getElementById("my-form");
|
|
|
|
|
|
|
|
// check if all required fields are filled out
|
|
|
|
var requiredFields = form.querySelectorAll("[required]");
|
|
|
|
for (var i = 0; i < requiredFields.length; i++) {
|
|
|
|
if (!requiredFields[i].value) {
|
|
|
|
alert("Please fill out all required fields.");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// create a hidden input field with the parameter value
|
|
|
|
var paramField = document.createElement("input");
|
|
|
|
paramField.setAttribute("type", "hidden");
|
|
|
|
paramField.setAttribute("name", "param");
|
|
|
|
paramField.setAttribute("value", paramValue);
|
|
|
|
// append the hidden input field to the form
|
|
|
|
form.appendChild(paramField);
|
|
|
|
// submit the form
|
|
|
|
form.submit();
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|
2022-11-08 16:11:59 +01:00
|
|
|
</div>
|
2023-04-26 15:44:39 +02:00
|
|
|
</section>
|
|
|
|
<br><br>
|
|
|
|
{{-- <details>
|
2023-06-06 09:39:24 +02:00
|
|
|
<summary>{{__('messages.More information')}}</summary>
|
2023-04-26 15:44:39 +02:00
|
|
|
<pre style="color: grey;">
|
2023-06-06 09:39:24 +02:00
|
|
|
{{__('messages.editlink.description.1-5')}}
|
|
|
|
{{__('messages.editlink.description.2-5')}}
|
|
|
|
{{__('messages.editlink.description.3-5')}}
|
|
|
|
{{__('messages.editlink.description.4-5')}}
|
|
|
|
{{__('messages.editlink.description.5-5')}}
|
2023-04-26 15:44:39 +02:00
|
|
|
</pre>
|
|
|
|
</details> --}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Modal -->
|
|
|
|
<style>.modal-title{color:#000!important;}</style>
|
2023-06-16 20:20:26 +02:00
|
|
|
<x-modal title="{{__('messages.Select Block')}}" id="SelectLinkType">
|
2023-04-26 15:44:39 +02:00
|
|
|
|
|
|
|
<div class="d-flex flex-row flex-wrap p-3">
|
|
|
|
|
|
|
|
@php
|
|
|
|
$custom_order = [1, 2, 8, 6, 7, 3, 4, 5,];
|
|
|
|
$sorted = $LinkTypes->sortBy(function ($item) use ($custom_order) {
|
|
|
|
return array_search($item['id'], $custom_order);
|
|
|
|
});
|
|
|
|
@endphp
|
|
|
|
|
|
|
|
@foreach ($sorted as $lt)
|
2023-06-16 20:06:37 +02:00
|
|
|
@php
|
|
|
|
$title = __('messages.block.title.'.$lt['typename']);
|
|
|
|
$description = __('messages.block.description.'.$lt['typename']);
|
|
|
|
@endphp
|
|
|
|
<a href="#" data-dismiss="modal" data-typeid="{{$lt['id']}}" data-typename="{{$title}}" class="hvr-grow m-2 w-100 d-block doSelectLinkType">
|
2023-04-26 15:44:39 +02:00
|
|
|
<div class="rounded mb-3 shadow-lg">
|
|
|
|
<div class="row g-0">
|
|
|
|
<div class="col-auto bg-light d-flex align-items-center justify-content-center p-3">
|
|
|
|
<i class="{{$lt['icon']}} text-primary h1 mb-0"></i>
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
<div class="card-body">
|
2023-06-16 20:06:37 +02:00
|
|
|
<h5 class="card-title text-dark mb-0">{{$title}}</h5>
|
|
|
|
<p class="card-text text-muted">{{$description}}</p>
|
2023-04-26 15:44:39 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-06-16 20:06:37 +02:00
|
|
|
</div>
|
|
|
|
</a>
|
2023-04-26 15:44:39 +02:00
|
|
|
@endforeach
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<x-slot name="buttons">
|
2023-06-06 09:39:24 +02:00
|
|
|
<button type="button" class="btn btn-gray" data-dismiss="modal">{{__('messages.Close')}}</button>
|
2023-04-26 15:44:39 +02:00
|
|
|
</x-slot>
|
|
|
|
|
|
|
|
</x-modal>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-11-08 16:11:59 +01:00
|
|
|
</div>
|
2023-04-26 15:44:39 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
2022-11-08 16:11:59 +01:00
|
|
|
</div>
|
|
|
|
|
2021-04-16 01:00:00 +02:00
|
|
|
@endsection
|
2022-11-08 16:11:59 +01:00
|
|
|
|
|
|
|
@push("sidebar-scripts")
|
|
|
|
<script>
|
|
|
|
$(function() {
|
|
|
|
LoadLinkTypeParams($("input[name='linktype_id']").val() , $("input[name=linkid]").val());
|
|
|
|
|
|
|
|
$('.doSelectLinkType').on('click', function() {
|
|
|
|
$("input[name='linktype_id']").val($(this).data('typeid'));
|
|
|
|
$("#btnLinkType").html($(this).data('typename'));
|
|
|
|
|
|
|
|
LoadLinkTypeParams($(this).data('typeid'), $("input[name=linkid]").val());
|
|
|
|
|
|
|
|
$('#SelectLinkType').modal('hide');
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function LoadLinkTypeParams($TypeId, $LinkId) {
|
|
|
|
var baseURL = <?php echo "\"" . url('') . "\""; ?>;
|
2023-04-26 15:44:39 +02:00
|
|
|
$("#link_params").html('<div class="spinner-border text-primary" role="status"><span class="visually-hidden">Loading...</span></div>').load(baseURL + `/studio/linkparamform_part/${$TypeId}/${$LinkId}`);
|
2022-11-08 16:11:59 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endpush
|