Return input when linking a BBS, some consistent instantiation of <form>, more work on select2 transition
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
@use(App\Models\Echoarea)
|
||||
<!-- $o=Domain::class -->
|
||||
@use(App\Models\Echoarea)
|
||||
|
||||
@extends('layouts.app')
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<form class="needs-validation" method="post" novalidate>
|
||||
<form class="needs-validation" method="post" autocomplete="off" novalidate>
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
@@ -137,22 +137,12 @@
|
||||
</div>
|
||||
<div class="col-4">
|
||||
@if ($o->isManaged())
|
||||
<label for="nodestatus_id" class="form-label">Echoarea Node Status</label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-journal-text"></i></span>
|
||||
<select style="width: 80%;" class="form-select @error('nodestatus_id') is-invalid @enderror" id="nodestatus_id" name="nodestatus_id" @cannot('admin',$o)disabled @endcannot>
|
||||
<option value=""> </option>
|
||||
@foreach (Echoarea::active()->where('domain_id',$o->id)->orderBy('description')->cursor() as $oo)
|
||||
<option value="{{ $oo->id }}" @if(old('nodestatus_id',$o->nodestatus_id)==$oo->id)selected @endif>{{ $oo->description }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('nodestatus_id')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Add a <a href="{{ url('echoarea/addedit') }}">NEW Echoarea</a>. This echoarea is used to send node status messages.</span>
|
||||
</div>
|
||||
@php
|
||||
$helper = (! $o->nodestatus_id)
|
||||
? sprintf('Add a <a href="%s">NEW Echoarea</a>. This echoarea is used to send node status messages.',url('echoarea/addedit'))
|
||||
: sprintf('<a href="%s">Edit</a> Echoarea',url('echoarea/addedit',[$o->nodestatus_id]));
|
||||
@endphp
|
||||
<x-form.select name="nodestatus_id" icon="bi-journal-text" label="Echoarea Node Status" :helper="$helper" :value="$o->nodestatus_id" :options="Echoarea::select('id','description')->active()->where('domain_id',$o->id)->orderBy('description')->cursor()->map(fn($item)=>['id'=>$item->id,'value'=>$item->description])"/>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -195,21 +185,10 @@
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@section('page-css')
|
||||
@css('simplemde')
|
||||
@css('select2')
|
||||
@append
|
||||
@pa(simplemde)
|
||||
|
||||
@section('page-scripts')
|
||||
@js('simplemde')
|
||||
@js('select2')
|
||||
|
||||
@can('admin',$o)
|
||||
<script type="text/javascript">
|
||||
var simplemde = new SimpleMDE({ element: $("#homepage")[0] });
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#nodestatus_id').select2();
|
||||
});
|
||||
</script>
|
||||
@endcan
|
||||
<script type="text/javascript">
|
||||
var simplemde = new SimpleMDE({ element: $("#homepage")[0] });
|
||||
</script>
|
||||
@append
|
Reference in New Issue
Block a user