From d0484b25f3a0de967a98261e8327a4420110db16 Mon Sep 17 00:00:00 2001 From: Blog Manager Robot Date: Tue, 25 Oct 2022 20:05:51 +0000 Subject: [PATCH] Add blog build page, central nav. --- Web/lib/MJB/Web.pm | 1 + Web/lib/MJB/Web/Controller/Dashboard.pm | 14 ++ Web/templates/dashboard/_blog_nav.html.ep | 30 +++ Web/templates/dashboard/blog.html.ep | 17 +- Web/templates/dashboard/blog_builds.html.ep | 205 ++++++++++++++++++ Web/templates/dashboard/blog_post.html.ep | 21 +- .../dashboard/blog_post_create.html.ep | 21 +- Web/templates/dashboard/blog_posts.html.ep | 17 +- Web/templates/dashboard/blog_settings.html.ep | 17 +- 9 files changed, 255 insertions(+), 88 deletions(-) create mode 100644 Web/templates/dashboard/blog_builds.html.ep diff --git a/Web/lib/MJB/Web.pm b/Web/lib/MJB/Web.pm index 758d195..fb6b803 100644 --- a/Web/lib/MJB/Web.pm +++ b/Web/lib/MJB/Web.pm @@ -125,6 +125,7 @@ sub startup ($self) { $auth->post( '/dashboard/blog/:id/settings' )->to('Dashboard#do_blog_settings' )->name('do_dashboard_blog_settings' ); $auth->get ( '/dashboard/blog/:id/config' )->to('Dashboard#blog_config' )->name('show_dashboard_blog_config' ); $auth->post( '/dashboard/blog/:id/config' )->to('Dashboard#do_blog_config' )->name('do_dashboard_blog_config' ); + $auth->get ( '/dashboard/blog/:id/builds' )->to('Dashboard#blog_builds' )->name('show_dashboard_blog_builds' ); # Blog Management $auth->get ( '/blog' )->to('Blog#create' )->name('show_blog_create' ); diff --git a/Web/lib/MJB/Web/Controller/Dashboard.pm b/Web/lib/MJB/Web/Controller/Dashboard.pm index 3395791..b09505b 100644 --- a/Web/lib/MJB/Web/Controller/Dashboard.pm +++ b/Web/lib/MJB/Web/Controller/Dashboard.pm @@ -245,6 +245,20 @@ sub do_blog_config ( $c ) { $c->redirect_to( $c->url_for( 'show_dashboard_blog_config', { id => $blog->id } ) ); } +sub blog_builds ( $c ) { + my $blog = $c->stash->{blog} = $c->db->blog( $c->param('id') ); + + if ( $blog->person->id ne $c->stash->{person}->id ) { + $c->render( + text => "Error: This blog isn't owned by you.", + status => 404, + format => 'txt', + ); + return; + } + +} + 1; diff --git a/Web/templates/dashboard/_blog_nav.html.ep b/Web/templates/dashboard/_blog_nav.html.ep index 4b92e34..6e986c9 100644 --- a/Web/templates/dashboard/_blog_nav.html.ep +++ b/Web/templates/dashboard/_blog_nav.html.ep @@ -17,3 +17,33 @@ + + diff --git a/Web/templates/dashboard/blog.html.ep b/Web/templates/dashboard/blog.html.ep index 670e5ac..ad805ba 100644 --- a/Web/templates/dashboard/blog.html.ep +++ b/Web/templates/dashboard/blog.html.ep @@ -1,21 +1,6 @@ % layout 'standard', title => 'Dashboard', sb_active => 'dashboard'; -%= include 'dashboard/_blog_nav' - - +%= include 'dashboard/_blog_nav', page => 'info' % if ( my $confirmation = flash 'confirmation' ) {