Permalink
Browse files

Merge branch 'master' into design

Conflicts:
	app/views/pages/home.html.erb
  • Loading branch information...
2 parents 838a399 + 50c47ce commit dbcdf31b945ed932ca37d1ffb83a6d5de984a1a2 David Lee committed Sep 23, 2012
View
@@ -14,5 +14,5 @@
/log/*.log
/tmp
-# Ignore Stripe.rb file with sensitive api info
-stripe.rb
+.swp
+.orig
View
@@ -5,9 +5,11 @@ gem 'pg'
gem 'jquery-rails'
gem 'bcrypt-ruby', '~> 3.0.0'
gem 'stripe'
+gem 'haml-rails'
gem "twitter-bootstrap-rails"
group :development, :test do
+ gem 'quiet_assets'
gem 'shoulda-matchers'
gem 'rspec-rails'
gem 'guard-rspec'
View
@@ -63,6 +63,12 @@ GEM
guard (>= 1.1)
spork (>= 0.8.4)
sys-proctable
+ haml (3.1.7)
+ haml-rails (0.3.5)
+ actionpack (>= 3.1, < 4.1)
+ activesupport (>= 3.1, < 4.1)
+ haml (~> 3.1)
+ railties (>= 3.1, < 4.1)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
@@ -85,6 +91,8 @@ GEM
multi_json (1.3.6)
pg (0.14.1)
polyglot (0.3.3)
+ quiet_assets (1.0.1)
+ railties (~> 3.1)
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
@@ -170,8 +178,10 @@ DEPENDENCIES
faker
guard-rspec
guard-spork
+ haml-rails
jquery-rails
pg
+ quiet_assets
rails (= 3.2.8)
rb-fsevent
rspec-rails
View
@@ -1,163 +0,0 @@
-GEM
- remote: https://rubygems.org/
- specs:
- actionmailer (3.2.8)
- actionpack (= 3.2.8)
- mail (~> 2.4.4)
- actionpack (3.2.8)
- activemodel (= 3.2.8)
- activesupport (= 3.2.8)
- builder (~> 3.0.0)
- erubis (~> 2.7.0)
- journey (~> 1.0.4)
- rack (~> 1.4.0)
- rack-cache (~> 1.2)
- rack-test (~> 0.6.1)
- sprockets (~> 2.1.3)
- activemodel (3.2.8)
- activesupport (= 3.2.8)
- builder (~> 3.0.0)
- activerecord (3.2.8)
- activemodel (= 3.2.8)
- activesupport (= 3.2.8)
- arel (~> 3.0.2)
- tzinfo (~> 0.3.29)
- activeresource (3.2.8)
- activemodel (= 3.2.8)
- activesupport (= 3.2.8)
- activesupport (3.2.8)
- i18n (~> 0.6)
- multi_json (~> 1.0)
- arel (3.0.2)
- bcrypt-ruby (3.0.1)
- builder (3.0.3)
- childprocess (0.3.5)
- ffi (~> 1.0, >= 1.0.6)
- coffee-rails (3.2.2)
- coffee-script (>= 2.2.0)
- railties (~> 3.2.0)
- coffee-script (2.2.0)
- coffee-script-source
- execjs
- coffee-script-source (1.3.3)
- diff-lcs (1.1.3)
- erubis (2.7.0)
- execjs (1.4.0)
- multi_json (~> 1.0)
- ffi (1.1.5)
- guard (1.3.3)
- listen (>= 0.4.2)
- thor (>= 0.14.6)
- guard-rspec (1.2.1)
- guard (>= 1.1)
- guard-spork (1.2.0)
- childprocess
- guard (>= 1.1)
- spork (>= 0.8.4)
- sys-proctable
- hike (1.2.1)
- i18n (0.6.1)
- journey (1.0.4)
- jquery-rails (2.1.2)
- railties (>= 3.1.0, < 5.0)
- thor (~> 0.14)
- json (1.7.5)
- listen (0.5.1)
- mail (2.4.4)
- i18n (>= 0.4.0)
- mime-types (~> 1.16)
- treetop (~> 1.4.8)
- mime-types (1.19)
- multi_json (1.3.6)
- pg (0.14.1)
- polyglot (0.3.3)
- rack (1.4.1)
- rack-cache (1.2)
- rack (>= 0.4)
- rack-ssl (1.3.2)
- rack
- rack-test (0.6.1)
- rack (>= 1.0)
- rails (3.2.8)
- actionmailer (= 3.2.8)
- actionpack (= 3.2.8)
- activerecord (= 3.2.8)
- activeresource (= 3.2.8)
- activesupport (= 3.2.8)
- bundler (~> 1.0)
- railties (= 3.2.8)
- railties (3.2.8)
- actionpack (= 3.2.8)
- activesupport (= 3.2.8)
- rack-ssl (~> 1.3.2)
- rake (>= 0.8.7)
- rdoc (~> 3.4)
- thor (>= 0.14.6, < 2.0)
- rake (0.9.2.2)
- rb-fsevent (0.9.1)
- rdoc (3.12)
- json (~> 1.4)
- rest-client (1.6.7)
- mime-types (>= 1.16)
- rspec (2.11.0)
- rspec-core (~> 2.11.0)
- rspec-expectations (~> 2.11.0)
- rspec-mocks (~> 2.11.0)
- rspec-core (2.11.1)
- rspec-expectations (2.11.3)
- diff-lcs (~> 1.1.3)
- rspec-mocks (2.11.3)
- rspec-rails (2.11.0)
- actionpack (>= 3.0)
- activesupport (>= 3.0)
- railties (>= 3.0)
- rspec (~> 2.11.0)
- sass (3.2.1)
- sass-rails (3.2.5)
- railties (~> 3.2.0)
- sass (>= 3.1.10)
- tilt (~> 1.3)
- shoulda-matchers (1.3.0)
- activesupport (>= 3.0.0)
- spork (0.9.2)
- sprockets (2.1.3)
- hike (~> 1.2)
- rack (~> 1.0)
- tilt (~> 1.1, != 1.3.0)
-<<<<<<< HEAD
- stripe (1.7.3)
- multi_json (~> 1.1)
- rest-client (~> 1.4)
-=======
- sys-proctable (0.9.1)
->>>>>>> 8c96c48353b50733af120b25bc71fe2063fd3d33
- thor (0.16.0)
- tilt (1.3.3)
- treetop (1.4.10)
- polyglot
- polyglot (>= 0.3.1)
- tzinfo (0.3.33)
- uglifier (1.3.0)
- execjs (>= 0.3.0)
- multi_json (~> 1.0, >= 1.0.2)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- bcrypt-ruby (~> 3.0.0)
- coffee-rails (~> 3.2.1)
- guard-rspec
- guard-spork
- jquery-rails
- pg
- rails (= 3.2.8)
- rb-fsevent
- rspec-rails
- sass-rails (~> 3.2.3)
- shoulda-matchers
-<<<<<<< HEAD
- stripe
-=======
->>>>>>> 8c96c48353b50733af120b25bc71fe2063fd3d33
- uglifier (>= 1.0.3)
View
@@ -1,38 +0,0 @@
-source 'https://rubygems.org'
-
-gem 'rails', '3.2.8'
-<<<<<<< HEAD
-gem 'stripe'
-gem 'pg'
-=======
-gem 'pg'
-gem 'jquery-rails'
-gem 'bcrypt-ruby', '~> 3.0.0'
->>>>>>> 8c96c48353b50733af120b25bc71fe2063fd3d33
-
-group :development, :test do
- gem 'shoulda-matchers'
- gem 'rspec-rails'
- gem 'guard-rspec'
-<<<<<<< HEAD
-=======
- gem 'guard-spork'
- gem 'rb-fsevent'
->>>>>>> 8c96c48353b50733af120b25bc71fe2063fd3d33
-end
-
-group :assets do
- gem 'sass-rails', '~> 3.2.3'
- gem 'coffee-rails', '~> 3.2.1'
- gem 'uglifier', '>= 1.0.3'
-<<<<<<< HEAD
-end
-
-gem 'jquery-rails'
-=======
-
- # See https://github.com/sstephenson/execjs#readme for more supported runtimes
- # gem 'therubyracer', :platforms => :ruby
-
-end
->>>>>>> 8c96c48353b50733af120b25bc71fe2063fd3d33
Binary file not shown.
@@ -1,3 +1,22 @@
class ApplicationController < ActionController::Base
protect_from_forgery
+ helper_method :current_user
+
+ private
+ def current_user
+ @current_user ||= User.find(session[:user_id]) if session[:user_id]
+ end
+
+ def current_user=(user)
+ session.clear
+ session[:user_id] = user.id
+ end
+
+ def authenticate_user!
+ redirect_to login_path unless current_user
+ end
+
+ def check_current_user
+ redirect_to root_path if current_user
+ end
end
@@ -0,0 +1,22 @@
+class SessionsController < ApplicationController
+ before_filter :check_current_user, :only => [ :new, :create ]
+
+ def new
+ end
+
+ def create
+ if user = User.authenticate(params[:email], params[:password])
+ self.current_user = user
+ redirect_to root_path, :notice => "Logged in!"
+ else
+ flash.now[:error] = "Invalid email or password"
+ render "new"
+ end
+ end
+
+ def destroy
+ session.clear
+ redirect_to root_path, :notice => "Logged out!"
+ end
+
+end
@@ -0,0 +1,18 @@
+class UsersController < ApplicationController
+ before_filter :check_current_user
+
+ def new
+ @user = User.new
+ end
+
+ def create
+ @user = User.new(params[:user])
+ if @user.save
+ self.current_user = @user
+ redirect_to root_path, :notice => "Signed up!"
+ else
+ flash.now[:error] = 'There was a problem creating your account'
+ render "new"
+ end
+ end
+end
Binary file not shown.
@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><%= content_for?(:title) ? yield(:title) : "Tithe" %></title>
<%= csrf_meta_tags %>
- <%= tag :meta, :name => "stripe-key", :content => STRIPE_PUBLIC_TEST_KEY %>
+ <%= tag :meta, :name => "stripe-key", :content => ENV['STRIPE_PUBLIC_TEST_KEY'] %>
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
@@ -6,7 +6,7 @@
<div class="field">
<%= f.label "Organization description:" %>
- <%= f.text_field :description %>
+ <%= f.text_area :description, :rows => 5 %>
</div>
<div class="actions">
@@ -3,5 +3,5 @@
<%= render 'layouts/carousel' %>
</body>
<h2>Welcome to Tithe.</h2>
-<h3>We help citizens support the governmental agencies they care most about.</h3>
-<%= button_to "Join today!", "#", class: "center btn btn-primary btn-large" %>
+<h3>We help citizens support the governmental agencies they care most about. </h3>
+<%= button_to "Join today!", sign_up_path, class: "center btn btn-primary btn-large", :method => :get %> <%= button_to "Log in!", login_path, class: "center btn btn-primary btn-large", :method => :get %>
@@ -0,0 +1,12 @@
+%h1 Log in
+
+= form_tag sessions_path do
+ %p
+ = label_tag :email
+ %br
+ = text_field_tag :email, params[:email]
+ %p
+ = label_tag :password
+ %br
+ = password_field_tag :password
+ %p.button= submit_tag('Login')
@@ -0,0 +1,23 @@
+<h1>Sign Up</h1>
+
+= form_for @user do |f|
+ - if @user.errors.any?
+ .error_messages
+ %h2 Form is invalid
+ %ul
+ - @user.errors.full_messages.each do |message|
+ %li= message
+ %p
+ = f.label :email
+ %br
+ = f.text_field :email
+ %p
+ = f.label :password
+ %br
+ = f.password_field :password
+ %p
+ = f.label :password_confirmation
+ %br
+ = f.password_field :password_confirmation
+ %p.button
+ = f.submit
@@ -0,0 +1 @@
+Stripe.api_key = ENV['STRIPE_API_KEY']
Oops, something went wrong.

0 comments on commit dbcdf31

Please sign in to comment.