Skip to content

Commit

Permalink
Merge remote branch 'kariskids/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Parsons committed Jun 27, 2011
2 parents b18301f + 5d1c930 commit 310c507
Show file tree
Hide file tree
Showing 44 changed files with 212 additions and 496 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gem 'rails', '3.0.7'
gem 'pg'

gem 'configurable_engine'
gem 'paginate_alphabetically', git: 'git://github.com/edendevelopment/paginate_alphabetically.git', branch: 'bundler'

gem 'haml'
gem 'compass'
Expand All @@ -12,7 +13,7 @@ gem 'inherited_resources', '1.1.2'

gem 'rmagick', "= 2.12.2", :require => 'RMagick'
gem 'aws-s3', :require => 'aws/s3'
gem 'dragonfly', '~>0.7.5'
gem 'dragonfly'
gem 'devise', "1.1.2"
gem 'formtastic'
gem 'validation_reflection'
Expand Down
12 changes: 10 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
GIT
remote: git://github.com/edendevelopment/paginate_alphabetically.git
revision: f9ed9c1b043de06a2c60dd11a324b2eb4657635b
branch: bundler
specs:
paginate_alphabetically (0.3.3)

GEM
remote: http://rubygems.org/
specs:
Expand Down Expand Up @@ -85,7 +92,7 @@ GEM
bcrypt-ruby (~> 2.1.2)
warden (~> 0.10.7)
diff-lcs (1.1.2)
dragonfly (0.7.7)
dragonfly (0.9.4)
rack
erubis (2.6.6)
abstract (>= 1.0.0)
Expand Down Expand Up @@ -267,7 +274,7 @@ DEPENDENCIES
culerity
database_cleaner
devise (= 1.1.2)
dragonfly (~> 0.7.5)
dragonfly
escape_utils
factory_girl
formtastic
Expand All @@ -279,6 +286,7 @@ DEPENDENCIES
jelly
launchy
metric_fu
paginate_alphabetically!
pg
rack-cache
rails (= 3.0.7)
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ def ssl_required?

protect_from_forgery
before_filter :authenticate_user!
before_filter :default_url_options
helper :all

def default_url_options
ActionMailer::Base.default_url_options = { :host => request.host_with_port }
end
end
2 changes: 1 addition & 1 deletion app/helpers/people_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ def output(field_name, field_value, options = {})

def person_image_with_size(person, size)
return image_tag("default-person-#{size}.png") if person.image.nil?
image_tag(person.image.url("#{size}x#{size}#"))
image_tag(person.image.thumb("#{size}x#{size}#").url)
end
end
2 changes: 1 addition & 1 deletion app/views/households/_notes.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.box
.delete-comment= button_to 'Remove', { :controller => 'households/comments', :action => 'destroy', :household_id => @household.id, :id => note.id }, :confirm => "Are you sure you want to remove the note?", :method => :delete
-if !note.image.nil?
%div.photo= image_tag(note.image.url("200x200"))
%div.photo= image_tag(note.image.thumb("200x200").url)
.comment_text= simple_format note.comment
.info
by
Expand Down
2 changes: 1 addition & 1 deletion app/views/households/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%dl
-if !@household.image.nil?
%dt
%dd#household_image= image_tag(@household.image.url("400x400"))
%dd#household_image= image_tag(@household.image.thumb("400x400").url)

%dt Caretaker
%dd= @household.caretaker
Expand Down
4 changes: 2 additions & 2 deletions app/views/people/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

- if params[:search]
%h2 Search results
%p= link_to '« back', people_path
%p= link_to '« back'.html_safe, people_path
- else
%h2 List of people

= alphabetically_paginate(@people)
= alphabetically_paginate(@people, :always_display => true)

- if @people.any?
%ul.people
Expand Down
4 changes: 2 additions & 2 deletions app/views/photos/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%ul.photos
- @person.photos.each do |photo|
%li.photo
= link_to image_tag(photo.image.url('250x200')), person_photo_path(@person, photo)
= link_to image_tag(photo.image.thumb('250x200').url), person_photo_path(@person, photo)
%p.comment
= photo.comment

Expand All @@ -17,4 +17,4 @@
= f.label :comment
= f.text_area :comment
%div
= f.submit "Add"
= f.submit "Add"
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ class Application < Rails::Application
config.filter_parameters += [:password]

config.action_mailer.default_url_options = { :host => "localhost:3000" }
config.middleware.insert_before 'Rack::Lock', 'Dragonfly::Middleware', :images, '/media'
config.middleware.insert_before 'Rack::Lock', 'Dragonfly::Middleware', :images
end
end
17 changes: 0 additions & 17 deletions config/configurable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,3 @@ show_courses:
name: Show the courses tab?
default: true
type: boolean

default_url_for_emails:
name: What is the first part of the URL for this site?
default: "cfi.heroku.com"

