@extends('layouts.admin') @section('style') @parent @section('style') @parent @endSection @endSection @php $form = config('admin.template_form'); $template_type_cond = config('admin.template_type_cond'); $overwite_cond = $template_type_cond [ $data['type'] ]; $max_cta_count = config('admin.template_max_cta'); function is_req($id, $overwite_cond, $form){ return array_key_exists($id, $overwite_cond) && array_key_exists('req', $overwite_cond[$id]) ? $overwite_cond[$id]['req']: $form[$id]['req']; } @endphp @section('content') @component('admin.components.step_form_pages', [ 'post_url'=>'', 'type'=>'templates', 'title'=> 'Customize', 'all_pages' =>['Setup','Customize'], 'step'=> '2', ])
@foreach($data['data'] as $top) @php $lang = $top['locale']; @endphp
{{-- header select --}} @php $id = 'msg_header'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_100', [ 'class'=>'mb-0', 'label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ])
@php $id = 'msg_header_type'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field', [ 'class'=>'col-sm-3', 'label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @endcomponent
{{-- header text form --}} @php $id = 'msg_header_text'; $hasError = $errors->has($id); @endphp @component('admin.components.form_field', ['style'=>'display:none','class'=>'msg-header-form mhf-text col-sm-12 px-0', 'label'=>$form[$id]['label'], 'required'=>is_req($id, $overwite_cond, $form), 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @endcomponent {{-- header attachment preview --}} {{-- header attachment file uploader form --}} @php $id = 'msg_header_attachment'; $hasError = $errors->has($id);@endphp @component('admin.components.form_field', ['style'=>'display:none','class'=>'msg-header-form mhf-sticker mhf-image mhf-document col-sm-12 px-0', 'label'=>$form[$id]['label'], 'required'=>is_req($id, $overwite_cond, $form), 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ])
{{-- accept="{{ \App\Http\Controllers\Admin\VoucherSeriesController::IMG_HTML_ACCEPT_RULE }}">--}}
@endcomponent {{-- header attachment alias name form --}} @php $id = 'msg_header_attachment_filename'; $hasError = $errors->has($id);@endphp @component('admin.components.form_field', ['style'=>'display:none','class'=>'msg-header-attachment-alias col-12 px-0 mx-0', 'label'=>$form[$id]['label'], 'required'=>is_req($id, $overwite_cond, $form), 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent
@endcomponent {{-- body --}} @php $id = 'msg_body'; $hasError = $errors->has($id); if($overwite_cond[$id]){ $overwite_cond[$id]['req'] = $data['init_type']=='bi_template' ? true : $overwite_cond[$id]['req']; } @endphp @component('admin.components.form_field', [ 'class'=> 'col-12', 'label'=>$form[$id]['label'], 'required'=>is_req($id, $overwite_cond, $form), 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @endcomponent {{-- Scheduled message (business initiated) text: Variable Samples --}} @php $id = 'msg_footer'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field', ['style'=>'display:none', 'class'=> 'col-12', 'label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent {{-- cta types --}} @php $id = 'msg_cta_type'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field', [ 'class'=> 'col-12', 'label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent {{-- cta types : quick link --}} {{-- cta types : btn reply --}} {{-- cta types : list reply --}}
{{-- preview panel --}}
@if( $data['type'] ?? '') @switch( $data['type'] ) {{-- preview panel : image --}} @case('image') @case('sticker') @case('document')
{{-- preview panel : document --}}
@break {{-- preview panel : cta --}} @case('button_reply') @case('url')
00:00
@for ($i = 0; $i < 3 ; $i++) @if($i>0) @endif @endfor
@break @case('list_reply')
00:00
@for ($i = 0; $i < $max_cta_count['list_reply'] ; $i++) @if($i>0) @endif
@endfor
@break {{-- preview panel : timestamp preview --}} @default
00:00
@break @endswitch @endif
@endforeach
@slot('footer_back') Back @endslot @slot('footer_next') Save Step @endslot @endcomponent @endsection @section('script') @parent @endSection