2021-04-16 01:00:00 +02:00
|
|
|
@extends('layouts.sidebar')
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
|
2024-06-22 17:58:26 +02:00
|
|
|
@push('sidebar-stylesheets')
|
|
|
|
<script src="{{ asset('assets/external-dependencies/fontawesome.js') }}" crossorigin="anonymous"></script>
|
|
|
|
@endpush
|
|
|
|
|
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">
|
2024-06-21 16:48:00 +02:00
|
|
|
<div class="card rounded">
|
2023-04-26 15:44:39 +02:00
|
|
|
<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-10-09 14:29:26 +02:00
|
|
|
<h3 class="card-header"><i class="bi bi-journal-plus"> @if($LinkID !== 0) {{__('messages.Edit')}} @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">
|
|
|
|
<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
|
|
|
|
2024-06-20 12:24:54 +02:00
|
|
|
<input type='hidden' name='typename' value='{{$typename}}'>
|
2023-04-26 15:44:39 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<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");
|
|
|
|
|
|
|
|
// 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>
|
2024-06-21 16:48:00 +02:00
|
|
|
|
2023-04-26 15:44:39 +02:00
|
|
|
<!-- 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">
|
2024-06-20 12:24:54 +02:00
|
|
|
@foreach ($LinkTypes as $lt)
|
2023-06-16 20:06:37 +02:00
|
|
|
@php
|
2024-06-21 16:48:00 +02:00
|
|
|
if(block_text_translation_check($lt['title'])) {$title = bt($lt['title']);} else {$title = __('messages.block.title.'.$lt['typename']);}
|
|
|
|
$description = bt($lt['description']) ?? __('messages.block.description.'.$lt['typename']);
|
2023-06-16 20:06:37 +02:00
|
|
|
@endphp
|
2024-06-20 12:24:54 +02:00
|
|
|
<a href="#" data-dismiss="modal" data-typeid="{{$lt['typename']}}" 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() {
|
2024-06-20 12:24:54 +02:00
|
|
|
LoadLinkTypeParams($("input[name='typename']").val() , $("input[name=linkid]").val());
|
2022-11-08 16:11:59 +01:00
|
|
|
|
|
|
|
$('.doSelectLinkType').on('click', function() {
|
2024-06-20 12:24:54 +02:00
|
|
|
$("input[name='typename']").val($(this).data('typeid'));
|
2022-11-08 16:11:59 +01:00
|
|
|
$("#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
|