Permalink
Browse files

clean up unneeded files; get postgres, css and js working on heroku

  • Loading branch information...
1 parent f234e6f commit df50294e3eb279fe42973172a0c279073508de79 @sachinr committed Nov 21, 2011
View
@@ -11,20 +11,19 @@ gem 'rails', '3.1.1'
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.4'
- gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
- gem 'haml'
end
+gem 'haml'
+gem 'coffee-rails', '~> 3.1.1'
gem 'twitter-bootstrap-rails'
gem 'jquery-rails'
gem "devise", "~> 1.5.0"
-gem 'devise-twitter'
gem 'pg'
gem 'thin'
gem 'heroku'
gem 'icalendar'
-
+gem 'sprockets'
gem "omniauth-facebook"
# To use ActiveModel has_secure_password
@@ -37,7 +36,7 @@ gem "omniauth-facebook"
# gem 'capistrano'
group :development do
-# To use debugger
+ # To use debugger
gem 'ruby-debug19', :require => 'ruby-debug'
gem "awesome_print", "~> 0.4.0"
gem "letter_opener"
View
@@ -49,9 +49,6 @@ GEM
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
warden (~> 1.1)
- devise-twitter (0.1.1)
- devise (>= 1.1.0)
- warden_oauth (~> 0.1.1)
erubis (2.7.0)
eventmachine (0.12.10)
execjs (1.2.9)
@@ -93,7 +90,6 @@ GEM
mime-types (1.17.2)
multi_json (1.0.3)
multipart-post (1.1.3)
- oauth (0.4.5)
oauth2 (0.5.1)
faraday (~> 0.7.4)
multi_json (~> 1.0.3)
@@ -185,9 +181,6 @@ GEM
multi_json (>= 1.0.2)
warden (1.1.0)
rack (>= 1.0)
- warden_oauth (0.1.1)
- oauth
- warden (>= 0.8.1)
PLATFORMS
ruby
@@ -196,7 +189,6 @@ DEPENDENCIES
awesome_print (~> 0.4.0)
coffee-rails (~> 3.1.1)
devise (~> 1.5.0)
- devise-twitter
haml
heroku
icalendar
@@ -207,6 +199,7 @@ DEPENDENCIES
rails (= 3.1.1)
ruby-debug19
sass-rails (~> 3.1.4)
+ sprockets
sqlite3
thin
turn
@@ -7,6 +7,7 @@
//= require jquery
//= require jquery_ujs
//= require_tree .
-//= require selectToUISlider.jQuery
-//= require jquery-ui-1.7.1.custom.min
//
+
+
+
@@ -1,3 +0,0 @@
-# Place all the behaviors and hooks related to the matching controller here.
-# All this logic will automatically be available in application.js.
-# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -1,3 +0,0 @@
-# Place all the behaviors and hooks related to the matching controller here.
-# All this logic will automatically be available in application.js.
-# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -1,3 +0,0 @@
-# Place all the behaviors and hooks related to the matching controller here.
-# All this logic will automatically be available in application.js.
-# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -1,3 +0,0 @@
-# Place all the behaviors and hooks related to the matching controller here.
-# All this logic will automatically be available in application.js.
-# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -1,3 +0,0 @@
-# Place all the behaviors and hooks related to the matching controller here.
-# All this logic will automatically be available in application.js.
-# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -1,3 +0,0 @@
-# Place all the behaviors and hooks related to the matching controller here.
-# All this logic will automatically be available in application.js.
-# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -2,7 +2,40 @@
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
+ *= require twitter/bootstrap
*= require_self
*= require_tree .
- *= require twitter/bootstrap
*/
+
+p.pull-right{
+ color: #E6E6E6 !important;
+}
+
+.profile
+ label{
+ width: auto;
+ margin-top: -8px;
+ }
+
+.ui-widget{
+ margin-left: 280px;
+ margin-top: 10px;
+}
+
+body {
+ padding-top: 60px !important
+}
+
+.question_label{
+ width: auto;
+ padding: 0px;
+}
+
+.date
+ select{
+ width: auto !important;
+ }
+
+input[type="checkbox"]{
+ height: 20px !important;
+}
@@ -1,7 +0,0 @@
-// Place all the styles related to the dashboard controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
-
-p.pull-right{
- color: #E6E6E6 !important;
-}
@@ -1,3 +0,0 @@
-// Place all the styles related to the Organizations controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,14 +0,0 @@
-// Place all the styles related to the profile_questions controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
-
-.profile
- label{
- width: auto;
- margin-top: -8px;
- }
-
-.ui-widget{
- margin-left: 280px;
- margin-top: 10px;
-}
@@ -1,17 +0,0 @@
-// Place all the styles related to the Projects controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
-
-.question_label{
- width: auto;
- padding: 0px;
-}
-
-.date
- select{
- width: auto !important;
- }
-
-input[type="checkbox"]{
- height: 20px !important;
-}
@@ -1,49 +0,0 @@
-body {
- //background-color: #fff;
- //color: #333;
- //font-family: verdana, arial, helvetica, sans-serif;
- //font-size: 13px;
- //line-height: 18px;
- padding-top: 60px !important}
-
-//p, ol, ul, td {
- //font-family: verdana, arial, helvetica, sans-serif;
- //font-size: 13px;
- //line-height: 18px; }
-
-//pre {
- //background-color: #eee;
- //padding: 10px;
- //font-size: 11px; }
-
-//div {
- //&.field, &.actions {
- //margin-bottom: 10px; } }
-
-//#notice {
- //color: green; }
-
-//.field_with_errors {
- //padding: 2px;
- //background-color: red;
- //display: table; }
-
-//#error_explanation {
- //width: 450px;
- //border: 2px solid red;
- //padding: 7px;
- //padding-bottom: 0;
- //margin-bottom: 20px;
- //background-color: #f0f0f0;
- //h2 {
- //text-align: left;
- //font-weight: bold;
- //padding: 5px 5px 5px 15px;
- //font-size: 12px;
- //margin: -7px;
- //margin-bottom: 0px;
- //background-color: #c00;
- //color: #fff; }
- //ul li {
- //font-size: 12px;
- //list-style: square; } }
@@ -1,3 +0,0 @@
-// Place all the styles related to the static_page controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,3 +0,0 @@
-// Place all the styles related to the users controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -4,14 +4,23 @@ def show
redirect_to root_path
else
if current_user && !current_user.admin
- date_today = DateTime.now.strftime('%Y-%m-%d')
- @project_user_scores = current_user.project_user_scores.joins('JOIN projects ON project_id').
- group('project_id').order('score DESC').
- where("projects.end_date >= #{date_today}").limit(4)
- @projects = Project.order('created_at DESC').limit(3)
- @upcoming_projects = current_user.projects.where("start_date >= #{date_today}").
- order('start_date ASC').limit(4)
+ prepare_user_dashboard
+ elsif current_organization
+ prepare_org_dashboard
end
end
end
+
+ private
+
+ def prepare_user_dashboard
+ @upcoming_suggestions = current_user.upcoming_suggested_projects.limit(4)
+ @projects = Project.order('created_at DESC').limit(3)
+ @upcoming_attending_projects = current_user.upcoming_attending_projects.limit(4)
+ end
+
+ def prepare_org_dashboard
+ @unapproved_volunteers = Attendee.joins(:project).where("organization_id = #{current_organization.id} AND accepted = 'FALSE' OR accepted IS NULL")
+ end
+
end
View
@@ -33,6 +33,10 @@ def update_answers(questions)
return true
end
+ def unapproved_attendees
+ self.users.where("accepted = 'FALSE' OR accepted IS NULL")
+ end
+
private
def update_project_user_score
View
@@ -6,7 +6,7 @@ class User < ActiveRecord::Base
has_many :profile_answers, :as => :answerable
has_many :projects, :through => :attendees
- has_many :attendees
+ has_many :attendees, :dependent => :destroy
has_many :project_user_scores, :dependent => :destroy
# Setup accessible (or protected) attributes for your model
@@ -29,10 +29,21 @@ def self.find_for_facebook_oauth(access_token, signed_in_resource=nil)
if user = User.find_by_email(data["email"])
user
else # Create a user with a stub password.
- User.create!(:email => data["email"], :password => Devise.friendly_token[0,20])
+ User.create!(:email => data["email"], :name => data["name"], :password => Devise.friendly_token[0,20])
end
end
+ def upcoming_suggested_projects
+ date_today = DateTime.now.strftime('%Y-%m-%d')
+ self.project_user_scores.joins(:project).order('score DESC').where("projects.end_date >= '#{date_today}'")
+ end
+
+ def upcoming_attending_projects
+ date_today = DateTime.now.strftime('%Y-%m-%d')
+ self.projects.where("start_date >= '#{date_today}'").
+ order('start_date ASC')
+ end
+
private
def update_project_user_score
@@ -8,8 +8,8 @@
.row
.span6
%h2 Upcoming Projects
- - if current_user.projects.length > 0
- - current_user.projects.each do |project|
+ - if @upcoming_attending_projects.length > 0
+ - @upcoming_attending_projects.each do |project|
%p
= link_to project.name, project
%br
@@ -19,8 +19,8 @@
.span5
%h2 Suggested Projects
- - if @project_user_scores.length > 0
- - @project_user_scores.each do |suggested|
+ - if @upcoming_suggestions.length > 0
+ - @upcoming_suggestions.each do |suggested|
%p
= link_to suggested.project.name, suggested.project
%br
@@ -1,3 +1,12 @@
.hero-unit
%h1 Welcome to Helpa!
+.row
+ .span8
+ %h2 Volunteers
+ %p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ =link_to 'Become a Volunteer!', new_user_registration_path, :class => 'btn large primary'
+ .span8
+ %h2 Non-profit Organizations
+ %p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ =link_to 'Register as an NGO!', new_organization_registration_path, :class => 'btn large'
@@ -12,7 +12,7 @@
config.serve_static_assets = false
# Compress JavaScripts and CSS
- config.assets.compress = true
+ config.assets.compress = false
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false

0 comments on commit df50294

Please sign in to comment.