From 9cf94eec5ae98f750f9babc0c37373df87e3981c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 2 Jul 2017 15:30:30 -0400 Subject: Styled flash and errors in admin panel --- app/views/admin/blogs/_form.html.haml | 10 ++++++---- app/views/layouts/admin.html.haml | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) (limited to 'app/views') 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 @@ -- if f.object.errors.any? - %ul#errors - - f.object.errors.full_messages.each do |error| - %li= error %fieldset#content .title-field = f.label :title @@ -13,6 +9,12 @@ = f.label :body = f.cktext_area :body %fieldset#details + - if f.object.errors.any? + #errors.details-module + %h3 Error! + %ul + - f.object.errors.full_messages.each do |error| + %li= error .details-module = f.fields_for :records, Record.new do |builder| .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 @@ = stylesheet_link_tag 'admin', media: 'all', 'data-turbolinks-track': 'reload' = javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %body - #banner= link_to "Thoughts", root_url + #banner + = link_to "Thoughts", root_url + - if flash[:alert] + #flash.flash-alert + %span.flash-tag ERROR: + = flash.alert + - if flash[:notice] + #flash.flash-notice + %span.flash-tag NOTICE: + = flash.notice #container %ul#sidebar %li{major_sidebar_attrs("dashboard")} @@ -16,12 +25,4 @@ %ul.minors %li.minor= link_to "New blog", new_admin_blog_url #main - - if flash[:alert] - #flash.flash-alert - %span.flash-tag ERROR: - = flash.alert - - if flash[:notice] - #flash.flash-notice - %span.flash-tag NOTICE: - = flash.notice = yield -- cgit 1.4.1