├── lib ├── tasks │ └── .gitkeep ├── assets │ └── .gitkeep └── templates │ └── erb │ └── scaffold │ └── _form.html.erb ├── public ├── favicon.ico ├── robots.txt ├── 500.html ├── 422.html └── 404.html ├── test ├── unit │ ├── .gitkeep │ ├── helpers │ │ ├── keg_helper_test.rb │ │ ├── beers_helper_test.rb │ │ ├── kegs_helper_test.rb │ │ ├── taps_helper_test.rb │ │ ├── vote_helper_test.rb │ │ ├── callback_helper_test.rb │ │ ├── ratings_helper_test.rb │ │ ├── requests_helper_test.rb │ │ ├── sessions_helper_test.rb │ │ ├── breweries_helper_test.rb │ │ ├── dashboard_helper_test.rb │ │ └── measurements_helper_test.rb │ ├── beer_test.rb │ ├── user_test.rb │ ├── vote_test.rb │ ├── rating_test.rb │ ├── beer_tap_test.rb │ ├── brewery_test.rb │ ├── request_test.rb │ ├── measurement_test.rb │ └── keg_test.rb ├── fixtures │ ├── .gitkeep │ ├── users.yml │ ├── votes.yml │ ├── beer_taps.yml │ ├── ratings.yml │ ├── requests.yml │ ├── manufacturers.yml │ ├── measurements.yml │ ├── kegs.yml │ └── beers.yml ├── functional │ ├── .gitkeep │ ├── keg_controller_test.rb │ ├── vote_controller_test.rb │ ├── breweries_controller_test.rb │ ├── callback_controller_test.rb │ ├── dashboard_controller_test.rb │ ├── ratings_controller_test.rb │ ├── requests_controller_test.rb │ ├── sessions_controller_test.rb │ ├── taps_controller_test.rb │ ├── kegs_controller_test.rb │ ├── beers_controller_test.rb │ └── measurements_controller_test.rb ├── integration │ └── .gitkeep ├── performance │ └── browsing_test.rb └── test_helper.rb ├── app ├── mailers │ └── .gitkeep ├── models │ ├── .gitkeep │ ├── .DS_Store │ ├── request.rb │ ├── vote.rb │ ├── user.rb │ ├── rating.rb │ ├── measurement.rb │ ├── beer_tap.rb │ ├── manufacturer.rb │ ├── beer.rb │ └── keg.rb ├── helpers │ ├── beers_helper.rb │ ├── keg_helper.rb │ ├── taps_helper.rb │ ├── vote_helper.rb │ ├── ratings_helper.rb │ ├── breweries_helper.rb │ ├── callback_helper.rb │ ├── requests_helper.rb │ ├── sessions_helper.rb │ ├── measurements_helper.rb │ ├── kegs_helper.rb │ ├── application_helper.rb │ └── dashboard_helper.rb ├── views │ ├── kegs │ │ ├── _sadface.html.erb │ │ ├── _keg.html.erb │ │ ├── new.html.erb │ │ ├── index.html.erb │ │ └── _beer_tap.html.erb │ ├── beers │ │ ├── new.html.erb │ │ └── index.html.erb │ ├── dashboard │ │ ├── index.html.erb │ │ └── _beer_list.html.erb │ ├── breweries │ │ ├── _brewery.html.erb │ │ ├── new.html.erb │ │ └── index.html.erb │ └── layouts │ │ └── application.html.erb ├── assets │ ├── .DS_Store │ ├── images │ │ ├── rails.png │ │ ├── beermon.png │ │ ├── beer-gloss.png │ │ ├── ui-icons_2694e8_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_3d80b3_256x240.png │ │ ├── ui-icons_72a7cf_256x240.png │ │ ├── ui-icons_ffffff_256x240.png │ │ ├── ui-bg_flat_15_cd0a0a_40x100.png │ │ ├── ui-bg_glass_100_e4f1fb_1x400.png │ │ ├── ui-bg_glass_50_3baae3_1x400.png │ │ ├── ui-bg_glass_80_d7ebf9_1x400.png │ │ ├── ui-bg_highlight-hard_70_000000_1x100.png │ │ ├── ui-bg_highlight-soft_25_ffef8f_1x100.png │ │ ├── ui-bg_diagonals-thick_90_eeeeee_40x40.png │ │ ├── ui-bg_highlight-hard_100_f2f5f7_1x100.png │ │ └── ui-bg_highlight-soft_100_deedf7_1x100.png │ ├── javascripts │ │ ├── .DS_Store │ │ ├── bootstrap.js.coffee │ │ ├── keg.js.coffee │ │ ├── taps.js.coffee │ │ ├── vote.js.coffee │ │ ├── beers.js.coffee │ │ ├── breweries.js.coffee │ │ ├── callback.js.coffee │ │ ├── dashboard.js.coffee │ │ ├── ratings.js.coffee │ │ ├── requests.js.coffee │ │ ├── sessions.js.coffee │ │ ├── measurements.js.coffee │ │ ├── application.js │ │ └── kegs.js.coffee │ ├── webfonts │ │ ├── 2470E9_0_0.eot │ │ ├── 2470E9_0_0.ttf │ │ └── 2470E9_0_0.woff │ └── stylesheets │ │ ├── keg.css.scss │ │ ├── kegs.css.scss │ │ ├── taps.css.scss │ │ ├── vote.css.scss │ │ ├── beers.css.scss │ │ ├── breweries.css.scss │ │ ├── callback.css.scss │ │ ├── dashboard.css.scss │ │ ├── ratings.css.scss │ │ ├── requests.css.scss │ │ ├── sessions.css.scss │ │ ├── measurements.css.scss │ │ ├── webfonts.css │ │ ├── bootstrap_and_overrides.css.less │ │ ├── application.css │ │ └── jquery-ui-1.9.2.custom.css └── controllers │ ├── requests_controller.rb │ ├── breweries_controller.rb │ ├── ratings_controller.rb │ ├── taps_controller.rb │ ├── sessions_controller.rb │ ├── application_controller.rb │ ├── measurements_controller.rb │ ├── callback_controller.rb │ ├── beers_controller.rb │ ├── votes_controller.rb │ ├── kegs_controller.rb │ └── dashboard_controller.rb ├── vendor ├── plugins │ └── .gitkeep └── assets │ ├── javascripts │ └── .gitkeep │ └── stylesheets │ └── .gitkeep ├── Procfile ├── assets ├── .DS_Store ├── beermon.psd └── beermon.aiff ├── README.rdoc ├── config ├── initializers │ ├── twilio.rb │ ├── mime_types.rb │ ├── omniauth.rb │ ├── backtrace_silencers.rb │ ├── session_store.rb │ ├── secret_token.rb │ ├── wrap_parameters.rb │ ├── inflections.rb │ └── simple_form.rb ├── unicorn.rb ├── environment.rb ├── boot.rb ├── locales │ ├── en.yml │ ├── en.bootstrap.yml │ └── simple_form.en.yml ├── database.yml ├── routes.rb ├── environments │ ├── development.rb │ ├── test.rb │ └── production.rb └── application.rb ├── config.ru ├── db ├── migrate │ ├── 20121019020043_add_notified_for_keg.rb │ ├── 20121016233749_create_beer_taps.rb │ ├── 20121019151218_rename_brewery_column.rb │ ├── 20121019195635_change_timestamp_to_integer.rb │ ├── 20121016121546_create_measurements.rb │ ├── 20121018144916_create_ratings.rb │ ├── 20121016121501_create_requests.rb │ ├── 20121019014130_create_users.rb │ ├── 20121016224314_create_beers.rb │ ├── 20121016121454_create_kegs.rb │ ├── 20121019154140_create_votes.rb │ ├── 20121016230125_add_measurement_sample_timestamp_to_measurement.rb │ ├── 20121016224326_remove_beer_information_from_keg.rb │ └── 20121019022202_create_breweries.rb ├── seeds.rb └── schema.rb ├── doc └── README_FOR_APP ├── Rakefile ├── script └── rails ├── .gitignore ├── Gemfile ├── LICENSE └── Gemfile.lock /lib/tasks/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/unit/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/mailers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/plugins/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functional/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/integration/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bundle exec unicorn -c ./config/unicorn.rb -------------------------------------------------------------------------------- /app/helpers/beers_helper.rb: -------------------------------------------------------------------------------- 1 | module BeersHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/keg_helper.rb: -------------------------------------------------------------------------------- 1 | module KegHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/taps_helper.rb: -------------------------------------------------------------------------------- 1 | module TapsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/vote_helper.rb: -------------------------------------------------------------------------------- 1 | module VoteHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/ratings_helper.rb: -------------------------------------------------------------------------------- 1 | module RatingsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/breweries_helper.rb: -------------------------------------------------------------------------------- 1 | module BreweriesHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/callback_helper.rb: -------------------------------------------------------------------------------- 1 | module CallbackHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/requests_helper.rb: -------------------------------------------------------------------------------- 1 | module RequestsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | module SessionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/measurements_helper.rb: -------------------------------------------------------------------------------- 1 | module MeasurementsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/views/kegs/_sadface.html.erb: -------------------------------------------------------------------------------- 1 |

