Added and implemented a form-check input component

This commit is contained in:
cp6 2022-10-31 12:02:56 +11:00
parent 1c90ff116e
commit 5f18ccff2c
3 changed files with 12 additions and 23 deletions

View File

@ -0,0 +1,7 @@
<div class="form-check mb-2">
<input class="form-check-input" name="{{$name}}" id="{{$id ?? 'formCheck'}}" type="checkbox"
value="1" @if(isset($checked) && $checked === '1') checked @endif>
<label class="form-check-label">
{{$text}}
</label>
</div>

View File

@ -225,14 +225,7 @@
</x-labels-select>
</div>
</div>
<div class="form-check">
<input class="form-check-input" name="show_public" type="checkbox"
value="1">
<label class="form-check-label">
Allow this data to be public, restrict values
in settings
</label>
</div>
<x-form-check text="Allow this data to be public, restrict values in settings" name="show_public"></x-form-check>
<div class="row">
<div class="col-12 col-lg-4">
<x-submit-button>Insert server</x-submit-button>

View File

@ -250,23 +250,12 @@
</div>
<div class="row mt-2">
<div class="col-12 col-lg-6 mb-4">
<div class="form-check">
<input class="form-check-input" name="is_active" type="checkbox"
value="1" {{ ($server_data->active === 1) ? 'checked' : '' }}>
<label class="form-check-label">
I still have this server
</label>
</div>
<x-form-check text="I still have this server" name="is_active"
checked="{{$server_data->active}}"></x-form-check>
</div>
<div class="col-12 col-lg-6 mb-4">
<div class="form-check">
<input class="form-check-input" name="show_public" type="checkbox"
value="1" {{ ($server_data->show_public === 1) ? 'checked' : '' }}>
<label class="form-check-label">
Allow this data to be public <a href="{{route('settings.index')}}">restrict values
here</a>
</label>
</div>
<x-form-check text="Allow some of this data to be public" name="show_public"
checked="{{$server_data->show_public}}"></x-form-check>
</div>
</div>
<div class="row mt-2">