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