Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

30737909-As a Dayhome, I need my photo caption over the photo, not th…

…e blurb
  • Loading branch information...
commit 08bea5486aac313881857a49524475f926533d43 1 parent 35a0028
@jonmholt jonmholt authored
View
BIN  app/assets/images/icons/Word2007Icon.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/icons/pdf-icon4.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
9 app/assets/stylesheets/application.css.scss
@@ -24,13 +24,16 @@ $iconSpritePath: asset-url("glyphicons-halflings.png", image) !default;
.field_with_errors input {
border: 1px solid #b94a48;
}
-
+.field_with_errors textarea {
+ border: 1px solid #b94a48;
+}
.field_with_errors {
display: inline;
}
-
+.field_with_errors label {
+ color: red;
+}
.field_with_errors label.message {
- display: inline;
margin-left: 5px;
}
View
3  app/models/day_home.rb
@@ -27,7 +27,8 @@ class DayHome < ActiveRecord::Base
has_many :user_day_homes, :dependent => :destroy
has_many :users, :through => :user_day_homes
- validates :name, :street1, :city, :province, :postal_code, :slug, :email, :phone_number, :presence => true
+ validates :name, :street1, :city, :province, :postal_code, :slug, :email, :phone_number, :highlight, :presence => true
+ validates :highlight,:length => { :maximum => 200 }
validates_associated :photos
validates_uniqueness_of :slug, :email
View
8 app/views/admin/day_homes/_form.html.haml
@@ -12,6 +12,7 @@
= form_for [:admin, @day_home], :html => {:multipart => true} do |f|
+
= f.label :name
= f.text_field :name
@@ -27,12 +28,13 @@
= f.label :email
= f.text_field :email
- = f.label :blurb
- = f.text_area :blurb
-
= f.label :highlight
= f.text_area :highlight
+ = f.label :blurb
+ = f.text_area :blurb
+
+
= f.label :featured, :class => 'checkbox' do
= f.check_box :featured
Feature on homepage?
View
4 config/initializers/client_side_validations.rb
@@ -6,9 +6,9 @@
# Uncomment the following block if you want each input field to have the validation messages attached.
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
unless html_tag =~ /^<label/
- %{<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>}.html_safe
- else
%{<div class="field_with_errors">#{html_tag}</div>}.html_safe
+ else
+ %{<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>}.html_safe
end
end
View
2  db/migrate/20120608214548_add_highlight_blurb_to_day_homes.rb
@@ -1,5 +1,5 @@
class AddHighlightBlurbToDayHomes < ActiveRecord::Migration
def change
- add_column :day_homes, :highlight, :text
+ add_column :day_homes, :highlight, :string
end
end
View
2  db/schema.rb
@@ -115,7 +115,7 @@
t.string "phone_number"
t.text "blurb"
t.boolean "licensed", :default => false, :null => false
- t.text "highlight"
+ t.string "highlight"
end
create_table "events", :force => true do |t|
Please sign in to comment.
Something went wrong with that request. Please try again.