Skip to content

Commit 4ae2126

Browse files
authored
Merge pull request grokability#16213 from marcusmoore/chore/migrate-checkbox-helpers-p1
Replace calls to Form::checkbox pt1
2 parents c420670 + 38df5e8 commit 4ae2126

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

resources/views/account/profile.blade.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
<div class="form-group{{ $errors->has('image_delete') ? ' has-error' : '' }}">
129129
<div class="col-md-9 col-md-offset-3">
130130
<label for="image_delete" class="form-control">
131-
{{ Form::checkbox('image_delete', '1', old('image_delete'), ['id' => 'image_delete', 'aria-label'=>'image_delete']) }}
131+
<input type="checkbox" name="image_delete" id="image_delete" value="1" @checked(old('image_delete')) aria-label="image_delete">
132132
{{ trans('general.image_delete') }}
133133
</label>
134134
{!! $errors->first('image_delete', '<span class="alert-msg">:message</span>') !!}
@@ -150,13 +150,23 @@
150150
@if ($snipeSettings->two_factor_enabled=='1')
151151
<div class="form-group {{ $errors->has('two_factor_optin') ? 'has-error' : '' }}">
152152
<div class="col-md-7 col-md-offset-3">
153-
@can('self.two_factor')
154-
<label class="form-control">{{ Form::checkbox('two_factor_optin', '1', old('two_factor_optin', $user->two_factor_optin)) }}
155-
@else
156-
<label class="form-control form-control--disabled">{{ Form::checkbox('two_factor_optin', '1', old('two_factor_optin', $user->two_factor_optin),['disabled' => 'disabled']) }}
157-
@endcan
158-
159-
{{ trans('admin/settings/general.two_factor_enabled_text') }}</label>
153+
<label
154+
for="two_factor_optin"
155+
@class([
156+
'form-control',
157+
'form-control--disabled' => auth()->user()->cannot('self.two_factor'),
158+
])
159+
>
160+
<input
161+
type="checkbox"
162+
name="two_factor_optin"
163+
id="two_factor_optin"
164+
value="1"
165+
@checked(old('two_factor_optin', $user->two_factor_optin))
166+
@disabled(auth()->user()->cannot('self.two_factor'))
167+
>
168+
{{ trans('admin/settings/general.two_factor_enabled_text') }}
169+
</label>
160170
@can('self.two_factor')
161171
<p class="help-block">{{ trans('admin/settings/general.two_factor_enabled_warning') }}</p>
162172
@else

resources/views/custom_fields/fieldsets/view.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109

110110
<div class="checkbox-inline">
111111
<label>
112-
{{ Form::checkbox('required', 'on', old('required')) }}
112+
<input type="checkbox" name="required" value="on" @checked(old('required'))>
113113
<span style="padding-left: 10px;">{{ trans('admin/custom_fields/general.required') }}</span>
114114
</label>
115115
</div>

resources/views/hardware/bulk.blade.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</div>
4848
<div class="col-md-5">
4949
<label class="form-control">
50-
{{ Form::checkbox('null_name', '1', false) }}
50+
<input type="checkbox" name="null_name" value="1">
5151
{{ trans_choice('general.set_to_null', count($assets), ['selection_count' => count($assets)]) }}
5252
</label>
5353
</div>
@@ -66,7 +66,7 @@
6666
</div>
6767
<div class="col-md-5">
6868
<label class="form-control">
69-
{{ Form::checkbox('null_purchase_date', '1', false) }}
69+
<input type="checkbox" name="null_purchase_date" value="1">
7070
{{ trans_choice('general.set_to_null', count($assets),['selection_count' => count($assets)]) }}
7171
</label>
7272
</div>
@@ -85,7 +85,7 @@
8585
</div>
8686
<div class="col-md-5">
8787
<label class="form-control">
88-
{{ Form::checkbox('null_expected_checkin_date', '1', false) }}
88+
<input type="checkbox" name="null_expected_checkin_date" value="1">
8989
{{ trans_choice('general.set_to_null', count($assets), ['selection_count' => count($assets)]) }}
9090
</label>
9191
</div>
@@ -103,7 +103,7 @@
103103
</div>
104104
<div class="col-md-5">
105105
<label class="form-control">
106-
{{ Form::checkbox('null_asset_eol_date', '1', false) }}
106+
<input type="checkbox" name="null_asset_eol_date" value="1">
107107
{{ trans_choice('general.set_to_null', count($assets),['selection_count' => count($assets)]) }}
108108
</label>
109109
</div>
@@ -112,7 +112,7 @@
112112
<div class="form-group">
113113
<div class="col-md-9 col-md-offset-3">
114114
<label class="form-control">
115-
{{ Form::checkbox('calc_eol', '1', false) }}
115+
<input type="checkbox" name="calc_eol" value="1">
116116
{{ trans('admin/hardware/form.calc_eol') }}
117117
</label>
118118
</div>
@@ -215,7 +215,7 @@
215215
</div>
216216
<div class="col-md-5">
217217
<label class="form-control">
218-
{{ Form::checkbox('null_next_audit_date', '1', false) }}
218+
<input type="checkbox" name="null_next_audit_date" value="1">
219219
{{ trans_choice('general.set_to_null', count($assets), ['selection_count' => count($assets)]) }}
220220
</label>
221221
</div>

0 commit comments

Comments
 (0)