From a3b4214040e4710c50507e9c60f63062aa71c2e2 Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 14 Jun 2021 15:46:18 +1000 Subject: [PATCH] CSS updates, layout tweeks, domain editing/updating --- app/Http/Controllers/DomainController.php | 9 +- app/Models/Domain.php | 7 ++ public/oldschool/css/main.css | 106 ++++++++++++++++- resources/views/about.blade.php | 2 +- resources/views/auth/login.blade.php | 6 +- .../views/auth/passwords/email.blade.php | 4 +- .../views/auth/passwords/reset.blade.php | 5 +- resources/views/auth/register.blade.php | 8 +- resources/views/domain/addedit.blade.php | 112 +++++++++++------- resources/views/domain/home.blade.php | 61 ++++++---- resources/views/home.blade.php | 2 +- resources/views/layouts/app.blade.php | 2 +- 12 files changed, 235 insertions(+), 89 deletions(-) diff --git a/app/Http/Controllers/DomainController.php b/app/Http/Controllers/DomainController.php index 3ca77f7..886c772 100644 --- a/app/Http/Controllers/DomainController.php +++ b/app/Http/Controllers/DomainController.php @@ -19,12 +19,15 @@ class DomainController extends Controller public function add_edit(Request $request,Domain $o) { if ($request->post()) { - // @todo Add validation that we can only have 1 "default" domain for a zone. - // The default domain is used when a node connects and doesnt use a full 5D address, eg: 10:999/1 vs 10:999/1@private + $request->validate([ + 'name' => 'required|unique:domains|max:8', + 'dnsdomain' => 'nullable|unique:domains|regex:/^(?!:\/\/)(?=.{1,255}$)((.{1,63}\.){1,127}(?![0-9]*$)[a-z0-9-]+\.?)$/i', + 'active' => 'required', + ]); + foreach (['name','dnsdomain','active','notes'] as $key) $o->{$key} = $request->post($key); - $o->active = TRUE; $o->save(); return redirect()->action([self::class,'home']); diff --git a/app/Models/Domain.php b/app/Models/Domain.php index b3a8371..f5bbfe6 100644 --- a/app/Models/Domain.php +++ b/app/Models/Domain.php @@ -9,4 +9,11 @@ use App\Traits\ScopeActive; class Domain extends Model { use ScopeActive; + + /* RELATIONS */ + + public function zones() + { + return $this->hasMany(Zone::class); + } } \ No newline at end of file diff --git a/public/oldschool/css/main.css b/public/oldschool/css/main.css index bebbc02..5363d12 100644 --- a/public/oldschool/css/main.css +++ b/public/oldschool/css/main.css @@ -46,8 +46,8 @@ a:link { text-transform:uppercase } -div p:last-child { - margin-bottom:0 +strong.highlight { + color: #eee; } body { @@ -88,7 +88,6 @@ sup:after { z-index: 4; box-sizing: content-box } - #nav-menu { color:#aaa; padding:0; @@ -273,7 +272,7 @@ ul#navlist-desktop { margin:24px auto 40px auto; box-shadow:8px 9px 0 0 #333 } -#content>h2:first-child { +#content h2:first-child { margin-top:8px } #content h3, @@ -299,6 +298,13 @@ ul#navlist-desktop { color:#c60; } +#content>div.row:first-child { + padding-top: 0px; +} +#content>div.row { + padding-top: 20px; +} + #content ul { margin:0 1ch; padding-left:1ch; @@ -402,6 +408,10 @@ form div.row { .greyframe h2.cap+p { margin-top:1em } +.greyframe>div.row:last-child, +.greyframe>form>div.row:last-child { + padding-bottom: 15px; +} label.form-label { font-size: 75%; @@ -414,6 +424,22 @@ p { text-align:left; word-break:break-word } +p>small { + color: #bbb; +} +p>small:before { + content: '['; +} +p>small:after { + content: ']'; +} +p>small:before, +p>small:after { + color: #eee; +} +div p:last-child { + margin-bottom:0 +} .pad { padding:1em 1.5ch; @@ -450,6 +476,78 @@ p { transition:all .1s ease-in-out } +table { + border-collapse:collapse; + color:#fff; +} +th { + font-weight:400 +} +td { + padding:0 4px +} +thead { + background-color:#222; + border-top:1px solid #555; + border-bottom:3px double #555; + border-left:2px solid #555; + border-right:2px solid #555 +} +tbody { + border-left:2px solid #555; + border-right:2px solid #555; + border-bottom:1px solid #555 +} +.monotable { + background-color:#1e1e1e; + margin-top:.5em; + margin-bottom:1.5em; + text-indent:0 +} +.monotable.sbm { + margin-bottom:.5em +} +.monotable thead { + border-top:1px solid #666; + border-left:2px solid #666; + border-right:2px solid #666; + border-bottom:0; + color:#fff; + background-color:#000 +} +.monotable th { + padding:.5em 1.5ch .4em; + border-right:2px solid #666 +} +.monotable tbody { + border-top:3px double #666; + border-left:2px solid #666; + border-right:2px solid #666; + border-bottom:1px solid #666; + color: #eee; +} +.monotable tbody td { + padding-left:1.5ch!important; + padding-right:1.5ch!important; + vertical-align:middle!important +} +.monotable tbody tr:first-child td { + padding-top:9px!important +} +.monotable tbody tr:last-child td { + padding-bottom:7px!important +} +.monotable tr td:not(:last-child) { + border-right:2px solid #666 +} +.monotable.cozy { + text-align:left +} +.monotable.cozy td { + padding-top:8px!important; + padding-bottom:7px!important; + border-bottom:1px solid #666 +} .text-center { text-align:center; diff --git a/resources/views/about.blade.php b/resources/views/about.blade.php index 3fd0434..6821138 100644 --- a/resources/views/about.blade.php +++ b/resources/views/about.blade.php @@ -1,6 +1,6 @@ @extends('layouts.app') -@section('main-content') +@section('content')

About the FTN Clearing House

Welcome to the FTN Clearing House.

diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 8b48b6d..52f221c 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -26,7 +26,7 @@

Login

- {{ csrf_field() }} + @csrf
@@ -74,13 +74,13 @@
-
+ -
+
diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php index 7774da7..b3cbfbd 100644 --- a/resources/views/auth/passwords/email.blade.php +++ b/resources/views/auth/passwords/email.blade.php @@ -28,7 +28,7 @@
- + @error('email') {{ $message }} @@ -49,7 +49,7 @@
-
+
diff --git a/resources/views/auth/passwords/reset.blade.php b/resources/views/auth/passwords/reset.blade.php index 7ada010..eaffe8c 100644 --- a/resources/views/auth/passwords/reset.blade.php +++ b/resources/views/auth/passwords/reset.blade.php @@ -29,7 +29,7 @@
- + @error('email') {{ $message }} @@ -75,14 +75,13 @@
-
+
Cancel
-
diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index ed9e4d9..d977657 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -11,14 +11,14 @@

Register

- {{ csrf_field() }} + @csrf
- + @error('name') {{ $message }} @@ -37,7 +37,7 @@
- + @error('email') {{ $message }} @@ -91,7 +91,7 @@
-
+
diff --git a/resources/views/domain/addedit.blade.php b/resources/views/domain/addedit.blade.php index b5335a1..94dadfe 100644 --- a/resources/views/domain/addedit.blade.php +++ b/resources/views/domain/addedit.blade.php @@ -4,55 +4,79 @@ @if($o->exists) Update @else Add @endif Domain @endsection -@section('main-content') -
-

@if($o->exists) Update @else Add @endif Domain

+@section('content') +
+
+
+

@if($o->exists) Update @else Add @endif Domain

-
- {{ csrf_field() }} + + @csrf -
-
-
-
- - -
- -
- - -
- -
- -
-
- active)checked @endif> - -
- -
- active)checked @endif> - -
-
-
- -
- - -
- -
-
- - Cancel +
+
+ +
+ + + @error('name') + + {{ $message }} + + @else + + A name is required. + + @enderror
-
+ +
+
+ +
+ + + @error('dnsdomain') + + {{ $message }} + + @enderror +
+
+
+ +
+
+ +
+
+ active)checked @endif> + + + active)checked @endif> + +
+
+
+
+ +
+
+ + +
+
+ +
+
+ Cancel + +
+
+
- +
@endsection diff --git a/resources/views/domain/home.blade.php b/resources/views/domain/home.blade.php index 826feed..01c5aec 100644 --- a/resources/views/domain/home.blade.php +++ b/resources/views/domain/home.blade.php @@ -1,45 +1,60 @@ @extends('layouts.app') -@section('main-content') +@section('content') +
+
+

