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
&.error
float: none
display: inline
display: none !important
color: #990000
margin-left: 10px
textarea
@ -259,28 +259,30 @@ form
#alert
background: #fffeef
color: #664400
border-width: 2px 0
border-width: 0 0 1px
border-style: solid
border-color: #996600
padding: 0 10px 2px
margin-top: 15px
padding: 0 25px 2px
border-radius: 2px
#notice
background: #efffef
color: #446600
border-width: 2px 0
border-width: 0 0 1px
border-style: solid
border-color: #669900
padding: 0 10px 2px
margin-top: 15px
padding: 0 25px 2px
border-radius: 2px
.field_with_errors
input, textarea
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
input.error, textarea.error
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
form input[type='submit']

View File

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