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.
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.
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 |
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 |
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 |