mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
adds one input
This commit is contained in:
parent
0f8ee22053
commit
2e22eeade5
|
@ -11,6 +11,11 @@ class SlackSettingsForm extends Component
|
|||
{
|
||||
public Setting $setting;
|
||||
|
||||
protected $rules = [
|
||||
'setting.slack_endpoint' => 'url|required_with:slack_channel|starts_with:https://hooks.slack.com/|nullable',
|
||||
'setting.slack_channel' => 'required_with:slack_endpoint|starts_with:#|nullable',
|
||||
'setting.slack_botname' => 'string|nullable',
|
||||
];
|
||||
|
||||
|
||||
public function render()
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
<div>
|
||||
{{-- In work, do what you enjoy. --}}
|
||||
<form wire:submit.prevent="save">
|
||||
<div class="form-group required {{ $errors->has('slack_endpoint') ? 'error' : '' }}">
|
||||
<div class="col-md-2">
|
||||
{{ Form::label('slack_endpoint', trans('admin/settings/general.slack_endpoint')) }}
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
@if (config('app.lock_passwords')===true)
|
||||
{{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}}
|
||||
<p class="text-warning"><i class="fas fa-lock"></i> {{ trans('general.feature_disabled') }}</p>
|
||||
<input type="text" wire:model.lazy="setting.slack_endpoint" id="slack_endpoint" class= 'form-control' placeholder="'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX'" {{old('slack_endpoint', $setting->slack_endpoint)}} >
|
||||
@else
|
||||
<input type="text" wire:model.lazy="setting.slack_endpoint" id="slack_endpoint" class= 'form-control' placeholder="'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX'" {{old('slack_endpoint', $setting->slack_endpoint)}} >
|
||||
{{-- {{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}--}}
|
||||
@endif
|
||||
{!! $errors->first('slack_endpoint', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -50,22 +50,7 @@
|
|||
<div class="col-md-12" style="border-top: 0px;">
|
||||
|
||||
|
||||
<!-- slack endpoint -->
|
||||
<div class="form-group required {{ $errors->has('slack_endpoint') ? 'error' : '' }}">
|
||||
<div class="col-md-2">
|
||||
{{ Form::label('slack_endpoint', trans('admin/settings/general.slack_endpoint')) }}
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
@if (config('app.lock_passwords')===true)
|
||||
{{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}
|
||||
<p class="text-warning"><i class="fas fa-lock"></i> {{ trans('general.feature_disabled') }}</p>
|
||||
|
||||
@else
|
||||
{{ Form::text('slack_endpoint', old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX', 'id' => 'slack_endpoint')) }}
|
||||
@endif
|
||||
{!! $errors->first('slack_endpoint', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
@livewire('slack-settings-form', ['setting' => $setting])
|
||||
|
||||
<!-- slack channel -->
|
||||
<div class="form-group required {{ $errors->has('slack_channel') ? 'error' : '' }}">
|
||||
|
|
Loading…
Reference in a new issue