default_url_for_emails_for_staging:
name: What is the first part of the URL for the demo site?
default: "cfi-staging.heroku.com"
# site_description:
# name: Description for Google
# default: Lots of Awesomeness Here
# type: text
#
# secret:
# name: Secret Password for Accessing Secret Areas
# default: secret
# type: password
2 changes: 1 addition & 1 deletion config/cucumber.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
%>
default: <%= std_opts %> features
wip: --tags @wip:3 --wip features
Expand Down
3 changes: 1 addition & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'configurable_engine'
Cfi::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb

Expand Down Expand Up @@ -46,6 +47,4 @@

# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify

config.action_mailer.default_url_options = { :host => Configurable.default_url_for_emails }
end
2 changes: 0 additions & 2 deletions config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,4 @@

# Enable threaded mode
# config.threadsafe!

config.action_mailer.default_url_options = { :host => Configurable.default_url_for_emails_for_staging }
end
4 changes: 2 additions & 2 deletions config/initializers/dragonfly.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'dragonfly'

app = Dragonfly[:images]
app.configure_with(:rmagick)
app.configure_with(:imagemagick)
app.configure_with(:rails)
app.configure_with(:heroku, ENV['S3_BUCKET']) unless Rails.env.development?
app.configure_with(:heroku, ENV['S3_BUCKET']) unless Rails.env.development? || Rails.env.test?

app.define_macro(ActiveRecord::Base, :image_accessor)
3 changes: 2 additions & 1 deletion features/add_a_person.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Feature: Manage a person
And I add the person "Oum Bora"
Then I should be on the person page for "Oum Bora"
When I go to the person list page
And I follow "O"
Then I should see the person "Oum Bora"

Scenario: Add basic person information
Expand Down Expand Up @@ -122,4 +123,4 @@ Feature: Manage a person
Given a person called "Oum Bora"
When I go to the person page for "Oum Bora"
And I make "Oum Bora" a student
Then "Oum Bora" should be a student
Then "Oum Bora" should be a student
4 changes: 1 addition & 3 deletions features/step_definitions/caretaker_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
end

Then /^I should see caretaker "([^\"]*)"$/ do |caretaker_name|
within('ul') do
page.should have_css('li', :text => caretaker_name)
end
page.should have_css('li', :text => caretaker_name)
end

Given /^"([^\"]*)" has the caretaker "([^\"]*)"$/ do |person_name, caretaker_name|
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/comment_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

When /^I edit the comment with "([^\"]*)"$/ do |text|
within('#comments ul li') do
click 'Edit'
click_link_or_button 'Edit'
end
fill_in "comment_comment", :with => text
click_button "Update"
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/course_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def fill_in_fields(table)

When /^I add "([^\"]*)" to the course$/ do |student_name|
select student_name, :from => "student_id"
click "Add"
click_link_or_button "Add"
end

Then /^"([^\"]*)" should be taking the course "([^\"]*)"$/ do |student_name, course_name|
Expand Down
4 changes: 2 additions & 2 deletions features/step_definitions/household_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

When /^I add "([^\"]*)" to the household$/ do |person_name|
select person_name, :from => "person_id"
click "Add"
click_link_or_button "Add"
end

Then /^"([^\"]*)" should be living in the household "([^\"]*)"$/ do |person_name, household_name|
Expand Down Expand Up @@ -53,7 +53,7 @@
end

Then /^I should see the note "([^\"]*)" with photo "([^\"]*)"$/ do |note, file_name|
with_scope(".box") do
within(".box") do
page.should have_css(".photo")
page.should have_css(".comment_text", :text => note)
end
Expand Down
6 changes: 3 additions & 3 deletions features/step_definitions/people_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
end

Then /^I should see these people:$/ do |table|
table.raw.each_with_index do |row, index|
page.should have_css("ul.people li:nth-child(#{index+1}) .person .name", :content => row[0])
table.raw.map(&:first).each do |person_name|
page.should have_css("ul.people li .person .name", :content => person_name)
end
page.should have_css('ul.people li', :count => table.raw.size)
end
Expand Down Expand Up @@ -53,7 +53,7 @@
end

Then /^I should see the person "([^\"]*)"$/ do |name|
within('.people .person') do
within('.people') do
page.should have_content(name)
page.should have_css('img')
end
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/photo_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
end

Then /^I should see the photo "([^\"]*)" with comment "([^\"]*)"$/ do |file_name, comment|
with_scope(".photo") do
within(".photo") do
page.should have_css("img")
page.should have_css(".comment", :text => comment)
end
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/student_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

Then /^"([^\"]*)" should be a student$/ do |student_name|
within(".student-status") do
page.should have_content("Student")
page.should have_content("student")
end
end
2 changes: 1 addition & 1 deletion features/step_definitions/village_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
end

Then /^I should see "([^\"]*)" in the list of villages$/ do |village_name|
with_scope("#villages li") do
within("#villages li") do
page.should have_content(village_name)
end
end
Expand Down
Loading

0 comments on commit 310c507

Please sign in to comment.