fix lang bug

This commit is contained in:
decoder 2024-04-26 20:45:01 +05:00
parent a46ec03369
commit 157a5a1939
2 changed files with 165 additions and 142 deletions

View File

@ -16,7 +16,8 @@
visibility: hidden;
}
#printSection, #printSection * {
#printSection,
#printSection * {
visibility: visible;
}
@ -53,11 +54,13 @@
<form action="{{ @route('form-data.show', ['id' => $form->id]) }}" class="form row mt-3 mx-2 mb-0">
<div class="form-group mb-0 col-1">
<input type="date" class="form-control" name="start_date" value="{{ request()->get('start_date') ?? \Carbon\Carbon::now()->subDays(7)->toDateString() }}">
<input type="date" class="form-control" name="start_date"
value="{{ request()->get('start_date') ?? \Carbon\Carbon::now()->subDays(7)->toDateString() }}">
</div>
<div class="form-group mb-0 col-1">
<input type="date" class="form-control" name="end_date" value="{{ request()->get('end_date') ?? \Carbon\Carbon::now()->toDateString() }}">
<input type="date" class="form-control" name="end_date"
value="{{ request()->get('end_date') ?? \Carbon\Carbon::now()->toDateString() }}">
</div>
<div class="form-group mb-0 col-2 d-flex">
@ -67,7 +70,10 @@
@php
$is_enabled_sub_ref_no = false;
if(isset($form->schema['settings']['form_submision_ref']['is_enabled']) && $form->schema['settings']['form_submision_ref']['is_enabled']) {
if (
isset($form->schema['settings']['form_submision_ref']['is_enabled']) &&
$form->schema['settings']['form_submision_ref']['is_enabled']
) {
$is_enabled_sub_ref_no = true;
}
@ -93,7 +99,12 @@
@foreach ($schema as $element)
@if (in_array($element['name'], $col_visible))
<th>
{{-- $element['label'] --}}
@if (in_array(session()->get('locale'), ['ru', 'est']) && isset($element['label_' . session()->get('locale')]))
{{ $element['label_' . session()->get('locale')] }}
@else
{{ $element['label'] }}
@endif
</th>
@endif
@endforeach
@ -107,7 +118,8 @@
@if (auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
<td>
@if (in_array('view', $btn_enabled))
<button type="button" class="btn btn-info btn-sm view_form_data m-1"
<button type="button"
class="btn btn-info btn-sm view_form_data m-1"
data-href="{{ action([\App\Http\Controllers\FormDataController::class, 'viewData'], [$row->id]) }}"
data-toggle="modal">
<i class="fa fa-eye" aria-hidden="true"></i>
@ -146,8 +158,10 @@
<td>
@isset($row->data[$row_element['name']])
@if ($row_element['type'] == 'file_upload')
@include('form_data.file_view', ['form_upload' => $row->data[$row_element['name']]])
@include('form_data.file_view', [
'form_upload' =>
$row->data[$row_element['name']],
])
@elseif($row_element['type'] == 'signature')
@if (!empty($row->data[$row_element['name']]))
<a target="_blank"
@ -162,7 +176,6 @@
@else
{!! nl2br($row->data[$row_element['name']]) !!}
@endif
@endisset
</td>
@endif

View File

@ -23,7 +23,9 @@
<div class="modal-body">
<div class="row mb-2">
<div class="col-md-6">
@if(isset($form_data->form->schema['settings']['form_submision_ref']['is_enabled']) && $form_data->form->schema['settings']['form_submision_ref']['is_enabled'] && !empty($form_data->submission_ref))
@if (isset($form_data->form->schema['settings']['form_submision_ref']['is_enabled']) &&
$form_data->form->schema['settings']['form_submision_ref']['is_enabled'] &&
!empty($form_data->submission_ref))
<b>@lang('messages.submission_numbering'):</b>
{{ $form_data->submission_ref }}
@endif
@ -41,12 +43,19 @@
@isset($form_data->data[$element['name']])
<tr>
<td>
<strong>{{$element['label']}}</strong>
<strong>
@if (in_array(session()->get('locale'), ['ru', 'est']) && isset($element['label_' . session()->get('locale')]))
{{ $element['label_' . session()->get('locale')] }}
@else
{{ $element['label'] }}
@endif
</strong>
</td>
<td>
@if ($element['type'] == 'file_upload')
@include('form_data.file_view', ['form_upload' => $form_data->data[$element['name']]])
@include('form_data.file_view', [
'form_upload' => $form_data->data[$element['name']],
])
@elseif($element['type'] == 'signature')
@if (!empty($form_data->data[$element['name']]))
<a target="_blank" href="{{ $form_data->data[$element['name']] }}"
@ -55,9 +64,7 @@
</a>
@endif
@elseif(is_array($form_data->data[$element['name']]) && $element['type'] != 'file_upload')
{{ implode(', ', $form_data->data[$element['name']]) }}
@else
{!! nl2br($form_data->data[$element['name']]) !!}
@endif
@ -69,7 +76,9 @@
</table>
<div class="no-print mt-4">
<hr>
<form id="add_comment_form" action="{{action([\App\Http\Controllers\FormDataCommentController::class, 'store'])}}" method="POST">
<form id="add_comment_form"
action="{{ action([\App\Http\Controllers\FormDataCommentController::class, 'store']) }}"
method="POST">
{{ csrf_field() }}
<!-- hiden fields -->
<input type="hidden" name="form_data_id" id="form_data_id" value="{{ $form_data->id }}">
@ -104,7 +113,8 @@
<i class="fas fa-print"></i>
@lang('messages.print')
</button>
<a class="btn float-right btn-primary btn-sm m-1" target="_blank" href="{{action([\App\Http\Controllers\FormDataController::class, 'downloadPdf'], [$form_data->id])}}">
<a class="btn float-right btn-primary btn-sm m-1" target="_blank"
href="{{ action([\App\Http\Controllers\FormDataController::class, 'downloadPdf'], [$form_data->id]) }}">
<i class="far fa-file-pdf" aria-hidden="true"></i>
@lang('messages.download_pdf')
</a>