From 75ca0aba0f985c646e01dff902849bcbde1600d6 Mon Sep 17 00:00:00 2001 From: ngoomie Date: Sat, 24 Aug 2024 01:06:51 -0600 Subject: [PATCH] Push error flash code into _err_msg.html.ep --- lib/CharmBoard/Controller/Index.pm | 4 +++- lib/CharmBoard/Controller/ViewSubf.pm | 4 +++- templates/items/_err_msg.html.ep | 6 ++++++ templates/layouts/default.html.ep | 1 + templates/login.html.ep | 6 ------ templates/register.html.ep | 6 ------ templates/thread_compose.html.ep | 3 ++- 7 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 templates/items/_err_msg.html.ep diff --git a/lib/CharmBoard/Controller/Index.pm b/lib/CharmBoard/Controller/Index.pm index 44d803d..a3ce69c 100644 --- a/lib/CharmBoard/Controller/Index.pm +++ b/lib/CharmBoard/Controller/Index.pm @@ -19,7 +19,9 @@ sub index { $c->render( template => 'index', - category_tree => $c->model('forums')->list_full + category_tree => $c->model('forums')->list_full, + error => $c->flash('error'), + message => $c->flash('message') ) } diff --git a/lib/CharmBoard/Controller/ViewSubf.pm b/lib/CharmBoard/Controller/ViewSubf.pm index f7953b0..b6d1494 100644 --- a/lib/CharmBoard/Controller/ViewSubf.pm +++ b/lib/CharmBoard/Controller/ViewSubf.pm @@ -27,7 +27,9 @@ sub subf_view { cat_title => $cat_title, subf_title => $c->schema->resultset('Subforums')->title_from_id($subf_id), - thread_list => \@thread_list + thread_list => \@thread_list, + error => $c->flash('error'), + message => $c->flash('message') ) } diff --git a/templates/items/_err_msg.html.ep b/templates/items/_err_msg.html.ep new file mode 100644 index 0000000..0c32789 --- /dev/null +++ b/templates/items/_err_msg.html.ep @@ -0,0 +1,6 @@ +% if ($error) { +

<%= $error %>

+%}; +% if ($message) { +

<%= $message %>

+%}; \ No newline at end of file diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index e75ed15..b140d23 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -6,6 +6,7 @@ %= include 'layouts/default/_header' + %= include 'items/_err_msg' <%= content %> %= include 'layouts/default/_footer' diff --git a/templates/login.html.ep b/templates/login.html.ep index 61c2fea..3e1ffbc 100644 --- a/templates/login.html.ep +++ b/templates/login.html.ep @@ -1,11 +1,5 @@ % layout 'default', % title => $c->board_name . ' - Login'; -% if ($error) { -

<%= $error %>

-%}; -% if ($message) { -

<%= $message %>

-%};
username: $c->board_name . ' - Registration'; -% if ($error) { -

<%= $error %>

-%}; -% if ($message) { -

<%= $message %>

-%};

fields marked with * are required

username: + placeholder="post content" + >

\ No newline at end of file