├── app ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── concerns │ │ └── .keep │ └── user.rb ├── assets │ ├── images │ │ └── .keep │ ├── .DS_Store │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ ├── stylesheets │ │ ├── .DS_Store │ │ ├── home.css.scss │ │ ├── users │ │ │ └── omniauth_callbacks.css.scss │ │ ├── application.css │ │ ├── sticky-footer-navbar.css │ │ └── font-awesome.css.scss │ └── javascripts │ │ ├── home.js.coffee │ │ ├── users │ │ └── omniauth_callbacks.js.coffee │ │ ├── bootstrap.js │ │ ├── application.js │ │ └── bootstrap │ │ ├── transition.js │ │ ├── alert.js │ │ ├── button.js │ │ ├── tab.js │ │ ├── popover.js │ │ ├── affix.js │ │ ├── dropdown.js │ │ ├── scrollspy.js │ │ ├── collapse.js │ │ ├── carousel.js │ │ ├── modal.js │ │ └── tooltip.js ├── controllers │ ├── concerns │ │ └── .keep │ ├── home_controller.rb │ ├── users │ │ ├── registrations_controller.rb │ │ └── omniauth_callbacks_controller.rb │ └── application_controller.rb ├── helpers │ ├── home_helper.rb │ ├── application_helper.rb │ └── users │ │ └── omniauth_callbacks_helper.rb ├── .DS_Store └── views │ ├── devise │ ├── mailer │ │ ├── confirmation_instructions.html.erb │ │ ├── unlock_instructions.html.erb │ │ └── reset_password_instructions.html.erb │ ├── unlocks │ │ └── new.html.erb │ ├── passwords │ │ ├── new.html.erb │ │ └── edit.html.erb │ ├── confirmations │ │ └── new.html.erb │ ├── sessions │ │ └── new.html.erb │ ├── registrations │ │ ├── new.html.erb │ │ └── edit.html.erb │ └── shared │ │ └── _links.erb │ ├── home │ └── index.html.erb │ ├── shared │ └── _footer.html.erb │ └── layouts │ └── application.html.erb ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── public ├── favicon.ico ├── robots.txt ├── 500.html ├── 422.html └── 404.html ├── test ├── helpers │ ├── .keep │ ├── home_helper_test.rb │ └── users │ │ └── omniauth_callbacks_helper_test.rb ├── mailers │ └── .keep ├── models │ ├── .keep │ └── user_test.rb ├── controllers │ ├── .keep │ ├── home_controller_test.rb │ └── users │ │ └── omniauth_callbacks_controller_test.rb ├── fixtures │ ├── .keep │ └── users.yml ├── integration │ └── .keep └── test_helper.rb ├── vendor └── assets │ ├── javascripts │ └── .keep │ └── stylesheets │ └── .keep ├── .DS_Store ├── db ├── .DS_Store ├── migrate │ ├── 20140210113330_add_omniauth_columns_to_users.rb │ └── 20140210113302_devise_create_users.rb ├── seeds.rb └── schema.rb ├── bin ├── rake ├── bundle └── rails ├── config.ru ├── config ├── boot.rb ├── environment.rb ├── initializers │ ├── session_store.rb │ ├── filter_parameter_logging.rb │ ├── mime_types.rb │ ├── backtrace_silencers.rb │ ├── wrap_parameters.rb │ ├── inflections.rb │ └── devise.rb ├── webapi.yml.default ├── database.yml ├── locales │ ├── en.yml │ └── devise.en.yml ├── application.rb ├── environments │ ├── development.rb │ ├── test.rb │ └── production.rb └── routes.rb ├── Rakefile ├── .gitignore ├── README.rdoc ├── LICENSE ├── README.md ├── Gemfile └── Gemfile.lock /app/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/helpers/home_helper.rb: -------------------------------------------------------------------------------- 1 | module HomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/goofmint/hackathon-starter-rails/HEAD/.DS_Store -------------------------------------------------------------------------------- /db/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/goofmint/hackathon-starter-rails/HEAD/db/.DS_Store -------------------------------------------------------------------------------- /app/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/goofmint/hackathon-starter-rails/HEAD/app/.DS_Store -------------------------------------------------------------------------------- /app/helpers/users/omniauth_callbacks_helper.rb: -------------------------------------------------------------------------------- 1 | module Users::OmniauthCallbacksHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/goofmint/hackathon-starter-rails/HEAD/app/assets/.DS_Store -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /test/helpers/home_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class HomeHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /app/controllers/home_controller.rb: -------------------------------------------------------------------------------- 1 | class HomeController < ApplicationController 2 | def index 3 | 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/goofmint/hackathon-starter-rails/HEAD/app/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /app/assets/stylesheets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/goofmint/hackathon-starter-rails/HEAD/app/assets/stylesheets/.DS_Store -------------------------------------------------------------------------------- /app/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/goofmint/hackathon-starter-rails/HEAD/app/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /app/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/goofmint/hackathon-starter-rails/HEAD/app/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /app/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/goofmint/hackathon-starter-rails/HEAD/app/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /test/helpers/users/omniauth_callbacks_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class Users::OmniauthCallbacksHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) 5 | -------------------------------------------------------------------------------- /test/controllers/home_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class HomeControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | HackathonStarterRails::Application.initialize! 6 | -------------------------------------------------------------------------------- /app/assets/stylesheets/home.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the home controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | HackathonStarterRails::Application.config.session_store :cookie_store, key: '_hackathon-starter-rails_session' 4 | -------------------------------------------------------------------------------- /app/controllers/users/registrations_controller.rb: -------------------------------------------------------------------------------- 1 | class Users::RegistrationsController < Devise::RegistrationsController 2 | def build_resource(hash=nil) 3 | hash[:uid] = User.create_unique_string 4 | super 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /test/controllers/users/omniauth_callbacks_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class Users::OmniauthCallbacksControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /app/assets/javascripts/home.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/users/omniauth_callbacks.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users/omniauth_callbacks controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /app/assets/javascripts/users/omniauth_callbacks.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/views/devise/mailer/confirmation_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Welcome <%= @email %>!

2 | 3 |

You can confirm your account email through the link below:

4 | 5 |

<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) %>

