chore: remove APAW from tracking; gitignore agent-generated files
This commit is contained in:
125
resources/views/form/collaborate.blade.php
Normal file
125
resources/views/form/collaborate.blade.php
Normal file
@@ -0,0 +1,125 @@
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<form id="collaborate_form" action="{{action([\App\Http\Controllers\FormController::class, 'postCollab'])}}" method="POST">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">
|
||||
@lang('messages.collaborate') ({{$form->name}})
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@if($form->assignedTo->count() > 0)
|
||||
<h5>@lang('messages.assigned_users'):</h5>
|
||||
@foreach($form->assignedTo as $key => $assigned_to)
|
||||
<div class="card edit-assigned-form mb-2 p-3">
|
||||
<label>
|
||||
<i class="fas fa-user-tie"></i>
|
||||
{{$assigned_to->user->name}}
|
||||
<small>
|
||||
<code>({{$assigned_to->user->email}})</code>
|
||||
</small>
|
||||
</label>
|
||||
<div class="row">
|
||||
<input type="hidden" name="edit_assigned_id[]" value="{{$assigned_to->id}}">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="edit_permissions[{{$assigned_to->id}}][]" id="form_design_{{$key}}" value="can_design_form"
|
||||
@if(in_array('can_design_form', $assigned_to->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="form_design_{{$key}}">
|
||||
@lang('messages.can_design_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_design_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="edit_permissions[{{$assigned_to->id}}][]" id="form_data_{{$key}}" value="can_view_data"
|
||||
@if(in_array('can_view_data', $assigned_to->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="form_data_{{$key}}">
|
||||
@lang('messages.can_view_data')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_data_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="edit_permissions[{{$assigned_to->id}}][]" id="can_view_form_{{$key}}" value="can_view_form"
|
||||
@if(in_array('can_view_form', $assigned_to->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="can_view_form_{{$key}}">
|
||||
@lang('messages.can_view_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<input type="hidden" name="form_id" value="{{$form->id}}">
|
||||
<div class="card assign-form mt-4 p-3">
|
||||
<h5 class="text-secondary">
|
||||
@lang('messages.invite_to_collaborate'):
|
||||
</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="email">
|
||||
@lang('messages.email'):
|
||||
</label>
|
||||
|
||||
<input type="email" class="form-control"
|
||||
name="email" id="email">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h5>@lang('messages.permissions'):</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_design" value="can_design_form">
|
||||
<label class="form-check-label" for="form_design">
|
||||
@lang('messages.can_design_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_design_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_data" value="can_view_data">
|
||||
<label class="form-check-label" for="form_data">
|
||||
@lang('messages.can_view_data')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_data_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_view" value="can_view_form">
|
||||
<label class="form-check-label" for="form_view">
|
||||
@lang('messages.can_view_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-sm btn-primary submit_btn">
|
||||
@lang('messages.save')
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
93
resources/views/form/copy_form.blade.php
Normal file
93
resources/views/form/copy_form.blade.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">
|
||||
@lang('messages.copy_form') ({{$form->name}})
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@if(!isset($subscription_info['success']))
|
||||
<form id="copy_form" action="{{action([\App\Http\Controllers\FormController::class, 'store'])}}" method="POST">
|
||||
{{ csrf_field() }}
|
||||
<div class="form-row pb-4">
|
||||
<div class="col-md-4">
|
||||
<label for="name">
|
||||
@lang('messages.form_name')
|
||||
<span class="error">*</span>
|
||||
</label>
|
||||
<input type="text" class="form-control"
|
||||
name="name" id="name" required>
|
||||
<input type="hidden" name="id" value="{{$form->id}}">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="form_slug">
|
||||
@lang('messages.form_slug')
|
||||
<span class="error">*</span>
|
||||
</label>
|
||||
|
||||
<input type="text" class="form-control"
|
||||
name="slug" id="form_slug" required readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="description">
|
||||
@lang('messages.form_description')
|
||||
</label>
|
||||
<input type="text" name="description" id="description" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<button type="submit" class="btn btn-primary btn-sm float-right">
|
||||
@lang('messages.copy_form')
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary btn-sm float-right mr-2" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
{!!$subscription_info['msg']!!}
|
||||
</div>
|
||||
@if($subscription_info['subscribe_btn'])
|
||||
<div class="col-md-2">
|
||||
<a href="{{action([\App\Http\Controllers\SubscriptionsController::class, 'index'])}}" class="btn btn-primary text-deco-none float-right btn-sm">
|
||||
@lang('messages.subscribe')
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-secondary btn-sm float-right mr-2" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('form#copy_form').validate({
|
||||
submitHandler: function(form) {
|
||||
$('#modal_div').modal('hide')
|
||||
form.submit();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('change', 'input#name',function() {
|
||||
var name = $('form#copy_form input#name').val();
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/generate-form-slug',
|
||||
dataType: 'json',
|
||||
data: {'name' : name},
|
||||
success: function(response) {
|
||||
$('form#copy_form input#form_slug').val(response);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
112
resources/views/form/create.blade.php
Normal file
112
resources/views/form/create.blade.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">
|
||||
@lang('messages.create_form')
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@if(!isset($subscription_info['success']))
|
||||
<form id="create_form" action="{{action([\App\Http\Controllers\FormController::class, 'store'])}}" method="POST">
|
||||
{{ csrf_field() }}
|
||||
<div class="form-row pb-4">
|
||||
<div class="col-md-4">
|
||||
<label for="name">
|
||||
@lang('messages.form_name')
|
||||
<span class="error">*</span>
|
||||
</label>
|
||||
|
||||
<input type="text" class="form-control"
|
||||
name="name" id="name" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="form_slug">
|
||||
@lang('messages.form_slug')
|
||||
<span class="error">*</span>
|
||||
</label>
|
||||
|
||||
<input type="text" class="form-control"
|
||||
name="slug" id="form_slug" required readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="description">
|
||||
@lang('messages.form_description')
|
||||
</label>
|
||||
<input type="text" name="description" id="description" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
@if(!empty($templates))
|
||||
<div class="form-row pb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="template">
|
||||
@lang('messages.template')
|
||||
</label>
|
||||
<select class="form-control" id="template" name="template_id">
|
||||
<option value="">
|
||||
@lang('messages.choose_template')
|
||||
</option>
|
||||
@foreach($templates as $id => $name)
|
||||
<option value="{{$id}}">{{$name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<hr>
|
||||
<button type="submit" class="btn btn-primary btn-sm float-right">
|
||||
@lang('messages.create_form')
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary btn-sm float-right mr-2" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
{!!$subscription_info['msg']!!}
|
||||
</div>
|
||||
@if($subscription_info['subscribe_btn'])
|
||||
<div class="col-md-2">
|
||||
<a href="{{action([\App\Http\Controllers\SubscriptionsController::class, 'index'])}}" class="btn btn-primary text-deco-none float-right btn-sm">
|
||||
@lang('messages.subscribe')
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-secondary btn-sm float-right mr-2" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('form#create_form').validate({
|
||||
submitHandler: function(form) {
|
||||
$('#modal_div').modal('hide')
|
||||
form.submit();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('change', 'input#name',function() {
|
||||
var name = $('form#create_form input#name').val();
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/generate-form-slug',
|
||||
dataType: 'json',
|
||||
data: {'name' : name},
|
||||
success: function(response) {
|
||||
$('form#create_form input#form_slug').val(response);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
168
resources/views/form/download.blade.php
Normal file
168
resources/views/form/download.blade.php
Normal file
@@ -0,0 +1,168 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>{{ $form->name }}</title>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="dns-prefetch" href="//fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
|
||||
@php
|
||||
$bg_color = $form->schema['settings']['color']['background'];
|
||||
$additional_js = $form->schema['additional_js_css']['js'];
|
||||
$additional_css = $form->schema['additional_js_css']['css'];
|
||||
$bg_type = $form->schema['settings']['background']['bg_type'];
|
||||
$bg_image = $form->schema['settings']['color']['image_path'];
|
||||
$form_attributes = isset($form->schema['form_attributes']) ? $form->schema['form_attributes'] : [];
|
||||
@endphp
|
||||
<!-- Styles -->
|
||||
@include('layouts.partials.css', ['is_download' => true, 'error_msg_color' => $form->schema['settings']['color']['error_msg'], 'additional_css' => $additional_css])
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<main class="py-4">
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-body" style="@if(!empty($bg_image) && $bg_type == 'bg_image')background-image: url(./asset/{{$bg_image}}); background-repeat: no-repeat;background-size: cover;background-position: right top;@else background-color: {{$bg_color}}; @endif">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<form id="{{$form->id}}"
|
||||
action="{{'./' . $form_slug . '.php'}}" @includeIf('form.partials.custom_attribute_generator', ['attributes' => $form_attributes])>
|
||||
@include('form.partials.fields_generator')
|
||||
|
||||
@if($form->schema['settings']['recaptcha']['is_enable'])
|
||||
<div class="g-recaptcha"
|
||||
data-sitekey="{{$form->schema['settings']['recaptcha']['site_key']}}"></div>
|
||||
<br/>
|
||||
@endif
|
||||
|
||||
@php
|
||||
$submit_btn_setting = $form->schema['settings']['submit'];
|
||||
@endphp
|
||||
<button type="submit" class="btn mt-5 {{$submit_btn_setting['btn_alignment']}} {{$submit_btn_setting['btn_size']}} {{$submit_btn_setting['btn_color']}}"
|
||||
data-btn_loading="{{$submit_btn_setting['loading_text']}}"
|
||||
data-btn_text="{{$submit_btn_setting['text']}}">
|
||||
@if((!empty($submit_btn_setting['btn_icon']) && $submit_btn_setting['btn_icon'] != 'none') && $submit_btn_setting['icon_position'] == 'left')
|
||||
<i class="fas {{$submit_btn_setting['btn_icon']}}">
|
||||
</i>
|
||||
@endif
|
||||
{{$submit_btn_setting['text']}}
|
||||
@if((!empty($submit_btn_setting['btn_icon']) && $submit_btn_setting['btn_icon'] != 'none') && $submit_btn_setting['icon_position'] == 'right')
|
||||
<i class="fas {{$submit_btn_setting['btn_icon']}}">
|
||||
</i>
|
||||
@endif
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@include('layouts.partials.javascript', ['is_download' => true])
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
@if(!empty($form->schema['form']))
|
||||
@foreach($form->schema['form'] as $element)
|
||||
@if($element['type'] == 'calendar')
|
||||
@php
|
||||
$enable_time_picker = ($element['enable_time_picker'] == 1) ? 'true' : 'false';
|
||||
|
||||
$time_picker_inline = ($element['time_picker_inline'] == 1) ? 'true' : 'false';
|
||||
@endphp
|
||||
|
||||
initialize_datetimepicker('{{$element['name']}}', '{{$element['start_date']}}', '{{$element['end_date']}}', '{{$element['format']}}', '{{$element['time_format']}}', {!!json_encode($element['disabled_days'])!!}, {{$enable_time_picker}}, {{$time_picker_inline}});
|
||||
@elseif($element['type'] == 'range')
|
||||
initialize_rangeslider('{{$element['name']}}');
|
||||
@elseif($element['type'] == 'file_upload')
|
||||
initialize_dropzone('{{$element['name']}}', '{{$element['upload_text']}}', '{{$element['no_of_files']}}', '{{$element['file_size_limit']}}', '{{$element['allowed_file_type']}}', 'library/upload.php');
|
||||
@elseif($element['type'] == 'text_editor')
|
||||
initialize_text_editor('{{$element['name']}}', '{{$element['placeholder']}}', '{{$element['editor_height']}}');
|
||||
@elseif($element['type'] == 'rating')
|
||||
initialize_star_rating('{{$element['name']}}');
|
||||
@elseif($element['type'] == 'signature')
|
||||
initialize_signature_pad('{{$element['name']}}');
|
||||
@elseif($element['type'] == 'countdown')
|
||||
initialize_countdowntimer({!!json_encode($element)!!});
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@php
|
||||
$toastr_position = isset($form->schema['settings']['notification']['position']) ? $form->schema['settings']['notification']['position'] : '';
|
||||
@endphp
|
||||
initializeToastrSettingsForForm("{{$toastr_position}}");
|
||||
@endif
|
||||
|
||||
$('form#{{$form->id}}').validate({
|
||||
ignore: ".note-editor *",
|
||||
submitHandler: function(form, e) {
|
||||
e.preventDefault();
|
||||
|
||||
var form_data = $('form#{{$form->id}}').serialize();
|
||||
|
||||
var form_submit_btn = $(form).find('button[type="submit"]');
|
||||
form_submit_btn.attr('disabled', 'disabled');
|
||||
form_submit_btn.text(form_submit_btn.data('btn_loading'));
|
||||
var dropzoneCount = $('.dropzone').length;
|
||||
var textEditor = $('.summer_note').length;
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: $(form).attr('action'),
|
||||
dataType: 'json',
|
||||
data: form_data,
|
||||
success: function(result) {
|
||||
form_submit_btn.text(form_submit_btn.data('btn_text'));
|
||||
form_submit_btn.removeAttr('disabled', 'disabled');
|
||||
|
||||
$(form)[0].reset();
|
||||
|
||||
window.onbeforeunload = null;
|
||||
|
||||
if(result.success == 1){
|
||||
if(result.redirect == 1){
|
||||
window.location = result.url;
|
||||
} else {
|
||||
toastr.success(result.msg);
|
||||
if (textEditor > 0) {
|
||||
$('.summer_note').each(function(){
|
||||
$(this).summernote("code", "");
|
||||
});
|
||||
}
|
||||
if (dropzoneCount > 0) {
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
toastr.error(result.msg);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//show aleart before page reloading
|
||||
var form_obj = $('form#{{$form->id}}');
|
||||
var orig_forn_data = form_obj.serialize();
|
||||
window.onbeforeunload = function() {
|
||||
if($('form#{{$form->id}}').length == 1){
|
||||
if (form_obj.serialize() != orig_forn_data) {
|
||||
return 'Are you sure?';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<!-- Form additional JS -->
|
||||
@if(!empty($additional_js))
|
||||
{!!$additional_js!!}
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
||||
12
resources/views/form/edit.blade.php
Normal file
12
resources/views/form/edit.blade.php
Normal file
@@ -0,0 +1,12 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<create-form form-data="{{json_encode($form)}}" :placeholder-img="{{json_encode($placeholder_img)}}" :save-template="{{json_encode($save_as_template)}}">
|
||||
</create-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
39
resources/views/form/generate_widget.blade.php
Normal file
39
resources/views/form/generate_widget.blade.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">
|
||||
@lang('messages.generate_widget')
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="widget">
|
||||
@lang('messages.iframe_code')
|
||||
</label>
|
||||
<textarea class="form-control form-control-sm" id="widget" rows="4" aria-describedby="widget_help" readonly>{{$widget}}</textarea>
|
||||
<small id="widget_help" class="form-text text-muted">
|
||||
@lang('messages.widget_help_text')
|
||||
</small>
|
||||
<textarea class="form-control form-control-sm" id="widget" rows="4" aria-describedby="widget_script_help" readonly>{{$widget_script}}</textarea>
|
||||
<small id="widget_script_help" class="form-text text-muted">
|
||||
@lang('messages.widget_script_help_text')
|
||||
</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>@lang('messages.new_window')</label>
|
||||
<textarea class="form-control form-control-sm" id="new_window" rows="4" aria-describedby="new_window_help" readonly>{{$form}}</textarea>
|
||||
<small id="widget_help" class="form-text text-muted">
|
||||
@lang('messages.new_window_help_text')
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
@foreach($attributes as $attribute)
|
||||
{{$attribute['key']}} = "{{$attribute['value']}}"
|
||||
@endforeach
|
||||
499
resources/views/form/partials/fields_generator.blade.php
Normal file
499
resources/views/form/partials/fields_generator.blade.php
Normal file
@@ -0,0 +1,499 @@
|
||||
@if(!empty($form->schema['form']))
|
||||
<div class="row">
|
||||
@foreach($form->schema['form'] as $key => $element)
|
||||
@php
|
||||
$custom_attributes = isset($element['custom_attributes']) ? $element['custom_attributes'] : [];
|
||||
@endphp
|
||||
<div class="@if(!empty($element['col'])) {{$element['col']}} @else col-md-12 @endif mt-25 mb-25">
|
||||
@if($element['type'] == 'text')
|
||||
<div class="form-group">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">
|
||||
{{$element['label']}}
|
||||
</span>
|
||||
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="input-group">
|
||||
|
||||
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas {{$element['prefix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<input type="{{$element['subtype']}}"
|
||||
name="fields[{{$element['name']}}]"
|
||||
placeholder="{{$element['placeholder']}}"
|
||||
class="form-control {{$element['size']}} {{$element['custom_class']}}"
|
||||
id="{{$element['name']}}"
|
||||
@foreach ($validation_rules[$key] as $validation)
|
||||
{{$validation['rule']}} = "{{$validation['value']}}"
|
||||
{{$validation['error']}} = "{{$validation['msg']}}"
|
||||
@endforeach
|
||||
@if($element['required']) required @endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])
|
||||
>
|
||||
|
||||
@if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
<i class="fas {{$element['suffix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif($element['type'] == 'range')
|
||||
<div class="form-group mb-4 mt-3">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">
|
||||
{{$element['label']}}
|
||||
</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="row">
|
||||
<div class="col-sm-1">{{$element['min']}}</div>
|
||||
<div class="col-sm-10">
|
||||
<input type="range"
|
||||
name="fields[{{$element['name']}}]"
|
||||
@if($element['required']) required @endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
id="{{$element['name']}}"
|
||||
min="{{$element['min']}}"
|
||||
max="{{$element['max']}}"
|
||||
step="{{$element['step']}}"
|
||||
data-orientation="{{$element['data_orientation']}}"
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])>
|
||||
</div>
|
||||
<div class="col-sm-1">{{$element['max']}}</div>
|
||||
</div>
|
||||
<b><output class="{{$element['name']}}" style="display: block;text-align:center;" for="{{$element['name']}}"></output></b>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@elseif($element['type'] == 'calendar')
|
||||
<div class="form-group">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">
|
||||
{{$element['label']}}
|
||||
</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="input-group date" id="{{$element['name']}}" data-target-input="nearest">
|
||||
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" data-target="#{{$element['name']}}" data-toggle="datetimepicker">
|
||||
<i class="fas {{$element['prefix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
<input type="text"
|
||||
name="fields[{{$element['name']}}]"
|
||||
data-toggle="datetimepicker"
|
||||
id="{{$element['name']}}"
|
||||
class="form-control datetimepicker-input {{$element['custom_class']}}"
|
||||
readonly
|
||||
data-target="#{{$element['name']}}"
|
||||
@if($element['required']) required @endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])
|
||||
>
|
||||
@if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text" data-target="#{{$element['name']}}" data-toggle="datetimepicker">
|
||||
<i class="fas {{$element['suffix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif($element['type'] == 'textarea')
|
||||
|
||||
<div class="form-group">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">
|
||||
{{$element['label']}}
|
||||
</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="input-group">
|
||||
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas {{$element['prefix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
<textarea
|
||||
rows="{{$element['rows']}}"
|
||||
name="fields[{{$element['name']}}]"
|
||||
cols="{{$element['columns']}}"
|
||||
placeholder="{{$element['placeholder']}}"
|
||||
class="form-control {{$element['custom_class']}}"
|
||||
id="{{$element['name']}}"
|
||||
@foreach ($validation_rules[$key] as $validation)
|
||||
{{$validation['rule']}} = "{{$validation['value']}}"
|
||||
{{$validation['error']}} = "{{$validation['msg']}}"
|
||||
@endforeach
|
||||
@if($element['required']) required @endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])
|
||||
></textarea>
|
||||
@if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
<i class="fas {{$element['suffix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@elseif(in_array($element['type'], ['radio', 'checkbox']))
|
||||
<div class="form-group">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
@foreach(explode(PHP_EOL, $element['options']) as $option)
|
||||
<div class="custom-control @if($element['type'] == 'radio') custom-radio @else custom-checkbox @endif">
|
||||
<input class="custom-control-input"
|
||||
type="{{$element['type']}}"
|
||||
value="{{$option}}"
|
||||
name="fields[{{$element['name']}}][]"
|
||||
id="{{$element['name']}}_{{$loop->index}}"
|
||||
@foreach ($validation_rules[$key] as $validation)
|
||||
{{$validation['rule']}} = "{{$validation['value']}}"
|
||||
{{$validation['error']}} = "{{$validation['msg']}}"
|
||||
@endforeach
|
||||
@if($element['required'])
|
||||
required
|
||||
@endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])
|
||||
>
|
||||
<label class="custom-control-label" for="{{$element['name']}}_{{$loop->index}}">
|
||||
{{$option}}
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@elseif($element['type'] == 'dropdown')
|
||||
|
||||
<div class="form-group">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<div class="input-group">
|
||||
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas {{$element['prefix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
<select class="custom-select {{$element['size']}} {{$element['custom_class']}}" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}" id="{{$element['name']}}"
|
||||
@if($element['multiselect'])
|
||||
multiple
|
||||
name="fields[{{$element['name']}}][]"
|
||||
@else
|
||||
name="fields[{{$element['name']}}]"
|
||||
@endif
|
||||
@foreach ($validation_rules[$key] as $validation)
|
||||
{{$validation['rule']}} = "{{$validation['value']}}"
|
||||
{{$validation['error']}} = "{{$validation['msg']}}"
|
||||
@endforeach
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])>
|
||||
@foreach(explode(PHP_EOL, $element['options']) as $option)
|
||||
<option>
|
||||
{{$option}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
<i class="fas {{$element['suffix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif($element['type'] == 'heading')
|
||||
|
||||
<div class="{{$element['custom_class'] ?? ''}}">
|
||||
@php
|
||||
echo '<' . $element['tag'] . ' style="color:' . $element['text_color'] . '">' . $element['content'] .'</' . $element['tag'] . '>';
|
||||
@endphp
|
||||
</div>
|
||||
@elseif($element['type'] == 'file_upload')
|
||||
<div class="mb-2">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="dropzone {{$element['custom_class']}}"
|
||||
id="{{$element['name']}}" @includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])></div>
|
||||
<input type="hidden" name="fields[{{$element['name']}}][]" id="{{$element['name']}}" value="" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}">
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif($element['type'] == 'text_editor')
|
||||
<div class="mb-2">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<textarea class="form-control summer_note" id="{{$element['name']}}" name="fields[{{$element['name']}}]" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}"
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])></textarea>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif($element['type'] == 'terms_and_condition')
|
||||
<div class="pt-2 mb-2">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input {{$element['custom_class']}}" type="checkbox" name="fields[{{$element['name']}}]" id="terms_and_condition" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}" @includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])>
|
||||
<label class="custom-control-label" for="terms_and_condition">
|
||||
@if(!empty($element['link']))
|
||||
<a href="{{$element['link']}}" target="_blank"> {{$element['label']}}
|
||||
</a>
|
||||
@else
|
||||
{{$element['label']}}
|
||||
@endif
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@elseif($element['type'] == 'hr')
|
||||
<hr style="
|
||||
@if(!empty($element['padding_top']))
|
||||
padding-top: {{$element['padding_top']}}px;
|
||||
@endif
|
||||
@if(!empty($element['padding_bottom']))
|
||||
padding-bottom:{{$element['padding_bottom']}}px;
|
||||
@endif
|
||||
@if(!empty($element['border_size']) && !empty($element['border_color']))
|
||||
border-top:{{$element['border_size']}}px {{$element['border_type']}} {{$element['border_color']}};
|
||||
@endif">
|
||||
@elseif($element['type'] == 'html_text')
|
||||
<div class="{{$element['custom_class'] ?? ''}}">
|
||||
{!!$element['html_text']!!}
|
||||
</div>
|
||||
@elseif($element['type'] == 'rating')
|
||||
<div class="form-group pt-2">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<input id="{{$element['name']}}" name="fields[{{$element['name']}}]"
|
||||
data-stars="{{$element['stars_to_display']}}"
|
||||
data-min="{{$element['min_rating']}}"
|
||||
data-max="{{$element['max_rating']}}"
|
||||
data-step="{{$element['increment']}}"
|
||||
dir="{{$element['direction']}}"
|
||||
data-size="{{$element['size']}}"
|
||||
class="star_rating"
|
||||
@if($element['required']) required @endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
>
|
||||
</div>
|
||||
@elseif($element['type'] == 'switch')
|
||||
<div class="form-group pt-2">
|
||||
<span class="switch @if(!empty($element['size'])) {{$element['size']}} @endif">
|
||||
<input type="checkbox" class="switch" name="fields[{{$element['name']}}]" id="{{$element['name']}}"" @if($element['required']) required @endif @includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes]) data-msg-required="{{$element['required_error_msg']}}">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}" class="ml-2">
|
||||
{{$element['label']}}
|
||||
</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
</span>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif($element['type'] == 'signature')
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="form-group">
|
||||
<canvas id="{{$element['name']}}" width="300" height="200" class="signature-pad" @includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])></canvas>
|
||||
<input type="hidden" class="signature" name="fields[{{$element['name']}}]" id="output_{{$element['name']}}" value="" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}">
|
||||
</div>
|
||||
<div class="form-text">
|
||||
<span class="pointer mr-4" id="clear_{{$element['name']}}" title="@lang('messages.clear_signature_pad')" data-name="{{$element['name']}}">
|
||||
<i class="far fa-times-circle"></i>
|
||||
{{__('messages.clear')}}
|
||||
</span>
|
||||
<span class="pointer" id="undo_{{$element['name']}}" title="@lang('messages.undo')" data-name="{{$element['name']}}">
|
||||
<i class="fas fa-undo"></i>
|
||||
{{__('messages.undo')}}
|
||||
</span>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif(($element['type'] == 'youtube') && !empty($element['iframe_url']))
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
@php
|
||||
$video_id = '';
|
||||
$url = $element['iframe_url'];
|
||||
if (str_contains($url, 'watch')) {
|
||||
$video_id = str_replace('https://www.youtube.com/watch?v=', '', $url);
|
||||
} else if (str_contains($url, 'youtu.be')) {
|
||||
$video_id = str_replace('https://youtu.be/', '', $url);
|
||||
} else if (str_contains($url, 'embed')) {
|
||||
$video_id = str_replace('https://www.youtube.com/embed/', '', $url);
|
||||
}
|
||||
$yt_embed_url = "https://www.youtube.com/embed/{$video_id}";
|
||||
@endphp
|
||||
<div class="col-md-12">
|
||||
<iframe src="{{$yt_embed_url}}"
|
||||
id="{{$element['name']}}"
|
||||
name="{{$element['label']}}"
|
||||
title="{{$element['label']}}"
|
||||
class="{{$element['custom_class']}}"
|
||||
width="{{$element['width']}}%"
|
||||
height="{{$element['height']}}"
|
||||
frameborder="0"
|
||||
style="max-width: 100%;"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
|
||||
</iframe>
|
||||
</div>
|
||||
@elseif(($element['type'] == 'iframe') && !empty($element['iframe_url']))
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="col-md-12">
|
||||
<iframe src="{{$element['iframe_url']}}"
|
||||
id="{{$element['name']}}"
|
||||
name="{{$element['label']}}"
|
||||
title="{{$element['label']}}"
|
||||
class="{{$element['custom_class']}}"
|
||||
width="{{$element['width']}}%"
|
||||
height="{{$element['height']}}"
|
||||
frameborder="0"
|
||||
style="max-width: 100%;"
|
||||
>
|
||||
</iframe>
|
||||
</div>
|
||||
@elseif(($element['type'] == 'pdf') && !empty($element['pdf']))
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="col-md-12">
|
||||
<iframe src="{{$form->media_url.'/'.$element['pdf']}}"
|
||||
id="{{$element['name']}}"
|
||||
name="{{$element['label']}}"
|
||||
title="{{$element['label']}}"
|
||||
class="{{$element['custom_class']}}"
|
||||
width="{{$element['width']}}%"
|
||||
height="{{$element['height']}}"
|
||||
frameborder="0"
|
||||
style="max-width: 100%;"
|
||||
>
|
||||
</iframe>
|
||||
</div>
|
||||
@elseif($element['type'] == 'countdown')
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="col-md-12">
|
||||
<div class="{{$element['custom_class']}}">
|
||||
<span id="{{$element['name']}}" class="max-width-100">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
29
resources/views/form/partials/form_card.blade.php
Normal file
29
resources/views/form/partials/form_card.blade.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<div class="card">
|
||||
@php
|
||||
$bg_color = $form->schema['settings']['color']['background'];
|
||||
$error_msg_color = $form->schema['settings']['color']['error_msg'];
|
||||
$bg_type = $form->schema['settings']['background']['bg_type'];
|
||||
$bg_image = $form->schema['settings']['color']['image_path'];
|
||||
$action = '';
|
||||
|
||||
switch (request()->route()->getName()) {
|
||||
case 'form-data.edit':
|
||||
$action = 'edit';
|
||||
break;
|
||||
case 'forms.show':
|
||||
$action = 'show';
|
||||
break;
|
||||
}
|
||||
@endphp
|
||||
<div class="tab-content card-body"
|
||||
id="" role="tabpanel" style='@if(!empty($bg_image) && $bg_type == 'bg_image')background-image: url("{{Storage::url(config('constants.doc_path').'/'.$bg_image)}}"); background-repeat: no-repeat;background-size: cover;background-position: right top;@else background-color: {{$bg_color}}; @endif'>
|
||||
|
||||
@if(!empty($is_form_closed) && $is_form_closed)
|
||||
<div class="card-text">
|
||||
{!! $form_closed_msg !!}
|
||||
</div>
|
||||
@else
|
||||
<show-form form="{{json_encode($form)}}" action-by="{{$action_by ?? ''}}" action="{{ $action }}"></show-form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
40
resources/views/form/show.blade.php
Normal file
40
resources/views/form/show.blade.php
Normal file
@@ -0,0 +1,40 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$bg_color = $form->schema['settings']['color']['background'];
|
||||
$error_msg_color = $form->schema['settings']['color']['error_msg'];
|
||||
$additional_css = $form->schema['additional_js_css']['css'];
|
||||
$additional_js = $form->schema['additional_js_css']['js'];
|
||||
$page_color = $form->schema['settings']['color']['page_color'] ?? '#f4f6f9';
|
||||
@endphp
|
||||
|
||||
<div class="@if(!empty($iframe_enabled) && $iframe_enabled) container-fluid @else container @endif">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
|
||||
@include('form.partials.form_card')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('footer')
|
||||
<!-- form theme -->
|
||||
@if(isset($form->schema['settings']['theme']) && $form->schema['settings']['theme'] != 'default')
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/{{$form->schema['settings']['theme']}}/bootstrap.min.css" rel="stylesheet">
|
||||
@endif
|
||||
<style type="text/css">
|
||||
.error {
|
||||
color:{{$error_msg_color}}
|
||||
}
|
||||
.content-wrapper {
|
||||
background-color: {{$page_color}} !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Form additional JS -->
|
||||
@if(!empty($additional_js))
|
||||
{!!$additional_js!!}
|
||||
@endif
|
||||
|
||||
@endsection
|
||||
78
resources/views/form/validate_password.blade.php
Normal file
78
resources/views/form/validate_password.blade.php
Normal file
@@ -0,0 +1,78 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container mt-5">
|
||||
<div class="col-md-6 offset-md-3 mt-5">
|
||||
<div class="card card-outline card-primary card-widget widget-user shadow pb-5">
|
||||
<div class="card-body">
|
||||
<form id="password-form" action="{{route('post.validate.protected.form', ['id' => $id])}}"
|
||||
method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h4 class="text-center">
|
||||
<i class="far fa-file-archive fa-5x"></i>
|
||||
</h4>
|
||||
<h4 class="text-center">
|
||||
@lang('messages.this_form_is_password_protected')
|
||||
</h4>
|
||||
<p class="text-center form-text text-muted">
|
||||
{{__('messages.enter_your_password_to_view_the_form')}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas fa-key"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="password" class="form-control"
|
||||
placeholder="@lang('messages.password')"
|
||||
required
|
||||
id="password">
|
||||
<div class="input-group-append">
|
||||
<button type="submit" class="btn btn-sm bg-primary">
|
||||
@lang('messages.continue')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="error-msg text-danger"></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("form#password-form").validate({
|
||||
submitHandler: function(form, e) {
|
||||
e.preventDefault();
|
||||
if ($('form#password-form').valid()) {
|
||||
$(".error-msg").html('');
|
||||
$.ajax({
|
||||
method:"POST",
|
||||
url: $("form#password-form").attr("action"),
|
||||
data: {
|
||||
password: $("#password").val()
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if(response.success == true){
|
||||
window.location = response.redirect;
|
||||
} else {
|
||||
$(".error-msg").html(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user