CSS updates, layout tweeks, domain editing/updating

This commit is contained in:
Deon George
2021-06-14 15:46:18 +10:00
parent dd648adf91
commit a3b4214040
12 changed files with 235 additions and 89 deletions

View File

@@ -4,55 +4,79 @@
@if($o->exists) Update @else Add @endif Domain
@endsection
@section('main-content')
<div class="pb-3">
<h2>@if($o->exists) Update @else Add @endif Domain</h2>
@section('content')
<div class="row">
<div class="col-6 m-auto">
<div class="greyframe titledbox shadow0xb0 text-center">
<h2 class="cap">@if($o->exists) Update @else Add @endif Domain</h2>
<form method="POST">
{{ csrf_field() }}
<form class="row g-0 needs-validation" method="post" novalidate>
@csrf
<div class="row">
<div class="col-9 m-auto">
<div class="bg-blue">
<div class="row m-3">
<label class="col-3" for="name">Name:</label>
<input class="col-9" type="text" name="name" value="{{ $o->name }}">
</div>
<div class="row m-3">
<label class="col-3" for="dnsdomain">DNS Domain:</label>
<input class="col-9" type="text" name="dnsdomain" value="{{ $o->dnsdomain }}">
</div>
<div class="row m-3">
<label class="col-3" for="active">Active:</label>
<div class="form-group col-3">
<div class="custom-control custom-radio mb-3">
<input type="radio" class="custom-control-input" name="active" id="active_yes" value="1" required @if($o->active)checked @endif>
<label class="custom-control-label" for="active_yes">Yes</label>
</div>
<div class="custom-control custom-radio mb-3">
<input type="radio" class="custom-control-input" name="active" id="active_no" value="0" required @if(! $o->active)checked @endif>
<label class="custom-control-label" for="active_no">No</label>
</div>
</div>
</div>
<div class="row m-3">
<label class="col-3" for="notes">Notes:</label>
<textarea class="col-9" rows=3 cols=68 name="notes" placeholder="Notes...">{{ $o->notes }}</textarea>
</div>
<div class="row m-3">
<div class="col-12">
<button type="submit" name="submit" class="btn btn-lg btn-success mr-0 float-right">@if ($o->exists)Save @else Add @endif</button>
<a href="{{ url('/') }}" class="btn btn-lg btn-primary float-right">Cancel</a>
<div class="row">
<div class="col-12">
<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 autocomplete="name" autofocus>
@error('name')
<span class="invalid-feedback" role="alert">
{{ $message }}
</span>
@else
<span class="invalid-feedback">
A name is required.
</span>
@enderror
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<label for="name" 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) }}">
@error('dnsdomain')
<span class="invalid-feedback" role="alert">
{{ $message }}
</span>
@enderror
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<label for="active" class="form-label">Active</label>
<div class="input-group has-validation">
<div class="btn-group" role="group">
<input type="radio" class="btn-check" name="active" id="active_yes" value="1" required @if($o->active)checked @endif>
<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 @if(! $o->active)checked @endif>
<label class="btn btn-outline-danger" for="active_no">No</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<label for="notes" class="form-label">Notes</label>
<textarea class="form-control" rows=3 cols=68 name="notes" placeholder="Notes...">{{ old('notes',$o->notes) }}</textarea>
</div>
</div>
<div class="row">
<div class="col-12">
<a href="{{ url('ftn/domain') }}" class="btn btn-danger">Cancel</a>
<button type="submit" name="submit" class="btn btn-success mr-0 float-end">@if ($o->exists)Save @else Add @endif</button>
</div>
</div>
</form>
</div>
</form>
</div>
</div>
@endsection

View File

@@ -1,45 +1,60 @@
@extends('layouts.app')
@section('main-content')
@section('content')
<div class="row">
<div class="col-12">
<h2>About the FTN Clearing House</h2>
<p>In FTN network addresses, a domain is the 5th dimension and used when a system supports 5D addressing, ie: zone:hub/host@<strong class="highlight">domain</strong>.</p>
<p>Domains are used with zones to uniquely identify a FTN network.</p>
<p><small>Some legacy Fidonet software is not 5D aware and may behave unexpectedly when a domain is used</small></p>
</div>
</div>
<div class="row">
<div class="col-6">
<table class="table table-bordered m-5">
<thead>
<tr>
<th>ID</th>
<th>Active</th>
<th>Domain</th>
<th>DNS domain</th>
</tr>
</thead>
<p>This system is aware of the following domains:</p>
<tbody>
<tr>
<td colspan="4"><a href="{{ url('ftn/domain/addedit') }}">Add New Domain</a></td>
</tr>
@foreach (\App\Models\Domain::cursor() as $oo)
@if (\App\Models\Domain::count() == 0)
<p>There are no domains setup, to <a href="{{ url('ftn/domain/addedit') }}">set up your first</a>.</p>
@else
<table class="table monotable">
<thead>
<tr>
<th>ID</th>
<th>Active</th>
<th>Domain</th>
<th>DNS domain</th>
<th>Zones</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="5"><a href="{{ url('ftn/domain/addedit') }}">Add New Domain</a></td>
</tr>
@foreach (\App\Models\Domain::cursor() as $oo)
<tr>
<td><a href="{{ url('ftn/domain/addedit',[$oo->id]) }}">{{ $oo->id }}</a></td>
<td>{{ $oo->active ? 'YES' : 'NO' }}</td>
<td>{{ $oo->name }}</td>
<td>{{ $oo->dnsdomain }}</td>
<td>{{ join(', ',$oo->zones->pluck('zone_id')->toArray()) }}</td>
</tr>
@endforeach
</tbody>
</table>
@endforeach
</tbody>
</table>
@endif
</div>
</div>
@endsection
@section('page-scripts')
<script type="text/javascript">
$(document).ready(function() {
$('table tr').click(function() {
var href = $(this).find("a").attr("href");
if(href) {
var href = $(this).find('a').attr('href');
if (href)
window.location = href;
}
});
});
</script>
@append