styled form errors and success messages

This commit is contained in:
Bret Haynie 2014-04-25 13:10:57 -04:00
parent 7b30af0684
commit fec3064162
4 changed files with 37 additions and 13 deletions

View File

@ -2,6 +2,14 @@ body {
margin-top: 50px;
}
h2 {
margin-top: 0;
}
strong, label, th {
color: #395C84;
}
ul {
list-style: none;
padding-left: 0;
@ -11,6 +19,16 @@ ul {
font-size: .85em;
}
.alert {
margin-bottom: 0;
margin-top: 1.5em;
padding: 5px 10px;
}
.alert-form {
margin-top: .5em !important;
}
// $medgray: #3A9AC9;
.videolisting {

View File

@ -1,5 +1,13 @@
<div id="flash">
<% flash.each do |key, value| -%>
<div id="flash_<%= key %>"><%= value %></div>
<% end -%>
</div>
<div class="container">
<section>
<div id="flash">
<% flash.each do |key, value| -%>
<% if flash[:notice] %>
<div id="flash_<%= key %>" class="alert alert-success"><%= value %></div>
<% else %>
<div id="flash_<%= key %>" class="alert alert-danger"><%= value %></div>
<% end %>
<% end -%>
</div>
</section>
</div>

View File

@ -4,9 +4,8 @@
file: :vertical_file_input,
boolean: :vertical_boolean
}) do |frm| %>
<% if @campaign.errors.any? %>
<div class="row">
<div class="col-md-12 error_explanation">
<!-- <% if @campaign.errors.any? %>
<div class="error_explanation">
<h2><%= pluralize(@campaign.errors.count, "error") %> prohibited this campaign from being saved:</h2>
<ul>
<% @campaign.errors.full_messages.each do |msg| %>
@ -14,8 +13,7 @@
<% end %>
</ul>
</div>
</div>
<% end %>
<% end %> -->
<div class="row">
<div class="col-md-8">

View File

@ -9,7 +9,7 @@ SimpleForm.setup do |config|
b.use :label
b.wrapper tag: 'div', class: 'controls' do |ba|
ba.use :input
ba.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
ba.use :error, wrap_with: { tag: 'div', class: 'alert alert-danger alert-form' }
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
end
end
@ -23,7 +23,7 @@ SimpleForm.setup do |config|
prepend.use :input
end
input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
input.use :error, wrap_with: { tag: 'div', class: 'alert alert-danger alert-form' }
end
end
@ -36,7 +36,7 @@ SimpleForm.setup do |config|
append.use :input
end
input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
input.use :error, wrap_with: { tag: 'div', class: 'alert alert-danger alert-form' }
end
end