mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Implement toggling message when email will be sent
This commit is contained in:
parent
6349d52803
commit
105c94aea9
|
@ -6,8 +6,6 @@ use Livewire\Component;
|
|||
|
||||
class CategoryEditForm extends Component
|
||||
{
|
||||
// public bool $displayEmailMessage = false;
|
||||
|
||||
public bool $checkinEmail;
|
||||
|
||||
public $defaultEulaText;
|
||||
|
@ -33,14 +31,17 @@ class CategoryEditForm extends Component
|
|||
return view('livewire.category-edit-form');
|
||||
}
|
||||
|
||||
public function getDisplayEmailMessageProperty(): bool
|
||||
public function getShouldDisplayEmailMessageProperty(): bool
|
||||
{
|
||||
return false;
|
||||
return $this->eulaText || $this->useDefaultEula;
|
||||
}
|
||||
|
||||
public function getEmailMessageProperty(): string
|
||||
{
|
||||
// @todo:
|
||||
return '';
|
||||
if ($this->useDefaultEula) {
|
||||
return trans('admin/categories/general.email_will_be_sent_due_to_global_eula');
|
||||
}
|
||||
|
||||
return trans('admin/categories/general.email_will_be_sent_due_to_category_eula');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
{{ Form::checkbox('checkin_email', '1', null, ['wire:model' => 'checkinEmail', 'aria-label'=>'checkin_email']) }}
|
||||
{{ trans('admin/categories/general.checkin_email') }}
|
||||
</label>
|
||||
@if ($this->displayEmailMessage)
|
||||
@if ($this->shouldDisplayEmailMessage)
|
||||
<div class="callout callout-info">
|
||||
<i class="far fa-envelope"></i>
|
||||
<span>{{ $this->emailMessage }}</span>
|
||||
|
|
Loading…
Reference in a new issue