-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
124 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ | |
'filters' => [ | ||
'type_hidden' => [ | ||
'password', | ||
'coordinates', | ||
], | ||
'hidden' => [ | ||
'deleted_at', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
<br> | ||
<?php $checked = false; ?> | ||
@if(isset($dataTypeContent->{$row->field})) | ||
<?php $checked = $dataTypeContent->{$row->field}; ?> | ||
@else | ||
<?php $checked = isset($options->checked) && | ||
filter_var($options->checked, FILTER_VALIDATE_BOOLEAN) ? true: false; ?> | ||
@endif | ||
|
||
<?php $class = $options->class ?? "toggleswitch"; ?> | ||
|
||
@if(isset($options->on) && isset($options->off)) | ||
<input type="checkbox" name="{{ $row->field }}" class="{{ $class }}" | ||
data-on="{{ $options->on }}" {!! $checked ? 'checked="checked"' : '' !!} | ||
data-off="{{ $options->off }}"> | ||
@else | ||
<input type="checkbox" name="{{ $row->field }}" class="{{ $class }}" | ||
@if($checked) checked @endif> | ||
@endif | ||
@php $options->options = [ | ||
'1' => 'Yes', | ||
'0' => 'No', | ||
]; @endphp | ||
<?php $selected_value = (isset($dataTypeContent->{$row->field}) && !is_null($dataTypeContent->{$row->field})) ? $dataTypeContent->{$row->field} : null; ?> | ||
<select class="form-control input-sm select2" name="{{ $row->field }}"> | ||
<option value="">{{__('voyager::generic.none')}}</option> | ||
<?php $default = (isset($options->filter_default) && !isset($dataTypeContent->{$row->field})) ? $options->filter_default : null; ?> | ||
@if(isset($options->options)) | ||
@foreach($options->options as $key => $option) | ||
@continue($key === '') | ||
<option value="{{ $key }}" @if($default === $key && $selected_value === NULL) selected="selected" @endif @if($selected_value === $key) selected="selected" @endif>{{ $option }}</option> | ||
@endforeach | ||
@endif | ||
</select> |
29 changes: 11 additions & 18 deletions
29
resources/views/filterformfields/multiple_checkbox.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
<br> | ||
<?php $checked = false; ?> | ||
@if(isset($options->options)) | ||
@foreach($options->options as $key => $label) | ||
@if(isset($dataTypeContent->{$row->field})) | ||
@php | ||
$checkedData = $dataTypeContent->{$row->field}; | ||
$checkedData = is_array($checkedData) ? $checkedData : json_decode($checkedData, true); | ||
$checked = in_array($key, $checkedData); | ||
@endphp | ||
@else | ||
<?php $checked = isset($options->checked) && $options->checked ? true : false; ?> | ||
@endif | ||
|
||
<input type="checkbox" name="{{ $row->field }}[{{$key}}]" {!! $checked ? 'checked="checked"' : '' !!} value="{{$key}}" id="{{$key}}"/> | ||
<label for="{{$key}}">{{$label}}</label> | ||
@endforeach | ||
@endif | ||
<?php $selected_value = (isset($dataTypeContent->{$row->field}) && !is_null($dataTypeContent->{$row->field})) ? $dataTypeContent->{$row->field} : null; ?> | ||
<select multiple class="form-control input-sm select2" name="{{ $row->field }}[]"> | ||
<option value="">{{__('voyager::generic.none')}}</option> | ||
<?php $default = (isset($options->filter_default) && !isset($dataTypeContent->{$row->field})) ? $options->filter_default : null; ?> | ||
@if(isset($options->options)) | ||
@foreach($options->options as $key => $option) | ||
@continue($key === '') | ||
<option value="{{ $key }}" @if($default === $key && $selected_value === NULL) selected="selected" @endif @if($selected_value === $key) selected="selected" @endif>{{ $option }}</option> | ||
@endforeach | ||
@endif | ||
</select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
<br> | ||
<?php $checked = false; ?> | ||
@if(isset($options->options)) | ||
@foreach($options->options as $key => $label) | ||
@if(isset($dataTypeContent->{$row->field})) | ||
@php | ||
$checkedData = $dataTypeContent->{$row->field}; | ||
$checkedData = is_array($checkedData) ? $checkedData : json_decode($checkedData, true); | ||
$checked = in_array($key, $checkedData); | ||
@endphp | ||
@else | ||
<?php $checked = isset($options->checked) && $options->checked ? true : false; ?> | ||
@endif | ||
|
||
<input type="checkbox" name="{{ $row->field }}[{{$key}}]" {!! $checked ? 'checked="checked"' : '' !!} value="{{$key}}" id="{{$key}}"/> | ||
<label for="{{$key}}">{{$label}}</label> | ||
@endforeach | ||
@endif | ||
<?php $selected_value = (isset($dataTypeContent->{$row->field}) && !is_null($dataTypeContent->{$row->field})) ? $dataTypeContent->{$row->field} : null; ?> | ||
<select multiple class="form-control input-sm select2" name="{{ $row->field }}[]"> | ||
<option value="">{{__('voyager::generic.none')}}</option> | ||
<?php $default = (isset($options->filter_default) && !isset($dataTypeContent->{$row->field})) ? $options->filter_default : null; ?> | ||
@if(isset($options->options)) | ||
@foreach($options->options as $key => $option) | ||
@continue($key === '') | ||
<option value="{{ $key }}" @if($default === $key && $selected_value === NULL) selected="selected" @endif @if($selected_value === $key) selected="selected" @endif>{{ $option }}</option> | ||
@endforeach | ||
@endif | ||
</select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters