From cb6aa9f724a45a2fc366e183a84500b9944dd21f Mon Sep 17 00:00:00 2001 From: Citlali del Rey Date: Sat, 6 Jan 2024 15:43:54 -0800 Subject: [PATCH] Add new page --- lib/unix_dog.pm | 5 +- lib/unix_dog/Controller/Main.pm | 5 -- lib/unix_dog/Controller/Services.pm | 16 ++++ templates/services/bridges.html.ep | 75 +++++++++++++++++++ .../index.html.ep} | 0 5 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 lib/unix_dog/Controller/Services.pm create mode 100644 templates/services/bridges.html.ep rename templates/{main/services.html.ep => services/index.html.ep} (100%) diff --git a/lib/unix_dog.pm b/lib/unix_dog.pm index 5cf4e35..8b11ccc 100644 --- a/lib/unix_dog.pm +++ b/lib/unix_dog.pm @@ -25,7 +25,10 @@ sub startup ($self) { $r->get('/')->to('Main#index'); $r->get('/index.html')->to('Main#index'); $r->get('/rules')->to('Main#rules'); - $r->get('/services')->to('Main#services'); + + my $svc = $r->any('/services')->to(controller => 'Services'); + $svc->get('/')->to(action => 'index'); + $svc->get('/bridges')->to(action => 'bridges'); $r->get('/register')->to('Register#registration'); $r->post('/register')->to('Register#register'); diff --git a/lib/unix_dog/Controller/Main.pm b/lib/unix_dog/Controller/Main.pm index 3da54a7..bd2a77b 100644 --- a/lib/unix_dog/Controller/Main.pm +++ b/lib/unix_dog/Controller/Main.pm @@ -19,11 +19,6 @@ sub rules ($self) { $self->render(); } -sub services ($self) { - $self->render(); -} - - my $cache = Mojo::Cache->new(max_keys => 1); $cache->set(users => []); Mojo::IOLoop->recurring(60 => sub { diff --git a/lib/unix_dog/Controller/Services.pm b/lib/unix_dog/Controller/Services.pm new file mode 100644 index 0000000..1f33925 --- /dev/null +++ b/lib/unix_dog/Controller/Services.pm @@ -0,0 +1,16 @@ +package unix_dog::Controller::Services; +use strict; +use warnings FATAL => 'all'; +use experimental 'signatures'; + +use Mojo::Base 'Mojolicious::Controller', -signatures; + +sub index($c) { + $c->render(); +} + +sub bridges($c) { + $c->render(); +} + +1; diff --git a/templates/services/bridges.html.ep b/templates/services/bridges.html.ep new file mode 100644 index 0000000..ede4ece --- /dev/null +++ b/templates/services/bridges.html.ep @@ -0,0 +1,75 @@ +% title 'UNIX.dog Services'; +% layout 'default'; +
+

XMPP and Matrix Bridge Helper

+

+

+ +
+
+ + +
+
+ + +
+
+ +
+
+
+ diff --git a/templates/main/services.html.ep b/templates/services/index.html.ep similarity index 100% rename from templates/main/services.html.ep rename to templates/services/index.html.ep