Nothing is Hooked up :(

-------------------------------------------------------------------------------- /assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/assets/.DS_Store -------------------------------------------------------------------------------- /assets/beermon.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/assets/beermon.psd -------------------------------------------------------------------------------- /app/assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/.DS_Store -------------------------------------------------------------------------------- /app/controllers/requests_controller.rb: -------------------------------------------------------------------------------- 1 | class RequestsController < ApplicationController 2 | end 3 | -------------------------------------------------------------------------------- /app/models/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/models/.DS_Store -------------------------------------------------------------------------------- /assets/beermon.aiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/assets/beermon.aiff -------------------------------------------------------------------------------- /app/models/request.rb: -------------------------------------------------------------------------------- 1 | class Request < ActiveRecord::Base 2 | # attr_accessible :title, :body 3 | end 4 | -------------------------------------------------------------------------------- /README.rdoc: -------------------------------------------------------------------------------- 1 | == Beermon 2 | 3 | Keg monitoring service and Suggestion collector for 4 | the Shopify Keggerator -------------------------------------------------------------------------------- /app/assets/images/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/rails.png -------------------------------------------------------------------------------- /app/assets/images/beermon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/beermon.png -------------------------------------------------------------------------------- /test/unit/helpers/keg_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class KegHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /app/assets/images/beer-gloss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/beer-gloss.png -------------------------------------------------------------------------------- /app/assets/javascripts/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/javascripts/.DS_Store -------------------------------------------------------------------------------- /test/unit/helpers/beers_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BeersHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/unit/helpers/kegs_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class KegsHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/unit/helpers/taps_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TapsHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/unit/helpers/vote_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class VoteHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /app/assets/webfonts/2470E9_0_0.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/webfonts/2470E9_0_0.eot -------------------------------------------------------------------------------- /app/assets/webfonts/2470E9_0_0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/webfonts/2470E9_0_0.ttf -------------------------------------------------------------------------------- /app/assets/webfonts/2470E9_0_0.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/webfonts/2470E9_0_0.woff -------------------------------------------------------------------------------- /test/unit/helpers/callback_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class CallbackHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/unit/helpers/ratings_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class RatingsHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/unit/helpers/requests_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class RequestsHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/unit/helpers/sessions_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SessionsHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /app/helpers/kegs_helper.rb: -------------------------------------------------------------------------------- 1 | module KegsHelper 2 | def add_draggable(keg) 3 | 'draggable' if keg.remaining > 1 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/models/vote.rb: -------------------------------------------------------------------------------- 1 | class Vote < ActiveRecord::Base 2 | belongs_to :beer 3 | belongs_to :user 4 | attr_accessible :value 5 | end 6 | -------------------------------------------------------------------------------- /test/unit/helpers/breweries_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BreweriesHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/unit/helpers/dashboard_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class DashboardHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/unit/helpers/measurements_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class MeasurementsHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /app/assets/images/ui-icons_2694e8_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-icons_2694e8_256x240.png -------------------------------------------------------------------------------- /app/assets/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /app/assets/images/ui-icons_3d80b3_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-icons_3d80b3_256x240.png -------------------------------------------------------------------------------- /app/assets/images/ui-icons_72a7cf_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-icons_72a7cf_256x240.png -------------------------------------------------------------------------------- /app/assets/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /app/assets/javascripts/bootstrap.js.coffee: -------------------------------------------------------------------------------- 1 | jQuery -> 2 | $("a[rel=popover]").popover() 3 | $(".tooltip").tooltip() 4 | $("a[rel=tooltip]").tooltip() -------------------------------------------------------------------------------- /app/assets/images/ui-bg_flat_15_cd0a0a_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-bg_flat_15_cd0a0a_40x100.png -------------------------------------------------------------------------------- /app/assets/images/ui-bg_glass_100_e4f1fb_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-bg_glass_100_e4f1fb_1x400.png -------------------------------------------------------------------------------- /app/assets/images/ui-bg_glass_50_3baae3_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-bg_glass_50_3baae3_1x400.png -------------------------------------------------------------------------------- /app/assets/images/ui-bg_glass_80_d7ebf9_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-bg_glass_80_d7ebf9_1x400.png -------------------------------------------------------------------------------- /config/initializers/twilio.rb: -------------------------------------------------------------------------------- 1 | $twilio_username = ENV['TWILIO_USERNAME'] 2 | $twilio_password = ENV['TWILIO_PASSWORD'] 3 | $twilio_sender = ENV['TWILIO_SENDER'] -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ActiveRecord::Base 2 | attr_accessible :email, :phone_number, :send_sms, :send_email 3 | # attr_accessible :title, :body 4 | end 5 | -------------------------------------------------------------------------------- /config/unicorn.rb: -------------------------------------------------------------------------------- 1 | port = ENV['PORT'].to_i 2 | port = 3000 if port <= 0 3 | worker_processes 1 4 | timeout 30 5 | preload_app true 6 | listen port, :tcp_nopush => false -------------------------------------------------------------------------------- /test/unit/beer_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BeerTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/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 | -------------------------------------------------------------------------------- /test/unit/vote_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class VoteTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/rating_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class RatingTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /app/assets/images/ui-bg_highlight-hard_70_000000_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-bg_highlight-hard_70_000000_1x100.png -------------------------------------------------------------------------------- /app/assets/images/ui-bg_highlight-soft_25_ffef8f_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-bg_highlight-soft_25_ffef8f_1x100.png -------------------------------------------------------------------------------- /app/models/rating.rb: -------------------------------------------------------------------------------- 1 | class Rating < ActiveRecord::Base 2 | belongs_to :beer 3 | validates_inclusion_of :value, :in => 1..5 4 | attr_accessible :value, :message 5 | end 6 | -------------------------------------------------------------------------------- /test/unit/beer_tap_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BeerTapTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/brewery_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BreweryTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/request_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class RequestTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /app/assets/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png -------------------------------------------------------------------------------- /app/assets/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png -------------------------------------------------------------------------------- /app/assets/images/ui-bg_highlight-soft_100_deedf7_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orenmazor/beermon-server/master/app/assets/images/ui-bg_highlight-soft_100_deedf7_1x100.png -------------------------------------------------------------------------------- /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 Beermon::Application 5 | -------------------------------------------------------------------------------- /test/unit/measurement_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class MeasurementTest < ActiveSupport::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 | Beermon::Application.initialize! 6 | -------------------------------------------------------------------------------- /test/functional/keg_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class KegControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/functional/vote_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class VoteControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20121019020043_add_notified_for_keg.rb: -------------------------------------------------------------------------------- 1 | class AddNotifiedForKeg < ActiveRecord::Migration 2 | def change 3 | add_column :kegs, :notified, :boolean, :default => false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /test/functional/breweries_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BreweriesControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/functional/callback_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class CallbackControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/functional/dashboard_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class DashboardControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/functional/ratings_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class RatingsControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/functional/requests_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class RequestsControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/functional/sessions_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SessionsControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /app/models/measurement.rb: -------------------------------------------------------------------------------- 1 | class Measurement < ActiveRecord::Base 2 | belongs_to :keg 3 | attr_accessible :volume, :temperature, :sampled_at 4 | validates_uniqueness_of :volume, :scope => :keg_id 5 | end 6 | -------------------------------------------------------------------------------- /app/assets/stylesheets/keg.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Keg controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/kegs.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Kegs controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/taps.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Taps controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/vote.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the vote controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/beers.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Beers controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/breweries.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the breweries controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/callback.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Callback controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/dashboard.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Dashboard controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/ratings.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Ratings controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/requests.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Requests controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/sessions.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Sessions controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | 3 | # Set up gems listed in the Gemfile. 4 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 5 | 6 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) 7 | -------------------------------------------------------------------------------- /doc/README_FOR_APP: -------------------------------------------------------------------------------- 1 | Use this README file to introduce your application and point to useful places in the API for learning more. 2 | Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries. 3 | -------------------------------------------------------------------------------- /app/assets/stylesheets/measurements.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Measurements controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /db/migrate/20121016233749_create_beer_taps.rb: -------------------------------------------------------------------------------- 1 | class CreateBeerTaps < ActiveRecord::Migration 2 | def change 3 | create_table :beer_taps do |t| 4 | t.string :name 5 | 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | def current_user 3 | @current_user || User.find(session[:user_id]) 4 | end 5 | 6 | def navbar_admin 7 | 'navbar-admin' if current_user.admin? 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20121019151218_rename_brewery_column.rb: -------------------------------------------------------------------------------- 1 | class RenameBreweryColumn < ActiveRecord::Migration 2 | def change 3 | rename_column :beers, :brewery_id, :manufacturer_id 4 | rename_table :breweries, :manufacturers 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Sample localization file for English. Add more files in this directory for other locales. 2 | # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. 3 | 4 | en: 5 | hello: "Hello world" 6 | -------------------------------------------------------------------------------- /config/initializers/omniauth.rb: -------------------------------------------------------------------------------- 1 | require 'openid/store/filesystem' 2 | Rails.application.config.middleware.use OmniAuth::Builder do 3 | provider :google_apps, :store => OpenID::Store::Filesystem.new('./tmp'), :name => 'g', :domain => 'jadedpixel.com' 4 | end 5 | -------------------------------------------------------------------------------- /db/migrate/20121019195635_change_timestamp_to_integer.rb: -------------------------------------------------------------------------------- 1 | class ChangeTimestampToInteger < ActiveRecord::Migration 2 | def change 3 | remove_column :measurements, :sampled_at 4 | add_column :measurements, :sampled_at, :integer, :limit => 8 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/assets/javascripts/keg.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://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/taps.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://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/vote.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://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/beers.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://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/breweries.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://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/callback.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://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/dashboard.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://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/ratings.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://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/requests.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://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/sessions.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://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/measurements.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://jashkenas.github.com/coffee-script/ 4 | -------------------------------------------------------------------------------- /db/migrate/20121016121546_create_measurements.rb: -------------------------------------------------------------------------------- 1 | class CreateMeasurements < ActiveRecord::Migration 2 | def change 3 | create_table :measurements do |t| 4 | t.integer :keg_id 5 | t.float :amount 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/models/beer_tap.rb: -------------------------------------------------------------------------------- 1 | class BeerTap < ActiveRecord::Base 2 | attr_accessible :name 3 | has_one :keg 4 | 5 | def detached? 6 | keg.blank? 7 | end 8 | 9 | def serializable_hash(options={}) 10 | options[:include] ||= [:keg] 11 | super 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20121018144916_create_ratings.rb: -------------------------------------------------------------------------------- 1 | class CreateRatings < ActiveRecord::Migration 2 | def change 3 | create_table :ratings do |t| 4 | t.integer :beer_id 5 | t.integer :value 6 | t.string :message 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | # Add your own tasks in files placed in lib/tasks ending in .rake, 3 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 4 | 5 | require File.expand_path('../config/application', __FILE__) 6 | 7 | Beermon::Application.load_tasks 8 | -------------------------------------------------------------------------------- /db/migrate/20121016121501_create_requests.rb: -------------------------------------------------------------------------------- 1 | class CreateRequests < ActiveRecord::Migration 2 | def change 3 | create_table :requests do |t| 4 | t.string :brewery 5 | t.string :name 6 | t.string :requested_by 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20121019014130_create_users.rb: -------------------------------------------------------------------------------- 1 | class CreateUsers < ActiveRecord::Migration 2 | def change 3 | create_table :users do |t| 4 | t.string :email 5 | t.string :phone_number 6 | t.boolean :send_sms 7 | t.boolean :send_email 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /script/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. 3 | 4 | APP_PATH = File.expand_path('../../config/application', __FILE__) 5 | require File.expand_path('../../config/boot', __FILE__) 6 | require 'rails/commands' 7 | -------------------------------------------------------------------------------- /db/migrate/20121016224314_create_beers.rb: -------------------------------------------------------------------------------- 1 | class CreateBeers < ActiveRecord::Migration 2 | def change 3 | create_table :beers do |t| 4 | t.string :name 5 | t.string :brewery 6 | t.float :abv 7 | t.float :srm 8 | t.float :ibus 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20121016121454_create_kegs.rb: -------------------------------------------------------------------------------- 1 | class CreateKegs < ActiveRecord::Migration 2 | def change 3 | create_table :kegs do |t| 4 | t.string :kind 5 | t.float :capacity 6 | t.string :brewery 7 | t.string :name 8 | t.float :ibu 9 | t.float :srm 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20121019154140_create_votes.rb: -------------------------------------------------------------------------------- 1 | class CreateVotes < ActiveRecord::Migration 2 | def change 3 | create_table :votes do |t| 4 | t.integer :value 5 | t.integer :beer_id 6 | t.integer :user_id 7 | t.timestamps 8 | end 9 | 10 | add_index(:votes, :beer_id) 11 | add_index(:votes, :user_id) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/views/kegs/_keg.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 |

<%= keg.beer.name %>

4 |

<%= keg.beer.manufacturer.name %>

5 |

<%= keg.beer.abv %>%

6 |

<%= keg.beer.ibus %> IBU

7 |

Received On: <%= keg.created_at %>

8 |
-------------------------------------------------------------------------------- /app/views/kegs/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= simple_form_for @keg, :html => {:class => 'form-horizontal'} do |f| %> 3 | <%= f.association :beer %> 4 | <%= f.input :capacity, :label => "Capacity of keg (in liters)" %> 5 | <%= f.input :kind, :label => "Keg Attachment" %> 6 | 7 | <%= f.submit 'Submit', :class => 'btn btn-success' %> 8 | <% end %> 9 |
-------------------------------------------------------------------------------- /db/migrate/20121016230125_add_measurement_sample_timestamp_to_measurement.rb: -------------------------------------------------------------------------------- 1 | class AddMeasurementSampleTimestampToMeasurement < ActiveRecord::Migration 2 | def change 3 | remove_column :measurements, :amount 4 | add_column :measurements, :volume, :float 5 | add_column :measurements, :sampled_at, :datetime 6 | add_column :measurements, :temperature, :float 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20121016224326_remove_beer_information_from_keg.rb: -------------------------------------------------------------------------------- 1 | class RemoveBeerInformationFromKeg < ActiveRecord::Migration 2 | def change 3 | remove_column :kegs, :brewery 4 | remove_column :kegs, :name 5 | remove_column :kegs, :ibu 6 | remove_column :kegs, :srm 7 | 8 | add_column :kegs, :beer_tap_id, :integer 9 | add_column :kegs, :beer_id, :integer 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/views/beers/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= simple_form_for @beer, :html => {:class => 'form-horizontal'} do |f| %> 3 | <%= f.input :name %> 4 | <%= f.input :abv %> 5 | <%= f.input :srm %> 6 | <%= f.input :ibus %> 7 | <%= f.input :brewery %> 8 | <%= f.association :manufacturer %> 9 | 10 | <%= f.submit 'Submit', :class => 'btn btn-success' %> 11 | <% end %> 12 |
-------------------------------------------------------------------------------- /test/fixtures/users.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.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 | -------------------------------------------------------------------------------- /test/fixtures/votes.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.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 | -------------------------------------------------------------------------------- /test/fixtures/beer_taps.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.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 | left: 8 | name: "Left Tap" 9 | 10 | right: 11 | name: "Right Tap" 12 | -------------------------------------------------------------------------------- /test/fixtures/ratings.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.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 | -------------------------------------------------------------------------------- /test/fixtures/requests.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.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 | -------------------------------------------------------------------------------- /test/fixtures/manufacturers.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.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 | -------------------------------------------------------------------------------- /lib/templates/erb/scaffold/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%%= simple_form_for(@<%= singular_table_name %>) do |f| %> 2 | <%%= f.error_notification %> 3 | 4 |
5 | <%- attributes.each do |attribute| -%> 6 | <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %> 7 | <%- end -%> 8 |
9 | 10 |
11 | <%%= f.button :submit %> 12 |
13 | <%% end %> 14 | -------------------------------------------------------------------------------- /test/performance/browsing_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | require 'rails/performance_test_help' 3 | 4 | class BrowsingTest < ActionDispatch::PerformanceTest 5 | # Refer to the documentation for all available options 6 | # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory] 7 | # :output => 'tmp/performance', :formats => [:flat] } 8 | 9 | def test_homepage 10 | get '/' 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/controllers/breweries_controller.rb: -------------------------------------------------------------------------------- 1 | class BreweriesController < ApplicationController 2 | 3 | def index 4 | @breweries = Manufacturer.all 5 | end 6 | 7 | def create 8 | @brewery = Manufacturer.create(params[:manufacturer]) 9 | if @brewery.persisted? 10 | redirect_to :action => 'index' 11 | else 12 | render 'new' 13 | end 14 | end 15 | 16 | def new 17 | @brewery = Manufacturer.new 18 | end 19 | 20 | end 21 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Beermon::Application.config.session_store :cookie_store, key: '_beermon_session' 4 | 5 | # Use the database for sessions instead of the cookie-based default, 6 | # which shouldn't be used to store highly confidential information 7 | # (create the session table with "rails generate session_migration") 8 | # Beermon::Application.config.session_store :active_record_store 9 | -------------------------------------------------------------------------------- /app/models/manufacturer.rb: -------------------------------------------------------------------------------- 1 | class Manufacturer < ActiveRecord::Base 2 | has_many :beers 3 | attr_accessible :name, :phone, :email, :address1, :address2, :city 4 | attr_accessible :city, :postal_code, :province, :country 5 | validate :valid_phone_number 6 | validates_presence_of :name 7 | 8 | def valid_phone_number 9 | return unless phone.present? 10 | return if phone =~ /\+\d{11}/ 11 | errors.add(:phone, "must match format +10123456789") 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/fixtures/measurements.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.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 | carsons_stein: 8 | keg: keg_o_darkhorse 9 | volume: 1.0 10 | 11 | chris_pint_glass: 12 | keg: keg_o_lugtread 13 | volume: 0.355 14 | -------------------------------------------------------------------------------- /app/controllers/ratings_controller.rb: -------------------------------------------------------------------------------- 1 | class RatingsController < ApplicationController 2 | respond_to :html, :json, :only => [:create] 3 | before_filter :find_beer 4 | 5 | def new 6 | @rating = @beer.ratings.new 7 | end 8 | 9 | 10 | def create 11 | rating = request.format.json? ? @beer.ratings.create(params[:rating]) : nil 12 | respond_with(@beer, rating) 13 | end 14 | 15 | private 16 | 17 | def find_beer 18 | @beer = Beer.find(params[:beer_id]) 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile ~/.gitignore_global 6 | 7 | # Ignore bundler config 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | 13 | # Ignore all logfiles and tempfiles. 14 | /log/*.log 15 | /tmp 16 | 17 | .DS_Store -------------------------------------------------------------------------------- /app/views/beers/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 | <%= link_to 'Create', {:action => 'new'}, {:class => 'btn btn-primary'} %> 4 |
5 |
6 | 7 |
8 | <% if @beers.present? %> 9 | <%= render 'dashboard/beer_list' %> 10 | <% else %> 11 |
12 |

You don't have any beers added yet.

13 |

<%= link_to 'Add one now', :action => 'new' %>

14 |
15 | <% end %> 16 |
17 | -------------------------------------------------------------------------------- /config/locales/en.bootstrap.yml: -------------------------------------------------------------------------------- 1 | # Sample localization file for English. Add more files in this directory for other locales. 2 | # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. 3 | 4 | en: 5 | helpers: 6 | actions: "Actions" 7 | links: 8 | back: "Back" 9 | cancel: "Cancel" 10 | confirm: "Are you sure?" 11 | destroy: "Delete" 12 | new: "New" 13 | titles: 14 | edit: "Edit" 15 | save: "Save" 16 | new: "New" 17 | delete: "Delete" 18 | -------------------------------------------------------------------------------- /config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | # Make sure the secret is at least 30 characters and all random, 6 | # no regular words or you'll be exposed to dictionary attacks. 7 | Beermon::Application.config.secret_token = '4a85c4b823acde3e99c85988ebadaca761750d15b8d672e29c602a2bec5af8d7ef1e3409b3336a1c00f89e9d166783733e8fb3533607a3adf54442c1787803c4' 8 | -------------------------------------------------------------------------------- /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] 9 | end 10 | 11 | # Disable root element in JSON by default. 12 | ActiveSupport.on_load(:active_record) do 13 | self.include_root_in_json = false 14 | end 15 | -------------------------------------------------------------------------------- /app/views/dashboard/index.html.erb: -------------------------------------------------------------------------------- 1 |

What's on Tap?

2 | 3 |
4 | <% @beer_taps.each do |beer_tap| %> 5 | <%= render :partial => 'kegs/beer_tap', :locals => {:beer_tap => beer_tap} %> 6 | <% end %> 7 |
8 | 9 | <% if current_user.admin? %> 10 | 11 |

To Order Next:

12 | 13 |
14 |
15 | <%= @recommended.map{|beer| beer.name}.to_sentence %> 16 |
17 |
18 | 19 | <% end %> 20 | 21 | 22 |

☥ The Bible ☥

23 | 24 | <%= render 'beer_list' %> -------------------------------------------------------------------------------- /test/fixtures/kegs.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.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 | keg_o_lugtread: 8 | capacity: 20.0 9 | kind: 'sankey' 10 | beer: lugtread 11 | 12 | # column: value 13 | # 14 | keg_o_darkhorse: 15 | capacity: 50.0 16 | kind: 'sankey' 17 | beer: darkhorse 18 | beer_tap: left 19 | 20 | # column: value 21 | -------------------------------------------------------------------------------- /app/controllers/taps_controller.rb: -------------------------------------------------------------------------------- 1 | class TapsController < ApplicationController 2 | respond_to :json, :only => [:index, :show, :update] 3 | before_filter :find_beer_tap, :only => [:show, :update] 4 | 5 | def index 6 | respond_with(BeerTap.all) 7 | end 8 | 9 | def show 10 | respond_with(@beer_tap) 11 | end 12 | 13 | def update 14 | keg = Keg.find(params[:keg_id]) 15 | @beer_tap.keg = keg 16 | @beer_tap.save 17 | respond_with(@beer_tap) 18 | end 19 | 20 | private 21 | 22 | def find_beer_tap 23 | @beer_tap = BeerTap.find(params[:id]) 24 | end 25 | 26 | end 27 | -------------------------------------------------------------------------------- /app/views/kegs/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <% @beer_taps.each do |beer_tap| %> 3 | <%= render :partial => 'beer_tap', :locals => {:beer_tap => beer_tap} %> 4 | <% end %> 5 |
6 | 7 |
8 |
9 | <%= link_to 'Create', {:action => 'new'}, {:class => 'btn btn-primary'} %> 10 |
11 |
12 | 13 |

Available Kegs

14 | <% @kegs.each_slice(3) do |row| %> 15 |
16 | <% row.each do |keg| %> 17 | <%= render :partial => "keg", :locals => {:keg => keg} %> 18 | <% end %> 19 |
20 | <% end %> 21 | -------------------------------------------------------------------------------- /app/controllers/sessions_controller.rb: -------------------------------------------------------------------------------- 1 | class SessionsController < ApplicationController 2 | skip_before_filter :authenticate 3 | 4 | def new 5 | redirect_to '/auth/g' 6 | end 7 | 8 | def create 9 | if auth = request.env['omniauth.auth'] 10 | user = User.find_or_initialize_by_email(auth['info']['email']) 11 | user.uid = auth['uid'] 12 | user.save 13 | 14 | session[:user_id] = user.id 15 | redirect_to root_url 16 | else 17 | redirect_to 'auth/failure' 18 | end 19 | end 20 | 21 | def failure 22 | render :text => "None shall pass!" 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /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 4 | # (all these examples are active by default): 5 | # ActiveSupport::Inflector.inflections do |inflect| 6 | # inflect.plural /^(ox)$/i, '\1en' 7 | # inflect.singular /^(ox)en/i, '\1' 8 | # inflect.irregular 'person', 'people' 9 | # inflect.uncountable %w( fish sheep ) 10 | # end 11 | # 12 | # These inflection rules are supported but not enabled by default: 13 | # ActiveSupport::Inflector.inflections do |inflect| 14 | # inflect.acronym 'RESTful' 15 | # end 16 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | before_filter :authenticate 3 | 4 | def authenticate 5 | return if current_user 6 | return if Rails.env.development? 7 | authenticate_or_request_with_http_basic do |name, password| 8 | name == '05f8a4e34b57482ad021cfb0' && password == 'd84c1dfb42c2abcf0c90180e' 9 | end 10 | end 11 | 12 | def requires_admin 13 | return if current_user && current_user.admin? 14 | head :unauthorized 15 | end 16 | 17 | def current_user 18 | @user ||= User.find_by_id(session[:user_id]) 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /app/views/breweries/_brewery.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 | <%= brewery.name %>
4 | <%= brewery.address1 %>
5 | <%= brewery.address2 %>
6 | <%= brewery.city %>, <%= brewery.province %>
7 | <%= brewery.postal_code %>
8 |
9 | 10 |
11 | <% if brewery.phone %> 12 | Tel: <%= link_to brewery.phone, "tel:#{brewery.phone}" %>
13 | <% end %> 14 | <% if brewery.email %> 15 | Email: <%= link_to brewery.email, "mailto:#{brewery.email}" %>
16 | <% end %> 17 |
18 |
-------------------------------------------------------------------------------- /db/migrate/20121019022202_create_breweries.rb: -------------------------------------------------------------------------------- 1 | class CreateBreweries < ActiveRecord::Migration 2 | def change 3 | create_table :breweries do |t| 4 | t.string :name 5 | t.string :phone 6 | t.string :email 7 | t.string :address1 8 | t.string :address2 9 | t.string :city 10 | t.string :postal_code 11 | t.string :province, :default => "Ontario" 12 | t.string :country, :default => "Canada" 13 | 14 | t.timestamps 15 | end 16 | 17 | add_column :beers, :brewery_id, :integer 18 | add_column :users, :uid, :string 19 | add_column :users, :admin, :boolean, :default => false 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /test/fixtures/beers.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.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 | lugtread: 8 | brewery: "Beau's All Natural Brewing Co." 9 | name: 'Lug Tread' 10 | ibus: 21.0 11 | srm: 3.5 12 | abv: 5.6 13 | # column: value 14 | # 15 | darkhorse: 16 | brewery: 'Broadhead Brewing Company' 17 | name: 'Dark Horse Stout' 18 | ibus: 25.5 19 | srm: 34.2 20 | abv: 6.1 21 | # column: value 22 | -------------------------------------------------------------------------------- /app/controllers/measurements_controller.rb: -------------------------------------------------------------------------------- 1 | class MeasurementsController < ApplicationController 2 | respond_to :json 3 | before_filter :find_keg 4 | 5 | def index 6 | respond_with(@keg.measurements) 7 | end 8 | 9 | def show 10 | measurement = @keg.measurements.find(params[:id]) 11 | respond_with([@keg, measurement]) 12 | end 13 | 14 | def create 15 | measurement_params = params[:measurement].except(:sampled_at, :keg_id) 16 | measurement = @keg.measurements.create(measurement_params) 17 | respond_with(@keg, measurement) 18 | end 19 | 20 | private 21 | 22 | def find_keg 23 | @keg = Keg.find(params[:keg_id]) 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /app/views/breweries/new.html.erb: -------------------------------------------------------------------------------- 1 | <%= simple_form_for @brewery, :url => {:controller => 'breweries', :action => 'create'} do |f|%> 2 |
3 |
4 | <%= f.input :name %> 5 | <%= f.input :phone %> 6 | <%= f.input :email %> 7 |
8 |
9 | <%= f.input :address1 %> 10 | <%= f.input :address2 %> 11 | <%= f.input :city %> 12 |
13 |
14 | <%= f.input :postal_code %> 15 | <%= f.input :province %> 16 | <%= f.input :country %> 17 |
18 |
19 | 20 |
21 | <%= f.submit 'Submit', :class => 'btn btn-success' %> 22 |
23 | <% end %> 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/controllers/callback_controller.rb: -------------------------------------------------------------------------------- 1 | class CallbackController < ApplicationController 2 | skip_before_filter :authenticate 3 | 4 | def create 5 | Rails.logger.info params 6 | brewery = Manufacturer.find_by_id(params[:brewery]) 7 | if brewery 8 | Rails.logger.info "#{brewery.name}" 9 | response = Twilio::TwiML::Response.new do |r| 10 | r.Say "Connecting you to #{brewery.name}", :voice => 'woman' 11 | r.Dial :callerId => brewery.phone 12 | end 13 | 14 | Rails.logger.info response.text 15 | 16 | render :text => response.text, :content_type => "application/xml" 17 | else 18 | render :text => "whoopsie" 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/views/breweries/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 | <%= link_to 'Create', {:action => 'new'}, {:class => 'btn btn-primary'} %> 4 |
5 |
6 | 7 | <% if @breweries.present? %> 8 | <% @breweries.each_slice(3) do |row| %> 9 |
10 | <% row.each do |brewery| %> 11 | <%= render :partial => 'brewery', :locals => {:brewery => brewery} %> 12 | <% end %> 13 |
14 | <% end %> 15 | <% else %> 16 |
17 |
18 |

You don't have any breweries yet.

19 |

<%= link_to 'Add one now', :action => 'new' %>

20 |
21 |
22 | <% end %> 23 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

We're sorry, but something went wrong.

23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /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 | // the compiled file. 9 | // 10 | // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD 11 | // GO AFTER THE REQUIRES BELOW. 12 | // 13 | //= require jquery 14 | //= require jquery_ujs 15 | //= require twitter/bootstrap 16 | //= require_tree . 17 | -------------------------------------------------------------------------------- /app/models/beer.rb: -------------------------------------------------------------------------------- 1 | class Beer < ActiveRecord::Base 2 | attr_accessible :ibus, :srm, :abv, :name, :brewery, :manufacturer_id 3 | has_many :kegs 4 | has_many :votes 5 | has_many :ratings 6 | belongs_to :manufacturer 7 | validates_presence_of :name 8 | 9 | def rating 10 | ratings.average(:value) 11 | end 12 | 13 | def serializable_hash(options={}) 14 | options[:only] = [:id, :created_at, :updated_at, :name, :ibus, :srm, :abv, :brewery] 15 | options[:methods] = [:rating] 16 | super 17 | end 18 | 19 | def email_order 20 | email = "mailto:#{manufacturer.email}?" 21 | email << "subject=" 22 | email << %w(Shopify would like to place an order for).join(' ') 23 | email << " #{name}" 24 | email 25 | end 26 | 27 | end 28 | -------------------------------------------------------------------------------- /test/unit/keg_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class KegTest < ActiveSupport::TestCase 4 | 5 | setup do 6 | @keg = kegs(:keg_o_darkhorse) 7 | end 8 | 9 | test "it should be able to report the remaining liquid in a keg" do 10 | keg = kegs(:keg_o_darkhorse) 11 | 12 | assert_equal 1, keg.measurements.count 13 | assert_equal 49.0, keg.remaining 14 | 15 | keg.measurements.create(:volume => 0.5) 16 | assert_equal 48.5, keg.remaining 17 | end 18 | 19 | test "if a keg has more than the threshold" do 20 | assert !@keg.below_threshold? 21 | end 22 | 23 | test "if a keg has less than the threshold" do 24 | @keg.measurements.create(:volume => @keg.capacity - 4.0) 25 | assert @keg.reload.below_threshold? 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /app/assets/javascripts/kegs.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://jashkenas.github.com/coffee-script/ 4 | 5 | $('.draggable').draggable({revert: 'invalid'}) 6 | $('.droppable').droppable 7 | drop: (event, ui) -> 8 | tapId = $(this).attr('data-id') 9 | kegId = ui.draggable.attr('data-id') 10 | request_url = 11 | $.ajax({ 12 | type: 'PUT', 13 | url: "/taps/#{tapId}.json", 14 | data: {'keg_id': kegId}, 15 | dataType: 'JSON', 16 | success: (data, textStatus, jqXHR) -> 17 | document.location.reload(true) 18 | }) 19 | 20 | $('.close').bind 'click', (event) -> 21 | console.log event 22 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | 3 | ENV["RAILS_ENV"] = "test" 4 | require File.expand_path('../../config/environment', __FILE__) 5 | require 'rails/test_help' 6 | 7 | class ActiveSupport::TestCase 8 | # Setup all fixtures in test/fixtures/*.(yml|csv) 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 | 17 | class ActionController::TestCase 18 | def login 19 | request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('05f8a4e34b57482ad021cfb0', 'd84c1dfb42c2abcf0c90180e') 20 | end 21 | end 22 | 23 | require 'mocha' 24 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The change you wanted was rejected.

23 |

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

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The page you were looking for doesn't exist.

23 |

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

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /config/locales/simple_form.en.yml: -------------------------------------------------------------------------------- 1 | en: 2 | simple_form: 3 | "yes": 'Yes' 4 | "no": 'No' 5 | required: 6 | text: 'required' 7 | mark: '*' 8 | # You can uncomment the line below if you need to overwrite the whole required html. 9 | # When using html, text and mark won't be used. 10 | # html: '*' 11 | error_notification: 12 | default_message: "Please review the problems below:" 13 | # Labels and hints examples 14 | # labels: 15 | # defaults: 16 | # password: 'Password' 17 | # user: 18 | # new: 19 | # email: 'E-mail to sign in.' 20 | # edit: 21 | # email: 'E-mail.' 22 | # hints: 23 | # defaults: 24 | # username: 'User name to sign in.' 25 | # password: 'No special characters, please.' 26 | 27 | -------------------------------------------------------------------------------- /app/controllers/beers_controller.rb: -------------------------------------------------------------------------------- 1 | class BeersController < ApplicationController 2 | respond_to :json, :only => [:index, :show, :create, :update, :destroy] 3 | respond_to :html 4 | before_filter :find_beer, :only => [:show, :update, :destroy] 5 | 6 | def index 7 | @beers = Beer.all 8 | respond_with(@beers) 9 | end 10 | 11 | def show 12 | respond_with(@beer) 13 | end 14 | 15 | def update 16 | @beer.update_attributes(params[:beer]) 17 | respond_with(@beer) 18 | end 19 | 20 | def new 21 | @beer = Beer.new 22 | end 23 | 24 | def create 25 | beer = Beer.create(params[:beer]) 26 | respond_with(beer) 27 | end 28 | 29 | def destroy 30 | @beer.destroy 31 | respond_with(@beer) 32 | end 33 | 34 | private 35 | 36 | def find_beer 37 | @beer = Beer.find(params[:id]) 38 | end 39 | 40 | end 41 | -------------------------------------------------------------------------------- /app/controllers/votes_controller.rb: -------------------------------------------------------------------------------- 1 | class VotesController < ApplicationController 2 | respond_to :json, :only => [:show, :update, :create] 3 | 4 | def upvote 5 | vote_with(1) 6 | end 7 | 8 | def downvote 9 | vote_with(-1) 10 | end 11 | 12 | private 13 | 14 | def vote_with(value) 15 | beer = Beer.find_by_id(params[:beer_id]) 16 | if beer.present? 17 | vote = Vote.find_or_initialize_by_beer_id_and_user_id(beer.id, current_user.id) 18 | vote.value = normalize_vote(value) 19 | vote.save! 20 | flash[:notice] = "You just #{vote.value > 0 ? 'upvoted' : 'downvoted'} #{beer.name}. Great success!" 21 | else 22 | flash[:error] = "Beer #{params[:beer_id]} not found! We suggest you remedy this immediately." 23 | end 24 | redirect_to root_url 25 | end 26 | 27 | def normalize_vote(value) 28 | case 29 | when value > 0 then 1 30 | when value < 0 then -1 31 | else 0 32 | end 33 | end 34 | 35 | end 36 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Beermon::Application.routes.draw do 2 | 3 | resources :beers do 4 | resources :kegs, :only => [:create, :show] 5 | resources :ratings, :only => [:create, :new, :show] 6 | end 7 | 8 | resources :taps, :only => [:index, :show, :update] do 9 | resource :keg, :only => [:update, :show] 10 | end 11 | 12 | resources :breweries 13 | 14 | resources :kegs do 15 | resources :measurements, :only => [:index, :create, :show] 16 | end 17 | 18 | resources :dashboard 19 | 20 | get '/dashboard/call/:manufacturer_id', :to => 'dashboard#call', :as => :call_brewery 21 | get '/callback', :to => 'callback#create' 22 | post '/callback', :to => 'callback#create' 23 | 24 | get '/upvote', :to => 'votes#upvote' 25 | get '/downvote', :to => 'votes#downvote' 26 | 27 | get '/login', :to => 'sessions#new', :as => :login 28 | post '/auth/:provider/callback', :to => 'sessions#create' 29 | get '/auth/failure', :to => 'sessions#failure' 30 | 31 | root :to => 'dashboard#index' 32 | 33 | end 34 | -------------------------------------------------------------------------------- /test/functional/taps_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TapsControllerTest < ActionController::TestCase 4 | 5 | setup do 6 | @keg = kegs(:keg_o_lugtread) 7 | @beer_tap = beer_taps(:right) 8 | login 9 | end 10 | 11 | test "it should be possible to request a list of taps" do 12 | get :index, :format => :json 13 | assert_response :ok 14 | taps = ActiveSupport::JSON.decode(@response.body) 15 | assert_equal BeerTap.count, taps.count 16 | expected_keys = %w{id keg_id name created_at updated_at}.sort 17 | assert_equal expected_keys, taps.first.keys.sort 18 | end 19 | 20 | test "it should be possible to view a taps information" do 21 | get :show, :id => @beer_tap, :format => :json 22 | assert_response :ok 23 | end 24 | 25 | test "it should be possible to swap out a keg on a tap" do 26 | put :update, :id => @beer_tap, :keg_id => @keg.id, :format => :json 27 | assert_response :no_content 28 | assert_equal @keg, @beer_tap.reload.keg 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /app/controllers/kegs_controller.rb: -------------------------------------------------------------------------------- 1 | class KegsController < ApplicationController 2 | respond_to :json, :only => [:show, :update, :create] 3 | before_filter :find_beer, :only => [:create] 4 | before_filter :find_beer_tap, :only => [:show, :update] 5 | 6 | def index 7 | @beer_taps = BeerTap.all 8 | @kegs = Keg.untapped 9 | end 10 | 11 | def show 12 | respond_with(@beer_tap.keg) 13 | end 14 | 15 | def new 16 | @keg = Keg.new(:capacity => 20, :kind => 'sankey') 17 | end 18 | 19 | def update 20 | keg = @beer_tap.keg 21 | keg.update_attributes(params[:keg]) 22 | respond_with(keg) 23 | end 24 | 25 | def create 26 | keg = @beer.kegs.create(params[:keg]) 27 | respond_with([@beer, keg]) do |format| 28 | format.html { redirect_to :action => 'index' } 29 | end 30 | end 31 | 32 | private 33 | def find_beer 34 | beer_id = params[:beer_id] || params[:keg].delete(:beer_id) 35 | @beer = Beer.find(beer_id) 36 | end 37 | 38 | def find_beer_tap 39 | @beer_tap = BeerTap.find(params[:tap_id]) 40 | end 41 | 42 | end 43 | -------------------------------------------------------------------------------- /app/views/kegs/_beer_tap.html.erb: -------------------------------------------------------------------------------- 1 |
2 |

<%= beer_tap.name.titleize %> Tap

3 | <% if beer_tap.detached? %> 4 | <%= render :partial => 'kegs/sadface' %> 5 | <% else %> 6 |

<%= beer_tap.keg.beer.name %>

7 |
8 |

<%= beer_tap.keg.beer.abv %>%

9 |
10 |
11 |

12 | <%= number_with_precision(beer_tap.keg.remaining, :precision => 2) %> 13 | / 14 | <%= number_with_precision(beer_tap.keg.capacity, :precision => 2) %>  15 |

16 |
17 |
18 |
19 |
20 | <% if beer_tap.keg.below_threshold? %> 21 |
Running Low!
22 | <% end %> 23 |
24 |
25 | Like it! | Dislike it 26 | <% end %> 27 |
-------------------------------------------------------------------------------- /app/assets/stylesheets/webfonts.css: -------------------------------------------------------------------------------- 1 | /* @license 2 | * MyFonts Webfont Build ID 2388201, 2012-10-19T11:43:56-0400 3 | * 4 | * The fonts listed in this notice are subject to the End User License 5 | * Agreement(s) entered into by the website owner. All other parties are 6 | * explicitly restricted from using the Licensed Webfonts(s). 7 | * 8 | * You may obtain a valid license at the URLs below. 9 | * 10 | * Webfont: Otari-Bold-Limited by TK Type 11 | * URL: http://www.myfonts.com/fonts/tk-type/otari/bold-limited/ 12 | * Copyright: Copyright (c) 2010 by Travis Kochel. All rights reserved. 13 | * Licensed pageviews: Unlimited 14 | * 15 | * 16 | * License: http://www.myfonts.com/viewlicense?type=web&buildid=2388201 17 | * 18 | * © 2012 Bitstream Inc 19 | */ 20 | 21 | 22 | 23 | 24 | @font-face { 25 | font-family: 'Otari-Bold-Limited'; 26 | src: url('/assets/2470E9_0_0.eot'); 27 | src: url('/assets/2470E9_0_0.eot?#iefix') 28 | format('embedded-opentype'), 29 | url('/assets/2470E9_0_0.woff') format('woff'), 30 | url('/assets/2470E9_0_0.ttf') format('truetype'); 31 | } 32 | -------------------------------------------------------------------------------- /app/views/dashboard/_beer_list.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | <% @beers.each do |beer| %> 17 | 18 | 21 | <% if current_user.admin? %> 22 | 25 | <% else %> 26 | 27 | <% end %> 28 | 31 | 32 | <% if current_user.admin? %> 33 | 34 | <% end %> 35 | 36 | 39 | 41 | <% end %> 42 | 43 |
NameVote!BreweryAlcoholColourIBUs
19 | <%= beer.name %>  20 | 23 | <%= link_to "Order by Email", beer.email_order %> 24 | 29 | Like it! | Dislike it 30 | <%= beer.brewery %><%= link_to 'Call Em Up!', call_brewery_url(beer.manufacturer) %><%= beer.abv %>% 37 | <%= beer.srm %> 38 | <%= beer.ibus %> 40 |
-------------------------------------------------------------------------------- /app/helpers/dashboard_helper.rb: -------------------------------------------------------------------------------- 1 | module DashboardHelper 2 | 3 | SRMS = %w( 4 | #FFFFFF 5 | #F3F993 6 | #F5F75C 7 | #F6F513 8 | #EAE615 9 | #E0D01B 10 | #D5BC26 11 | #CDAA37 12 | #C1963C 13 | #BE8C3A 14 | #BE823A 15 | #C17A37 16 | #BC6733 17 | #B26033 18 | #A85839 19 | #985336 20 | #BF7138 21 | #8D4C32 22 | #7C452D 23 | #6B3A1E 24 | #5D341A 25 | #4E2A0C 26 | #4A2727 27 | #361F1B 28 | #261716 29 | #231716 30 | #19100F 31 | #16100F 32 | #120D0C 33 | #100B0A 34 | #050B0A) 35 | 36 | FONT_COLORS = %w( 37 | #000000 38 | #000000 39 | #000000 40 | #000000 41 | #000000 42 | #000000 43 | #000000 44 | #000000 45 | #000000 46 | #000000 47 | #000000 48 | #000000 49 | #FFFFFF 50 | #FFFFFF 51 | #FFFFFF 52 | #FFFFFF 53 | #FFFFFF 54 | #FFFFFF 55 | #FFFFFF 56 | #FFFFFF 57 | #FFFFFF 58 | #FFFFFF 59 | #FFFFFF 60 | #FFFFFF 61 | #FFFFFF 62 | #FFFFFF 63 | #FFFFFF 64 | #FFFFFF 65 | #FFFFFF 66 | #FFFFFF 67 | #FFFFFF 68 | ) 69 | 70 | def color_for_srm(srm) 71 | position = srm < 0 ? 1 : [30, srm.to_i].min 72 | "background-color:#{SRMS[position]};color:#{FONT_COLORS[position]}" 73 | end 74 | end 75 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'rails', '3.2.11' 4 | # Bundle edge Rails instead: 5 | # gem 'rails', :git => 'git://github.com/rails/rails.git' 6 | gem 'simple_form' 7 | gem 'country_select' 8 | gem 'twilio-ruby' 9 | gem 'unicorn' 10 | 11 | gem 'omniauth-google-apps' 12 | 13 | # Gems used only for assets and not required 14 | # in production environments by default. 15 | group :assets do 16 | gem 'sass-rails', '~> 3.2.3' 17 | gem 'coffee-rails', '~> 3.2.1' 18 | 19 | # gem 'less' 20 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes 21 | gem 'therubyracer', :platforms => :ruby 22 | 23 | gem 'uglifier', '>= 1.0.3' 24 | end 25 | 26 | group :test do 27 | gem 'debugger' 28 | gem 'mocha', :require => false 29 | end 30 | 31 | group :development do 32 | gem 'sqlite3' 33 | 34 | # for great debugging justice 35 | gem 'pry' 36 | gem 'pry-nav' 37 | gem 'pry-rescue' 38 | gem 'pry-stack_explorer' 39 | end 40 | 41 | group :production do 42 | gem 'pg' 43 | end 44 | 45 | gem "less-rails" 46 | gem "twitter-bootstrap-rails" 47 | gem 'jquery-rails' 48 | # To use ActiveModel has_secure_password 49 | # gem 'bcrypt-ruby', '~> 3.0.0' 50 | 51 | # To use Jbuilder templates for JSON 52 | # gem 'jbuilder' 53 | 54 | # Use unicorn as the app server 55 | # gem 'unicorn' 56 | 57 | # Deploy with Capistrano 58 | # gem 'capistrano' 59 | 60 | # To use debugger 61 | # gem 'debugger' 62 | -------------------------------------------------------------------------------- /app/assets/stylesheets/bootstrap_and_overrides.css.less: -------------------------------------------------------------------------------- 1 | @import "twitter/bootstrap/bootstrap"; 2 | @import "twitter/bootstrap/responsive"; 3 | 4 | // Set the correct sprite paths 5 | @iconSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings.png"); 6 | @iconWhiteSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings-white.png"); 7 | 8 | // Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines) 9 | // Note: If you use asset_path() here, your compiled bootstrap_and_overrides.css will not 10 | // have the proper paths. So for now we use the absolute path. 11 | @fontAwesomeEotPath: asset-path("fontawesome-webfont.eot?v=3.0.2"); 12 | @fontAwesomeEotPath_iefix: asset-path("fontawesome-webfont.eot?#iefix&v=3.0.2"); 13 | @fontAwesomeWoffPath: asset-path("fontawesome-webfont.woff?v=3.0.2"); 14 | @fontAwesomeTtfPath: asset-path("fontawesome-webfont.ttf?v=3.0.2"); 15 | 16 | // Font Awesome 17 | @import "fontawesome"; 18 | 19 | // Glyphicons 20 | //@import "twitter/bootstrap/sprites.less"; 21 | 22 | // Your custom LESS stylesheets goes here 23 | // 24 | // Since bootstrap was imported above you have access to its mixins which 25 | // you may use and inherit here 26 | // 27 | // If you'd like to override bootstrap's own variables, you can do so here as well 28 | // See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation 29 | // 30 | // Example: 31 | // @linkColor: #ff0000; 32 | -------------------------------------------------------------------------------- /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 | 12 | *= require_tree . 13 | *= require_self 14 | */ 15 | 16 | h1 17 | { 18 | font-family: 'Otari-Bold-Limited', 'Arial Rounded MT Bold'; 19 | color: #6E234D; 20 | } 21 | 22 | .application-header 23 | { 24 | background-color: #2E1F30; 25 | background-image: none; 26 | } 27 | 28 | .navbar-admin 29 | { 30 | background-color: #42004B; 31 | } 32 | 33 | form .input { 34 | padding-top: 10px; 35 | } 36 | 37 | form .input label { 38 | padding-right: 5px; 39 | } 40 | 41 | thead 42 | { 43 | font-family: 'Otari-Bold-Limited', 'Arial Rounded MT Bold'; 44 | font-weight: normal; 45 | color: #A62135; 46 | } 47 | 48 | .beer-colour 49 | { 50 | background-image: url('/assets/beer-gloss.png'); 51 | background-size: 100% 120%; 52 | } 53 | 54 | footer 55 | { 56 | margin: 20px 0px 0px 50px; 57 | font-family: 'Otari-Bold-Limited', 'Arial Rounded MT Bold'; 58 | font-size: 1.1em; 59 | font-weight: normal; 60 | color: #aaa; 61 | } -------------------------------------------------------------------------------- /test/functional/kegs_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class KegsControllerTest < ActionController::TestCase 4 | setup do 5 | @beer_tap = beer_taps(:left) 6 | @beer = beers(:lugtread) 7 | login 8 | end 9 | 10 | test "it should not be possible to create a new keg via HTML" do 11 | params = {kind: 'sankey', :capacity => 50.0} 12 | 13 | assert_no_difference "Keg.count" do 14 | post :create, :beer_id => @beer, :keg => params 15 | end 16 | end 17 | 18 | test "it should be possible to create a new keg of beer" do 19 | params = {kind: 'sankey', :capacity => 50.0} 20 | 21 | assert_difference "Keg.count" do 22 | post :create, :beer_id => @beer, :keg => params, :format => :json 23 | assert_response :created 24 | end 25 | end 26 | 27 | test "it should be possible to show the keg attached to a tap" do 28 | get :show, :tap_id => @beer_tap, :format => :json 29 | assert_response :ok 30 | keg = ActiveSupport::JSON.decode(@response.body) 31 | expected_keys = %w{id kind capacity created_at updated_at beer_tap_id beer_id} 32 | assert_equal expected_keys.sort, keg.keys 33 | assert_equal keg['id'], @beer_tap.keg.id 34 | end 35 | 36 | test "it should be possible to the details of a keg attached to a tap" do 37 | put :update, :tap_id => @beer_tap, :keg => {:kind => 'pin lock'}, :format => :json 38 | assert_response :no_content 39 | assert_equal 'pin lock', @beer_tap.keg.reload.kind 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Beermon::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 | # Log error messages when you accidentally call methods on nil. 10 | config.whiny_nils = true 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 | # Only use best-standards-support built into browsers 23 | config.action_dispatch.best_standards_support = :builtin 24 | 25 | # Raise exception on mass assignment protection for Active Record models 26 | config.active_record.mass_assignment_sanitizer = :strict 27 | 28 | # Log the query plan for queries taking more than this (works 29 | # with SQLite, MySQL, and PostgreSQL) 30 | config.active_record.auto_explain_threshold_in_seconds = 0.5 31 | 32 | # Do not compress assets 33 | config.assets.compress = false 34 | 35 | # Expands the lines which load the assets 36 | config.assets.debug = true 37 | Beermon::Application.application_url = "http://localhost:3000" 38 | end 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Shopify - Chris Saunders, Carson Brown, Samuel Kadolph, Aaron Olson, Lydia Krupp-Hunter 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 5 | following conditions are met: 6 | 7 | - Redistributions of source code must retain the above copyright notice, this list of conditions and the following 8 | disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 11 | disclaimer in the documentation and/or other materials provided with the distribution. 12 | 13 | - Neither the name of the Shopify nor the names of its contributors may be used to endorse or promote products derived 14 | from this software without specific prior written permission. 15 | 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 20 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 21 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Beermon::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 | # Configure static asset server for tests with Cache-Control for performance 11 | config.serve_static_assets = true 12 | config.static_cache_control = "public, max-age=3600" 13 | 14 | # Log error messages when you accidentally call methods on nil 15 | config.whiny_nils = true 16 | 17 | # Show full error reports and disable caching 18 | config.consider_all_requests_local = true 19 | config.action_controller.perform_caching = false 20 | 21 | # Raise exceptions instead of rendering exception templates 22 | config.action_dispatch.show_exceptions = false 23 | 24 | # Disable request forgery protection in test environment 25 | config.action_controller.allow_forgery_protection = false 26 | 27 | # Tell Action Mailer not to deliver emails to the real world. 28 | # The :test delivery method accumulates sent emails in the 29 | # ActionMailer::Base.deliveries array. 30 | config.action_mailer.delivery_method = :test 31 | 32 | # Raise exception on mass assignment protection for Active Record models 33 | config.active_record.mass_assignment_sanitizer = :strict 34 | 35 | # Print deprecation notices to the stderr 36 | config.active_support.deprecation = :stderr 37 | end 38 | -------------------------------------------------------------------------------- /test/functional/beers_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BeersControllerTest < ActionController::TestCase 4 | 5 | setup do 6 | login 7 | end 8 | 9 | test "it should only respond to JSON requests" do 10 | get :index 11 | assert_response :not_acceptable 12 | end 13 | 14 | test "it should return a list of beers on record" do 15 | get :index, :format => :json 16 | assert_response :ok 17 | 18 | results = ActiveSupport::JSON.decode(@response.body) 19 | expected_keys = %w{id created_at updated_at name brewery abv srm ibus rating}.sort 20 | assert_equal expected_keys, results.first.keys.sort 21 | end 22 | 23 | test "it should be possible to create a new beer" do 24 | request = { 25 | name: 'Night Marzen', 26 | brewery: 'Beaus All Natural Brewing Co', 27 | ibus: 30.0, 28 | srm: 13.4, 29 | abv: 5.5 30 | } 31 | 32 | assert_difference "Beer.count" do 33 | post :create, :beer => request, :format => :json 34 | assert_response :created 35 | end 36 | end 37 | 38 | test "it should be possible to update a beer" do 39 | beer = beers(:lugtread) 40 | 41 | assert_no_difference "Beer.count" do 42 | put :update, :id => beer.id, :beer => {:brewery => "Moslon-Coors"}, :format => :json 43 | assert_response :no_content 44 | end 45 | 46 | assert_equal "Moslon-Coors", beer.reload.brewery 47 | end 48 | 49 | test "it should be possible to destroy a beer" do 50 | beer = beers(:lugtread) 51 | assert_difference "Beer.count", -1 do 52 | delete :destroy, :id => beer, :format => :json 53 | assert_response :no_content 54 | end 55 | end 56 | 57 | end 58 | -------------------------------------------------------------------------------- /app/models/keg.rb: -------------------------------------------------------------------------------- 1 | class Keg < ActiveRecord::Base 2 | DEFAULT_RATIO = 0.25 3 | has_many :measurements 4 | belongs_to :beer 5 | belongs_to :beer_tap 6 | attr_accessible :kind, :capacity, :beer, :notified 7 | after_update :send_capacity_warning, :if => :below_threshold? 8 | scope :untapped, where(:beer_tap_id => nil) 9 | 10 | validates_presence_of :beer 11 | 12 | def remaining 13 | if measurements.present? 14 | capacity - (measurements.last.volume || 0) 15 | else 16 | capacity 17 | end 18 | end 19 | 20 | def ratio 21 | (remaining * 100 / capacity).to_i 22 | end 23 | 24 | def status 25 | if ratio < 25 26 | "danger" 27 | elsif ratio < 50 28 | "warning" 29 | else 30 | "success" 31 | end 32 | end 33 | 34 | def below_threshold? 35 | ratio = ENV['KEG_THRESHOLD'] ? ENV['KEG_WARNING_RATIO'].to_f : DEFAULT_RATIO 36 | threshold = capacity * ratio 37 | remaining < threshold 38 | end 39 | 40 | def serializable_hash(options = {}) 41 | options[:include] = [:beer] 42 | options[:methods] = [:remaining] 43 | super 44 | end 45 | 46 | private 47 | 48 | def send_capacity_warning 49 | return unless beer && beer_tap 50 | return if notified? 51 | message = "Oh no! #{beer.name} on the #{beer_tap.name} tap is almost empty!" 52 | phone_numbers = User.where(:send_sms => true).map { |user| user.phone_number } 53 | twilio = Twilio::REST::Client.new($twilio_username, $twilio_password) 54 | from = $twilio_sender 55 | 56 | Thread.new do 57 | phone_numbers.each do |number| 58 | next unless number.present? 59 | twilio.account.sms.messages.create( 60 | :from => from, 61 | :to => number, 62 | :body => message 63 | ) 64 | end 65 | end 66 | update_attributes(:notified => true) 67 | end 68 | end 69 | -------------------------------------------------------------------------------- /test/functional/measurements_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class MeasurementsControllerTest < ActionController::TestCase 4 | 5 | setup do 6 | @keg = kegs(:keg_o_lugtread) 7 | login 8 | end 9 | 10 | test "it should be possible to get a list of measurements for a keg" do 11 | get :index, :keg_id => @keg, :format => :json 12 | assert_response :ok 13 | measurements = ActiveSupport::JSON.decode(@response.body) 14 | assert_equal @keg.measurements.count, measurements.size 15 | end 16 | 17 | test "it should be possible to create a measurement for a keg" do 18 | request = {:volume => 0.5, :temperature => 9.5, :sampled_at => Time.now} 19 | assert_difference "Measurement.count" do 20 | post :create, :keg_id => @keg, :measurement => request, :format => :json 21 | assert_response :created 22 | end 23 | end 24 | 25 | test "it should be possible to create a measurement with only a temperature" do 26 | request = {:temperature => 8.0, :sampled_at => Time.now} 27 | assert_difference "Measurement.count" do 28 | post :create, :keg_id => @keg, :measurement => request, :format => :json 29 | assert_response :created 30 | end 31 | end 32 | 33 | test "it should be possible to create a measurement with only a volume" do 34 | request = {:volume => 8.0, :sampled_at => Time.now} 35 | assert_difference "Measurement.count" do 36 | post :create, :keg_id => @keg, :measurement => request, :format => :json 37 | assert_response :created 38 | end 39 | end 40 | 41 | test "it should not be possible to create a measurement with duplicate volumes for the same keg" do 42 | first_request = {:volume => 8.0, :sampled_at => 1.minute.ago} 43 | second_request = {:volume => 8.0, :sampled_at => Time.now} 44 | 45 | post :create, :keg_id => @keg, :measurement => first_request, :format => :json 46 | assert_response :created 47 | 48 | assert_no_difference "Measurement.count" do 49 | post :create, :keg_id => @keg, :measurement => second_request, :format => :json 50 | assert_response :unprocessable_entity 51 | end 52 | end 53 | end -------------------------------------------------------------------------------- /app/controllers/dashboard_controller.rb: -------------------------------------------------------------------------------- 1 | class DashboardController < ApplicationController 2 | skip_before_filter :authenticate 3 | before_filter :ensure_logged_in 4 | 5 | FORGET_FACTOR = 0.2 6 | 7 | def index 8 | @beer_taps = BeerTap.all 9 | @beers = Beer.all 10 | @recommended = top_beers(2) 11 | puts @recommended.inspect 12 | end 13 | 14 | def call 15 | brewery = Manufacturer.find_by_id(params[:manufacturer_id]) 16 | if brewery 17 | twilio = Twilio::REST::Client.new($twilio_username, $twilio_password) 18 | from = $twilio_sender 19 | to = current_user.phone_number 20 | 21 | url = Beermon::Application.application_url + "/callback?brewery=#{brewery.id}" 22 | 23 | flash[:message] = "Setting up a call with #{brewery.name}" 24 | 25 | if Rails.env.production? 26 | Rails.logger.info "[Dashboard#call] -- callback url: #{url}" 27 | call = twilio.account.calls.create({:from => from, :to => to, :url => url}) 28 | else 29 | flash[:message] << "You are in development fool! No real calls" 30 | end 31 | else 32 | flash[:error] = "That brewery doesn't exist???!?" 33 | end 34 | redirect_to root_url 35 | end 36 | 37 | private 38 | 39 | def ensure_logged_in 40 | unless current_user.present? 41 | redirect_to login_url 42 | end 43 | end 44 | 45 | def top_beers(number) 46 | sorted = @beers.each.map { |beer| [beer, sort_value(beer)] } 47 | recommended_beers = sorted.sort_by{|beersort| beersort[1] }.map{|beersort| beersort[0]}.reverse.take(number) 48 | end 49 | 50 | def sort_value(beer) 51 | # upvotes 52 | a = beer.votes.where(:value => 1) 53 | .map { |v| Math.exp(-FORGET_FACTOR * (Date.today - v.updated_at.to_date).to_i) } 54 | .reduce(1, :+) * 1.0 55 | 56 | # downvotes 57 | b = beer.votes.where(:value => -1) 58 | .map { |v| Math.exp(-FORGET_FACTOR * (Date.today - v.updated_at.to_date).to_i) } 59 | .reduce(1, :+) * 1.0 60 | 61 | # mean and stddev 62 | m = b / (b + a) 63 | sd = Math.sqrt(a * b / ((a + b) * (a + b) * (a + b + 1))) 64 | 65 | # sharpe ratio 66 | sr = sd / m 67 | end 68 | end 69 | -------------------------------------------------------------------------------- /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 | 9 | beaus_beers = [ 10 | {name: 'Night-Marzen', srm: 16, ibus: 30, abv: 5.5, brewery: 'Beaus'}, 11 | {name: 'Bog Water', srm: 25, ibus: 0, abv: 6.6, brewery: 'Beaus'}, 12 | {name: 'Festivale', srm: 13, ibus: 45, abv: 4.7, brewery: 'Beaus'}, 13 | {name: 'Beaver River', srm: 18, ibus: 60, abv: 5.6, brewery: 'Beaus'}, 14 | {name: 'Lug-Tread', srm: 4, ibus: 21, abv: 5.2, brewery: 'Beaus'} 15 | ] 16 | 17 | broadhead_beers = [ 18 | {name: 'Underdog Pale', srm: 6.9, ibus: 41.2, abv: 5.2, brewery: 'Broadhead Beer'}, 19 | {name: 'Backbone Standard', srm: 4.0, ibus: 15.0, abv: 5.0, brewery: 'Broadhead Beer'}, 20 | {name: 'Long Shot White', srm: 5.3, ibus: 13.5, abv: 5.0, brewery: 'Broadhead Beer'}, 21 | {name: 'Grindstone Amber', srm: 11.8, ibus: 25.7, abv: 4.8, brewery: 'Broadhead Beer'}, 22 | {name: 'Dark Horse Stout', srm: 34.2, ibus: 25.5, abv: 5.5, brewery: 'Broadhead Beer'}, 23 | {name: 'Wildcard Ale', srm: 5.2, ibus: 22.7, abv: 5.0, brewery: 'Broadhead Beer'} 24 | ] 25 | 26 | kitchesippi = [ 27 | {name: 'Kitchesippi Blonde', srm: 6.9, ibus: 41.2, abv: 5.2, brewery: 'Kitchesippi'}, 28 | {name: 'Kitchesippi 1855', srm: 18.0, ibus: 30, abv: 5.2, brewery: 'Kitchesippi'}, 29 | ] 30 | 31 | kitchesippi_brewery = Manufacturer.create( 32 | name: "Kitchesippi Beer Co.", phone: "+16137287845", email: "sheena@kbeer.ca", 33 | address1: "866 Campbell Ave", city: "Ottawa" 34 | ) 35 | 36 | beaus_brewery = Manufacturer.create( 37 | name: "Beaus All Natural Brewing Co.", phone: "+18665852337", email: "ohyeah@beaus.ca", 38 | address1: "10 Terry Fox Dr.", city: "Vankleek Hill" 39 | ) 40 | 41 | broadhead_brewery = Manufacturer.create( 42 | name: "Broadhead Brewing Company", phone: "+16136959444", email: "greetings@broadheadbeer.com", 43 | address1: "81 Auriga Dr.", address2: "Unit 13", city: "Ottawa" 44 | ) 45 | 46 | beaus_brewery.beers.create(beaus_beers) 47 | 48 | kitchesippi_brewery.beers.create(kitchesippi) 49 | 50 | broadhead_brewery.beers.create(broadhead_beers) 51 | 52 | BeerTap.create([ 53 | {name: "left"}, 54 | {name: "right"} 55 | ]) 56 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Beermon::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 | # Full error reports are disabled and caching is turned on 8 | config.consider_all_requests_local = false 9 | config.action_controller.perform_caching = true 10 | 11 | # Disable Rails's static asset server (Apache or nginx will already do this) 12 | config.serve_static_assets = false 13 | 14 | # Compress JavaScripts and CSS 15 | config.assets.compress = true 16 | 17 | # Don't fallback to assets pipeline if a precompiled asset is missed 18 | config.assets.compile = true 19 | 20 | # Generate digests for assets URLs 21 | config.assets.digest = true 22 | 23 | # Defaults to nil and saved in location specified by config.assets.prefix 24 | # config.assets.manifest = YOUR_PATH 25 | 26 | # Specifies the header that your server uses for sending files 27 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 28 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 29 | 30 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 31 | # config.force_ssl = true 32 | 33 | # See everything in the log (default is :info) 34 | # config.log_level = :debug 35 | 36 | # Prepend all log lines with the following tags 37 | # config.log_tags = [ :subdomain, :uuid ] 38 | 39 | # Use a different logger for distributed setups 40 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 41 | 42 | # Use a different cache store in production 43 | # config.cache_store = :mem_cache_store 44 | 45 | # Enable serving of images, stylesheets, and JavaScripts from an asset server 46 | # config.action_controller.asset_host = "http://assets.example.com" 47 | 48 | # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) 49 | # config.assets.precompile += %w( search.js ) 50 | 51 | # Disable delivery errors, bad email addresses will be ignored 52 | # config.action_mailer.raise_delivery_errors = false 53 | 54 | # Enable threaded mode 55 | # config.threadsafe! 56 | 57 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 58 | # the I18n.default_locale when a translation can not be found) 59 | config.i18n.fallbacks = true 60 | 61 | # Send deprecation notices to registered listeners 62 | config.active_support.deprecation = :notify 63 | 64 | Beermon::Application.application_url = "http://beermon.herokuapp.com" 65 | 66 | # Log the query plan for queries taking more than this (works 67 | # with SQLite, MySQL, and PostgreSQL) 68 | # config.active_record.auto_explain_threshold_in_seconds = 0.5 69 | end 70 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | if defined?(Bundler) 6 | # If you precompile assets before deploying to production, use this line 7 | Bundler.require(*Rails.groups(:assets => %w(development test))) 8 | # If you want your assets lazily compiled in production, use this line 9 | # Bundler.require(:default, :assets, Rails.env) 10 | end 11 | 12 | module Beermon 13 | class Application < Rails::Application 14 | # Settings in config/environments/* take precedence over those specified here. 15 | # Application configuration should go into files in config/initializers 16 | # -- all .rb files in that directory are automatically loaded. 17 | 18 | # Custom directories with classes and modules you want to be autoloadable. 19 | # config.autoload_paths += %W(#{config.root}/extras) 20 | 21 | # Only load the plugins named here, in the order given (default is alphabetical). 22 | # :all can be used as a placeholder for all plugins not explicitly named. 23 | # config.plugins = [ :exception_notification, :ssl_requirement, :all ] 24 | 25 | # Activate observers that should always be running. 26 | # config.active_record.observers = :cacher, :garbage_collector, :forum_observer 27 | 28 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 29 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 30 | # config.time_zone = 'Central Time (US & Canada)' 31 | 32 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 33 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 34 | # config.i18n.default_locale = :de 35 | 36 | # Configure the default encoding used in templates for Ruby 1.9. 37 | config.encoding = "utf-8" 38 | 39 | # Configure sensitive parameters which will be filtered from the log file. 40 | config.filter_parameters += [:password] 41 | 42 | # Enable escaping HTML in JSON. 43 | config.active_support.escape_html_entities_in_json = true 44 | config.assets.initialize_on_precompile=false 45 | # Use SQL instead of Active Record's schema dumper when creating the database. 46 | # This is necessary if your schema can't be completely dumped by the schema dumper, 47 | # like if you have constraints or database-specific column types 48 | # config.active_record.schema_format = :sql 49 | 50 | # Enforce whitelist mode for mass assignment. 51 | # This will create an empty whitelist of attributes available for mass-assignment for all models 52 | # in your app. As such, your models will need to explicitly whitelist or blacklist accessible 53 | # parameters by using an attr_accessible or attr_protected declaration. 54 | config.active_record.whitelist_attributes = true 55 | 56 | # Enable the asset pipeline 57 | config.assets.enabled = true 58 | 59 | # Version of your assets, change this if you want to expire all your assets 60 | config.assets.version = '1.0' 61 | 62 | mattr_accessor :application_url 63 | end 64 | end 65 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <%= content_for?(:title) ? yield(:title) : "Beermon" %> 8 | <%= csrf_meta_tags %> 9 | 10 | 11 | 14 | 15 | <%= stylesheet_link_tag "application", :media => "all" %> 16 | 17 | 18 | 19 | <%= favicon_link_tag 'images/apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144' %> 20 | 21 | 22 | 23 | <%= favicon_link_tag 'images/apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114' %> 24 | 25 | 26 | 27 | <%= favicon_link_tag 'images/apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72' %> 28 | 29 | 30 | 31 | <%= favicon_link_tag 'images/apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png' %> 32 | 33 | 34 | 35 | <%= favicon_link_tag 'images/favicon.ico', :rel => 'shortcut icon' %> 36 | 37 | 38 | 39 | 51 | 52 |
53 | <% if current_user.admin? %> 54 | 67 | <% end %> 68 |
69 |
70 | <%= bootstrap_flash %> 71 | <%= yield %> 72 |
73 |
74 | 75 |
76 | 77 | 80 | 81 | 83 | 84 | <%= javascript_include_tag "application" %> 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /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 to check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(:version => 20121019195635) do 15 | 16 | create_table "beer_taps", :force => true do |t| 17 | t.string "name" 18 | t.datetime "created_at", :null => false 19 | t.datetime "updated_at", :null => false 20 | end 21 | 22 | create_table "beers", :force => true do |t| 23 | t.string "name" 24 | t.string "brewery" 25 | t.float "abv" 26 | t.float "srm" 27 | t.float "ibus" 28 | t.datetime "created_at", :null => false 29 | t.datetime "updated_at", :null => false 30 | t.integer "manufacturer_id" 31 | end 32 | 33 | create_table "kegs", :force => true do |t| 34 | t.string "kind" 35 | t.float "capacity" 36 | t.datetime "created_at", :null => false 37 | t.datetime "updated_at", :null => false 38 | t.integer "beer_tap_id" 39 | t.integer "beer_id" 40 | t.boolean "notified", :default => false 41 | end 42 | 43 | create_table "manufacturers", :force => true do |t| 44 | t.string "name" 45 | t.string "phone" 46 | t.string "email" 47 | t.string "address1" 48 | t.string "address2" 49 | t.string "city" 50 | t.string "postal_code" 51 | t.string "province", :default => "Ontario" 52 | t.string "country", :default => "Canada" 53 | t.datetime "created_at", :null => false 54 | t.datetime "updated_at", :null => false 55 | end 56 | 57 | create_table "measurements", :force => true do |t| 58 | t.integer "keg_id" 59 | t.datetime "created_at", :null => false 60 | t.datetime "updated_at", :null => false 61 | t.float "volume" 62 | t.float "temperature" 63 | t.integer "sampled_at", :limit => 8 64 | end 65 | 66 | create_table "ratings", :force => true do |t| 67 | t.integer "beer_id" 68 | t.integer "value" 69 | t.string "message" 70 | t.datetime "created_at", :null => false 71 | t.datetime "updated_at", :null => false 72 | end 73 | 74 | create_table "requests", :force => true do |t| 75 | t.string "brewery" 76 | t.string "name" 77 | t.string "requested_by" 78 | t.datetime "created_at", :null => false 79 | t.datetime "updated_at", :null => false 80 | end 81 | 82 | create_table "users", :force => true do |t| 83 | t.string "email" 84 | t.string "phone_number" 85 | t.boolean "send_sms" 86 | t.boolean "send_email" 87 | t.datetime "created_at", :null => false 88 | t.datetime "updated_at", :null => false 89 | t.string "uid" 90 | t.boolean "admin", :default => false 91 | end 92 | 93 | create_table "votes", :force => true do |t| 94 | t.integer "value" 95 | t.integer "beer_id" 96 | t.integer "user_id" 97 | t.datetime "created_at", :null => false 98 | t.datetime "updated_at", :null => false 99 | end 100 | 101 | add_index "votes", ["beer_id"], :name => "index_votes_on_beer_id" 102 | add_index "votes", ["user_id"], :name => "index_votes_on_user_id" 103 | 104 | end 105 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actionmailer (3.2.11) 5 | actionpack (= 3.2.11) 6 | mail (~> 2.4.4) 7 | actionpack (3.2.11) 8 | activemodel (= 3.2.11) 9 | activesupport (= 3.2.11) 10 | builder (~> 3.0.0) 11 | erubis (~> 2.7.0) 12 | journey (~> 1.0.4) 13 | rack (~> 1.4.0) 14 | rack-cache (~> 1.2) 15 | rack-test (~> 0.6.1) 16 | sprockets (~> 2.2.1) 17 | activemodel (3.2.11) 18 | activesupport (= 3.2.11) 19 | builder (~> 3.0.0) 20 | activerecord (3.2.11) 21 | activemodel (= 3.2.11) 22 | activesupport (= 3.2.11) 23 | arel (~> 3.0.2) 24 | tzinfo (~> 0.3.29) 25 | activeresource (3.2.11) 26 | activemodel (= 3.2.11) 27 | activesupport (= 3.2.11) 28 | activesupport (3.2.11) 29 | i18n (~> 0.6) 30 | multi_json (~> 1.0) 31 | arel (3.0.2) 32 | binding_of_caller (0.7.2) 33 | debug_inspector (>= 0.0.1) 34 | builder (3.0.4) 35 | coderay (1.0.9) 36 | coffee-rails (3.2.2) 37 | coffee-script (>= 2.2.0) 38 | railties (~> 3.2.0) 39 | coffee-script (2.2.0) 40 | coffee-script-source 41 | execjs 42 | coffee-script-source (1.6.3) 43 | columnize (0.3.6) 44 | commonjs (0.2.6) 45 | country_select (1.2.0) 46 | debug_inspector (0.0.2) 47 | debugger (1.6.1) 48 | columnize (>= 0.3.1) 49 | debugger-linecache (~> 1.2.0) 50 | debugger-ruby_core_source (~> 1.2.3) 51 | debugger-linecache (1.2.0) 52 | debugger-ruby_core_source (1.2.3) 53 | erubis (2.7.0) 54 | execjs (1.4.0) 55 | multi_json (~> 1.0) 56 | hashie (2.0.5) 57 | hike (1.2.3) 58 | i18n (0.6.4) 59 | interception (0.3) 60 | journey (1.0.4) 61 | jquery-rails (3.0.4) 62 | railties (>= 3.0, < 5.0) 63 | thor (>= 0.14, < 2.0) 64 | json (1.8.0) 65 | jwt (0.1.8) 66 | multi_json (>= 1.5) 67 | kgio (2.8.0) 68 | less (2.3.2) 69 | commonjs (~> 0.2.6) 70 | less-rails (2.3.3) 71 | actionpack (>= 3.1) 72 | less (~> 2.3.1) 73 | libv8 (3.11.8.17) 74 | mail (2.4.4) 75 | i18n (>= 0.4.0) 76 | mime-types (~> 1.16) 77 | treetop (~> 1.4.8) 78 | metaclass (0.0.1) 79 | method_source (0.8.1) 80 | mime-types (1.23) 81 | mocha (0.14.0) 82 | metaclass (~> 0.0.1) 83 | multi_json (1.7.7) 84 | omniauth (1.1.4) 85 | hashie (>= 1.2, < 3) 86 | rack 87 | omniauth-google-apps (0.0.2) 88 | omniauth (~> 1.0) 89 | omniauth-openid (~> 1.0) 90 | ruby-openid-apps-discovery (~> 1.2.0) 91 | omniauth-openid (1.0.1) 92 | omniauth (~> 1.0) 93 | rack-openid (~> 1.3.1) 94 | pg (0.15.1) 95 | polyglot (0.3.3) 96 | pry (0.9.12.2) 97 | coderay (~> 1.0.5) 98 | method_source (~> 0.8) 99 | slop (~> 3.4) 100 | pry-nav (0.2.3) 101 | pry (~> 0.9.10) 102 | pry-rescue (1.1.1) 103 | interception (>= 0.3) 104 | pry 105 | pry-stack_explorer (0.4.9) 106 | binding_of_caller (>= 0.7) 107 | pry (~> 0.9.11) 108 | rack (1.4.5) 109 | rack-cache (1.2) 110 | rack (>= 0.4) 111 | rack-openid (1.3.1) 112 | rack (>= 1.1.0) 113 | ruby-openid (>= 2.1.8) 114 | rack-ssl (1.3.3) 115 | rack 116 | rack-test (0.6.2) 117 | rack (>= 1.0) 118 | rails (3.2.11) 119 | actionmailer (= 3.2.11) 120 | actionpack (= 3.2.11) 121 | activerecord (= 3.2.11) 122 | activeresource (= 3.2.11) 123 | activesupport (= 3.2.11) 124 | bundler (~> 1.0) 125 | railties (= 3.2.11) 126 | railties (3.2.11) 127 | actionpack (= 3.2.11) 128 | activesupport (= 3.2.11) 129 | rack-ssl (~> 1.3.2) 130 | rake (>= 0.8.7) 131 | rdoc (~> 3.4) 132 | thor (>= 0.14.6, < 2.0) 133 | raindrops (0.11.0) 134 | rake (10.1.0) 135 | rdoc (3.12.2) 136 | json (~> 1.4) 137 | ref (1.0.5) 138 | ruby-openid (2.2.3) 139 | ruby-openid-apps-discovery (1.2.0) 140 | ruby-openid (>= 2.1.7) 141 | sass (3.2.9) 142 | sass-rails (3.2.6) 143 | railties (~> 3.2.0) 144 | sass (>= 3.1.10) 145 | tilt (~> 1.3) 146 | simple_form (2.1.0) 147 | actionpack (~> 3.0) 148 | activemodel (~> 3.0) 149 | slop (3.4.5) 150 | sprockets (2.2.2) 151 | hike (~> 1.2) 152 | multi_json (~> 1.0) 153 | rack (~> 1.0) 154 | tilt (~> 1.1, != 1.3.0) 155 | sqlite3 (1.3.7) 156 | therubyracer (0.11.4) 157 | libv8 (~> 3.11.8.12) 158 | ref 159 | thor (0.18.1) 160 | tilt (1.4.1) 161 | treetop (1.4.14) 162 | polyglot 163 | polyglot (>= 0.3.1) 164 | twilio-ruby (3.9.0) 165 | builder (>= 2.1.2) 166 | jwt (>= 0.1.2) 167 | multi_json (>= 1.3.0) 168 | twitter-bootstrap-rails (2.2.6) 169 | actionpack (>= 3.1) 170 | execjs 171 | railties (>= 3.1) 172 | tzinfo (0.3.37) 173 | uglifier (2.1.1) 174 | execjs (>= 0.3.0) 175 | multi_json (~> 1.0, >= 1.0.2) 176 | unicorn (4.6.3) 177 | kgio (~> 2.6) 178 | rack 179 | raindrops (~> 0.7) 180 | 181 | PLATFORMS 182 | ruby 183 | 184 | DEPENDENCIES 185 | coffee-rails (~> 3.2.1) 186 | country_select 187 | debugger 188 | jquery-rails 189 | less-rails 190 | mocha 191 | omniauth-google-apps 192 | pg 193 | pry 194 | pry-nav 195 | pry-rescue 196 | pry-stack_explorer 197 | rails (= 3.2.11) 198 | sass-rails (~> 3.2.3) 199 | simple_form 200 | sqlite3 201 | therubyracer 202 | twilio-ruby 203 | twitter-bootstrap-rails 204 | uglifier (>= 1.0.3) 205 | unicorn 206 | -------------------------------------------------------------------------------- /config/initializers/simple_form.rb: -------------------------------------------------------------------------------- 1 | # Use this setup block to configure all options available in SimpleForm. 2 | SimpleForm.setup do |config| 3 | # Wrappers are used by the form builder to generate a 4 | # complete input. You can remove any component from the 5 | # wrapper, change the order or even add your own to the 6 | # stack. The options given below are used to wrap the 7 | # whole input. 8 | config.wrappers :default, :class => :input, 9 | :hint_class => :field_with_hint, :error_class => :field_with_errors do |b| 10 | ## Extensions enabled by default 11 | # Any of these extensions can be disabled for a 12 | # given input by passing: `f.input EXTENSION_NAME => false`. 13 | # You can make any of these extensions optional by 14 | # renaming `b.use` to `b.optional`. 15 | 16 | # Determines whether to use HTML5 (:email, :url, ...) 17 | # and required attributes 18 | b.use :html5 19 | 20 | # Calculates placeholders automatically from I18n 21 | # You can also pass a string as f.input :placeholder => "Placeholder" 22 | b.use :placeholder 23 | 24 | ## Optional extensions 25 | # They are disabled unless you pass `f.input EXTENSION_NAME => :lookup` 26 | # to the input. If so, they will retrieve the values from the model 27 | # if any exists. If you want to enable the lookup for any of those 28 | # extensions by default, you can change `b.optional` to `b.use`. 29 | 30 | # Calculates maxlength from length validations for string inputs 31 | b.optional :maxlength 32 | 33 | # Calculates pattern from format validations for string inputs 34 | b.optional :pattern 35 | 36 | # Calculates min and max from length validations for numeric inputs 37 | b.optional :min_max 38 | 39 | # Calculates readonly automatically from readonly attributes 40 | b.optional :readonly 41 | 42 | ## Inputs 43 | b.use :label_input 44 | b.use :hint, :wrap_with => { :tag => :span, :class => :hint } 45 | b.use :error, :wrap_with => { :tag => :span, :class => :error } 46 | end 47 | 48 | # The default wrapper to be used by the FormBuilder. 49 | config.default_wrapper = :default 50 | 51 | # Define the way to render check boxes / radio buttons with labels. 52 | # Defaults to :nested for bootstrap config. 53 | # :inline => input + label 54 | # :nested => label > input 55 | config.boolean_style = :nested 56 | 57 | # Default class for buttons 58 | config.button_class = 'btn' 59 | 60 | # Method used to tidy up errors. Specify any Rails Array method. 61 | # :first lists the first message for each field. 62 | # Use :to_sentence to list all errors for each field. 63 | # config.error_method = :first 64 | 65 | # Default tag used for error notification helper. 66 | config.error_notification_tag = :div 67 | 68 | # CSS class to add for error notification helper. 69 | config.error_notification_class = 'alert alert-error' 70 | 71 | # ID to add for error notification helper. 72 | # config.error_notification_id = nil 73 | 74 | # Series of attempts to detect a default label method for collection. 75 | # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] 76 | 77 | # Series of attempts to detect a default value method for collection. 78 | # config.collection_value_methods = [ :id, :to_s ] 79 | 80 | # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. 81 | # config.collection_wrapper_tag = nil 82 | 83 | # You can define the class to use on all collection wrappers. Defaulting to none. 84 | # config.collection_wrapper_class = nil 85 | 86 | # You can wrap each item in a collection of radio/check boxes with a tag, 87 | # defaulting to :span. Please note that when using :boolean_style = :nested, 88 | # SimpleForm will force this option to be a label. 89 | # config.item_wrapper_tag = :span 90 | 91 | # You can define a class to use in all item wrappers. Defaulting to none. 92 | # config.item_wrapper_class = nil 93 | 94 | # How the label text should be generated altogether with the required text. 95 | # config.label_text = lambda { |label, required| "#{required} #{label}" } 96 | 97 | # You can define the class to use on all labels. Default is nil. 98 | config.label_class = 'control-label' 99 | 100 | # You can define the class to use on all forms. Default is simple_form. 101 | # config.form_class = :simple_form 102 | 103 | # You can define which elements should obtain additional classes 104 | # config.generate_additional_classes_for = [:wrapper, :label, :input] 105 | 106 | # Whether attributes are required by default (or not). Default is true. 107 | # config.required_by_default = true 108 | 109 | # Tell browsers whether to use default HTML5 validations (novalidate option). 110 | # Default is enabled. 111 | config.browser_validations = false 112 | 113 | # Collection of methods to detect if a file type was given. 114 | # config.file_methods = [ :mounted_as, :file?, :public_filename ] 115 | 116 | # Custom mappings for input types. This should be a hash containing a regexp 117 | # to match as key, and the input type that will be used when the field name 118 | # matches the regexp as value. 119 | # config.input_mappings = { /count/ => :integer } 120 | 121 | # Custom wrappers for input types. This should be a hash containing an input 122 | # type as key and the wrapper that will be used for all inputs with specified type. 123 | # config.wrapper_mappings = { :string => :prepend } 124 | 125 | # Default priority for time_zone inputs. 126 | # config.time_zone_priority = nil 127 | 128 | # Default priority for country inputs. 129 | # config.country_priority = nil 130 | 131 | # Default size for text inputs. 132 | # config.default_input_size = 50 133 | 134 | # When false, do not use translations for labels. 135 | # config.translate_labels = true 136 | 137 | # Automatically discover new inputs in Rails' autoload path. 138 | # config.inputs_discovery = true 139 | 140 | # Cache SimpleForm inputs discovery 141 | # config.cache_discovery = !Rails.env.development? 142 | end 143 | -------------------------------------------------------------------------------- /app/assets/stylesheets/jquery-ui-1.9.2.custom.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.9.2 - 2012-11-26 2 | * http://jqueryui.com 3 | * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css 4 | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande%2CLucida%20Sans%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=deedf7&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=100&borderColorHeader=aed0ea&fcHeader=222222&iconColorHeader=72a7cf&bgColorContent=f2f5f7&bgTextureContent=04_highlight_hard.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=362b36&iconColorContent=72a7cf&bgColorDefault=d7ebf9&bgTextureDefault=02_glass.png&bgImgOpacityDefault=80&borderColorDefault=aed0ea&fcDefault=2779aa&iconColorDefault=3d80b3&bgColorHover=e4f1fb&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=74b2e2&fcHover=0070a3&iconColorHover=2694e8&bgColorActive=3baae3&bgTextureActive=02_glass.png&bgImgOpacityActive=50&borderColorActive=2694e8&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=ffef8f&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=25&borderColorHighlight=f9dd34&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=cd0a0a&bgTextureError=01_flat.png&bgImgOpacityError=15&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffffff&bgColorOverlay=eeeeee&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=90&opacityOverlay=80&bgColorShadow=000000&bgTextureShadow=04_highlight_hard.png&bgImgOpacityShadow=70&opacityShadow=30&thicknessShadow=7px&offsetTopShadow=-7px&offsetLeftShadow=-7px&cornerRadiusShadow=8px 5 | * Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */ 6 | 7 | /* Layout helpers 8 | ----------------------------------*/ 9 | .ui-helper-hidden { display: none; } 10 | .ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } 11 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } 12 | .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } 13 | .ui-helper-clearfix:after { clear: both; } 14 | .ui-helper-clearfix { zoom: 1; } 15 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } 16 | 17 | 18 | /* Interaction Cues 19 | ----------------------------------*/ 20 | .ui-state-disabled { cursor: default !important; } 21 | 22 | 23 | /* Icons 24 | ----------------------------------*/ 25 | 26 | /* states and images */ 27 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } 28 | 29 | 30 | /* Misc visuals 31 | ----------------------------------*/ 32 | 33 | /* Overlays */ 34 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } 35 | .ui-resizable { position: relative;} 36 | .ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; } 37 | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } 38 | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } 39 | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } 40 | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } 41 | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } 42 | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } 43 | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } 44 | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } 45 | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } 46 | .ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; } 47 | .ui-accordion .ui-accordion-icons { padding-left: 2.2em; } 48 | .ui-accordion .ui-accordion-noicons { padding-left: .7em; } 49 | .ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; } 50 | .ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } 51 | .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; } 52 | .ui-autocomplete { 53 | position: absolute; 54 | top: 0; 55 | left: 0; 56 | cursor: default; 57 | } 58 | 59 | /* workarounds */ 60 | * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ 61 | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ 62 | .ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; } 63 | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ 64 | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ 65 | .ui-button-icons-only { width: 3.4em; } 66 | button.ui-button-icons-only { width: 3.7em; } 67 | 68 | /*button text element */ 69 | .ui-button .ui-button-text { display: block; line-height: 1.4; } 70 | .ui-button-text-only .ui-button-text { padding: .4em 1em; } 71 | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } 72 | .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } 73 | .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } 74 | .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } 75 | /* no icon support for input elements, provide padding by default */ 76 | input.ui-button { padding: .4em 1em; } 77 | 78 | /*button icon element(s) */ 79 | .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } 80 | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } 81 | .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } 82 | .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } 83 | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } 84 | 85 | /*button sets*/ 86 | .ui-buttonset { margin-right: 7px; } 87 | .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } 88 | 89 | /* workarounds */ 90 | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ 91 | .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } 92 | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } 93 | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } 94 | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } 95 | .ui-datepicker .ui-datepicker-prev { left:2px; } 96 | .ui-datepicker .ui-datepicker-next { right:2px; } 97 | .ui-datepicker .ui-datepicker-prev-hover { left:1px; } 98 | .ui-datepicker .ui-datepicker-next-hover { right:1px; } 99 | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } 100 | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } 101 | .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } 102 | .ui-datepicker select.ui-datepicker-month-year {width: 100%;} 103 | .ui-datepicker select.ui-datepicker-month, 104 | .ui-datepicker select.ui-datepicker-year { width: 49%;} 105 | .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } 106 | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } 107 | .ui-datepicker td { border: 0; padding: 1px; } 108 | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } 109 | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } 110 | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } 111 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } 112 | 113 | /* with multiple calendars */ 114 | .ui-datepicker.ui-datepicker-multi { width:auto; } 115 | .ui-datepicker-multi .ui-datepicker-group { float:left; } 116 | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } 117 | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } 118 | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } 119 | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } 120 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } 121 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } 122 | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } 123 | .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } 124 | 125 | /* RTL support */ 126 | .ui-datepicker-rtl { direction: rtl; } 127 | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } 128 | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } 129 | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } 130 | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } 131 | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } 132 | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } 133 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } 134 | .ui-datepicker-rtl .ui-datepicker-group { float:right; } 135 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 136 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 137 | 138 | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ 139 | .ui-datepicker-cover { 140 | position: absolute; /*must have*/ 141 | z-index: -1; /*must have*/ 142 | filter: mask(); /*must have*/ 143 | top: -4px; /*must have*/ 144 | left: -4px; /*must have*/ 145 | width: 200px; /*must have*/ 146 | height: 200px; /*must have*/ 147 | }.ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; width: 300px; overflow: hidden; } 148 | .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } 149 | .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } 150 | .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } 151 | .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } 152 | .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } 153 | .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } 154 | .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } 155 | .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } 156 | .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } 157 | .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } 158 | .ui-draggable .ui-dialog-titlebar { cursor: move; } 159 | .ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; } 160 | .ui-menu .ui-menu { margin-top: -3px; position: absolute; } 161 | .ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; } 162 | .ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; } 163 | .ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; } 164 | .ui-menu .ui-menu-item a.ui-state-focus, 165 | .ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; } 166 | 167 | .ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; } 168 | .ui-menu .ui-state-disabled a { cursor: default; } 169 | 170 | /* icon support */ 171 | .ui-menu-icons { position: relative; } 172 | .ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; } 173 | 174 | /* left-aligned */ 175 | .ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; } 176 | 177 | /* right-aligned */ 178 | .ui-menu .ui-menu-icon { position: static; float: right; } 179 | .ui-progressbar { height:2em; text-align: left; overflow: hidden; } 180 | .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }.ui-slider { position: relative; text-align: left; } 181 | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } 182 | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } 183 | 184 | .ui-slider-horizontal { height: .8em; } 185 | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } 186 | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } 187 | .ui-slider-horizontal .ui-slider-range-min { left: 0; } 188 | .ui-slider-horizontal .ui-slider-range-max { right: 0; } 189 | 190 | .ui-slider-vertical { width: .8em; height: 100px; } 191 | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } 192 | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } 193 | .ui-slider-vertical .ui-slider-range-min { bottom: 0; } 194 | .ui-slider-vertical .ui-slider-range-max { top: 0; }.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; } 195 | .ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; } 196 | .ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; } 197 | .ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */ 198 | .ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */ 199 | .ui-spinner-up { top: 0; } 200 | .ui-spinner-down { bottom: 0; } 201 | 202 | /* TR overrides */ 203 | .ui-spinner .ui-icon-triangle-1-s { 204 | /* need to fix icons sprite */ 205 | background-position:-65px -16px; 206 | } 207 | .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ 208 | .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } 209 | .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; } 210 | .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } 211 | .ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; } 212 | .ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; } 213 | .ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ 214 | .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } 215 | .ui-tooltip { 216 | padding: 8px; 217 | position: absolute; 218 | z-index: 9999; 219 | max-width: 300px; 220 | -webkit-box-shadow: 0 0 5px #aaa; 221 | box-shadow: 0 0 5px #aaa; 222 | } 223 | /* Fades and background-images don't work well together in IE6, drop the image */ 224 | * html .ui-tooltip { 225 | background-image: none; 226 | } 227 | body .ui-tooltip { border-width: 2px; } 228 | 229 | /* Component containers 230 | ----------------------------------*/ 231 | .ui-widget { font-family: Lucida Grande,Lucida Sans,Arial,sans-serif; font-size: 1.1em; } 232 | .ui-widget .ui-widget { font-size: 1em; } 233 | .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande,Lucida Sans,Arial,sans-serif; font-size: 1em; } 234 | .ui-widget-content { border: 1px solid #dddddd; background: #f2f5f7 url(images/ui-bg_highlight-hard_100_f2f5f7_1x100.png) 50% top repeat-x; color: #362b36; } 235 | .ui-widget-content a { color: #362b36; } 236 | .ui-widget-header { border: 1px solid #aed0ea; background: #deedf7 url(images/ui-bg_highlight-soft_100_deedf7_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } 237 | .ui-widget-header a { color: #222222; } 238 | 239 | /* Interaction states 240 | ----------------------------------*/ 241 | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #aed0ea; background: #d7ebf9 url(images/ui-bg_glass_80_d7ebf9_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #2779aa; } 242 | .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #2779aa; text-decoration: none; } 243 | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #74b2e2; background: #e4f1fb url(images/ui-bg_glass_100_e4f1fb_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #0070a3; } 244 | .ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #0070a3; text-decoration: none; } 245 | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #2694e8; background: #3baae3 url(images/ui-bg_glass_50_3baae3_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #ffffff; } 246 | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; text-decoration: none; } 247 | 248 | /* Interaction Cues 249 | ----------------------------------*/ 250 | .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #f9dd34; background: #ffef8f url(images/ui-bg_highlight-soft_25_ffef8f_1x100.png) 50% top repeat-x; color: #363636; } 251 | .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } 252 | .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #cd0a0a url(images/ui-bg_flat_15_cd0a0a_40x100.png) 50% 50% repeat-x; color: #ffffff; } 253 | .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } 254 | .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } 255 | .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } 256 | .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } 257 | .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } 258 | .ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */ 259 | 260 | /* Icons 261 | ----------------------------------*/ 262 | 263 | /* states and images */ 264 | .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_72a7cf_256x240.png); } 265 | .ui-widget-content .ui-icon {background-image: url(images/ui-icons_72a7cf_256x240.png); } 266 | .ui-widget-header .ui-icon {background-image: url(images/ui-icons_72a7cf_256x240.png); } 267 | .ui-state-default .ui-icon { background-image: url(images/ui-icons_3d80b3_256x240.png); } 268 | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_2694e8_256x240.png); } 269 | .ui-state-active .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } 270 | .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } 271 | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } 272 | 273 | /* positioning */ 274 | .ui-icon-carat-1-n { background-position: 0 0; } 275 | .ui-icon-carat-1-ne { background-position: -16px 0; } 276 | .ui-icon-carat-1-e { background-position: -32px 0; } 277 | .ui-icon-carat-1-se { background-position: -48px 0; } 278 | .ui-icon-carat-1-s { background-position: -64px 0; } 279 | .ui-icon-carat-1-sw { background-position: -80px 0; } 280 | .ui-icon-carat-1-w { background-position: -96px 0; } 281 | .ui-icon-carat-1-nw { background-position: -112px 0; } 282 | .ui-icon-carat-2-n-s { background-position: -128px 0; } 283 | .ui-icon-carat-2-e-w { background-position: -144px 0; } 284 | .ui-icon-triangle-1-n { background-position: 0 -16px; } 285 | .ui-icon-triangle-1-ne { background-position: -16px -16px; } 286 | .ui-icon-triangle-1-e { background-position: -32px -16px; } 287 | .ui-icon-triangle-1-se { background-position: -48px -16px; } 288 | .ui-icon-triangle-1-s { background-position: -64px -16px; } 289 | .ui-icon-triangle-1-sw { background-position: -80px -16px; } 290 | .ui-icon-triangle-1-w { background-position: -96px -16px; } 291 | .ui-icon-triangle-1-nw { background-position: -112px -16px; } 292 | .ui-icon-triangle-2-n-s { background-position: -128px -16px; } 293 | .ui-icon-triangle-2-e-w { background-position: -144px -16px; } 294 | .ui-icon-arrow-1-n { background-position: 0 -32px; } 295 | .ui-icon-arrow-1-ne { background-position: -16px -32px; } 296 | .ui-icon-arrow-1-e { background-position: -32px -32px; } 297 | .ui-icon-arrow-1-se { background-position: -48px -32px; } 298 | .ui-icon-arrow-1-s { background-position: -64px -32px; } 299 | .ui-icon-arrow-1-sw { background-position: -80px -32px; } 300 | .ui-icon-arrow-1-w { background-position: -96px -32px; } 301 | .ui-icon-arrow-1-nw { background-position: -112px -32px; } 302 | .ui-icon-arrow-2-n-s { background-position: -128px -32px; } 303 | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } 304 | .ui-icon-arrow-2-e-w { background-position: -160px -32px; } 305 | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } 306 | .ui-icon-arrowstop-1-n { background-position: -192px -32px; } 307 | .ui-icon-arrowstop-1-e { background-position: -208px -32px; } 308 | .ui-icon-arrowstop-1-s { background-position: -224px -32px; } 309 | .ui-icon-arrowstop-1-w { background-position: -240px -32px; } 310 | .ui-icon-arrowthick-1-n { background-position: 0 -48px; } 311 | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } 312 | .ui-icon-arrowthick-1-e { background-position: -32px -48px; } 313 | .ui-icon-arrowthick-1-se { background-position: -48px -48px; } 314 | .ui-icon-arrowthick-1-s { background-position: -64px -48px; } 315 | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } 316 | .ui-icon-arrowthick-1-w { background-position: -96px -48px; } 317 | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } 318 | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } 319 | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } 320 | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } 321 | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } 322 | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } 323 | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } 324 | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } 325 | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } 326 | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } 327 | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } 328 | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } 329 | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } 330 | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } 331 | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } 332 | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } 333 | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } 334 | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } 335 | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } 336 | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } 337 | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } 338 | .ui-icon-arrow-4 { background-position: 0 -80px; } 339 | .ui-icon-arrow-4-diag { background-position: -16px -80px; } 340 | .ui-icon-extlink { background-position: -32px -80px; } 341 | .ui-icon-newwin { background-position: -48px -80px; } 342 | .ui-icon-refresh { background-position: -64px -80px; } 343 | .ui-icon-shuffle { background-position: -80px -80px; } 344 | .ui-icon-transfer-e-w { background-position: -96px -80px; } 345 | .ui-icon-transferthick-e-w { background-position: -112px -80px; } 346 | .ui-icon-folder-collapsed { background-position: 0 -96px; } 347 | .ui-icon-folder-open { background-position: -16px -96px; } 348 | .ui-icon-document { background-position: -32px -96px; } 349 | .ui-icon-document-b { background-position: -48px -96px; } 350 | .ui-icon-note { background-position: -64px -96px; } 351 | .ui-icon-mail-closed { background-position: -80px -96px; } 352 | .ui-icon-mail-open { background-position: -96px -96px; } 353 | .ui-icon-suitcase { background-position: -112px -96px; } 354 | .ui-icon-comment { background-position: -128px -96px; } 355 | .ui-icon-person { background-position: -144px -96px; } 356 | .ui-icon-print { background-position: -160px -96px; } 357 | .ui-icon-trash { background-position: -176px -96px; } 358 | .ui-icon-locked { background-position: -192px -96px; } 359 | .ui-icon-unlocked { background-position: -208px -96px; } 360 | .ui-icon-bookmark { background-position: -224px -96px; } 361 | .ui-icon-tag { background-position: -240px -96px; } 362 | .ui-icon-home { background-position: 0 -112px; } 363 | .ui-icon-flag { background-position: -16px -112px; } 364 | .ui-icon-calendar { background-position: -32px -112px; } 365 | .ui-icon-cart { background-position: -48px -112px; } 366 | .ui-icon-pencil { background-position: -64px -112px; } 367 | .ui-icon-clock { background-position: -80px -112px; } 368 | .ui-icon-disk { background-position: -96px -112px; } 369 | .ui-icon-calculator { background-position: -112px -112px; } 370 | .ui-icon-zoomin { background-position: -128px -112px; } 371 | .ui-icon-zoomout { background-position: -144px -112px; } 372 | .ui-icon-search { background-position: -160px -112px; } 373 | .ui-icon-wrench { background-position: -176px -112px; } 374 | .ui-icon-gear { background-position: -192px -112px; } 375 | .ui-icon-heart { background-position: -208px -112px; } 376 | .ui-icon-star { background-position: -224px -112px; } 377 | .ui-icon-link { background-position: -240px -112px; } 378 | .ui-icon-cancel { background-position: 0 -128px; } 379 | .ui-icon-plus { background-position: -16px -128px; } 380 | .ui-icon-plusthick { background-position: -32px -128px; } 381 | .ui-icon-minus { background-position: -48px -128px; } 382 | .ui-icon-minusthick { background-position: -64px -128px; } 383 | .ui-icon-close { background-position: -80px -128px; } 384 | .ui-icon-closethick { background-position: -96px -128px; } 385 | .ui-icon-key { background-position: -112px -128px; } 386 | .ui-icon-lightbulb { background-position: -128px -128px; } 387 | .ui-icon-scissors { background-position: -144px -128px; } 388 | .ui-icon-clipboard { background-position: -160px -128px; } 389 | .ui-icon-copy { background-position: -176px -128px; } 390 | .ui-icon-contact { background-position: -192px -128px; } 391 | .ui-icon-image { background-position: -208px -128px; } 392 | .ui-icon-video { background-position: -224px -128px; } 393 | .ui-icon-script { background-position: -240px -128px; } 394 | .ui-icon-alert { background-position: 0 -144px; } 395 | .ui-icon-info { background-position: -16px -144px; } 396 | .ui-icon-notice { background-position: -32px -144px; } 397 | .ui-icon-help { background-position: -48px -144px; } 398 | .ui-icon-check { background-position: -64px -144px; } 399 | .ui-icon-bullet { background-position: -80px -144px; } 400 | .ui-icon-radio-on { background-position: -96px -144px; } 401 | .ui-icon-radio-off { background-position: -112px -144px; } 402 | .ui-icon-pin-w { background-position: -128px -144px; } 403 | .ui-icon-pin-s { background-position: -144px -144px; } 404 | .ui-icon-play { background-position: 0 -160px; } 405 | .ui-icon-pause { background-position: -16px -160px; } 406 | .ui-icon-seek-next { background-position: -32px -160px; } 407 | .ui-icon-seek-prev { background-position: -48px -160px; } 408 | .ui-icon-seek-end { background-position: -64px -160px; } 409 | .ui-icon-seek-start { background-position: -80px -160px; } 410 | /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ 411 | .ui-icon-seek-first { background-position: -80px -160px; } 412 | .ui-icon-stop { background-position: -96px -160px; } 413 | .ui-icon-eject { background-position: -112px -160px; } 414 | .ui-icon-volume-off { background-position: -128px -160px; } 415 | .ui-icon-volume-on { background-position: -144px -160px; } 416 | .ui-icon-power { background-position: 0 -176px; } 417 | .ui-icon-signal-diag { background-position: -16px -176px; } 418 | .ui-icon-signal { background-position: -32px -176px; } 419 | .ui-icon-battery-0 { background-position: -48px -176px; } 420 | .ui-icon-battery-1 { background-position: -64px -176px; } 421 | .ui-icon-battery-2 { background-position: -80px -176px; } 422 | .ui-icon-battery-3 { background-position: -96px -176px; } 423 | .ui-icon-circle-plus { background-position: 0 -192px; } 424 | .ui-icon-circle-minus { background-position: -16px -192px; } 425 | .ui-icon-circle-close { background-position: -32px -192px; } 426 | .ui-icon-circle-triangle-e { background-position: -48px -192px; } 427 | .ui-icon-circle-triangle-s { background-position: -64px -192px; } 428 | .ui-icon-circle-triangle-w { background-position: -80px -192px; } 429 | .ui-icon-circle-triangle-n { background-position: -96px -192px; } 430 | .ui-icon-circle-arrow-e { background-position: -112px -192px; } 431 | .ui-icon-circle-arrow-s { background-position: -128px -192px; } 432 | .ui-icon-circle-arrow-w { background-position: -144px -192px; } 433 | .ui-icon-circle-arrow-n { background-position: -160px -192px; } 434 | .ui-icon-circle-zoomin { background-position: -176px -192px; } 435 | .ui-icon-circle-zoomout { background-position: -192px -192px; } 436 | .ui-icon-circle-check { background-position: -208px -192px; } 437 | .ui-icon-circlesmall-plus { background-position: 0 -208px; } 438 | .ui-icon-circlesmall-minus { background-position: -16px -208px; } 439 | .ui-icon-circlesmall-close { background-position: -32px -208px; } 440 | .ui-icon-squaresmall-plus { background-position: -48px -208px; } 441 | .ui-icon-squaresmall-minus { background-position: -64px -208px; } 442 | .ui-icon-squaresmall-close { background-position: -80px -208px; } 443 | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } 444 | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } 445 | .ui-icon-grip-solid-vertical { background-position: -32px -224px; } 446 | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } 447 | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } 448 | .ui-icon-grip-diagonal-se { background-position: -80px -224px; } 449 | 450 | 451 | /* Misc visuals 452 | ----------------------------------*/ 453 | 454 | /* Corner radius */ 455 | .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -khtml-border-top-left-radius: 6px; border-top-left-radius: 6px; } 456 | .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; -khtml-border-top-right-radius: 6px; border-top-right-radius: 6px; } 457 | .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; -khtml-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; } 458 | .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; -khtml-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; } 459 | 460 | /* Overlays */ 461 | .ui-widget-overlay { background: #eeeeee url(images/ui-bg_diagonals-thick_90_eeeeee_40x40.png) 50% 50% repeat; opacity: .8;filter:Alpha(Opacity=80); } 462 | .ui-widget-shadow { margin: -7px 0 0 -7px; padding: 7px; background: #000000 url(images/ui-bg_highlight-hard_70_000000_1x100.png) 50% top repeat-x; opacity: .3;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; } --------------------------------------------------------------------------------