mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -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
|
class CategoryEditForm extends Component
|
||||||
{
|
{
|
||||||
// public bool $displayEmailMessage = false;
|
|
||||||
|
|
||||||
public bool $checkinEmail;
|
public bool $checkinEmail;
|
||||||
|
|
||||||
public $defaultEulaText;
|
public $defaultEulaText;
|
||||||
|
@ -33,14 +31,17 @@ class CategoryEditForm extends Component
|
||||||
return view('livewire.category-edit-form');
|
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
|
public function getEmailMessageProperty(): string
|
||||||
{
|
{
|
||||||
// @todo:
|
if ($this->useDefaultEula) {
|
||||||
return '';
|
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']) }}
|
{{ Form::checkbox('checkin_email', '1', null, ['wire:model' => 'checkinEmail', 'aria-label'=>'checkin_email']) }}
|
||||||
{{ trans('admin/categories/general.checkin_email') }}
|
{{ trans('admin/categories/general.checkin_email') }}
|
||||||
</label>
|
</label>
|
||||||
@if ($this->displayEmailMessage)
|
@if ($this->shouldDisplayEmailMessage)
|
||||||
<div class="callout callout-info">
|
<div class="callout callout-info">
|
||||||
<i class="far fa-envelope"></i>
|
<i class="far fa-envelope"></i>
|
||||||
<span>{{ $this->emailMessage }}</span>
|
<span>{{ $this->emailMessage }}</span>
|
||||||
|
|
Loading…
Reference in a new issue