Skip to content

Commit 4755fe0

Browse files
committed
fixing Eula text box
1 parent 9e3e045 commit 4755fe0

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

app/Livewire/CategoryEditForm.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ public function updated($property, $value)
4141
$this->sendCheckInEmail = $this->eulaText || $this->useDefaultEula ? 1 : $this->originalSendCheckInEmailValue;
4242
}
4343

44+
public function shouldUncheckDefaultEulaBox()
45+
{
46+
if($this->eulaText!='' && $this->defaultEulaText=='') {
47+
return $this->useDefaultEula = false;
48+
}
49+
}
50+
4451
public function getShouldDisplayEmailMessageProperty(): bool
4552
{
4653
return $this->eulaText || $this->useDefaultEula;

resources/views/livewire/category-edit-form.blade.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,11 @@
77
name="eula_text"
88
wire:model.live="eulaText"
99
aria-label="eula_text"
10-
:disabled="$this->eulaTextDisabled"
1110
/>
1211
<p class="help-block">{!! trans('admin/categories/general.eula_text_help') !!} </p>
1312
<p class="help-block">{!! trans('admin/settings/general.eula_markdown') !!} </p>
1413
{!! $errors->first('eula_text', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
1514
</div>
16-
@if ($this->eulaTextDisabled)
17-
<input type="hidden" name="eula_text" wire:model.live="eulaText" />
18-
@endif
1915
</div>
2016

2117
<!-- Use default checkbox -->
@@ -32,6 +28,18 @@
3228
/>
3329
<span>{!! trans('admin/categories/general.use_default_eula') !!}</span>
3430
</label>
31+
@elseif ($eulaText!='')
32+
<label class="form-control form-control--disabled">
33+
34+
<input
35+
type="checkbox"
36+
name="use_default_eula"
37+
value="0"
38+
wire:model.live="shouldUncheckDefaultEulaBox"
39+
aria-label="use_default_eula"
40+
/>
41+
<span>{!! trans('admin/categories/general.use_default_eula_disabled') !!}</span>
42+
</label>
3543
@else
3644
<label class="form-control form-control--disabled">
3745
<input

0 commit comments

Comments
 (0)