6 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | HackathonStarterRails::Application.load_tasks 7 | -------------------------------------------------------------------------------- /config/webapi.yml.default: -------------------------------------------------------------------------------- 1 | development: 2 | facebook: 3 | key: key 4 | secret: secret 5 | twitter: 6 | key: key 7 | secret: secret 8 | production: 9 | facebook: 10 | key: key 11 | secret: secret 12 | twitter: 13 | key: key 14 | secret: secret 15 | -------------------------------------------------------------------------------- /db/migrate/20140210113330_add_omniauth_columns_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddOmniauthColumnsToUsers < ActiveRecord::Migration 2 | def change 3 | add_column :users, :provider, :string 4 | add_column :users, :uid, :string 5 | add_column :users, :name, :string 6 | 7 | add_index :users, [:uid, :provider], unique: true 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.rbc 2 | *.sassc 3 | .sass-cache 4 | capybara-*.html 5 | .rspec 6 | .rvmrc 7 | /.bundle 8 | /vendor/bundle 9 | /log/* 10 | /tmp/* 11 | /db/*.sqlite3 12 | /public/system/* 13 | /coverage/ 14 | /spec/tmp/* 15 | **.orig 16 | rerun.txt 17 | pickle-email-*.html 18 | .project 19 | config/initializers/secret_token.rb 20 | config/webapi.yml 21 | -------------------------------------------------------------------------------- /app/views/devise/mailer/unlock_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

4 | 5 |

Click the link below to unlock your account:

6 | 7 |

<%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token) %>

8 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 7 | # Mayor.create(name: 'Emanuel', city: cities.first) 8 | -------------------------------------------------------------------------------- /test/fixtures/users.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /app/assets/javascripts/bootstrap.js: -------------------------------------------------------------------------------- 1 | //= require bootstrap/affix 2 | //= require bootstrap/alert 3 | //= require bootstrap/button 4 | //= require bootstrap/carousel 5 | //= require bootstrap/collapse 6 | //= require bootstrap/dropdown 7 | //= require bootstrap/tab 8 | //= require bootstrap/transition 9 | //= require bootstrap/scrollspy 10 | //= require bootstrap/modal 11 | //= require bootstrap/tooltip 12 | //= require bootstrap/popover 13 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /app/views/devise/mailer/reset_password_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

Someone has requested a link to change your password. You can do this through the link below.

4 | 5 |

<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) %>

6 | 7 |

If you didn't request this, please ignore this email.

8 |

Your password won't change until you access the link above and create a new one.

9 | -------------------------------------------------------------------------------- /app/views/devise/unlocks/new.html.erb: -------------------------------------------------------------------------------- 1 |

Resend unlock instructions

2 | 3 | <%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %> 4 | <%= devise_error_messages! %> 5 | 6 |
<%= f.label :email %>
7 | <%= f.email_field :email, :autofocus => true %>
8 | 9 |
<%= f.submit "Resend unlock instructions" %>
10 | <% end %> 11 | 12 | <%= render "devise/shared/links" %> 13 | -------------------------------------------------------------------------------- /app/views/devise/passwords/new.html.erb: -------------------------------------------------------------------------------- 1 |

Forgot your password?

2 | 3 | <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %> 4 | <%= devise_error_messages! %> 5 | 6 |
<%= f.label :email %>
7 | <%= f.email_field :email, :autofocus => true %>
8 | 9 |
<%= f.submit "Send me reset password instructions" %>
10 | <% end %> 11 | 12 | <%= render "devise/shared/links" %> 13 | -------------------------------------------------------------------------------- /app/views/devise/confirmations/new.html.erb: -------------------------------------------------------------------------------- 1 |

Resend confirmation instructions

2 | 3 | <%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %> 4 | <%= devise_error_messages! %> 5 | 6 |
<%= f.label :email %>
7 | <%= f.email_field :email, :autofocus => true %>
8 | 9 |
<%= f.submit "Resend confirmation instructions" %>
10 | <% end %> 11 | 12 | <%= render "devise/shared/links" %> 13 | -------------------------------------------------------------------------------- /app/views/home/index.html.erb: -------------------------------------------------------------------------------- 1 | 4 |

Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS. A fixed navbar has been added within #wrap with padding-top: 60px; on the .container.

5 |

Back to the default sticky footer minus the navbar.

6 | 7 | -------------------------------------------------------------------------------- /app/views/shared/_footer.html.erb: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= "test" 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | ActiveRecord::Migration.check_pending! 7 | 8 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 9 | # 10 | # Note: You'll currently still have to declare fixtures explicitly in integration tests 11 | # -- they do not yet inherit this setting 12 | fixtures :all 13 | 14 | # Add more helper methods to be used by all tests here... 15 | end 16 | -------------------------------------------------------------------------------- /app/views/devise/sessions/new.html.erb: -------------------------------------------------------------------------------- 1 |

Sign in

2 | 3 | <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> 4 |
<%= f.label :email %>
5 | <%= f.email_field :email, :autofocus => true %>
6 | 7 |
<%= f.label :password %>
8 | <%= f.password_field :password %>
9 | 10 | <% if devise_mapping.rememberable? -%> 11 |
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
12 | <% end -%> 13 | 14 |
<%= f.submit "Sign in" %>
15 | <% end %> 16 | 17 | <%= render "devise/shared/links" %> 18 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /README.rdoc: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | 26 | 27 | Please feel free to use a different markup language if you do not plan to run 28 | rake doc:app. 29 | -------------------------------------------------------------------------------- /app/views/devise/registrations/new.html.erb: -------------------------------------------------------------------------------- 1 |

Sign up

2 | 3 | <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> 4 | <%= devise_error_messages! %> 5 | 6 |
<%= f.label :email %>
7 | <%= f.email_field :email, :autofocus => true %>
8 | 9 |
<%= f.label :password %>
10 | <%= f.password_field :password %>
11 | 12 |
<%= f.label :password_confirmation %>
13 | <%= f.password_field :password_confirmation %>
14 | 15 |
<%= f.submit "Sign up" %>
16 | <% end %> 17 | 18 | <%= render "devise/shared/links" %> 19 | -------------------------------------------------------------------------------- /app/views/devise/passwords/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Change your password

2 | 3 | <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %> 4 | <%= devise_error_messages! %> 5 | <%= f.hidden_field :reset_password_token %> 6 | 7 |
<%= f.label :password, "New password" %>
8 | <%= f.password_field :password, :autofocus => true %>
9 | 10 |
<%= f.label :password_confirmation, "Confirm new password" %>
11 | <%= f.password_field :password_confirmation %>
12 | 13 |
<%= f.submit "Change my password" %>
14 | <% end %> 15 | 16 | <%= render "devise/shared/links" %> 17 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | development: 7 | adapter: sqlite3 8 | database: db/development.sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | # Warning: The database defined as "test" will be erased and 13 | # re-generated from your development database when you run "rake". 14 | # Do not set this db to the same as development or production. 15 | test: 16 | adapter: sqlite3 17 | database: db/test.sqlite3 18 | pool: 5 19 | timeout: 5000 20 | 21 | production: 22 | adapter: sqlite3 23 | database: db/production.sqlite3 24 | pool: 5 25 | timeout: 5000 26 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the top of the 9 | * compiled file, but it's generally better to create a new file per style scope. 10 | * 11 | *= require_self 12 | *= require_tree . 13 | */ 14 | 15 | #footer { 16 | color: #999; 17 | background-color: #f8f8f8; 18 | border-top: 1px solid #e7e7e7; 19 | } -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require jquery 14 | //= require jquery_ujs 15 | //= require turbolinks 16 | //= require_tree . 17 | -------------------------------------------------------------------------------- /app/assets/stylesheets/sticky-footer-navbar.css: -------------------------------------------------------------------------------- 1 | /* Sticky footer styles 2 | -------------------------------------------------- */ 3 | 4 | html, 5 | body { 6 | height: 100%; 7 | /* The html and body elements cannot have any padding or margin. */ 8 | } 9 | 10 | /* Wrapper for page content to push down footer */ 11 | #wrap { 12 | min-height: 100%; 13 | height: auto; 14 | /* Negative indent footer by its height */ 15 | margin: 0 auto -60px; 16 | /* Pad bottom by footer height */ 17 | padding: 0 0 60px; 18 | } 19 | 20 | /* Set the fixed height of the footer here */ 21 | #footer { 22 | height: 60px; 23 | background-color: #f5f5f5; 24 | } 25 | 26 | 27 | /* Custom page CSS 28 | -------------------------------------------------- */ 29 | /* Not required for template or sticky footer method. */ 30 | 31 | #wrap > .container { 32 | padding: 60px 15px 0; 33 | } 34 | .container .text-muted { 35 | margin: 20px 0; 36 | } 37 | 38 | #footer > .container { 39 | padding-left: 15px; 40 | padding-right: 15px; 41 | } 42 | 43 | code { 44 | font-size: 80%; 45 | } 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Atsushi Nakatsugawa 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /app/controllers/users/omniauth_callbacks_controller.rb: -------------------------------------------------------------------------------- 1 | class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController 2 | def facebook 3 | # You need to implement the method below in your model (e.g. app/models/user.rb) 4 | @user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) 5 | 6 | if @user.persisted? 7 | set_flash_message(:notice, :success, :kind => "Facebook") if is_navigational_format? 8 | sign_in_and_redirect @user, :event => :authentication 9 | else 10 | session["devise.facebook_data"] = request.env["omniauth.auth"] 11 | redirect_to new_user_registration_url 12 | end 13 | end 14 | 15 | def twitter 16 | # You need to implement the method below in your model 17 | @user = User.find_for_twitter_oauth(request.env["omniauth.auth"], current_user) 18 | 19 | if @user.persisted? 20 | set_flash_message(:notice, :success, :kind => "Twitter") if is_navigational_format? 21 | sign_in_and_redirect @user, :event => :authentication 22 | else 23 | session["devise.twitter_data"] = request.env["omniauth.auth"].except("extra") 24 | redirect_to new_user_registration_url 25 | end 26 | end 27 | end 28 | 29 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(:default, Rails.env) 8 | 9 | module HackathonStarterRails 10 | class Application < Rails::Application 11 | # Settings in config/environments/* take precedence over those specified here. 12 | # Application configuration should go into files in config/initializers 13 | # -- all .rb files in that directory are automatically loaded. 14 | 15 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 16 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 17 | # config.time_zone = 'Central Time (US & Canada)' 18 | config.assets.paths << Rails.root.join("app", "assets", "fonts") 19 | config.assets.precompile += %w( .svg .eot .woff .ttf ) 20 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 21 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 22 | # config.i18n.default_locale = :de 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /app/views/devise/shared/_links.erb: -------------------------------------------------------------------------------- 1 | <%- if controller_name != 'sessions' %> 2 | <%= link_to "Sign in", new_session_path(resource_name) %>
3 | <% end -%> 4 | 5 | <%- if devise_mapping.registerable? && controller_name != 'registrations' %> 6 | <%= link_to "Sign up", new_registration_path(resource_name) %>
7 | <% end -%> 8 | 9 | <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> 10 | <%= link_to "Forgot your password?", new_password_path(resource_name) %>
11 | <% end -%> 12 | 13 | <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> 14 | <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
15 | <% end -%> 16 | 17 | <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> 18 | <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
19 | <% end -%> 20 | 21 | <%- if devise_mapping.omniauthable? %> 22 | <%- resource_class.omniauth_providers.each do |provider| %> 23 | <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
24 | <% end -%> 25 | <% end -%> 26 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | HackathonStarterRails::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations 23 | config.active_record.migration_error = :page_load 24 | # Debug mode disables concatenation and preprocessing of assets. 25 | # This option may cause significant delays in view rendering with a large 26 | # number of complex assets. 27 | config.assets.debug = true 28 | end 29 | -------------------------------------------------------------------------------- /app/views/devise/registrations/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Edit <%= resource_name.to_s.humanize %>

