clrghouz/resources/views/domain/addedit.blade.php

151 lines
5.7 KiB
PHP
Raw Normal View History

2021-05-13 12:40:21 +00:00
@extends('layouts.app')
@section('htmlheader_title')
@if($o->exists) Update @else Add @endif Domain
@endsection
@section('content')
2021-06-14 11:33:18 +00:00
<form class="row g-0 needs-validation" method="post" novalidate>
@csrf
2021-06-14 11:33:18 +00:00
<div class="row">
<div class="col-12">
<div class="greyframe titledbox shadow0xb0">
<h2 class="cap">@if($o->exists) Update @else Add @endif Domain</h2>
<div class="row">
2021-06-14 11:33:18 +00:00
<div class="col-4">
<label for="name" class="form-label">Name</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-tag-fill"></i></span>
<input type="text" class="form-control @error('name') is-invalid @enderror" id="name" placeholder="Name" name="name" value="{{ old('name',$o->name) }}" required @cannot('admin',$o)disabled @endcannot autofocus>
<span class="invalid-feedback" role="alert">
@error('name')
{{ $message }}
@else
A name is required.
@enderror
</span>
</div>
2021-05-13 12:40:21 +00:00
</div>
2021-06-14 11:33:18 +00:00
<div class="col-4">
<label for="active" class="form-label">Active</label>
<div class="input-group">
2021-06-14 11:33:18 +00:00
<div class="btn-group" role="group">
<input type="radio" class="btn-check" name="active" id="active_yes" value="1" required @cannot('admin',$o)disabled @endcannot @if(old('active',$o->active))checked @endif>
2021-06-14 11:33:18 +00:00
<label class="btn btn-outline-success" for="active_yes">Yes</label>
<input type="radio" class="btn-check btn-danger" name="active" id="active_no" value="0" required @cannot('admin',$o)disabled @endcannot @if(! old('active',$o->active))checked @endif>
2021-06-14 11:33:18 +00:00
<label class="btn btn-outline-danger" for="active_no">No</label>
</div>
</div>
</div>
<div class="col-4">
2022-11-25 10:44:03 +00:00
@if ($o->managed())
@if ($o->nodelist_filename)
<label for="nodelist_filename" class="form-label">Nodelist Filearea</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi bi-file-earmark-break-fill"></i></span>
<input type="text" class="form-control" id="nodelist_filename" placeholder="Nodelist" name="nodelist_filename" value="{{ $o->nodelist_filename }}" readonly>
</div>
@else
No Nodelist filearea
@endif
@else
2022-11-25 10:44:03 +00:00
This domain is not configured here.
@endif
</div>
</div>
2021-05-13 12:40:21 +00:00
<div class="row">
2021-06-14 11:33:18 +00:00
<div class="col-4">
<label for="dnsdomain" class="form-label">DNS Domain</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-globe"></i></span>
<input type="text" class="form-control @error('dnsdomain') is-invalid @enderror" id="dnsdomain" placeholder="DNS Domain (if applicable)" name="dnsdomain" value="{{ old('dnsdomain',$o->dnsdomain) }}" @cannot('admin',$o)disabled @endcannot>
<span class="invalid-feedback" role="alert">
@error('dnsdomain')
{{ $message }}
@enderror
</span>
</div>
2021-05-13 12:40:21 +00:00
</div>
2021-06-14 11:33:18 +00:00
<div class="col-4">
<label for="public" class="form-label">Public</label>
<div class="input-group">
<div class="btn-group" role="group">
<input type="radio" class="btn-check" name="public" id="public_yes" value="1" required @cannot('admin',$o)disabled @endcannot @if(old('public',$o->public))checked @endif>
2021-06-14 11:33:18 +00:00
<label class="btn btn-outline-success" for="public_yes">Yes</label>
2021-05-13 12:40:21 +00:00
<input type="radio" class="btn-check btn-danger" name="public" id="public_no" value="0" required @cannot('admin',$o)disabled @endcannot @if(! old('public',$o->public))checked @endif>
2021-06-14 11:33:18 +00:00
<label class="btn btn-outline-danger" for="public_no">No</label>
2021-05-13 12:40:21 +00:00
</div>
</div>
</div>
@if ($o->nodelist_filename)
<div class="col-4">
<label for="name" class="form-label">Nodelist File Area</label>
<a href="{{ url('ftn/filearea/addedit',$o->nodelist_filearea_id) }}">
<div class="input-group">
<span class="input-group-text"><i class="bi bi bi-collection-fill"></i></span>
<input type="text" class="form-control @error('nodelist') is-invalid @enderror" id="nodelist" placeholder="Nodelist" name="nodelist" value="{{ $o->nodelist_filearea->name }}" readonly>
</div>
</a>
</div>
@endif
</div>
2021-05-13 12:40:21 +00:00
<div class="row">
<div class="col-12">
<label for="notes" class="form-label">Notes</label>
<textarea class="form-control" rows=3 name="notes" placeholder="Notes..." @cannot('admin',$o)disabled @endcannot>{{ old('notes',$o->notes) }}</textarea>
2021-05-13 12:40:21 +00:00
</div>
</div>
2021-06-14 11:33:18 +00:00
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="greyframe titledbox shadow0xb0">
<h2 class="cap">Home Page</h2>
2021-05-13 12:40:21 +00:00
<div class="row">
<div class="col-12">
2021-06-14 11:33:18 +00:00
<label for="homepage" class="form-label">Home Page Text</label>
<div style="background-color: #fff;color: #000;">
<textarea class="form-control" rows=5 id="homepage" name="homepage" placeholder="Home Page..." @cannot('admin',$o)disabled @endcannot>{{ old('homepage',$o->homepage) }}</textarea>
2021-06-14 11:33:18 +00:00
</div>
2021-05-13 12:40:21 +00:00
</div>
</div>
2021-06-14 11:33:18 +00:00
</div>
<div class="row">
<div class="col-12">
<a href="{{ url('ftn/domain') }}" class="btn btn-danger">Cancel</a>
@can('admin',$o)
<button type="submit" name="submit" class="btn btn-success float-end">@if ($o->exists)Save @else Add @endif</button>
@endcan
2021-06-14 11:33:18 +00:00
</div>
</div>
2021-05-13 12:40:21 +00:00
</div>
</div>
2021-06-14 11:33:18 +00:00
</form>
2021-05-13 12:40:21 +00:00
@endsection
2021-06-14 11:33:18 +00:00
2021-11-13 06:00:08 +00:00
@section('page-css')
@css('simplemde')
@append
2021-06-14 11:33:18 +00:00
@section('page-scripts')
2021-11-13 06:00:08 +00:00
@js('simplemde')
2021-06-14 11:33:18 +00:00
2021-11-13 06:00:08 +00:00
@can('admin',$o)
<script type="text/javascript">
var simplemde = new SimpleMDE({ element: $("#homepage")[0] });
</script>
@endcan
2021-06-14 11:33:18 +00:00
@append