1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Tweak error display. Move flash outside of form.

This commit is contained in:
Dan Barber 2013-06-03 09:06:44 +01:00
parent 372b189d53
commit 8e608a61d4
2 changed files with 25 additions and 23 deletions

View File

@ -229,7 +229,7 @@ form
margin-top: 4px margin-top: 4px
&.error &.error
float: none float: none
display: inline display: none !important
color: #990000 color: #990000
margin-left: 10px margin-left: 10px
textarea textarea
@ -259,28 +259,30 @@ form
#alert #alert
background: #fffeef background: #fffeef
color: #664400 color: #664400
border-width: 2px 0 border-width: 0 0 1px
border-style: solid border-style: solid
border-color: #996600 border-color: #996600
padding: 0 10px 2px padding: 0 25px 2px
margin-top: 15px border-radius: 2px
#notice #notice
background: #efffef background: #efffef
color: #446600 color: #446600
border-width: 2px 0 border-width: 0 0 1px
border-style: solid border-style: solid
border-color: #669900 border-color: #669900
padding: 0 10px 2px padding: 0 25px 2px
margin-top: 15px border-radius: 2px
.field_with_errors .field_with_errors
input, textarea input, textarea
background: #ffefef background: #ffefef
box-shadow: 0 0 8px rgba(0, 0, 0, 0.1), inset 0 0 2px rgba(255, 0, 0, 0.8) !important
border-color: #cc3333 !important border-color: #cc3333 !important
input.error, textarea.error input.error, textarea.error
background: #ffefef background: #ffefef
box-shadow: 0 0 8px rgba(0, 0, 0, 0.1), inset 0 0 2px rgba(255, 0, 0, 0.8) !important
border-color: #cc3333 !important border-color: #cc3333 !important
form input[type='submit'] form input[type='submit']

View File

@ -3,13 +3,13 @@
<% end %> <% end %>
<div class="sg-17 contact-form"> <div class="sg-17 contact-form">
<%= form_for :contact, :url => { :action => 'create' }, :html => { :id => 'contact_form' } do |f| %>
<% if flash[:notice] -%> <% if flash[:notice] -%>
<div id="notice"><%= flash[:notice] %></div> <div id="notice"><%= flash[:notice] %></div>
<% end -%> <% end -%>
<% if flash[:alert] -%> <% if flash[:alert] -%>
<div id="alert"><%= flash[:alert] %></div> <div id="alert"><%= flash[:alert] %></div>
<% end -%> <% end -%>
<%= form_for :contact, :url => { :action => 'create' }, :html => { :id => 'contact_form' } do |f| %>
<p>Please use the form below to contact me.</p> <p>Please use the form below to contact me.</p>
<p> <p>
<%= f.label :name %> <%= f.label :name %>