2 | 3 | <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %> 4 | <%= devise_error_messages! %> 5 | 6 |
<%= f.label :email %>
7 | <%= f.email_field :email, :autofocus => true %>
8 | 9 | <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> 10 |
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
11 | <% end %> 12 | 13 |
<%= f.label :password %> (leave blank if you don't want to change it)
14 | <%= f.password_field :password, :autocomplete => "off" %>
15 | 16 |
<%= f.label :password_confirmation %>
17 | <%= f.password_field :password_confirmation %>
18 | 19 |
<%= f.label :current_password %> (we need your current password to confirm your changes)
20 | <%= f.password_field :current_password %>
21 | 22 |
<%= f.submit "Update" %>
23 | <% end %> 24 | 25 |

Cancel my account

26 | 27 |

Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>

28 | 29 | <%= link_to "Back", :back %> 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Hackathon Starter Rails 2 | ======================= 3 | 4 | Hackathon starter for Rails developer. Inspired by [hackathon-starter](https://github.com/sahat/hackathon-starter). 5 | 6 | # Demo 7 | 8 | [http://hackathon-starter-rails.herokuapp.com/](http://hackathon-starter-rails.herokuapp.com/) 9 | 10 | # Usage 11 | 12 | $ git clone https://github.com/moongift/hackathon-starter-rails 13 | $ cd hackathon-starter-rails 14 | $ mv config/webapi.yml.default config/webapi.yml 15 | # Edit webapi.yml 16 | $ bundle install 17 | $ rails s 18 | 19 | # webapi.yml 20 | 21 | ``` 22 | development: 23 | facebook: 24 | key: key 25 | secret: secret 26 | twitter: 27 | key: key 28 | secret: secret 29 | ``` 30 | 31 | ## Facebook 32 | 33 | Goto [Facebook developers](https://developers.facebook.com/). And create new app. 34 | 35 | - URL is **http://localhost:3000/** 36 | - Enable Client OAuth Login 37 | - Enable Embedded browser OAuth Login 38 | 39 | ## Twitter 40 | 41 | Goto [Twitter Developers](https://dev.twitter.com/). And create new app. 42 | 43 | Fix key and secret to your app's. 44 | 45 | # Features 46 | 47 | - [Bootstrap](getbootstrap.com) 48 | - [Font awesome](fortawesome.github.io/Font-Awesome/) 49 | - OAuth Login (Facebook / Twitter) using OmniAuth 50 | - ID/Password Login (Devise) 51 | 52 | # LETS'S HACKING! 53 | 54 | # LICENSE 55 | 56 | MIT License. 57 | 58 | 59 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 4 | gem 'rails', '4.0.2' 5 | 6 | # Use sqlite3 as the database for Active Record 7 | gem 'sqlite3' 8 | 9 | # Use SCSS for stylesheets 10 | gem 'sass-rails', '~> 4.0.0' 11 | 12 | # Use Uglifier as compressor for JavaScript assets 13 | gem 'uglifier', '>= 1.3.0' 14 | 15 | # Use CoffeeScript for .js.coffee assets and views 16 | gem 'coffee-rails', '~> 4.0.0' 17 | 18 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes 19 | # gem 'therubyracer', platforms: :ruby 20 | 21 | # Use jquery as the JavaScript library 22 | gem 'jquery-rails' 23 | 24 | # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 25 | gem 'turbolinks' 26 | 27 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 28 | gem 'jbuilder', '~> 1.2' 29 | 30 | group :doc do 31 | # bundle exec rake doc:rails generates the API under doc/api. 32 | gem 'sdoc', require: false 33 | end 34 | 35 | # Use ActiveModel has_secure_password 36 | # gem 'bcrypt-ruby', '~> 3.0.0' 37 | 38 | # Use unicorn as the app server 39 | # gem 'unicorn' 40 | 41 | # Use Capistrano for deployment 42 | # gem 'capistrano', group: :development 43 | 44 | # Use debugger 45 | # gem 'debugger', group: [:development, :test] 46 | 47 | gem 'devise' 48 | gem 'omniauth' 49 | gem 'omniauth-twitter' 50 | gem 'omniauth-facebook' 51 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

We're sorry, but something went wrong.

54 |
55 |

If you are the application owner check the logs for more information.

56 | 57 | 58 | -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ActiveRecord::Base 2 | # Include default devise modules. Others available are: 3 | # :confirmable, :lockable, :timeoutable and 4 | devise :database_authenticatable, :registerable, :omniauthable, 5 | :recoverable, :rememberable, :trackable, :validatable 6 | 7 | def self.find_for_facebook_oauth(auth, signed_in_resource=nil) 8 | user = User.where(:provider => auth.provider, :uid => auth.uid).first 9 | unless user 10 | user = User.create(name: auth.extra.raw_info.name, 11 | provider: auth.provider, 12 | uid: auth.uid, 13 | email: auth.info.email, 14 | password: Devise.friendly_token[0,20] 15 | ) 16 | end 17 | user 18 | end 19 | 20 | def self.find_for_twitter_oauth(auth, signed_in_resource=nil) 21 | user = User.where(:provider => auth.provider, :uid => auth.uid).first 22 | unless user 23 | user = User.create(name: auth.info.nickname, 24 | provider: auth.provider, 25 | uid: auth.uid, 26 | email: User.create_unique_email, 27 | password: Devise.friendly_token[0,20] 28 | ) 29 | end 30 | user 31 | end 32 | 33 | def self.create_unique_string 34 | SecureRandom.uuid 35 | end 36 | 37 | def self.create_unique_email 38 | User.create_unique_string + "@example.com" 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /db/migrate/20140210113302_devise_create_users.rb: -------------------------------------------------------------------------------- 1 | class DeviseCreateUsers < ActiveRecord::Migration 2 | def change 3 | create_table(:users) do |t| 4 | ## Database authenticatable 5 | t.string :email, :null => false, :default => "" 6 | t.string :encrypted_password, :null => false, :default => "" 7 | 8 | ## Recoverable 9 | t.string :reset_password_token 10 | t.datetime :reset_password_sent_at 11 | 12 | ## Rememberable 13 | t.datetime :remember_created_at 14 | 15 | ## Trackable 16 | t.integer :sign_in_count, :default => 0, :null => false 17 | t.datetime :current_sign_in_at 18 | t.datetime :last_sign_in_at 19 | t.string :current_sign_in_ip 20 | t.string :last_sign_in_ip 21 | 22 | ## Confirmable 23 | # t.string :confirmation_token 24 | # t.datetime :confirmed_at 25 | # t.datetime :confirmation_sent_at 26 | # t.string :unconfirmed_email # Only if using reconfirmable 27 | 28 | ## Lockable 29 | # t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts 30 | # t.string :unlock_token # Only if unlock strategy is :email or :both 31 | # t.datetime :locked_at 32 | 33 | 34 | t.timestamps 35 | end 36 | 37 | add_index :users, :email, :unique => true 38 | add_index :users, :reset_password_token, :unique => true 39 | # add_index :users, :confirmation_token, :unique => true 40 | # add_index :users, :unlock_token, :unique => true 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

The change you wanted was rejected.

54 |

Maybe you tried to change something you didn't have access to.

55 |
56 |

If you are the application owner check the logs for more information.

57 | 58 | 59 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

The page you were looking for doesn't exist.

54 |

You may have mistyped the address or the page may have moved.

55 |
56 |

If you are the application owner check the logs for more information.

57 | 58 | 59 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | HackathonStarterRails::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static asset server for tests with Cache-Control for performance. 16 | config.serve_static_assets = true 17 | config.static_cache_control = "public, max-age=3600" 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Print deprecation notices to the stderr. 35 | config.active_support.deprecation = :stderr 36 | end 37 | -------------------------------------------------------------------------------- /app/assets/javascripts/bootstrap/transition.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: transition.js v3.1.0 3 | * http://getbootstrap.com/javascript/#transitions 4 | * ======================================================================== 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | * ======================================================================== */ 8 | 9 | 10 | +function ($) { 11 | 'use strict'; 12 | 13 | // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) 14 | // ============================================================ 15 | 16 | function transitionEnd() { 17 | var el = document.createElement('bootstrap') 18 | 19 | var transEndEventNames = { 20 | 'WebkitTransition' : 'webkitTransitionEnd', 21 | 'MozTransition' : 'transitionend', 22 | 'OTransition' : 'oTransitionEnd otransitionend', 23 | 'transition' : 'transitionend' 24 | } 25 | 26 | for (var name in transEndEventNames) { 27 | if (el.style[name] !== undefined) { 28 | return { end: transEndEventNames[name] } 29 | } 30 | } 31 | 32 | return false // explicit for ie8 ( ._.) 33 | } 34 | 35 | // http://blog.alexmaccaw.com/css-transitions 36 | $.fn.emulateTransitionEnd = function (duration) { 37 | var called = false, $el = this 38 | $(this).one($.support.transition.end, function () { called = true }) 39 | var callback = function () { if (!called) $($el).trigger($.support.transition.end) } 40 | setTimeout(callback, duration) 41 | return this 42 | } 43 | 44 | $(function () { 45 | $.support.transition = transitionEnd() 46 | }) 47 | 48 | }(jQuery); 49 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 20140210113330) do 15 | 16 | create_table "users", force: true do |t| 17 | t.string "email", default: "", null: false 18 | t.string "encrypted_password", default: "", null: false 19 | t.string "reset_password_token" 20 | t.datetime "reset_password_sent_at" 21 | t.datetime "remember_created_at" 22 | t.integer "sign_in_count", default: 0, null: false 23 | t.datetime "current_sign_in_at" 24 | t.datetime "last_sign_in_at" 25 | t.string "current_sign_in_ip" 26 | t.string "last_sign_in_ip" 27 | t.datetime "created_at" 28 | t.datetime "updated_at" 29 | t.string "provider" 30 | t.string "uid" 31 | t.string "name" 32 | end 33 | 34 | add_index "users", ["email"], name: "index_users_on_email", unique: true 35 | add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true 36 | add_index "users", ["uid", "provider"], name: "index_users_on_uid_and_provider", unique: true 37 | 38 | end 39 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | HackathonStarterRails::Application.routes.draw do 2 | devise_for :users, :controllers => { 3 | :registrations => "users/registrations", 4 | :omniauth_callbacks => "users/omniauth_callbacks" 5 | } 6 | # The priority is based upon order of creation: first created -> highest priority. 7 | # See how all your routes lay out with "rake routes". 8 | 9 | # You can have the root of your site routed with "root" 10 | root 'home#index' 11 | 12 | # Example of regular route: 13 | # get 'products/:id' => 'catalog#view' 14 | 15 | # Example of named route that can be invoked with purchase_url(id: product.id) 16 | # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase 17 | 18 | # Example resource route (maps HTTP verbs to controller actions automatically): 19 | # resources :products 20 | 21 | # Example resource route with options: 22 | # resources :products do 23 | # member do 24 | # get 'short' 25 | # post 'toggle' 26 | # end 27 | # 28 | # collection do 29 | # get 'sold' 30 | # end 31 | # end 32 | 33 | # Example resource route with sub-resources: 34 | # resources :products do 35 | # resources :comments, :sales 36 | # resource :seller 37 | # end 38 | 39 | # Example resource route with more complex sub-resources: 40 | # resources :products do 41 | # resources :comments 42 | # resources :sales do 43 | # get 'recent', on: :collection 44 | # end 45 | # end 46 | 47 | # Example resource route with concerns: 48 | # concern :toggleable do 49 | # post 'toggle' 50 | # end 51 | # resources :posts, concerns: :toggleable 52 | # resources :photos, concerns: :toggleable 53 | 54 | # Example resource route within a namespace: 55 | # namespace :admin do 56 | # # Directs /admin/products/* to Admin::ProductsController 57 | # # (app/controllers/admin/products_controller.rb) 58 | # resources :products 59 | # end 60 | end 61 | -------------------------------------------------------------------------------- /app/assets/javascripts/bootstrap/alert.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: alert.js v3.1.0 3 | * http://getbootstrap.com/javascript/#alerts 4 | * ======================================================================== 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | * ======================================================================== */ 8 | 9 | 10 | +function ($) { 11 | 'use strict'; 12 | 13 | // ALERT CLASS DEFINITION 14 | // ====================== 15 | 16 | var dismiss = '[data-dismiss="alert"]' 17 | var Alert = function (el) { 18 | $(el).on('click', dismiss, this.close) 19 | } 20 | 21 | Alert.prototype.close = function (e) { 22 | var $this = $(this) 23 | var selector = $this.attr('data-target') 24 | 25 | if (!selector) { 26 | selector = $this.attr('href') 27 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 28 | } 29 | 30 | var $parent = $(selector) 31 | 32 | if (e) e.preventDefault() 33 | 34 | if (!$parent.length) { 35 | $parent = $this.hasClass('alert') ? $this : $this.parent() 36 | } 37 | 38 | $parent.trigger(e = $.Event('close.bs.alert')) 39 | 40 | if (e.isDefaultPrevented()) return 41 | 42 | $parent.removeClass('in') 43 | 44 | function removeElement() { 45 | $parent.trigger('closed.bs.alert').remove() 46 | } 47 | 48 | $.support.transition && $parent.hasClass('fade') ? 49 | $parent 50 | .one($.support.transition.end, removeElement) 51 | .emulateTransitionEnd(150) : 52 | removeElement() 53 | } 54 | 55 | 56 | // ALERT PLUGIN DEFINITION 57 | // ======================= 58 | 59 | var old = $.fn.alert 60 | 61 | $.fn.alert = function (option) { 62 | return this.each(function () { 63 | var $this = $(this) 64 | var data = $this.data('bs.alert') 65 | 66 | if (!data) $this.data('bs.alert', (data = new Alert(this))) 67 | if (typeof option == 'string') data[option].call($this) 68 | }) 69 | } 70 | 71 | $.fn.alert.Constructor = Alert 72 | 73 | 74 | // ALERT NO CONFLICT 75 | // ================= 76 | 77 | $.fn.alert.noConflict = function () { 78 | $.fn.alert = old 79 | return this 80 | } 81 | 82 | 83 | // ALERT DATA-API 84 | // ============== 85 | 86 | $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) 87 | 88 | }(jQuery); 89 | -------------------------------------------------------------------------------- /app/assets/javascripts/bootstrap/button.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: button.js v3.1.0 3 | * http://getbootstrap.com/javascript/#buttons 4 | * ======================================================================== 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | * ======================================================================== */ 8 | 9 | 10 | +function ($) { 11 | 'use strict'; 12 | 13 | // BUTTON PUBLIC CLASS DEFINITION 14 | // ============================== 15 | 16 | var Button = function (element, options) { 17 | this.$element = $(element) 18 | this.options = $.extend({}, Button.DEFAULTS, options) 19 | this.isLoading = false 20 | } 21 | 22 | Button.DEFAULTS = { 23 | loadingText: 'loading...' 24 | } 25 | 26 | Button.prototype.setState = function (state) { 27 | var d = 'disabled' 28 | var $el = this.$element 29 | var val = $el.is('input') ? 'val' : 'html' 30 | var data = $el.data() 31 | 32 | state = state + 'Text' 33 | 34 | if (!data.resetText) $el.data('resetText', $el[val]()) 35 | 36 | $el[val](data[state] || this.options[state]) 37 | 38 | // push to event loop to allow forms to submit 39 | setTimeout($.proxy(function () { 40 | if (state == 'loadingText') { 41 | this.isLoading = true 42 | $el.addClass(d).attr(d, d) 43 | } else if (this.isLoading) { 44 | this.isLoading = false 45 | $el.removeClass(d).removeAttr(d) 46 | } 47 | }, this), 0) 48 | } 49 | 50 | Button.prototype.toggle = function () { 51 | var changed = true 52 | var $parent = this.$element.closest('[data-toggle="buttons"]') 53 | 54 | if ($parent.length) { 55 | var $input = this.$element.find('input') 56 | if ($input.prop('type') == 'radio') { 57 | if ($input.prop('checked') && this.$element.hasClass('active')) changed = false 58 | else $parent.find('.active').removeClass('active') 59 | } 60 | if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') 61 | } 62 | 63 | if (changed) this.$element.toggleClass('active') 64 | } 65 | 66 | 67 | // BUTTON PLUGIN DEFINITION 68 | // ======================== 69 | 70 | var old = $.fn.button 71 | 72 | $.fn.button = function (option) { 73 | return this.each(function () { 74 | var $this = $(this) 75 | var data = $this.data('bs.button') 76 | var options = typeof option == 'object' && option 77 | 78 | if (!data) $this.data('bs.button', (data = new Button(this, options))) 79 | 80 | if (option == 'toggle') data.toggle() 81 | else if (option) data.setState(option) 82 | }) 83 | } 84 | 85 | $.fn.button.Constructor = Button 86 | 87 | 88 | // BUTTON NO CONFLICT 89 | // ================== 90 | 91 | $.fn.button.noConflict = function () { 92 | $.fn.button = old 93 | return this 94 | } 95 | 96 | 97 | // BUTTON DATA-API 98 | // =============== 99 | 100 | $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { 101 | var $btn = $(e.target) 102 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') 103 | $btn.button('toggle') 104 | e.preventDefault() 105 | }) 106 | 107 | }(jQuery); 108 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | HackathonStarterRails::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both thread web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application 18 | # Add `rack-cache` to your Gemfile before enabling this. 19 | # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. 20 | # config.action_dispatch.rack_cache = true 21 | 22 | # Disable Rails's static asset server (Apache or nginx will already do this). 23 | config.serve_static_assets = false 24 | 25 | # Compress JavaScripts and CSS. 26 | config.assets.js_compressor = :uglifier 27 | # config.assets.css_compressor = :sass 28 | 29 | # Do not fallback to assets pipeline if a precompiled asset is missed. 30 | config.assets.compile = false 31 | 32 | # Generate digests for assets URLs. 33 | config.assets.digest = true 34 | 35 | # Version of your assets, change this if you want to expire all your assets. 36 | config.assets.version = '1.0' 37 | 38 | # Specifies the header that your server uses for sending files. 39 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 40 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 41 | 42 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 43 | # config.force_ssl = true 44 | 45 | # Set to :debug to see everything in the log. 46 | config.log_level = :info 47 | 48 | # Prepend all log lines with the following tags. 49 | # config.log_tags = [ :subdomain, :uuid ] 50 | 51 | # Use a different logger for distributed setups. 52 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 53 | 54 | # Use a different cache store in production. 55 | # config.cache_store = :mem_cache_store 56 | 57 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 58 | # config.action_controller.asset_host = "http://assets.example.com" 59 | 60 | # Precompile additional assets. 61 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 62 | # config.assets.precompile += %w( search.js ) 63 | 64 | # Ignore bad email addresses and do not raise email delivery errors. 65 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 66 | # config.action_mailer.raise_delivery_errors = false 67 | 68 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 69 | # the I18n.default_locale when a translation can not be found). 70 | config.i18n.fallbacks = true 71 | 72 | # Send deprecation notices to registered listeners. 73 | config.active_support.deprecation = :notify 74 | 75 | # Disable automatic flushing of the log to improve performance. 76 | # config.autoflush_log = false 77 | 78 | # Use default logging formatter so that PID and timestamp are not suppressed. 79 | config.log_formatter = ::Logger::Formatter.new 80 | end 81 | -------------------------------------------------------------------------------- /app/assets/javascripts/bootstrap/tab.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: tab.js v3.1.0 3 | * http://getbootstrap.com/javascript/#tabs 4 | * ======================================================================== 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | * ======================================================================== */ 8 | 9 | 10 | +function ($) { 11 | 'use strict'; 12 | 13 | // TAB CLASS DEFINITION 14 | // ==================== 15 | 16 | var Tab = function (element) { 17 | this.element = $(element) 18 | } 19 | 20 | Tab.prototype.show = function () { 21 | var $this = this.element 22 | var $ul = $this.closest('ul:not(.dropdown-menu)') 23 | var selector = $this.data('target') 24 | 25 | if (!selector) { 26 | selector = $this.attr('href') 27 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 28 | } 29 | 30 | if ($this.parent('li').hasClass('active')) return 31 | 32 | var previous = $ul.find('.active:last a')[0] 33 | var e = $.Event('show.bs.tab', { 34 | relatedTarget: previous 35 | }) 36 | 37 | $this.trigger(e) 38 | 39 | if (e.isDefaultPrevented()) return 40 | 41 | var $target = $(selector) 42 | 43 | this.activate($this.parent('li'), $ul) 44 | this.activate($target, $target.parent(), function () { 45 | $this.trigger({ 46 | type: 'shown.bs.tab', 47 | relatedTarget: previous 48 | }) 49 | }) 50 | } 51 | 52 | Tab.prototype.activate = function (element, container, callback) { 53 | var $active = container.find('> .active') 54 | var transition = callback 55 | && $.support.transition 56 | && $active.hasClass('fade') 57 | 58 | function next() { 59 | $active 60 | .removeClass('active') 61 | .find('> .dropdown-menu > .active') 62 | .removeClass('active') 63 | 64 | element.addClass('active') 65 | 66 | if (transition) { 67 | element[0].offsetWidth // reflow for transition 68 | element.addClass('in') 69 | } else { 70 | element.removeClass('fade') 71 | } 72 | 73 | if (element.parent('.dropdown-menu')) { 74 | element.closest('li.dropdown').addClass('active') 75 | } 76 | 77 | callback && callback() 78 | } 79 | 80 | transition ? 81 | $active 82 | .one($.support.transition.end, next) 83 | .emulateTransitionEnd(150) : 84 | next() 85 | 86 | $active.removeClass('in') 87 | } 88 | 89 | 90 | // TAB PLUGIN DEFINITION 91 | // ===================== 92 | 93 | var old = $.fn.tab 94 | 95 | $.fn.tab = function ( option ) { 96 | return this.each(function () { 97 | var $this = $(this) 98 | var data = $this.data('bs.tab') 99 | 100 | if (!data) $this.data('bs.tab', (data = new Tab(this))) 101 | if (typeof option == 'string') data[option]() 102 | }) 103 | } 104 | 105 | $.fn.tab.Constructor = Tab 106 | 107 | 108 | // TAB NO CONFLICT 109 | // =============== 110 | 111 | $.fn.tab.noConflict = function () { 112 | $.fn.tab = old 113 | return this 114 | } 115 | 116 | 117 | // TAB DATA-API 118 | // ============ 119 | 120 | $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { 121 | e.preventDefault() 122 | $(this).tab('show') 123 | }) 124 | 125 | }(jQuery); 126 | -------------------------------------------------------------------------------- /app/assets/javascripts/bootstrap/popover.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: popover.js v3.1.0 3 | * http://getbootstrap.com/javascript/#popovers 4 | * ======================================================================== 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | * ======================================================================== */ 8 | 9 | 10 | +function ($) { 11 | 'use strict'; 12 | 13 | // POPOVER PUBLIC CLASS DEFINITION 14 | // =============================== 15 | 16 | var Popover = function (element, options) { 17 | this.init('popover', element, options) 18 | } 19 | 20 | if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') 21 | 22 | Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { 23 | placement: 'right', 24 | trigger: 'click', 25 | content: '', 26 | template: '

' 27 | }) 28 | 29 | 30 | // NOTE: POPOVER EXTENDS tooltip.js 31 | // ================================ 32 | 33 | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) 34 | 35 | Popover.prototype.constructor = Popover 36 | 37 | Popover.prototype.getDefaults = function () { 38 | return Popover.DEFAULTS 39 | } 40 | 41 | Popover.prototype.setContent = function () { 42 | var $tip = this.tip() 43 | var title = this.getTitle() 44 | var content = this.getContent() 45 | 46 | $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) 47 | $tip.find('.popover-content')[ // we use append for html objects to maintain js events 48 | this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' 49 | ](content) 50 | 51 | $tip.removeClass('fade top bottom left right in') 52 | 53 | // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do 54 | // this manually by checking the contents. 55 | if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() 56 | } 57 | 58 | Popover.prototype.hasContent = function () { 59 | return this.getTitle() || this.getContent() 60 | } 61 | 62 | Popover.prototype.getContent = function () { 63 | var $e = this.$element 64 | var o = this.options 65 | 66 | return $e.attr('data-content') 67 | || (typeof o.content == 'function' ? 68 | o.content.call($e[0]) : 69 | o.content) 70 | } 71 | 72 | Popover.prototype.arrow = function () { 73 | return this.$arrow = this.$arrow || this.tip().find('.arrow') 74 | } 75 | 76 | Popover.prototype.tip = function () { 77 | if (!this.$tip) this.$tip = $(this.options.template) 78 | return this.$tip 79 | } 80 | 81 | 82 | // POPOVER PLUGIN DEFINITION 83 | // ========================= 84 | 85 | var old = $.fn.popover 86 | 87 | $.fn.popover = function (option) { 88 | return this.each(function () { 89 | var $this = $(this) 90 | var data = $this.data('bs.popover') 91 | var options = typeof option == 'object' && option 92 | 93 | if (!data && option == 'destroy') return 94 | if (!data) $this.data('bs.popover', (data = new Popover(this, options))) 95 | if (typeof option == 'string') data[option]() 96 | }) 97 | } 98 | 99 | $.fn.popover.Constructor = Popover 100 | 101 | 102 | // POPOVER NO CONFLICT 103 | // =================== 104 | 105 | $.fn.popover.noConflict = function () { 106 | $.fn.popover = old 107 | return this 108 | } 109 | 110 | }(jQuery); 111 | -------------------------------------------------------------------------------- /config/locales/devise.en.yml: -------------------------------------------------------------------------------- 1 | # Additional translations at https://github.com/plataformatec/devise/wiki/I18n 2 | 3 | en: 4 | devise: 5 | confirmations: 6 | confirmed: "Your account was successfully confirmed." 7 | send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes." 8 | send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes." 9 | failure: 10 | already_authenticated: "You are already signed in." 11 | inactive: "Your account is not activated yet." 12 | invalid: "Invalid email or password." 13 | locked: "Your account is locked." 14 | last_attempt: "You have one more attempt before your account will be locked." 15 | not_found_in_database: "Invalid email or password." 16 | timeout: "Your session expired. Please sign in again to continue." 17 | unauthenticated: "You need to sign in or sign up before continuing." 18 | unconfirmed: "You have to confirm your account before continuing." 19 | mailer: 20 | confirmation_instructions: 21 | subject: "Confirmation instructions" 22 | reset_password_instructions: 23 | subject: "Reset password instructions" 24 | unlock_instructions: 25 | subject: "Unlock Instructions" 26 | omniauth_callbacks: 27 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"." 28 | success: "Successfully authenticated from %{kind} account." 29 | passwords: 30 | no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." 31 | send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes." 32 | send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." 33 | updated: "Your password was changed successfully. You are now signed in." 34 | updated_not_active: "Your password was changed successfully." 35 | registrations: 36 | destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon." 37 | signed_up: "Welcome! You have signed up successfully." 38 | signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." 39 | signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." 40 | signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." 41 | update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address." 42 | updated: "You updated your account successfully." 43 | sessions: 44 | signed_in: "Signed in successfully." 45 | signed_out: "Signed out successfully." 46 | unlocks: 47 | send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes." 48 | send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes." 49 | unlocked: "Your account has been unlocked successfully. Please sign in to continue." 50 | errors: 51 | messages: 52 | already_confirmed: "was already confirmed, please try signing in" 53 | confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" 54 | expired: "has expired, please request a new one" 55 | not_found: "not found" 56 | not_locked: "was not locked" 57 | not_saved: 58 | one: "1 error prohibited this %{resource} from being saved:" 59 | other: "%{count} errors prohibited this %{resource} from being saved:" 60 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Sticky Footer Navbar Template for Bootstrap 12 | <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> 13 | 14 | 15 | 16 | 17 | 18 | 22 | <%= csrf_meta_tags %> 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 73 | 74 | 75 |
76 | <%= yield %> 77 |
78 |
79 | 80 | <%= render :partial => "shared/footer" %> 81 | 82 | 84 | 85 | 86 | <%= javascript_include_tag "application", "data-turbolinks-track" => true %> 87 | 88 | 89 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actionmailer (4.0.2) 5 | actionpack (= 4.0.2) 6 | mail (~> 2.5.4) 7 | actionpack (4.0.2) 8 | activesupport (= 4.0.2) 9 | builder (~> 3.1.0) 10 | erubis (~> 2.7.0) 11 | rack (~> 1.5.2) 12 | rack-test (~> 0.6.2) 13 | activemodel (4.0.2) 14 | activesupport (= 4.0.2) 15 | builder (~> 3.1.0) 16 | activerecord (4.0.2) 17 | activemodel (= 4.0.2) 18 | activerecord-deprecated_finders (~> 1.0.2) 19 | activesupport (= 4.0.2) 20 | arel (~> 4.0.0) 21 | activerecord-deprecated_finders (1.0.3) 22 | activesupport (4.0.2) 23 | i18n (~> 0.6, >= 0.6.4) 24 | minitest (~> 4.2) 25 | multi_json (~> 1.3) 26 | thread_safe (~> 0.1) 27 | tzinfo (~> 0.3.37) 28 | arel (4.0.2) 29 | atomic (1.1.14) 30 | bcrypt-ruby (3.1.2) 31 | builder (3.1.4) 32 | coffee-rails (4.0.1) 33 | coffee-script (>= 2.2.0) 34 | railties (>= 4.0.0, < 5.0) 35 | coffee-script (2.2.0) 36 | coffee-script-source 37 | execjs 38 | coffee-script-source (1.7.0) 39 | devise (3.2.2) 40 | bcrypt-ruby (~> 3.0) 41 | orm_adapter (~> 0.1) 42 | railties (>= 3.2.6, < 5) 43 | thread_safe (~> 0.1) 44 | warden (~> 1.2.3) 45 | erubis (2.7.0) 46 | execjs (2.0.2) 47 | faraday (0.9.0) 48 | multipart-post (>= 1.2, < 3) 49 | hashie (2.0.5) 50 | hike (1.2.3) 51 | i18n (0.6.9) 52 | jbuilder (1.5.3) 53 | activesupport (>= 3.0.0) 54 | multi_json (>= 1.2.0) 55 | jquery-rails (3.1.0) 56 | railties (>= 3.0, < 5.0) 57 | thor (>= 0.14, < 2.0) 58 | json (1.8.1) 59 | jwt (0.1.11) 60 | multi_json (>= 1.5) 61 | mail (2.5.4) 62 | mime-types (~> 1.16) 63 | treetop (~> 1.4.8) 64 | mime-types (1.25.1) 65 | minitest (4.7.5) 66 | multi_json (1.8.4) 67 | multi_xml (0.5.5) 68 | multipart-post (2.0.0) 69 | oauth (0.4.7) 70 | oauth2 (0.9.3) 71 | faraday (>= 0.8, < 0.10) 72 | jwt (~> 0.1.8) 73 | multi_json (~> 1.3) 74 | multi_xml (~> 0.5) 75 | rack (~> 1.2) 76 | omniauth (1.2.1) 77 | hashie (>= 1.2, < 3) 78 | rack (~> 1.0) 79 | omniauth-facebook (1.6.0) 80 | omniauth-oauth2 (~> 1.1) 81 | omniauth-oauth (1.0.1) 82 | oauth 83 | omniauth (~> 1.0) 84 | omniauth-oauth2 (1.1.2) 85 | faraday (>= 0.8, < 0.10) 86 | multi_json (~> 1.3) 87 | oauth2 (~> 0.9.3) 88 | omniauth (~> 1.2) 89 | omniauth-twitter (1.0.1) 90 | multi_json (~> 1.3) 91 | omniauth-oauth (~> 1.0) 92 | orm_adapter (0.5.0) 93 | polyglot (0.3.3) 94 | rack (1.5.2) 95 | rack-test (0.6.2) 96 | rack (>= 1.0) 97 | rails (4.0.2) 98 | actionmailer (= 4.0.2) 99 | actionpack (= 4.0.2) 100 | activerecord (= 4.0.2) 101 | activesupport (= 4.0.2) 102 | bundler (>= 1.3.0, < 2.0) 103 | railties (= 4.0.2) 104 | sprockets-rails (~> 2.0.0) 105 | railties (4.0.2) 106 | actionpack (= 4.0.2) 107 | activesupport (= 4.0.2) 108 | rake (>= 0.8.7) 109 | thor (>= 0.18.1, < 2.0) 110 | rake (10.1.1) 111 | rdoc (4.1.1) 112 | json (~> 1.4) 113 | sass (3.2.14) 114 | sass-rails (4.0.1) 115 | railties (>= 4.0.0, < 5.0) 116 | sass (>= 3.1.10) 117 | sprockets-rails (~> 2.0.0) 118 | sdoc (0.4.0) 119 | json (~> 1.8) 120 | rdoc (~> 4.0, < 5.0) 121 | sprockets (2.10.1) 122 | hike (~> 1.2) 123 | multi_json (~> 1.0) 124 | rack (~> 1.0) 125 | tilt (~> 1.1, != 1.3.0) 126 | sprockets-rails (2.0.1) 127 | actionpack (>= 3.0) 128 | activesupport (>= 3.0) 129 | sprockets (~> 2.8) 130 | sqlite3 (1.3.8) 131 | thor (0.18.1) 132 | thread_safe (0.1.3) 133 | atomic 134 | tilt (1.4.1) 135 | treetop (1.4.15) 136 | polyglot 137 | polyglot (>= 0.3.1) 138 | turbolinks (2.2.1) 139 | coffee-rails 140 | tzinfo (0.3.38) 141 | uglifier (2.4.0) 142 | execjs (>= 0.3.0) 143 | json (>= 1.8.0) 144 | warden (1.2.3) 145 | rack (>= 1.0) 146 | 147 | PLATFORMS 148 | ruby 149 | 150 | DEPENDENCIES 151 | coffee-rails (~> 4.0.0) 152 | devise 153 | jbuilder (~> 1.2) 154 | jquery-rails 155 | omniauth 156 | omniauth-facebook 157 | omniauth-twitter 158 | rails (= 4.0.2) 159 | sass-rails (~> 4.0.0) 160 | sdoc 161 | sqlite3 162 | turbolinks 163 | uglifier (>= 1.3.0) 164 | -------------------------------------------------------------------------------- /app/assets/javascripts/bootstrap/affix.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: affix.js v3.1.0 3 | * http://getbootstrap.com/javascript/#affix 4 | * ======================================================================== 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | * ======================================================================== */ 8 | 9 | 10 | +function ($) { 11 | 'use strict'; 12 | 13 | // AFFIX CLASS DEFINITION 14 | // ====================== 15 | 16 | var Affix = function (element, options) { 17 | this.options = $.extend({}, Affix.DEFAULTS, options) 18 | this.$window = $(window) 19 | .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) 20 | .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) 21 | 22 | this.$element = $(element) 23 | this.affixed = 24 | this.unpin = 25 | this.pinnedOffset = null 26 | 27 | this.checkPosition() 28 | } 29 | 30 | Affix.RESET = 'affix affix-top affix-bottom' 31 | 32 | Affix.DEFAULTS = { 33 | offset: 0 34 | } 35 | 36 | Affix.prototype.getPinnedOffset = function () { 37 | if (this.pinnedOffset) return this.pinnedOffset 38 | this.$element.removeClass(Affix.RESET).addClass('affix') 39 | var scrollTop = this.$window.scrollTop() 40 | var position = this.$element.offset() 41 | return (this.pinnedOffset = position.top - scrollTop) 42 | } 43 | 44 | Affix.prototype.checkPositionWithEventLoop = function () { 45 | setTimeout($.proxy(this.checkPosition, this), 1) 46 | } 47 | 48 | Affix.prototype.checkPosition = function () { 49 | if (!this.$element.is(':visible')) return 50 | 51 | var scrollHeight = $(document).height() 52 | var scrollTop = this.$window.scrollTop() 53 | var position = this.$element.offset() 54 | var offset = this.options.offset 55 | var offsetTop = offset.top 56 | var offsetBottom = offset.bottom 57 | 58 | if (this.affixed == 'top') position.top += scrollTop 59 | 60 | if (typeof offset != 'object') offsetBottom = offsetTop = offset 61 | if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) 62 | if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) 63 | 64 | var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : 65 | offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : 66 | offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false 67 | 68 | if (this.affixed === affix) return 69 | if (this.unpin) this.$element.css('top', '') 70 | 71 | var affixType = 'affix' + (affix ? '-' + affix : '') 72 | var e = $.Event(affixType + '.bs.affix') 73 | 74 | this.$element.trigger(e) 75 | 76 | if (e.isDefaultPrevented()) return 77 | 78 | this.affixed = affix 79 | this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null 80 | 81 | this.$element 82 | .removeClass(Affix.RESET) 83 | .addClass(affixType) 84 | .trigger($.Event(affixType.replace('affix', 'affixed'))) 85 | 86 | if (affix == 'bottom') { 87 | this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() }) 88 | } 89 | } 90 | 91 | 92 | // AFFIX PLUGIN DEFINITION 93 | // ======================= 94 | 95 | var old = $.fn.affix 96 | 97 | $.fn.affix = function (option) { 98 | return this.each(function () { 99 | var $this = $(this) 100 | var data = $this.data('bs.affix') 101 | var options = typeof option == 'object' && option 102 | 103 | if (!data) $this.data('bs.affix', (data = new Affix(this, options))) 104 | if (typeof option == 'string') data[option]() 105 | }) 106 | } 107 | 108 | $.fn.affix.Constructor = Affix 109 | 110 | 111 | // AFFIX NO CONFLICT 112 | // ================= 113 | 114 | $.fn.affix.noConflict = function () { 115 | $.fn.affix = old 116 | return this 117 | } 118 | 119 | 120 | // AFFIX DATA-API 121 | // ============== 122 | 123 | $(window).on('load', function () { 124 | $('[data-spy="affix"]').each(function () { 125 | var $spy = $(this) 126 | var data = $spy.data() 127 | 128 | data.offset = data.offset || {} 129 | 130 | if (data.offsetBottom) data.offset.bottom = data.offsetBottom 131 | if (data.offsetTop) data.offset.top = data.offsetTop 132 | 133 | $spy.affix(data) 134 | }) 135 | }) 136 | 137 | }(jQuery); 138 | -------------------------------------------------------------------------------- /app/assets/javascripts/bootstrap/dropdown.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: dropdown.js v3.1.0 3 | * http://getbootstrap.com/javascript/#dropdowns 4 | * ======================================================================== 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | * ======================================================================== */ 8 | 9 | 10 | +function ($) { 11 | 'use strict'; 12 | 13 | // DROPDOWN CLASS DEFINITION 14 | // ========================= 15 | 16 | var backdrop = '.dropdown-backdrop' 17 | var toggle = '[data-toggle=dropdown]' 18 | var Dropdown = function (element) { 19 | $(element).on('click.bs.dropdown', this.toggle) 20 | } 21 | 22 | Dropdown.prototype.toggle = function (e) { 23 | var $this = $(this) 24 | 25 | if ($this.is('.disabled, :disabled')) return 26 | 27 | var $parent = getParent($this) 28 | var isActive = $parent.hasClass('open') 29 | 30 | clearMenus() 31 | 32 | if (!isActive) { 33 | if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { 34 | // if mobile we use a backdrop because click events don't delegate 35 | $('