About the FTN Clearing House

+

In FTN network addresses, a domain is the 5th dimension and used when a system supports 5D addressing, ie: zone:hub/host@domain.

+

Domains are used with zones to uniquely identify a FTN network.

+

Some legacy Fidonet software is not 5D aware and may behave unexpectedly when a domain is used

+
+
+
- - - - - - - - - +

This system is aware of the following domains:

- - - - - @foreach (\App\Models\Domain::cursor() as $oo) + @if (\App\Models\Domain::count() == 0) +

There are no domains setup, to set up your first.

+ @else +
IDActiveDomainDNS domain
Add New Domain
+ + + + + + + + + + + + + + + @foreach (\App\Models\Domain::cursor() as $oo) + - @endforeach - -
IDActiveDomainDNS domainZones
Add New Domain
{{ $oo->id }} {{ $oo->active ? 'YES' : 'NO' }} {{ $oo->name }} {{ $oo->dnsdomain }}{{ join(', ',$oo->zones->pluck('zone_id')->toArray()) }}
+ @endforeach + + + @endif
@endsection @section('page-scripts') @append diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 1b39956..8794043 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -1,4 +1,4 @@ @extends('layouts.app') -@section('main-content') +@section('content') @endsection \ No newline at end of file diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index a403e8d..ca43641 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -10,7 +10,7 @@
- @yield('main-content') + @yield('content')