diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-07-02 15:30:30 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-07-02 15:30:30 -0400 |
commit | 9cf94eec5ae98f750f9babc0c37373df87e3981c (patch) | |
tree | 31ffe18ad835db2d786b406f76162766eabbbda9 /app/views | |
parent | 7971d7ac77c83717afcceaa1f476d1eb9afd5918 (diff) | |
download | thoughts-9cf94eec5ae98f750f9babc0c37373df87e3981c.tar.gz thoughts-9cf94eec5ae98f750f9babc0c37373df87e3981c.tar.bz2 thoughts-9cf94eec5ae98f750f9babc0c37373df87e3981c.zip |
Styled flash and errors in admin panel
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin/blogs/_form.html.haml | 10 | ||||
-rw-r--r-- | app/views/layouts/admin.html.haml | 19 |
2 files changed, 16 insertions, 13 deletions
diff --git a/app/views/admin/blogs/_form.html.haml b/app/views/admin/blogs/_form.html.haml index 55a297a..4a1c410 100644 --- a/app/views/admin/blogs/_form.html.haml +++ b/app/views/admin/blogs/_form.html.haml | |||
@@ -1,7 +1,3 @@ | |||
1 | - if f.object.errors.any? | ||
2 | %ul#errors | ||
3 | - f.object.errors.full_messages.each do |error| | ||
4 | %li= error | ||
5 | %fieldset#content | 1 | %fieldset#content |
6 | .title-field | 2 | .title-field |
7 | = f.label :title | 3 | = f.label :title |
@@ -13,6 +9,12 @@ | |||
13 | = f.label :body | 9 | = f.label :body |
14 | = f.cktext_area :body | 10 | = f.cktext_area :body |
15 | %fieldset#details | 11 | %fieldset#details |
12 | - if f.object.errors.any? | ||
13 | #errors.details-module | ||
14 | %h3 Error! | ||
15 | %ul | ||
16 | - f.object.errors.full_messages.each do |error| | ||
17 | %li= error | ||
16 | .details-module | 18 | .details-module |
17 | = f.fields_for :records, Record.new do |builder| | 19 | = f.fields_for :records, Record.new do |builder| |
18 | .should-create-record-field | 20 | .should-create-record-field |
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index a2c2d95..7f8c171 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml | |||
@@ -6,7 +6,16 @@ | |||
6 | = stylesheet_link_tag 'admin', media: 'all', 'data-turbolinks-track': 'reload' | 6 | = stylesheet_link_tag 'admin', media: 'all', 'data-turbolinks-track': 'reload' |
7 | = javascript_include_tag 'application', 'data-turbolinks-track': 'reload' | 7 | = javascript_include_tag 'application', 'data-turbolinks-track': 'reload' |
8 | %body | 8 | %body |
9 | #banner= link_to "Thoughts", root_url | 9 | #banner |
10 | = link_to "Thoughts", root_url | ||
11 | - if flash[:alert] | ||
12 | #flash.flash-alert | ||
13 | %span.flash-tag ERROR: | ||
14 | = flash.alert | ||
15 | - if flash[:notice] | ||
16 | #flash.flash-notice | ||
17 | %span.flash-tag NOTICE: | ||
18 | = flash.notice | ||
10 | #container | 19 | #container |
11 | %ul#sidebar | 20 | %ul#sidebar |
12 | %li{major_sidebar_attrs("dashboard")} | 21 | %li{major_sidebar_attrs("dashboard")} |
@@ -16,12 +25,4 @@ | |||
16 | %ul.minors | 25 | %ul.minors |
17 | %li.minor= link_to "New blog", new_admin_blog_url | 26 | %li.minor= link_to "New blog", new_admin_blog_url |
18 | #main | 27 | #main |
19 | - if flash[:alert] | ||
20 | #flash.flash-alert | ||
21 | %span.flash-tag ERROR: | ||
22 | = flash.alert | ||
23 | - if flash[:notice] | ||
24 | #flash.flash-notice | ||
25 | %span.flash-tag NOTICE: | ||
26 | = flash.notice | ||
27 | = yield | 28 | = yield |