diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/FinalProj/.gitignore b/FinalProj/.gitignore deleted file mode 100644 index 6a502e9..0000000 --- a/FinalProj/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -# See https://help.github.com/articles/ignoring-files for more about ignoring files. -# -# If you find yourself ignoring temporary files generated by your text editor -# or operating system, you probably want to add a global ignore instead: -# git config --global core.excludesfile '~/.gitignore_global' - -# Ignore bundler config. -/.bundle - -# Ignore the default SQLite database. -/db/*.sqlite3 -/db/*.sqlite3-journal - -# Ignore all logfiles and tempfiles. -/log/*.log -/tmp diff --git a/FinalProj/Gemfile b/FinalProj/Gemfile deleted file mode 100644 index bed6f40..0000000 --- a/FinalProj/Gemfile +++ /dev/null @@ -1,40 +0,0 @@ -source 'https://rubygems.org' - - -# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '4.1.7' -# Use postgresql as the database for Active Record -gem 'pg' -# Use SCSS for stylesheets -gem 'sass-rails', '~> 4.0.3' -# Use Uglifier as compressor for JavaScript assets -gem 'uglifier', '>= 1.3.0' -# Use CoffeeScript for .js.coffee assets and views -gem 'coffee-rails', '~> 4.0.0' -# See https://github.com/sstephenson/execjs#readme for more supported runtimes -# gem 'therubyracer', platforms: :ruby - -# Use jquery as the JavaScript library -gem 'jquery-rails' -# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks -gem 'turbolinks' -# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -gem 'jbuilder', '~> 2.0' -# bundle exec rake doc:rails generates the API under doc/api. -gem 'sdoc', '~> 0.4.0', group: :doc - -# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring -gem 'spring', group: :development - -# Use ActiveModel has_secure_password -# gem 'bcrypt', '~> 3.1.7' - -# Use unicorn as the app server -# gem 'unicorn' - -# Use Capistrano for deployment -# gem 'capistrano-rails', group: :development - -# Use debugger -# gem 'debugger', group: [:development, :test] - diff --git a/FinalProj/Gemfile.lock b/FinalProj/Gemfile.lock deleted file mode 100644 index 9336ea3..0000000 --- a/FinalProj/Gemfile.lock +++ /dev/null @@ -1,120 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - actionmailer (4.1.7) - actionpack (= 4.1.7) - actionview (= 4.1.7) - mail (~> 2.5, >= 2.5.4) - actionpack (4.1.7) - actionview (= 4.1.7) - activesupport (= 4.1.7) - rack (~> 1.5.2) - rack-test (~> 0.6.2) - actionview (4.1.7) - activesupport (= 4.1.7) - builder (~> 3.1) - erubis (~> 2.7.0) - activemodel (4.1.7) - activesupport (= 4.1.7) - builder (~> 3.1) - activerecord (4.1.7) - activemodel (= 4.1.7) - activesupport (= 4.1.7) - arel (~> 5.0.0) - activesupport (4.1.7) - i18n (~> 0.6, >= 0.6.9) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.1) - tzinfo (~> 1.1) - arel (5.0.1.20140414130214) - builder (3.2.2) - coffee-rails (4.0.1) - coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.0) - coffee-script (2.3.0) - coffee-script-source - execjs - coffee-script-source (1.8.0) - erubis (2.7.0) - execjs (2.2.2) - hike (1.2.3) - i18n (0.6.11) - jbuilder (2.2.5) - activesupport (>= 3.0.0, < 5) - multi_json (~> 1.2) - jquery-rails (3.1.2) - railties (>= 3.0, < 5.0) - thor (>= 0.14, < 2.0) - json (1.8.1) - mail (2.6.3) - mime-types (>= 1.16, < 3) - mime-types (2.4.3) - minitest (5.4.3) - multi_json (1.10.1) - pg (0.17.1) - rack (1.5.2) - rack-test (0.6.2) - rack (>= 1.0) - rails (4.1.7) - actionmailer (= 4.1.7) - actionpack (= 4.1.7) - actionview (= 4.1.7) - activemodel (= 4.1.7) - activerecord (= 4.1.7) - activesupport (= 4.1.7) - bundler (>= 1.3.0, < 2.0) - railties (= 4.1.7) - sprockets-rails (~> 2.0) - railties (4.1.7) - actionpack (= 4.1.7) - activesupport (= 4.1.7) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.4.0) - rdoc (4.1.2) - json (~> 1.4) - sass (3.2.19) - sass-rails (4.0.5) - railties (>= 4.0.0, < 5.0) - sass (~> 3.2.2) - sprockets (~> 2.8, < 3.0) - sprockets-rails (~> 2.0) - sdoc (0.4.1) - json (~> 1.7, >= 1.7.7) - rdoc (~> 4.0) - spring (1.2.0) - sprockets (2.12.3) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.2.1) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (>= 2.8, < 4.0) - thor (0.19.1) - thread_safe (0.3.4) - tilt (1.4.1) - turbolinks (2.5.2) - coffee-rails - tzinfo (1.2.2) - thread_safe (~> 0.1) - uglifier (2.5.3) - execjs (>= 0.3.0) - json (>= 1.8.0) - -PLATFORMS - ruby - -DEPENDENCIES - coffee-rails (~> 4.0.0) - jbuilder (~> 2.0) - jquery-rails - pg - rails (= 4.1.7) - sass-rails (~> 4.0.3) - sdoc (~> 0.4.0) - spring - turbolinks - uglifier (>= 1.3.0) diff --git a/FinalProj/README.rdoc b/FinalProj/README.rdoc deleted file mode 100644 index dd4e97e..0000000 --- a/FinalProj/README.rdoc +++ /dev/null @@ -1,28 +0,0 @@ -== README - -This README would normally document whatever steps are necessary to get the -application up and running. - -Things you may want to cover: - -* Ruby version - -* System dependencies - -* Configuration - -* Database creation - -* Database initialization - -* How to run the test suite - -* Services (job queues, cache servers, search engines, etc.) - -* Deployment instructions - -* ... - - -Please feel free to use a different markup language if you do not plan to run -rake doc:app. diff --git a/FinalProj/Rakefile b/FinalProj/Rakefile deleted file mode 100644 index ba6b733..0000000 --- a/FinalProj/Rakefile +++ /dev/null @@ -1,6 +0,0 @@ -# Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. - -require File.expand_path('../config/application', __FILE__) - -Rails.application.load_tasks diff --git a/FinalProj/app/assets/javascripts/application.js b/FinalProj/app/assets/javascripts/application.js deleted file mode 100644 index d6925fa..0000000 --- a/FinalProj/app/assets/javascripts/application.js +++ /dev/null @@ -1,16 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// compiled file. -// -// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details -// about supported directives. -// -//= require jquery -//= require jquery_ujs -//= require turbolinks -//= require_tree . diff --git a/FinalProj/app/assets/stylesheets/application.css b/FinalProj/app/assets/stylesheets/application.css deleted file mode 100644 index a443db3..0000000 --- a/FinalProj/app/assets/stylesheets/application.css +++ /dev/null @@ -1,15 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the bottom of the - * compiled file so the styles you add here take precedence over styles defined in any styles - * defined in the other CSS/SCSS files in this directory. It is generally better to create a new - * file per style scope. - * - *= require_tree . - *= require_self - */ diff --git a/FinalProj/app/controllers/application_controller.rb b/FinalProj/app/controllers/application_controller.rb deleted file mode 100644 index d83690e..0000000 --- a/FinalProj/app/controllers/application_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -class ApplicationController < ActionController::Base - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception -end diff --git a/FinalProj/app/helpers/application_helper.rb b/FinalProj/app/helpers/application_helper.rb deleted file mode 100644 index de6be79..0000000 --- a/FinalProj/app/helpers/application_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module ApplicationHelper -end diff --git a/FinalProj/app/models/artist.rb b/FinalProj/app/models/artist.rb deleted file mode 100644 index db05f5c..0000000 --- a/FinalProj/app/models/artist.rb +++ /dev/null @@ -1,8 +0,0 @@ -class Artist < ActiveRecord::Base - has_many :artist_users - has_many :followers, :through => :artist_users, source: :user - has_many :reviewers, :through => :reviews, source: :user - has_many :reviews - has_many :artist_genres - has_many :genres, :through => :artist_genres -end diff --git a/FinalProj/app/models/artist_genre.rb b/FinalProj/app/models/artist_genre.rb deleted file mode 100644 index 2f217f5..0000000 --- a/FinalProj/app/models/artist_genre.rb +++ /dev/null @@ -1,4 +0,0 @@ -class ArtistGenre < ActiveRecord::Base - belongs_to :artist - belongs_to :genre -end diff --git a/FinalProj/app/models/artist_user.rb b/FinalProj/app/models/artist_user.rb deleted file mode 100644 index 504fb9e..0000000 --- a/FinalProj/app/models/artist_user.rb +++ /dev/null @@ -1,4 +0,0 @@ -class ArtistUser < ActiveRecord::Base - belongs_to :user - belongs_to :artist -end diff --git a/FinalProj/app/models/genre.rb b/FinalProj/app/models/genre.rb deleted file mode 100644 index 50dc4e1..0000000 --- a/FinalProj/app/models/genre.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Genre < ActiveRecord::Base - has_many :artist_genres - has_many :artists, :through => :artist_genres -end diff --git a/FinalProj/app/models/review.rb b/FinalProj/app/models/review.rb deleted file mode 100644 index 133ab9e..0000000 --- a/FinalProj/app/models/review.rb +++ /dev/null @@ -1,5 +0,0 @@ -class Review < ActiveRecord::Base - belongs_to :user - belongs_to :artist - -end diff --git a/FinalProj/app/models/user.rb b/FinalProj/app/models/user.rb deleted file mode 100644 index 624e818..0000000 --- a/FinalProj/app/models/user.rb +++ /dev/null @@ -1,6 +0,0 @@ -class User < ActiveRecord::Base - has_many :reviews - has_many :artist_users - has_many :artists_following, through: :artist_users, :source => :artist - has_many :artists_reviewed, through: :reviews, :source => :artist -end diff --git a/FinalProj/app/views/layouts/application.html.erb b/FinalProj/app/views/layouts/application.html.erb deleted file mode 100644 index 7ff4d27..0000000 --- a/FinalProj/app/views/layouts/application.html.erb +++ /dev/null @@ -1,14 +0,0 @@ - - - - FinalProj - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> - <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> - <%= csrf_meta_tags %> - - - -<%= yield %> - - - diff --git a/FinalProj/bin/bundle b/FinalProj/bin/bundle deleted file mode 100755 index 66e9889..0000000 --- a/FinalProj/bin/bundle +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -load Gem.bin_path('bundler', 'bundle') diff --git a/FinalProj/bin/rails b/FinalProj/bin/rails deleted file mode 100755 index 7feb6a3..0000000 --- a/FinalProj/bin/rails +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env ruby -begin - load File.expand_path("../spring", __FILE__) -rescue LoadError -end -APP_PATH = File.expand_path('../../config/application', __FILE__) -require_relative '../config/boot' -require 'rails/commands' diff --git a/FinalProj/bin/rake b/FinalProj/bin/rake deleted file mode 100755 index 8017a02..0000000 --- a/FinalProj/bin/rake +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env ruby -begin - load File.expand_path("../spring", __FILE__) -rescue LoadError -end -require_relative '../config/boot' -require 'rake' -Rake.application.run diff --git a/FinalProj/bin/spring b/FinalProj/bin/spring deleted file mode 100755 index 7f24d96..0000000 --- a/FinalProj/bin/spring +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env ruby - -# This file loads spring without using Bundler, in order to be fast -# It gets overwritten when you run the `spring binstub` command - -unless defined?(Spring) - require "rubygems" - require "bundler" - - if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) - ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) - ENV["GEM_HOME"] = "" - Gem.paths = ENV - - gem "spring", match[1] - require "spring/binstub" - end -end diff --git a/FinalProj/config.ru b/FinalProj/config.ru deleted file mode 100644 index 5bc2a61..0000000 --- a/FinalProj/config.ru +++ /dev/null @@ -1,4 +0,0 @@ -# This file is used by Rack-based servers to start the application. - -require ::File.expand_path('../config/environment', __FILE__) -run Rails.application diff --git a/FinalProj/config/application.rb b/FinalProj/config/application.rb deleted file mode 100644 index 6670f53..0000000 --- a/FinalProj/config/application.rb +++ /dev/null @@ -1,23 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'rails/all' - -# Require the gems listed in Gemfile, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(*Rails.groups) - -module FinalProj - class Application < Rails::Application - # Settings in config/environments/* take precedence over those specified here. - # Application configuration should go into files in config/initializers - # -- all .rb files in that directory are automatically loaded. - - # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. - # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - # config.time_zone = 'Central Time (US & Canada)' - - # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] - # config.i18n.default_locale = :de - end -end diff --git a/FinalProj/config/boot.rb b/FinalProj/config/boot.rb deleted file mode 100644 index 5e5f0c1..0000000 --- a/FinalProj/config/boot.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) - -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) diff --git a/FinalProj/config/database.yml b/FinalProj/config/database.yml deleted file mode 100644 index b2e34b1..0000000 --- a/FinalProj/config/database.yml +++ /dev/null @@ -1,85 +0,0 @@ -# PostgreSQL. Versions 8.2 and up are supported. -# -# Install the pg driver: -# gem install pg -# On OS X with Homebrew: -# gem install pg -- --with-pg-config=/usr/local/bin/pg_config -# On OS X with MacPorts: -# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config -# On Windows: -# gem install pg -# Choose the win32 build. -# Install PostgreSQL and put its /bin directory on your path. -# -# Configure Using Gemfile -# gem 'pg' -# -default: &default - adapter: postgresql - encoding: unicode - # For details on connection pooling, see rails configuration guide - # http://guides.rubyonrails.org/configuring.html#database-pooling - pool: 5 - -development: - <<: *default - database: FinalProj_development - - # The specified database role being used to connect to postgres. - # To create additional roles in postgres see `$ createuser --help`. - # When left blank, postgres will use the default role. This is - # the same name as the operating system user that initialized the database. - #username: FinalProj - - # The password associated with the postgres role (username). - #password: - - # Connect on a TCP socket. Omitted by default since the client uses a - # domain socket that doesn't need configuration. Windows does not have - # domain sockets, so uncomment these lines. - #host: localhost - - # The TCP port the server listens on. Defaults to 5432. - # If your server runs on a different port number, change accordingly. - #port: 5432 - - # Schema search path. The server defaults to $user,public - #schema_search_path: myapp,sharedapp,public - - # Minimum log levels, in increasing order: - # debug5, debug4, debug3, debug2, debug1, - # log, notice, warning, error, fatal, and panic - # Defaults to warning. - #min_messages: notice - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - <<: *default - database: FinalProj_test - -# As with config/secrets.yml, you never want to store sensitive information, -# like your database password, in your source code. If your source code is -# ever seen by anyone, they now have access to your database. -# -# Instead, provide the password as a unix environment variable when you boot -# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database -# for a full rundown on how to provide these environment variables in a -# production deployment. -# -# On Heroku and other platform providers, you may have a full connection URL -# available as an environment variable. For example: -# -# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" -# -# You can use this database configuration with: -# -# production: -# url: <%= ENV['DATABASE_URL'] %> -# -production: - <<: *default - database: FinalProj_production - username: FinalProj - password: <%= ENV['FINALPROJ_DATABASE_PASSWORD'] %> diff --git a/FinalProj/config/environment.rb b/FinalProj/config/environment.rb deleted file mode 100644 index ee8d90d..0000000 --- a/FinalProj/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the Rails application. -require File.expand_path('../application', __FILE__) - -# Initialize the Rails application. -Rails.application.initialize! diff --git a/FinalProj/config/environments/development.rb b/FinalProj/config/environments/development.rb deleted file mode 100644 index ddf0e90..0000000 --- a/FinalProj/config/environments/development.rb +++ /dev/null @@ -1,37 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. - config.cache_classes = false - - # Do not eager load code on boot. - config.eager_load = false - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Don't care if the mailer can't send. - config.action_mailer.raise_delivery_errors = false - - # Print deprecation notices to the Rails logger. - config.active_support.deprecation = :log - - # Raise an error on page load if there are pending migrations. - config.active_record.migration_error = :page_load - - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = true - - # Adds additional error checking when serving assets at runtime. - # Checks for improperly declared sprockets dependencies. - # Raises helpful error messages. - config.assets.raise_runtime_errors = true - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true -end diff --git a/FinalProj/config/environments/production.rb b/FinalProj/config/environments/production.rb deleted file mode 100644 index b93a877..0000000 --- a/FinalProj/config/environments/production.rb +++ /dev/null @@ -1,78 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # Code is not reloaded between requests. - config.cache_classes = true - - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both threaded web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. - config.eager_load = true - - # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Enable Rack::Cache to put a simple HTTP cache in front of your application - # Add `rack-cache` to your Gemfile before enabling this. - # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. - # config.action_dispatch.rack_cache = true - - # Disable Rails's static asset server (Apache or nginx will already do this). - config.serve_static_assets = false - - # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier - # config.assets.css_compressor = :sass - - # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false - - # Generate digests for assets URLs. - config.assets.digest = true - - # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb - - # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true - - # Set to :debug to see everything in the log. - config.log_level = :info - - # Prepend all log lines with the following tags. - # config.log_tags = [ :subdomain, :uuid ] - - # Use a different logger for distributed setups. - # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = "http://assets.example.com" - - # Ignore bad email addresses and do not raise email delivery errors. - # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation cannot be found). - config.i18n.fallbacks = true - - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify - - # Disable automatic flushing of the log to improve performance. - # config.autoflush_log = false - - # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = ::Logger::Formatter.new - - # Do not dump schema after migrations. - config.active_record.dump_schema_after_migration = false -end diff --git a/FinalProj/config/environments/test.rb b/FinalProj/config/environments/test.rb deleted file mode 100644 index 053f5b6..0000000 --- a/FinalProj/config/environments/test.rb +++ /dev/null @@ -1,39 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false - - # Configure static asset server for tests with Cache-Control for performance. - config.serve_static_assets = true - config.static_cache_control = 'public, max-age=3600' - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment. - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Print deprecation notices to the stderr. - config.active_support.deprecation = :stderr - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true -end diff --git a/FinalProj/config/initializers/assets.rb b/FinalProj/config/initializers/assets.rb deleted file mode 100644 index d2f4ec3..0000000 --- a/FinalProj/config/initializers/assets.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = '1.0' - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. -# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/FinalProj/config/initializers/backtrace_silencers.rb b/FinalProj/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 59385cd..0000000 --- a/FinalProj/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/FinalProj/config/initializers/cookies_serializer.rb b/FinalProj/config/initializers/cookies_serializer.rb deleted file mode 100644 index 7a06a89..0000000 --- a/FinalProj/config/initializers/cookies_serializer.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Be sure to restart your server when you modify this file. - -Rails.application.config.action_dispatch.cookies_serializer = :json \ No newline at end of file diff --git a/FinalProj/config/initializers/filter_parameter_logging.rb b/FinalProj/config/initializers/filter_parameter_logging.rb deleted file mode 100644 index 4a994e1..0000000 --- a/FinalProj/config/initializers/filter_parameter_logging.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Configure sensitive parameters which will be filtered from the log file. -Rails.application.config.filter_parameters += [:password] diff --git a/FinalProj/config/initializers/inflections.rb b/FinalProj/config/initializers/inflections.rb deleted file mode 100644 index ac033bf..0000000 --- a/FinalProj/config/initializers/inflections.rb +++ /dev/null @@ -1,16 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format. Inflections -# are locale specific, and you may define rules for as many different -# locales as you wish. All of these examples are active by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end - -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' -# end diff --git a/FinalProj/config/initializers/mime_types.rb b/FinalProj/config/initializers/mime_types.rb deleted file mode 100644 index dc18996..0000000 --- a/FinalProj/config/initializers/mime_types.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf diff --git a/FinalProj/config/initializers/session_store.rb b/FinalProj/config/initializers/session_store.rb deleted file mode 100644 index 964befd..0000000 --- a/FinalProj/config/initializers/session_store.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Be sure to restart your server when you modify this file. - -Rails.application.config.session_store :cookie_store, key: '_FinalProj_session' diff --git a/FinalProj/config/initializers/wrap_parameters.rb b/FinalProj/config/initializers/wrap_parameters.rb deleted file mode 100644 index 33725e9..0000000 --- a/FinalProj/config/initializers/wrap_parameters.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# This file contains settings for ActionController::ParamsWrapper which -# is enabled by default. - -# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. -ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] if respond_to?(:wrap_parameters) -end - -# To enable root element in JSON for ActiveRecord objects. -# ActiveSupport.on_load(:active_record) do -# self.include_root_in_json = true -# end diff --git a/FinalProj/config/locales/en.yml b/FinalProj/config/locales/en.yml deleted file mode 100644 index 0653957..0000000 --- a/FinalProj/config/locales/en.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. - -en: - hello: "Hello world" diff --git a/FinalProj/config/routes.rb b/FinalProj/config/routes.rb deleted file mode 100644 index 3f66539..0000000 --- a/FinalProj/config/routes.rb +++ /dev/null @@ -1,56 +0,0 @@ -Rails.application.routes.draw do - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end -end diff --git a/FinalProj/config/secrets.yml b/FinalProj/config/secrets.yml deleted file mode 100644 index 33ec29b..0000000 --- a/FinalProj/config/secrets.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure the secrets in this file are kept private -# if you're sharing your code publicly. - -development: - secret_key_base: 1e93e298017aed66b3ed785bcf581d1d3dcf02f5c7305ea6613ff3a2ea6d6e4c06caf43ef70e71c4b728484198c5bdf4ea5ef9113031351bfef8337eacd2a073 - -test: - secret_key_base: 90495c23b5650f485530b8db00c11ff32eba8146a098d6f9de2f5120497f724dcdf100e53f09e010dac2312914f18ce8b92b76677d4ce5f1d4f600515e031add - -# Do not keep production secrets in the repository, -# instead read values from the environment. -production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/FinalProj/db/migrate/20141128233631_create_artists.rb b/FinalProj/db/migrate/20141128233631_create_artists.rb deleted file mode 100644 index 5573307..0000000 --- a/FinalProj/db/migrate/20141128233631_create_artists.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateArtists < ActiveRecord::Migration - def change - create_table :artists do |t| - t.string :mbid, :name - t.boolean :review_flag - t.integer :music_rating, :atmosphere_rating, :overall_rating, :composite_rating - t.timestamps - end - end -end diff --git a/FinalProj/db/migrate/20141128233637_create_reviews.rb b/FinalProj/db/migrate/20141128233637_create_reviews.rb deleted file mode 100644 index c1e04f0..0000000 --- a/FinalProj/db/migrate/20141128233637_create_reviews.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateReviews < ActiveRecord::Migration - def change - create_table :reviews do |t| - t.references :user_id, :artist_id - t.string :venue, :content - t.integer :ticket_price - t.integer :music_rating, :atmosphere_rating, :overall_rating, :composite_rating - t.string :event_date - t.integer :votes - t.boolean :repeat_experience - - t.timestamps - end - end -end diff --git a/FinalProj/db/migrate/20141128234459_create_artist_users.rb b/FinalProj/db/migrate/20141128234459_create_artist_users.rb deleted file mode 100644 index e75082f..0000000 --- a/FinalProj/db/migrate/20141128234459_create_artist_users.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateArtistUsers < ActiveRecord::Migration - def change - create_table :artist_users do |t| - ####following/follower table - t.belongs_to :user - t.belongs_to :artist - t.timestamps - end - end -end diff --git a/FinalProj/db/migrate/20141128235540_create_artist_genres.rb b/FinalProj/db/migrate/20141128235540_create_artist_genres.rb deleted file mode 100644 index e178478..0000000 --- a/FinalProj/db/migrate/20141128235540_create_artist_genres.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateArtistGenres < ActiveRecord::Migration - def change - create_table :artist_genres do |t| - t.belongs_to :artist, :genre - - t.timestamps - end - end -end diff --git a/FinalProj/db/migrate/20141128235714_create_genres.rb b/FinalProj/db/migrate/20141128235714_create_genres.rb deleted file mode 100644 index cd11fda..0000000 --- a/FinalProj/db/migrate/20141128235714_create_genres.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateGenres < ActiveRecord::Migration - def change - create_table :genres do |t| - t.string :name - t.timestamps - end - end -end diff --git a/FinalProj/db/schema.rb b/FinalProj/db/schema.rb deleted file mode 100644 index 48bf365..0000000 --- a/FinalProj/db/schema.rb +++ /dev/null @@ -1,93 +0,0 @@ -# encoding: UTF-8 -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended that you check this file into your version control system. - -ActiveRecord::Schema.define(version: 20141128235714) do - - # These are extensions that must be enabled in order to support this database - enable_extension "plpgsql" - - create_table "artist_genres", force: true do |t| - t.integer "artist_id" - t.integer "genre_id" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "artist_users", force: true do |t| - t.integer "user_id" - t.integer "artist_id" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "artists", force: true do |t| - t.string "mbid" - t.string "name" - t.boolean "review_flag" - t.integer "music_rating" - t.integer "atmosphere_rating" - t.integer "overall_rating" - t.integer "composite_rating" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "genres", force: true do |t| - t.string "name" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "reviews", force: true do |t| - t.integer "user_id_id" - t.integer "artist_id_id" - t.string "venue" - t.string "content" - t.integer "ticket_price" - t.integer "music_rating" - t.integer "atmosphere_rating" - t.integer "overall_rating" - t.integer "composite_rating" - t.string "event_date" - t.integer "votes" - t.boolean "repeat_experience" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "users", force: true do |t| - t.string "username" - t.string "zipcode" - t.string "current_location" - t.string "email", default: "", null: false - t.string "encrypted_password", default: "", null: false - t.string "name" - t.string "image" - t.string "reset_password_token" - t.datetime "reset_password_sent_at" - t.datetime "remember_created_at" - t.integer "sign_in_count", default: 0, null: false - t.datetime "current_sign_in_at" - t.datetime "last_sign_in_at" - t.inet "current_sign_in_ip" - t.inet "last_sign_in_ip" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree - add_index "users", ["image"], name: "index_users_on_image", using: :btree - add_index "users", ["name"], name: "index_users_on_name", using: :btree - add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree - -end diff --git a/FinalProj/db/seeds.rb b/FinalProj/db/seeds.rb deleted file mode 100644 index 4edb1e8..0000000 --- a/FinalProj/db/seeds.rb +++ /dev/null @@ -1,7 +0,0 @@ -# This file should contain all the record creation needed to seed the database with its default values. -# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). -# -# Examples: -# -# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) -# Mayor.create(name: 'Emanuel', city: cities.first) diff --git a/FinalProj/lib/tasks/.keep b/FinalProj/lib/tasks/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/FinalProj/log/.keep b/FinalProj/log/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/FinalProj/public/404.html b/FinalProj/public/404.html deleted file mode 100644 index b612547..0000000 --- a/FinalProj/public/404.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The page you were looking for doesn't exist (404) - - - - - - -
-
-

The page you were looking for doesn't exist.

-

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

-
-

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

-
- - diff --git a/FinalProj/public/422.html b/FinalProj/public/422.html deleted file mode 100644 index a21f82b..0000000 --- a/FinalProj/public/422.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The change you wanted was rejected (422) - - - - - - -
-
-

The change you wanted was rejected.

-

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

-
-

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

-
- - diff --git a/FinalProj/public/500.html b/FinalProj/public/500.html deleted file mode 100644 index 061abc5..0000000 --- a/FinalProj/public/500.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - We're sorry, but something went wrong (500) - - - - - - -
-
-

We're sorry, but something went wrong.

-
-

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

-
- - diff --git a/FinalProj/public/favicon.ico b/FinalProj/public/favicon.ico deleted file mode 100644 index e69de29..0000000 diff --git a/FinalProj/public/robots.txt b/FinalProj/public/robots.txt deleted file mode 100644 index 3c9c7c0..0000000 --- a/FinalProj/public/robots.txt +++ /dev/null @@ -1,5 +0,0 @@ -# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file -# -# To ban all spiders from the entire site uncomment the next two lines: -# User-agent: * -# Disallow: / diff --git a/FinalProj/test/controllers/.keep b/FinalProj/test/controllers/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/FinalProj/test/fixtures/.keep b/FinalProj/test/fixtures/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/FinalProj/test/helpers/.keep b/FinalProj/test/helpers/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/FinalProj/test/integration/.keep b/FinalProj/test/integration/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/FinalProj/test/mailers/.keep b/FinalProj/test/mailers/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/FinalProj/test/models/.keep b/FinalProj/test/models/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/FinalProj/vendor/assets/javascripts/.keep b/FinalProj/vendor/assets/javascripts/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/FinalProj/vendor/assets/stylesheets/.keep b/FinalProj/vendor/assets/stylesheets/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/Gemfile b/Gemfile index efc0790..60221a0 100644 --- a/Gemfile +++ b/Gemfile @@ -2,51 +2,46 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '4.2.0.beta4' +gem 'rails', '4.1.7' # Use postgresql as the database for Active Record gem 'pg' # Use SCSS for stylesheets -gem 'sass-rails', '~> 5.0.0.beta1' +gem 'sass-rails', '~> 4.0.3' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' -# Use CoffeeScript for .coffee assets and views -gem 'coffee-rails', '~> 4.1.0' +# Use CoffeeScript for .js.coffee assets and views +gem 'coffee-rails', '~> 4.0.0' # See https://github.com/sstephenson/execjs#readme for more supported runtimes -# gem 'therubyracer', platforms: :ruby +# gem 'therubyracer', platforms: :ruby -# Use jQuery as the JavaScript library -gem 'jquery-rails', '~> 4.0.0.beta2' +# Use jquery as the JavaScript library +gem 'jquery-rails' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks gem 'turbolinks' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.0' # bundle exec rake doc:rails generates the API under doc/api. -gem 'sdoc', '~> 0.4.0', group: :doc +gem 'sdoc', '~> 0.4.0', group: :doc -gem 'devise' +# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring +gem 'spring', group: :development -gem 'omniauth-facebook' +# Last.fm gem +gem 'rockstar', '~> 0.8.0' +gem 'lastfm' -gem 'httparty' +# .env gem +gem 'dotenv', '~> 1.0.2' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' -# Use Unicorn as the app server +# Use unicorn as the app server # gem 'unicorn' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development -group :development, :test do - # Call 'byebug' anywhere in the code to stop execution and get a debugger console - gem 'byebug' - gem 'better_errors' - - # Access an IRB console on exception pages or by using <%= console %> in views - gem 'web-console', '~> 2.0.0.beta4' - - # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring - gem 'spring' -end +# Use debugger +gem 'debugger', group: [:development, :test] diff --git a/Gemfile.lock b/Gemfile.lock index 133cd71..4366997 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,56 +1,35 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.0.beta4) - actionpack (= 4.2.0.beta4) - actionview (= 4.2.0.beta4) - activejob (= 4.2.0.beta4) + actionmailer (4.1.7) + actionpack (= 4.1.7) + actionview (= 4.1.7) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.4) - actionpack (4.2.0.beta4) - actionview (= 4.2.0.beta4) - activesupport (= 4.2.0.beta4) - rack (~> 1.6.0.beta) + actionpack (4.1.7) + actionview (= 4.1.7) + activesupport (= 4.1.7) + rack (~> 1.5.2) rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.4) - rails-html-sanitizer (~> 1.0, >= 1.0.1) - actionview (4.2.0.beta4) - activesupport (= 4.2.0.beta4) + actionview (4.1.7) + activesupport (= 4.1.7) builder (~> 3.1) erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.4) - rails-html-sanitizer (~> 1.0, >= 1.0.1) - activejob (4.2.0.beta4) - activesupport (= 4.2.0.beta4) - globalid (>= 0.3.0) - activemodel (4.2.0.beta4) - activesupport (= 4.2.0.beta4) + activemodel (4.1.7) + activesupport (= 4.1.7) builder (~> 3.1) - activerecord (4.2.0.beta4) - activemodel (= 4.2.0.beta4) - activesupport (= 4.2.0.beta4) - arel (>= 6.0.0.beta2, < 6.1) - activesupport (4.2.0.beta4) - i18n (>= 0.7.0.beta1, < 0.8) + activerecord (4.1.7) + activemodel (= 4.1.7) + activesupport (= 4.1.7) + arel (~> 5.0.0) + activesupport (4.1.7) + i18n (~> 0.6, >= 0.6.9) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.1) tzinfo (~> 1.1) - arel (6.0.0.beta2) - bcrypt (3.1.9) - better_errors (2.0.0) - coderay (>= 1.0.0) - erubis (>= 2.6.6) - rack (>= 0.9.0) - binding_of_caller (0.7.3.pre1) - debug_inspector (>= 0.0.1) + arel (5.0.1.20140414130214) builder (3.2.2) - byebug (3.5.1) - columnize (~> 0.8) - debugger-linecache (~> 1.2) - slop (~> 3.6) - coderay (1.1.0) - coffee-rails (4.1.0) + coffee-rails (4.0.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.0) coffee-script (2.3.0) @@ -58,118 +37,84 @@ GEM execjs coffee-script-source (1.8.0) columnize (0.8.9) - debug_inspector (0.0.2) + debugger (1.6.6) + columnize (>= 0.3.1) + debugger-linecache (~> 1.2.0) + debugger-ruby_core_source (~> 1.3.2) debugger-linecache (1.2.0) - devise (3.4.1) - bcrypt (~> 3.0) - orm_adapter (~> 0.1) - railties (>= 3.2.6, < 5) - responders - thread_safe (~> 0.1) - warden (~> 1.2.3) + debugger-ruby_core_source (1.3.2) + dotenv (1.0.2) erubis (2.7.0) execjs (2.2.2) - faraday (0.9.0) - multipart-post (>= 1.2, < 3) - globalid (0.3.0) - activesupport (>= 4.1.0) - hashie (3.3.1) hike (1.2.3) + hpricot (0.8.6) httparty (0.13.3) json (~> 1.8) multi_xml (>= 0.5.2) - i18n (0.7.0.beta1) + i18n (0.6.11) jbuilder (2.2.5) activesupport (>= 3.0.0, < 5) multi_json (~> 1.2) - jquery-rails (4.0.0.beta2) - rails-dom-testing (~> 1.0) - railties (>= 4.2.0.beta, < 5.0) + jquery-rails (3.1.2) + railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.8.1) - jwt (1.0.0) - loofah (2.0.1) - nokogiri (>= 1.5.9) + lastfm (1.25.0) + activesupport (>= 3.2.0) + httparty + xml-simple mail (2.6.3) mime-types (>= 1.16, < 3) mime-types (2.4.3) - mini_portile (0.6.1) minitest (5.4.3) multi_json (1.10.1) multi_xml (0.5.5) - multipart-post (2.0.0) - nokogiri (1.6.4.1) - mini_portile (~> 0.6.0) - oauth2 (1.0.0) - faraday (>= 0.8, < 0.10) - jwt (~> 1.0) - multi_json (~> 1.3) - multi_xml (~> 0.5) - rack (~> 1.2) - omniauth (1.2.2) - hashie (>= 1.2, < 4) - rack (~> 1.0) - omniauth-facebook (2.0.0) - omniauth-oauth2 (~> 1.2) - omniauth-oauth2 (1.2.0) - faraday (>= 0.8, < 0.10) - multi_json (~> 1.3) - oauth2 (~> 1.0) - omniauth (~> 1.2) - orm_adapter (0.5.0) pg (0.17.1) - rack (1.6.0.beta) + rack (1.5.2) rack-test (0.6.2) rack (>= 1.0) - rails (4.2.0.beta4) - actionmailer (= 4.2.0.beta4) - actionpack (= 4.2.0.beta4) - actionview (= 4.2.0.beta4) - activejob (= 4.2.0.beta4) - activemodel (= 4.2.0.beta4) - activerecord (= 4.2.0.beta4) - activesupport (= 4.2.0.beta4) + rails (4.1.7) + actionmailer (= 4.1.7) + actionpack (= 4.1.7) + actionview (= 4.1.7) + activemodel (= 4.1.7) + activerecord (= 4.1.7) + activesupport (= 4.1.7) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.0.beta4) - sprockets-rails (~> 3.0.0.beta1) - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.4) - activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6.0) - rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.1) - loofah (~> 2.0) - railties (4.2.0.beta4) - actionpack (= 4.2.0.beta4) - activesupport (= 4.2.0.beta4) + railties (= 4.1.7) + sprockets-rails (~> 2.0) + railties (4.1.7) + actionpack (= 4.1.7) + activesupport (= 4.1.7) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (10.3.2) + rake (10.4.0) rdoc (4.1.2) json (~> 1.4) - responders (2.0.2) - railties (>= 4.2.0.alpha, < 5) - sass (3.4.8) - sass-rails (5.0.0.beta1) + rockstar (0.8.0) + activesupport (>= 1.4.2) + hpricot (>= 0.4.86) + i18n (>= 0.5.0) + rake (>= 0.10.0) + sass (3.2.19) + sass-rails (4.0.5) railties (>= 4.0.0, < 5.0) - sass (~> 3.2) - sprockets (~> 2.12) - sprockets-rails (>= 2.0, < 4.0) + sass (~> 3.2.2) + sprockets (~> 2.8, < 3.0) + sprockets-rails (~> 2.0) sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) - slop (3.6.0) - spring (1.1.3) + spring (1.2.0) sprockets (2.12.3) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sprockets-rails (3.0.0.beta1) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (~> 2.8) + sprockets-rails (2.2.1) + actionpack (>= 3.0) + activesupport (>= 3.0) + sprockets (>= 2.8, < 4.0) thor (0.19.1) thread_safe (0.3.4) tilt (1.4.1) @@ -180,31 +125,23 @@ GEM uglifier (2.5.3) execjs (>= 0.3.0) json (>= 1.8.0) - warden (1.2.3) - rack (>= 1.0) - web-console (2.0.0.beta4) - activemodel (~> 4.0) - binding_of_caller (= 0.7.3.pre1) - railties (~> 4.0) - sprockets-rails (>= 2.0, < 4.0) + xml-simple (1.1.4) PLATFORMS ruby DEPENDENCIES - better_errors - byebug - coffee-rails (~> 4.1.0) - devise - httparty + coffee-rails (~> 4.0.0) + debugger + dotenv (~> 1.0.2) jbuilder (~> 2.0) - jquery-rails (~> 4.0.0.beta2) - omniauth-facebook + jquery-rails + lastfm pg - rails (= 4.2.0.beta4) - sass-rails (~> 5.0.0.beta1) + rails (= 4.1.7) + rockstar (~> 0.8.0) + sass-rails (~> 4.0.3) sdoc (~> 0.4.0) spring turbolinks uglifier (>= 1.3.0) - web-console (~> 2.0.0.beta4) diff --git a/README.md b/README.md index e69de29..286dd78 100644 --- a/README.md +++ b/README.md @@ -0,0 +1 @@ +This is our final project. Yelp for live events diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index d6925fa..59d7d8f 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -14,3 +14,5 @@ //= require jquery_ujs //= require turbolinks //= require_tree . +//= require ../../../vendor/assets/javascripts/bootstrap +//= require ../../../vendor/assets/javascripts/handlebars-v2.0.0 diff --git a/app/assets/javascripts/controller.js b/app/assets/javascripts/controller.js new file mode 100644 index 0000000..1b60615 --- /dev/null +++ b/app/assets/javascripts/controller.js @@ -0,0 +1,28 @@ +$( document ).ready(function() { + + attachSearch(); +}); + +var attachSearch = function() { + var view = new View(); + +// $('#artist-search').on("submit", function(event) { + +// // event.preventDefault(); +// // // console.log($(this).serialize()); +// // // console.log($(this).action); +// // var content = $(this).serialize(); + +// // $.ajax({ +// // url: '/search/show', +// // type: 'get', +// // data: content +// // }).success(function(return_data){ +// // // console.log("success"); +// // // console.log(return_data); +// // // view.displayArtistResults(return_data); +// // }).fail(function(){ +// // console.log("fail") +// // }); +// }); +} diff --git a/app/assets/javascripts/geocode.js b/app/assets/javascripts/geocode.js deleted file mode 100644 index a540fa3..0000000 --- a/app/assets/javascripts/geocode.js +++ /dev/null @@ -1,40 +0,0 @@ - -$(document).ready(function(){ - initialize(); -}); -var map; -var geocoder; - -function initialize() { - - // Try HTML5 geolocation - if(navigator.geolocation) { - navigator.geolocation.getCurrentPosition(function(position) { - var pos = new google.maps.LatLng(position.coords.latitude, - position.coords.longitude); - var latitude = pos['k'] - var longitude = pos['B'] - geocoder = new google.maps.Geocoder(); - var latlng = new google.maps.LatLng(latitude,longitude); - - geocoder.geocode({'latLng': latlng}, function(results, status) { - if (status == google.maps.GeocoderStatus.OK) { - var zipcode = (results[3]['address_components'][0]['long_name']); - storeZipCode(zipcode); - } - }); - - }); - } -} - -function storeZipCode(zipcode){ - $.ajax({ - url: '/store_zipcode/'+zipcode, - type: 'post' - }).done(function(response){ - console.log(response); - }) -} - - diff --git a/app/assets/javascripts/search.js.coffee b/app/assets/javascripts/search.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/search.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/view.js b/app/assets/javascripts/view.js new file mode 100644 index 0000000..6fd64ac --- /dev/null +++ b/app/assets/javascripts/view.js @@ -0,0 +1,17 @@ +var View = function() { + +}; + +View.prototype.displayArtistResults = function(data) { + console.log("display lastfm results"); + var source = $('#artist_template').html(); + var $template = Handlebars.compile(source); + + // for (var i = 0; i < data.length; i++) { + var context = { image_url: data.images["mega"], mbid: data.mbid, name: data.name, summary: data.summary, content: data.content } + var html = $template(context) + + $('#artists-container ul').append(html); + // } + +}; diff --git a/app/assets/javascripts/welcome.js.coffee b/app/assets/javascripts/welcome.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/welcome.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index a443db3..36cc4f7 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -12,4 +12,5 @@ * *= require_tree . *= require_self + *= require ../../../vendor/assets/stylesheets/_bootstrap */ diff --git a/app/assets/stylesheets/search.css.scss b/app/assets/stylesheets/search.css.scss new file mode 100644 index 0000000..c44f0d7 --- /dev/null +++ b/app/assets/stylesheets/search.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Search controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/welcome.css.scss b/app/assets/stylesheets/welcome.css.scss new file mode 100644 index 0000000..4e19aa4 --- /dev/null +++ b/app/assets/stylesheets/welcome.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Welcome controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8683876..9e7c494 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,13 +1,5 @@ class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception - - def after_sign_in_path_for(user) - "#{request.base_url}/users/#{current_user.id}" - end - - def after_sign_out_path_for(resource_or_scope) - request.base_url - end + protect_from_forgery with: :null_session end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb deleted file mode 100644 index 91b8086..0000000 --- a/app/controllers/home_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -class HomeController < ApplicationController - def index - - end -end \ No newline at end of file diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb new file mode 100644 index 0000000..7584887 --- /dev/null +++ b/app/controllers/search_controller.rb @@ -0,0 +1,53 @@ +require 'lastfm' +require 'json' + +class SearchController < ApplicationController + def index + + end + + def show + Dotenv.load + lastfm = Lastfm.new(ENV['LASTFM_API_KEY'], ENV['LASTFM_SECRET_KEY']); + response = lastfm.artist.search(artist: params[:search_query], limit:10); + # response = lastfm.artist.getInfo({artist: params[:search_query]}, {api_key: ENV['LASTFM_API_KEY']}); + @results = response['results']['artistmatches'] + @ruby_artists = create_artists(@results) + + end + + private + + def create_artists(json) + ruby_artists =[] + artists = [] + puts "********************" + if json['artist'].kind_of?(Hash) + artists << json['artist'] + else + artists = json['artist'] + end + artists.each do |artist| + if artist["mbid"] == {} + puts 'ella sucks' + next + end + + if Artist.exists?(mbid: artist["mbid"].to_s ) + ruby_artists.push(Artist.where(mbid: artist["mbid"].to_s ).first) + else + artist = Artist.new(name: artist["name"], mbid: artist["mbid"], search_image_url: artist["image"][4]["content"]) + puts artist.inspect + if artist.save + ruby_artists.push(artist) + end + end + end + + puts ruby_artists.inspect + return ruby_artists + end + +end + + diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb deleted file mode 100644 index 29d464e..0000000 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController - def facebook - # You need to implement the method below in your model (e.g. app/models/user.rb) - @user = User.from_omniauth(request.env["omniauth.auth"]) - - if @user.persisted? - sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated - set_flash_message(:notice, :success, :kind => "Facebook") if is_navigational_format? - else - session["devise.facebook_data"] = request.env["omniauth.auth"] - redirect_to new_user_registration_url - end - end -end \ No newline at end of file diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb deleted file mode 100644 index c5338f8..0000000 --- a/app/controllers/users_controller.rb +++ /dev/null @@ -1,22 +0,0 @@ -require_dependency "concert" - -class UsersController < ApplicationController - before_action :authenticate_user! - skip_before_filter :verify_authenticity_token - - - def show - @concerts = Event.all - # for later - # zipcode = current_user.zipcode - # @concerts = Concert.get_concerts(zipcode) - end - - def store_zipcode - @@zipcode = params[:zip] - @user = current_user - @user.update_attributes(:zipcode => params[:zip]) - @user.save - p @user - end -end \ No newline at end of file diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb new file mode 100644 index 0000000..44eaff8 --- /dev/null +++ b/app/controllers/welcome_controller.rb @@ -0,0 +1,6 @@ +class WelcomeController < ApplicationController + def index + + end + +end diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb new file mode 100644 index 0000000..eb4753a --- /dev/null +++ b/app/helpers/search_helper.rb @@ -0,0 +1,5 @@ +module SearchHelper + def get_review_count(artist) + return artist.reviews.count + end +end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb new file mode 100644 index 0000000..eeead45 --- /dev/null +++ b/app/helpers/welcome_helper.rb @@ -0,0 +1,2 @@ +module WelcomeHelper +end diff --git a/app/models/event.rb b/app/models/event.rb deleted file mode 100644 index 3a829fd..0000000 --- a/app/models/event.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Event < ActiveRecord::Base -end diff --git a/app/models/user.rb b/app/models/user.rb index 4ceb596..624e818 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,35 +1,6 @@ class User < ActiveRecord::Base - devise :omniauthable, :omniauth_providers => [:facebook] - # Include default devise modules. Others available are: - # :confirmable, :lockable, :timeoutable and :omniauthable - devise :database_authenticatable, :registerable, - :recoverable, :rememberable, :trackable, :validatable - has_many :reviews has_many :artist_users has_many :artists_following, through: :artist_users, :source => :artist has_many :artists_reviewed, through: :reviews, :source => :artist - - # include HTTParty - - def self.from_omniauth(auth) - where(provider: auth.provider, uid: auth.uid).first_or_create do |user| - user.email = auth.info.email - user.password = Devise.friendly_token[0,20] - user.name = auth.info.name - user.image = auth.info.image - end - end - - - - - def self.new_with_session(params, session) - #tapping into super and putting in some stuff - super.tap do |user| - if data = session["devise.facebook_data"] && session["devise.facebook_data"]["extra"]["raw_info"] - user.email = data["email"] if user.email.blank? - end - end - end end diff --git a/app/views/.DS_Store b/app/views/.DS_Store new file mode 100644 index 0000000..953c05c Binary files /dev/null and b/app/views/.DS_Store differ diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb deleted file mode 100644 index 4540811..0000000 --- a/app/views/devise/confirmations/new.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -

Resend confirmation instructions

- -<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> - -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true %> -
- -
- <%= f.submit "Resend confirmation instructions" %> -
-<% end %> - -<%= render "devise/shared/links" %> diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb deleted file mode 100644 index dc55f64..0000000 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

Welcome <%= @email %>!

- -

You can confirm your account email through the link below:

- -

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

diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb deleted file mode 100644 index f667dc1..0000000 --- a/app/views/devise/mailer/reset_password_instructions.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -

Hello <%= @resource.email %>!

- -

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

- -

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

- -

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

-

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

diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb deleted file mode 100644 index 41e148b..0000000 --- a/app/views/devise/mailer/unlock_instructions.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -

Hello <%= @resource.email %>!

- -

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

- -

Click the link below to unlock your account:

- -

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

diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb deleted file mode 100644 index 1b2ff26..0000000 --- a/app/views/devise/passwords/edit.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -

Change your password

- -<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> - <%= devise_error_messages! %> - <%= f.hidden_field :reset_password_token %> - -
- <%= f.label :password, "New password" %>
- <%= f.password_field :password, autofocus: true, autocomplete: "off" %> -
- -
- <%= f.label :password_confirmation, "Confirm new password" %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %> -
- -
- <%= f.submit "Change my password" %> -
-<% end %> - -<%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb deleted file mode 100644 index 3d6d11a..0000000 --- a/app/views/devise/passwords/new.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -

Forgot your password?

- -<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> - -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true %> -
- -
- <%= f.submit "Send me reset password instructions" %> -
-<% end %> - -<%= render "devise/shared/links" %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb deleted file mode 100644 index 3ea40f0..0000000 --- a/app/views/devise/registrations/edit.html.erb +++ /dev/null @@ -1,39 +0,0 @@ -

Edit <%= resource_name.to_s.humanize %>

- -<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> - <%= devise_error_messages! %> - -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true %> -
- - <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> -
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
- <% end %> - -
- <%= f.label :password %> (leave blank if you don't want to change it)
- <%= f.password_field :password, autocomplete: "off" %> -
- -
- <%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %> -
- -
- <%= f.label :current_password %> (we need your current password to confirm your changes)
- <%= f.password_field :current_password, autocomplete: "off" %> -
- -
- <%= f.submit "Update" %> -
-<% end %> - -

Cancel my account

- -

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

- -<%= link_to "Back", :back %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb deleted file mode 100644 index 343b265..0000000 --- a/app/views/devise/registrations/new.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -

Sign up

- -<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> - <%= devise_error_messages! %> - -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true %> -
- -
- <%= f.label :password %> - <% if @validatable %> - (<%= @minimum_password_length %> characters minimum) - <% end %>
- <%= f.password_field :password, autocomplete: "off" %> -
- -
- <%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %> -
- -
- <%= f.submit "Sign up" %> -
-<% end %> - -<%= render "devise/shared/links" %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb deleted file mode 100644 index b261cfd..0000000 --- a/app/views/devise/sessions/new.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -

Log in

- -<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true %> -
- -
- <%= f.label :password %>
- <%= f.password_field :password, autocomplete: "off" %> -
- - <% if devise_mapping.rememberable? -%> -
- <%= f.check_box :remember_me %> - <%= f.label :remember_me %> -
- <% end -%> - -
- <%= f.submit "Log in" %> -
-<% end %> - -<%= render "devise/shared/links" %> diff --git a/app/views/devise/shared/_links.html.erb b/app/views/devise/shared/_links.html.erb deleted file mode 100644 index cd795ad..0000000 --- a/app/views/devise/shared/_links.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -<%- if controller_name != 'sessions' %> - <%= link_to "Log in", new_session_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.registerable? && controller_name != 'registrations' %> - <%= link_to "Sign up", new_registration_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> - <%= link_to "Forgot your password?", new_password_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.omniauthable? %> - <%- resource_class.omniauth_providers.each do |provider| %> - <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
- <% end -%> -<% end -%> diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb deleted file mode 100644 index 16586bc..0000000 --- a/app/views/devise/unlocks/new.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -

Resend unlock instructions

- -<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> - -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true %> -
- -
- <%= f.submit "Resend unlock instructions" %> -
-<% end %> - -<%= render "devise/shared/links" %> diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb deleted file mode 100644 index f243df6..0000000 --- a/app/views/home/index.html.erb +++ /dev/null @@ -1 +0,0 @@ -

HOMEPAGE

\ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index eb5b9a2..7ff4d27 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,22 +1,13 @@ - - - - DeviseTest + FinalProj <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> - <% if user_signed_in? %> - <%= link_to "Log out", destroy_user_session_path, method: :delete %> - <% else %> - <%= link_to "Sign Up", new_user_registration_path %> - <%= link_to "Log in", new_user_session_path %> - <%= link_to "Sign in with Facebook", user_omniauth_authorize_path(:facebook) %> - <% end %> + <%= yield %> diff --git a/app/views/search/_result.html.erb b/app/views/search/_result.html.erb new file mode 100644 index 0000000..3a652df --- /dev/null +++ b/app/views/search/_result.html.erb @@ -0,0 +1,13 @@ + + + + diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb new file mode 100644 index 0000000..ad7cab6 --- /dev/null +++ b/app/views/search/index.html.erb @@ -0,0 +1 @@ +<%= @artist.inspect %> diff --git a/app/views/search/show.html.erb b/app/views/search/show.html.erb new file mode 100644 index 0000000..8f06f66 --- /dev/null +++ b/app/views/search/show.html.erb @@ -0,0 +1,5 @@ + + +<% @ruby_artists.each do |artist| %> + <%= render partial:'result', locals:{artist:artist} %> +<% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb deleted file mode 100644 index 5603381..0000000 --- a/app/views/users/show.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -

<%= current_user.email %>

- -

<% @concerts.each do |concert| %>

-

<%= concert.artist %>

-

<%= concert.venue %>

-

<%= concert.date %>

-

Ticket info

-
-<% end %> \ No newline at end of file diff --git a/app/views/welcome/.DS_Store b/app/views/welcome/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/app/views/welcome/.DS_Store differ diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb new file mode 100644 index 0000000..813f236 --- /dev/null +++ b/app/views/welcome/index.html.erb @@ -0,0 +1,29 @@ + + +
+ +
+

Results artist search

+ +
+
+ diff --git a/bin/setup b/bin/setup deleted file mode 100755 index acdb2c1..0000000 --- a/bin/setup +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env ruby -require 'pathname' - -# path to your application root. -APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) - -Dir.chdir APP_ROOT do - # This script is a starting point to setup your application. - # Add necessary setup steps to this file: - - puts "== Installing dependencies ==" - system "gem install bundler --conservative" - system "bundle check || bundle install" - - # puts "\n== Copying sample files ==" - # unless File.exist?("config/database.yml") - # system "cp config/database.yml.sample config/database.yml" - # end - - puts "\n== Preparing database ==" - system "bin/rake db:setup" - - puts "\n== Removing old logs and tempfiles ==" - system "rm -f log/*" - system "rm -rf tmp/cache" - - puts "\n== Restarting application server ==" - system "touch tmp/restart.txt" -end diff --git a/bin/spring b/bin/spring index 253ec37..7f24d96 100755 --- a/bin/spring +++ b/bin/spring @@ -7,7 +7,7 @@ unless defined?(Spring) require "rubygems" require "bundler" - if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m) + if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) ENV["GEM_HOME"] = "" Gem.paths = ENV diff --git a/config/application.rb b/config/application.rb index 52faf63..6670f53 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,20 +1,12 @@ require File.expand_path('../boot', __FILE__) -# Pick the frameworks you want: -require "active_model/railtie" -require "active_job/railtie" -require "active_record/railtie" -require "action_controller/railtie" -require "action_mailer/railtie" -require "action_view/railtie" -require "sprockets/railtie" -# require "rails/test_unit/railtie" +require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) -module DeviseTest +module FinalProj class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers @@ -27,8 +19,5 @@ class Application < Rails::Application # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de - - # Do not swallow errors in after_commit/after_rollback callbacks. - config.active_record.raise_in_transactional_callbacks = true end end diff --git a/config/boot.rb b/config/boot.rb index 6b750f0..5e5f0c1 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,4 @@ +# Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' # Set up gems listed in the Gemfile. +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) diff --git a/config/database.yml b/config/database.yml index 74574c8..b2e34b1 100644 --- a/config/database.yml +++ b/config/database.yml @@ -23,13 +23,13 @@ default: &default development: <<: *default - database: devise_test_development + database: FinalProj_development # The specified database role being used to connect to postgres. # To create additional roles in postgres see `$ createuser --help`. # When left blank, postgres will use the default role. This is # the same name as the operating system user that initialized the database. - #username: devise_test + #username: FinalProj # The password associated with the postgres role (username). #password: @@ -57,7 +57,7 @@ development: # Do not set this db to the same as development or production. test: <<: *default - database: devise_test_test + database: FinalProj_test # As with config/secrets.yml, you never want to store sensitive information, # like your database password, in your source code. If your source code is @@ -80,6 +80,6 @@ test: # production: <<: *default - database: devise_test_production - username: devise_test - password: <%= ENV['DEVISE_TEST_DATABASE_PASSWORD'] %> + database: FinalProj_production + username: FinalProj + password: <%= ENV['FINALPROJ_DATABASE_PASSWORD'] %> diff --git a/config/environments/development.rb b/config/environments/development.rb index b55e214..ddf0e90 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -27,10 +27,6 @@ # number of complex assets. config.assets.debug = true - # Asset digests allow you to set far-future HTTP expiration dates on all assets, - # yet still be able to expire them through the digest params. - config.assets.digest = true - # Adds additional error checking when serving assets at runtime. # Checks for improperly declared sprockets dependencies. # Raises helpful error messages. diff --git a/config/environments/production.rb b/config/environments/production.rb index 7c01713..b93a877 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -16,11 +16,10 @@ # Enable Rack::Cache to put a simple HTTP cache in front of your application # Add `rack-cache` to your Gemfile before enabling this. - # For large-scale production use, consider using a caching reverse proxy like - # NGINX, varnish or squid. + # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. # config.action_dispatch.rack_cache = true - # Disable Rails's static asset server (Apache or NGINX will already do this). + # Disable Rails's static asset server (Apache or nginx will already do this). config.serve_static_assets = false # Compress JavaScripts and CSS. @@ -30,21 +29,20 @@ # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false - # Asset digests allow you to set far-future HTTP expiration dates on all assets, - # yet still be able to expire them through the digest params. + # Generate digests for assets URLs. config.assets.digest = true # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # Decrease the log volume. - # config.log_level = :info + # Set to :debug to see everything in the log. + config.log_level = :info # Prepend all log lines with the following tags. # config.log_tags = [ :subdomain, :uuid ] @@ -56,7 +54,7 @@ # config.cache_store = :mem_cache_store # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = 'http://assets.example.com' + # config.action_controller.asset_host = "http://assets.example.com" # Ignore bad email addresses and do not raise email delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors. @@ -69,6 +67,9 @@ # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify + # Disable automatic flushing of the log to improve performance. + # config.autoflush_log = false + # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new diff --git a/config/environments/test.rb b/config/environments/test.rb index 32756eb..053f5b6 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -31,9 +31,6 @@ # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test - # Randomize the order test cases are executed - config.active_support.test_order = :random - # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 01ef3e6..d2f4ec3 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -3,9 +3,6 @@ # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = '1.0' -# Add additional assets to the asset load path -# Rails.application.config.assets.paths << Emoji.images_path - # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # Rails.application.config.assets.precompile += %w( search.js ) diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb index 7f70458..7a06a89 100644 --- a/config/initializers/cookies_serializer.rb +++ b/config/initializers/cookies_serializer.rb @@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file. -Rails.application.config.action_dispatch.cookies_serializer = :json +Rails.application.config.action_dispatch.cookies_serializer = :json \ No newline at end of file diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb deleted file mode 100644 index f7596cb..0000000 --- a/config/initializers/devise.rb +++ /dev/null @@ -1,261 +0,0 @@ -# Use this hook to configure devise mailer, warden hooks and so forth. -# Many of these configuration options can be set straight in your model. -Devise.setup do |config| - # The secret key used by Devise. Devise uses this key to generate - # random tokens. Changing this key will render invalid all existing - # confirmation, reset password and unlock tokens in the database. - # config.secret_key = '051bf62cc28e64344dbe23700ab79d534229c6fe2d80e949bc60496ee61d2eff1d4323bc6df477aaff01f7b2984f577dd7999bb79ee02a4574b9935b845f65e9' - - # ==> Mailer Configuration - # Configure the e-mail address which will be shown in Devise::Mailer, - # note that it will be overwritten if you use your own mailer class - # with default "from" parameter. - config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' - - # Configure the class responsible to send e-mails. - # config.mailer = 'Devise::Mailer' - - # ==> ORM configuration - # Load and configure the ORM. Supports :active_record (default) and - # :mongoid (bson_ext recommended) by default. Other ORMs may be - # available as additional gems. - require 'devise/orm/active_record' - - # ==> Configuration for any authentication mechanism - # Configure which keys are used when authenticating a user. The default is - # just :email. You can configure it to use [:username, :subdomain], so for - # authenticating a user, both parameters are required. Remember that those - # parameters are used only when authenticating and not when retrieving from - # session. If you need permissions, you should implement that in a before filter. - # You can also supply a hash where the value is a boolean determining whether - # or not authentication should be aborted when the value is not present. - # config.authentication_keys = [ :email ] - - # Configure parameters from the request object used for authentication. Each entry - # given should be a request method and it will automatically be passed to the - # find_for_authentication method and considered in your model lookup. For instance, - # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. - # The same considerations mentioned for authentication_keys also apply to request_keys. - # config.request_keys = [] - - # Configure which authentication keys should be case-insensitive. - # These keys will be downcased upon creating or modifying a user and when used - # to authenticate or find a user. Default is :email. - config.case_insensitive_keys = [ :email ] - - # Configure which authentication keys should have whitespace stripped. - # These keys will have whitespace before and after removed upon creating or - # modifying a user and when used to authenticate or find a user. Default is :email. - config.strip_whitespace_keys = [ :email ] - - # Tell if authentication through request.params is enabled. True by default. - # It can be set to an array that will enable params authentication only for the - # given strategies, for example, `config.params_authenticatable = [:database]` will - # enable it only for database (email + password) authentication. - # config.params_authenticatable = true - - # Tell if authentication through HTTP Auth is enabled. False by default. - # It can be set to an array that will enable http authentication only for the - # given strategies, for example, `config.http_authenticatable = [:database]` will - # enable it only for database authentication. The supported strategies are: - # :database = Support basic authentication with authentication key + password - # config.http_authenticatable = false - - # If 401 status code should be returned for AJAX requests. True by default. - # config.http_authenticatable_on_xhr = true - - # The realm used in Http Basic Authentication. 'Application' by default. - # config.http_authentication_realm = 'Application' - - # It will change confirmation, password recovery and other workflows - # to behave the same regardless if the e-mail provided was right or wrong. - # Does not affect registerable. - # config.paranoid = true - - # By default Devise will store the user in session. You can skip storage for - # particular strategies by setting this option. - # Notice that if you are skipping storage for all authentication paths, you - # may want to disable generating routes to Devise's sessions controller by - # passing skip: :sessions to `devise_for` in your config/routes.rb - config.skip_session_storage = [:http_auth] - - config.omniauth :facebook, "1405823239640180", "05876d4e812fd9ffa3bf8dea92dc3e44" - - # By default, Devise cleans up the CSRF token on authentication to - # avoid CSRF token fixation attacks. This means that, when using AJAX - # requests for sign in and sign up, you need to get a new CSRF token - # from the server. You can disable this option at your own risk. - # config.clean_up_csrf_token_on_authentication = true - - # ==> Configuration for :database_authenticatable - # For bcrypt, this is the cost for hashing the password and defaults to 10. If - # using other encryptors, it sets how many times you want the password re-encrypted. - # - # Limiting the stretches to just one in testing will increase the performance of - # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use - # a value less than 10 in other environments. Note that, for bcrypt (the default - # encryptor), the cost increases exponentially with the number of stretches (e.g. - # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). - config.stretches = Rails.env.test? ? 1 : 10 - - # Setup a pepper to generate the encrypted password. - # config.pepper = 'f59e8c6f14f338374929085273060577b962323a77f19dc4a6ac85ee75b8a2cca0745d02f8a44366752bded1da78c8dd36bf2e9ffd4419603293be1ca2fb842a' - - # ==> Configuration for :confirmable - # A period that the user is allowed to access the website even without - # confirming their account. For instance, if set to 2.days, the user will be - # able to access the website for two days without confirming their account, - # access will be blocked just in the third day. Default is 0.days, meaning - # the user cannot access the website without confirming their account. - # config.allow_unconfirmed_access_for = 2.days - - # A period that the user is allowed to confirm their account before their - # token becomes invalid. For example, if set to 3.days, the user can confirm - # their account within 3 days after the mail was sent, but on the fourth day - # their account can't be confirmed with the token any more. - # Default is nil, meaning there is no restriction on how long a user can take - # before confirming their account. - # config.confirm_within = 3.days - - # If true, requires any email changes to be confirmed (exactly the same way as - # initial account confirmation) to be applied. Requires additional unconfirmed_email - # db field (see migrations). Until confirmed, new email is stored in - # unconfirmed_email column, and copied to email column on successful confirmation. - config.reconfirmable = true - - # Defines which key will be used when confirming an account - # config.confirmation_keys = [ :email ] - - # ==> Configuration for :rememberable - # The time the user will be remembered without asking for credentials again. - # config.remember_for = 2.weeks - - # Invalidates all the remember me tokens when the user signs out. - config.expire_all_remember_me_on_sign_out = true - - # If true, extends the user's remember period when remembered via cookie. - # config.extend_remember_period = false - - # Options to be passed to the created cookie. For instance, you can set - # secure: true in order to force SSL only cookies. - # config.rememberable_options = {} - - # ==> Configuration for :validatable - # Range for password length. - config.password_length = 8..128 - - # Email regex used to validate email formats. It simply asserts that - # one (and only one) @ exists in the given string. This is mainly - # to give user feedback and not to assert the e-mail validity. - # config.email_regexp = /\A[^@]+@[^@]+\z/ - - # ==> Configuration for :timeoutable - # The time you want to timeout the user session without activity. After this - # time the user will be asked for credentials again. Default is 30 minutes. - # config.timeout_in = 30.minutes - - # If true, expires auth token on session timeout. - # config.expire_auth_token_on_timeout = false - - # ==> Configuration for :lockable - # Defines which strategy will be used to lock an account. - # :failed_attempts = Locks an account after a number of failed attempts to sign in. - # :none = No lock strategy. You should handle locking by yourself. - # config.lock_strategy = :failed_attempts - - # Defines which key will be used when locking and unlocking an account - # config.unlock_keys = [ :email ] - - # Defines which strategy will be used to unlock an account. - # :email = Sends an unlock link to the user email - # :time = Re-enables login after a certain amount of time (see :unlock_in below) - # :both = Enables both strategies - # :none = No unlock strategy. You should handle unlocking by yourself. - # config.unlock_strategy = :both - - # Number of authentication tries before locking an account if lock_strategy - # is failed attempts. - # config.maximum_attempts = 20 - - # Time interval to unlock the account if :time is enabled as unlock_strategy. - # config.unlock_in = 1.hour - - # Warn on the last attempt before the account is locked. - # config.last_attempt_warning = true - - # ==> Configuration for :recoverable - # - # Defines which key will be used when recovering the password for an account - # config.reset_password_keys = [ :email ] - - # Time interval you can reset your password with a reset password key. - # Don't put a too small interval or your users won't have the time to - # change their passwords. - config.reset_password_within = 6.hours - - # ==> Configuration for :encryptable - # Allow you to use another encryption algorithm besides bcrypt (default). You can use - # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, - # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) - # and :restful_authentication_sha1 (then you should set stretches to 10, and copy - # REST_AUTH_SITE_KEY to pepper). - # - # Require the `devise-encryptable` gem when using anything other than bcrypt - # config.encryptor = :sha512 - - # ==> Scopes configuration - # Turn scoped views on. Before rendering "sessions/new", it will first check for - # "users/sessions/new". It's turned off by default because it's slower if you - # are using only default views. - # config.scoped_views = false - - # Configure the default scope given to Warden. By default it's the first - # devise role declared in your routes (usually :user). - # config.default_scope = :user - - # Set this configuration to false if you want /users/sign_out to sign out - # only the current scope. By default, Devise signs out all scopes. - # config.sign_out_all_scopes = true - - # ==> Navigation configuration - # Lists the formats that should be treated as navigational. Formats like - # :html, should redirect to the sign in page when the user does not have - # access, but formats like :xml or :json, should return 401. - # - # If you have any extra navigational formats, like :iphone or :mobile, you - # should add them to the navigational formats lists. - # - # The "*/*" below is required to match Internet Explorer requests. - # config.navigational_formats = ['*/*', :html] - - # The default HTTP method used to sign out a resource. Default is :delete. - config.sign_out_via = :delete - - # ==> OmniAuth - # Add a new OmniAuth provider. Check the wiki for more information on setting - # up on your models and hooks. - # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' - - # ==> Warden configuration - # If you want to use other strategies, that are not supported by Devise, or - # change the failure app, you can configure them inside the config.warden block. - # - # config.warden do |manager| - # manager.intercept_401 = false - # manager.default_strategies(scope: :user).unshift :some_external_strategy - # end - - # ==> Mountable engine configurations - # When using Devise inside an engine, let's call it `MyEngine`, and this engine - # is mountable, there are some extra configurations to be taken into account. - # The following options are available, assuming the engine is mounted as: - # - # mount MyEngine, at: '/my_engine' - # - # The router that invoked `devise_for`, in the example above, would be: - # config.router_name = :my_engine - # - # When using omniauth, Devise cannot automatically set Omniauth path, - # so you need to do it manually. For the users scope, it would be: - # config.omniauth_path_prefix = '/my_engine/users/auth' -end diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index d9dafdc..964befd 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file. -Rails.application.config.session_store :cookie_store, key: '_devise_test_session' +Rails.application.config.session_store :cookie_store, key: '_FinalProj_session' diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml deleted file mode 100644 index 26a10f2..0000000 --- a/config/locales/devise.en.yml +++ /dev/null @@ -1,60 +0,0 @@ -# Additional translations at https://github.com/plataformatec/devise/wiki/I18n - -en: - devise: - confirmations: - confirmed: "Your email address has been successfully confirmed." - send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes." - failure: - already_authenticated: "You are already signed in." - inactive: "Your account is not activated yet." - invalid: "Invalid %{authentication_keys} or password." - locked: "Your account is locked." - last_attempt: "You have one more attempt before your account is locked." - not_found_in_database: "Invalid %{authentication_keys} or password." - timeout: "Your session expired. Please sign in again to continue." - unauthenticated: "You need to sign in or sign up before continuing." - unconfirmed: "You have to confirm your email address before continuing." - mailer: - confirmation_instructions: - subject: "Confirmation instructions" - reset_password_instructions: - subject: "Reset password instructions" - unlock_instructions: - subject: "Unlock instructions" - omniauth_callbacks: - failure: "Could not authenticate you from %{kind} because \"%{reason}\"." - success: "Successfully authenticated from %{kind} account." - passwords: - no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." - send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." - updated: "Your password has been changed successfully. You are now signed in." - updated_not_active: "Your password has been changed successfully." - registrations: - destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon." - signed_up: "Welcome! You have signed up successfully." - signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." - signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." - signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account." - update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address." - updated: "Your account has been updated successfully." - sessions: - signed_in: "Signed in successfully." - signed_out: "Signed out successfully." - already_signed_out: "Signed out successfully." - unlocks: - send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes." - send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes." - unlocked: "Your account has been unlocked successfully. Please sign in to continue." - errors: - messages: - already_confirmed: "was already confirmed, please try signing in" - confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" - expired: "has expired, please request a new one" - not_found: "not found" - not_locked: "was not locked" - not_saved: - one: "1 error prohibited this %{resource} from being saved:" - other: "%{count} errors prohibited this %{resource} from being saved:" diff --git a/config/routes.rb b/config/routes.rb index 42b1dc0..86c68b2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,63 +1,9 @@ Rails.application.routes.draw do - devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - # You can have the root of your site routed with "root" - root 'home#index' + root 'welcome#index' - get 'users/:id' => 'users#show' + get '/' => 'search#index' + post 'search/show' => 'search#show' - post '/store_zipcode/:zip' => 'users#store_zipcode' - # devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end end diff --git a/config/secrets.yml b/config/secrets.yml index 5cd92d0..33ec29b 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -11,10 +11,10 @@ # if you're sharing your code publicly. development: - secret_key_base: 93854d231676af1b27cb18bd048603aa110838b57ccffb0fa598ab24ef17bffaf5c8ab345ef0597007e90dcccaed9ce13b5ebaff5460dfbc7ee5ed124d059e9a + secret_key_base: 1e93e298017aed66b3ed785bcf581d1d3dcf02f5c7305ea6613ff3a2ea6d6e4c06caf43ef70e71c4b728484198c5bdf4ea5ef9113031351bfef8337eacd2a073 test: - secret_key_base: ba8b2da411bbdba18c2ae40d543525c5a86ac8270351f832e4fa529ccfa4f297e428e1f3cbe32748490d513c1400594ceb4220a77bdefcba6b633c2a84945b45 + secret_key_base: 90495c23b5650f485530b8db00c11ff32eba8146a098d6f9de2f5120497f724dcdf100e53f09e010dac2312914f18ce8b92b76677d4ce5f1d4f600515e031add # Do not keep production secrets in the repository, # instead read values from the environment. diff --git a/db/migrate/20141121022026_devise_create_users.rb b/db/migrate/20141121022026_devise_create_users.rb deleted file mode 100644 index 5f7bda0..0000000 --- a/db/migrate/20141121022026_devise_create_users.rb +++ /dev/null @@ -1,50 +0,0 @@ -class DeviseCreateUsers < ActiveRecord::Migration - def change - create_table(:users) do |t| - ## Database authenticatable - t.string :email, null: false, default: "" - t.string :encrypted_password, null: false, default: "" - t.string :name - t.string :image - ## zipcode is based on user profile/fallback is geocode disabled - t.string :zipcode - t.string :current_location - t.float :latitude - t.float :longitude - ## Recoverable - t.string :reset_password_token - t.datetime :reset_password_sent_at - - ## Rememberable - t.datetime :remember_created_at - - ## Trackable - t.integer :sign_in_count, default: 0, null: false - t.datetime :current_sign_in_at - t.datetime :last_sign_in_at - t.inet :current_sign_in_ip - t.inet :last_sign_in_ip - - ## Confirmable - # t.string :confirmation_token - # t.datetime :confirmed_at - # t.datetime :confirmation_sent_at - # t.string :unconfirmed_email # Only if using reconfirmable - - ## Lockable - # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts - # t.string :unlock_token # Only if unlock strategy is :email or :both - # t.datetime :locked_at - - - t.timestamps - end - - add_index :users, :email, unique: true - add_index :users, :reset_password_token, unique: true - add_index :users, :name - add_index :users, :image - # add_index :users, :confirmation_token, unique: true - # add_index :users, :unlock_token, unique: true - end -end diff --git a/db/migrate/20141121031604_add_columns_to_users.rb b/db/migrate/20141121031604_add_columns_to_users.rb deleted file mode 100644 index dec83f6..0000000 --- a/db/migrate/20141121031604_add_columns_to_users.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddColumnsToUsers < ActiveRecord::Migration - def change - add_column :users, :provider, :string - add_column :users, :uid, :string - end -end diff --git a/FinalProj/db/migrate/20141128233625_create_users.rb b/db/migrate/20141128233625_create_users.rb similarity index 100% rename from FinalProj/db/migrate/20141128233625_create_users.rb rename to db/migrate/20141128233625_create_users.rb diff --git a/db/migrate/20141128233631_create_artists.rb b/db/migrate/20141128233631_create_artists.rb index 5573307..2517ee0 100644 --- a/db/migrate/20141128233631_create_artists.rb +++ b/db/migrate/20141128233631_create_artists.rb @@ -1,7 +1,7 @@ class CreateArtists < ActiveRecord::Migration def change create_table :artists do |t| - t.string :mbid, :name + t.string :mbid, :name, :search_image_url t.boolean :review_flag t.integer :music_rating, :atmosphere_rating, :overall_rating, :composite_rating t.timestamps diff --git a/db/migrate/20141128233637_create_reviews.rb b/db/migrate/20141128233637_create_reviews.rb index c1e04f0..b8ebb0e 100644 --- a/db/migrate/20141128233637_create_reviews.rb +++ b/db/migrate/20141128233637_create_reviews.rb @@ -1,7 +1,8 @@ class CreateReviews < ActiveRecord::Migration def change create_table :reviews do |t| - t.references :user_id, :artist_id + t.references :user + t.references :artist t.string :venue, :content t.integer :ticket_price t.integer :music_rating, :atmosphere_rating, :overall_rating, :composite_rating diff --git a/db/migrate/20141129224243_create_events.rb b/db/migrate/20141129224243_create_events.rb deleted file mode 100644 index 203559d..0000000 --- a/db/migrate/20141129224243_create_events.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateEvents < ActiveRecord::Migration - def change - create_table :events do |t| - t.string :venue - t.string :artist - t.string :date - t.string :url - t.timestamps null: false - end - end -end diff --git a/db/schema.rb b/db/schema.rb index 79186e5..539466c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20141129224243) do +ActiveRecord::Schema.define(version: 20141128235714) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -33,6 +33,7 @@ create_table "artists", force: true do |t| t.string "mbid" t.string "name" + t.string "search_image_url" t.boolean "review_flag" t.integer "music_rating" t.integer "atmosphere_rating" @@ -42,15 +43,6 @@ t.datetime "updated_at" end - create_table "events", force: true do |t| - t.string "venue" - t.string "artist" - t.string "date" - t.string "url" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - create_table "genres", force: true do |t| t.string "name" t.datetime "created_at" @@ -58,8 +50,8 @@ end create_table "reviews", force: true do |t| - t.integer "user_id_id" - t.integer "artist_id_id" + t.integer "user_id" + t.integer "artist_id" t.string "venue" t.string "content" t.integer "ticket_price" @@ -75,14 +67,13 @@ end create_table "users", force: true do |t| + t.string "username" + t.string "zipcode" + t.string "current_location" t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false t.string "name" t.string "image" - t.string "zipcode" - t.string "current_location" - t.float "latitude" - t.float "longitude" t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" @@ -93,8 +84,6 @@ t.inet "last_sign_in_ip" t.datetime "created_at" t.datetime "updated_at" - t.string "provider" - t.string "uid" end add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree diff --git a/lib/concert.rb b/lib/concert.rb deleted file mode 100644 index 032ca59..0000000 --- a/lib/concert.rb +++ /dev/null @@ -1,18 +0,0 @@ -class Concert - include HTTParty - - def self.get_concerts(zipcode) - concert_array = [] - response = HTTParty.get('http://api.jambase.com/events?zipCode=95128&radius=50&page=0&api_key=B3Q6F9ZTGYVMDWJ57M44JFNJ') - response['Events'].each do |concert| - venue = concert['Venue']['Name'] - date = concert['Date'] - artist = concert['Artists'].first['Name'] - url = concert['TicketUrl'] - hash = {venue: venue, date: date, artist: artist, url: url} - concert_array << hash - # Event.create(hash) - end - concert_array - end -end \ No newline at end of file diff --git a/FinalProj/app/assets/images/.keep b/test/controllers/.keep similarity index 100% rename from FinalProj/app/assets/images/.keep rename to test/controllers/.keep diff --git a/test/controllers/search_controller_test.rb b/test/controllers/search_controller_test.rb new file mode 100644 index 0000000..bfbf22d --- /dev/null +++ b/test/controllers/search_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SearchControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/welcome_controller_test.rb b/test/controllers/welcome_controller_test.rb new file mode 100644 index 0000000..fb50856 --- /dev/null +++ b/test/controllers/welcome_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class WelcomeControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/FinalProj/app/controllers/concerns/.keep b/test/fixtures/.keep similarity index 100% rename from FinalProj/app/controllers/concerns/.keep rename to test/fixtures/.keep diff --git a/FinalProj/test/fixtures/artist_genres.yml b/test/fixtures/artist_genres.yml similarity index 100% rename from FinalProj/test/fixtures/artist_genres.yml rename to test/fixtures/artist_genres.yml diff --git a/FinalProj/test/fixtures/artist_users.yml b/test/fixtures/artist_users.yml similarity index 100% rename from FinalProj/test/fixtures/artist_users.yml rename to test/fixtures/artist_users.yml diff --git a/FinalProj/test/fixtures/artists.yml b/test/fixtures/artists.yml similarity index 100% rename from FinalProj/test/fixtures/artists.yml rename to test/fixtures/artists.yml diff --git a/FinalProj/test/fixtures/genres.yml b/test/fixtures/genres.yml similarity index 100% rename from FinalProj/test/fixtures/genres.yml rename to test/fixtures/genres.yml diff --git a/FinalProj/test/fixtures/reviews.yml b/test/fixtures/reviews.yml similarity index 100% rename from FinalProj/test/fixtures/reviews.yml rename to test/fixtures/reviews.yml diff --git a/FinalProj/test/fixtures/users.yml b/test/fixtures/users.yml similarity index 100% rename from FinalProj/test/fixtures/users.yml rename to test/fixtures/users.yml diff --git a/FinalProj/app/mailers/.keep b/test/helpers/.keep similarity index 100% rename from FinalProj/app/mailers/.keep rename to test/helpers/.keep diff --git a/test/helpers/search_helper_test.rb b/test/helpers/search_helper_test.rb new file mode 100644 index 0000000..3034163 --- /dev/null +++ b/test/helpers/search_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class SearchHelperTest < ActionView::TestCase +end diff --git a/test/helpers/welcome_helper_test.rb b/test/helpers/welcome_helper_test.rb new file mode 100644 index 0000000..d6ded59 --- /dev/null +++ b/test/helpers/welcome_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class WelcomeHelperTest < ActionView::TestCase +end diff --git a/FinalProj/app/models/.keep b/test/integration/.keep similarity index 100% rename from FinalProj/app/models/.keep rename to test/integration/.keep diff --git a/FinalProj/app/models/concerns/.keep b/test/mailers/.keep similarity index 100% rename from FinalProj/app/models/concerns/.keep rename to test/mailers/.keep diff --git a/FinalProj/lib/assets/.keep b/test/models/.keep similarity index 100% rename from FinalProj/lib/assets/.keep rename to test/models/.keep diff --git a/FinalProj/test/models/artist_genres_test.rb b/test/models/artist_genres_test.rb similarity index 100% rename from FinalProj/test/models/artist_genres_test.rb rename to test/models/artist_genres_test.rb diff --git a/FinalProj/test/models/artist_test.rb b/test/models/artist_test.rb similarity index 100% rename from FinalProj/test/models/artist_test.rb rename to test/models/artist_test.rb diff --git a/FinalProj/test/models/artist_users_test.rb b/test/models/artist_users_test.rb similarity index 100% rename from FinalProj/test/models/artist_users_test.rb rename to test/models/artist_users_test.rb diff --git a/FinalProj/test/models/genre_test.rb b/test/models/genre_test.rb similarity index 100% rename from FinalProj/test/models/genre_test.rb rename to test/models/genre_test.rb diff --git a/FinalProj/test/models/review_test.rb b/test/models/review_test.rb similarity index 100% rename from FinalProj/test/models/review_test.rb rename to test/models/review_test.rb diff --git a/FinalProj/test/models/user_test.rb b/test/models/user_test.rb similarity index 100% rename from FinalProj/test/models/user_test.rb rename to test/models/user_test.rb diff --git a/FinalProj/test/test_helper.rb b/test/test_helper.rb similarity index 100% rename from FinalProj/test/test_helper.rb rename to test/test_helper.rb diff --git a/vendor/.DS_Store b/vendor/.DS_Store new file mode 100644 index 0000000..c328838 Binary files /dev/null and b/vendor/.DS_Store differ diff --git a/vendor/assets/.DS_Store b/vendor/assets/.DS_Store new file mode 100644 index 0000000..339cc1f Binary files /dev/null and b/vendor/assets/.DS_Store differ diff --git a/vendor/assets/javascripts/bootstrap-sprockets.js b/vendor/assets/javascripts/bootstrap-sprockets.js new file mode 100644 index 0000000..1abde49 --- /dev/null +++ b/vendor/assets/javascripts/bootstrap-sprockets.js @@ -0,0 +1,12 @@ +//= require ./bootstrap/affix +//= require ./bootstrap/alert +//= require ./bootstrap/button +//= require ./bootstrap/carousel +//= require ./bootstrap/collapse +//= require ./bootstrap/dropdown +//= require ./bootstrap/tab +//= require ./bootstrap/transition +//= require ./bootstrap/scrollspy +//= require ./bootstrap/modal +//= require ./bootstrap/tooltip +//= require ./bootstrap/popover diff --git a/vendor/assets/javascripts/bootstrap.js b/vendor/assets/javascripts/bootstrap.js new file mode 100644 index 0000000..485f5f9 --- /dev/null +++ b/vendor/assets/javascripts/bootstrap.js @@ -0,0 +1,2304 @@ +/* ======================================================================== + * Bootstrap: affix.js v3.3.1 + * http://getbootstrap.com/javascript/#affix + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // AFFIX CLASS DEFINITION + // ====================== + + var Affix = function (element, options) { + this.options = $.extend({}, Affix.DEFAULTS, options) + + this.$target = $(this.options.target) + .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) + .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) + + this.$element = $(element) + this.affixed = + this.unpin = + this.pinnedOffset = null + + this.checkPosition() + } + + Affix.VERSION = '3.3.1' + + Affix.RESET = 'affix affix-top affix-bottom' + + Affix.DEFAULTS = { + offset: 0, + target: window + } + + Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { + var scrollTop = this.$target.scrollTop() + var position = this.$element.offset() + var targetHeight = this.$target.height() + + if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false + + if (this.affixed == 'bottom') { + if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' + return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' + } + + var initializing = this.affixed == null + var colliderTop = initializing ? scrollTop : position.top + var colliderHeight = initializing ? targetHeight : height + + if (offsetTop != null && colliderTop <= offsetTop) return 'top' + if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' + + return false + } + + Affix.prototype.getPinnedOffset = function () { + if (this.pinnedOffset) return this.pinnedOffset + this.$element.removeClass(Affix.RESET).addClass('affix') + var scrollTop = this.$target.scrollTop() + var position = this.$element.offset() + return (this.pinnedOffset = position.top - scrollTop) + } + + Affix.prototype.checkPositionWithEventLoop = function () { + setTimeout($.proxy(this.checkPosition, this), 1) + } + + Affix.prototype.checkPosition = function () { + if (!this.$element.is(':visible')) return + + var height = this.$element.height() + var offset = this.options.offset + var offsetTop = offset.top + var offsetBottom = offset.bottom + var scrollHeight = $('body').height() + + if (typeof offset != 'object') offsetBottom = offsetTop = offset + if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) + if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) + + var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) + + if (this.affixed != affix) { + if (this.unpin != null) this.$element.css('top', '') + + var affixType = 'affix' + (affix ? '-' + affix : '') + var e = $.Event(affixType + '.bs.affix') + + this.$element.trigger(e) + + if (e.isDefaultPrevented()) return + + this.affixed = affix + this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null + + this.$element + .removeClass(Affix.RESET) + .addClass(affixType) + .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') + } + + if (affix == 'bottom') { + this.$element.offset({ + top: scrollHeight - height - offsetBottom + }) + } + } + + + // AFFIX PLUGIN DEFINITION + // ======================= + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.affix') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.affix', (data = new Affix(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + var old = $.fn.affix + + $.fn.affix = Plugin + $.fn.affix.Constructor = Affix + + + // AFFIX NO CONFLICT + // ================= + + $.fn.affix.noConflict = function () { + $.fn.affix = old + return this + } + + + // AFFIX DATA-API + // ============== + + $(window).on('load', function () { + $('[data-spy="affix"]').each(function () { + var $spy = $(this) + var data = $spy.data() + + data.offset = data.offset || {} + + if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom + if (data.offsetTop != null) data.offset.top = data.offsetTop + + Plugin.call($spy, data) + }) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: alert.js v3.3.1 + * http://getbootstrap.com/javascript/#alerts + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // ALERT CLASS DEFINITION + // ====================== + + var dismiss = '[data-dismiss="alert"]' + var Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.VERSION = '3.3.1' + + Alert.TRANSITION_DURATION = 150 + + Alert.prototype.close = function (e) { + var $this = $(this) + var selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } + + var $parent = $(selector) + + if (e) e.preventDefault() + + if (!$parent.length) { + $parent = $this.closest('.alert') + } + + $parent.trigger(e = $.Event('close.bs.alert')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + // detach from parent, fire event then clean up data + $parent.detach().trigger('closed.bs.alert').remove() + } + + $.support.transition && $parent.hasClass('fade') ? + $parent + .one('bsTransitionEnd', removeElement) + .emulateTransitionEnd(Alert.TRANSITION_DURATION) : + removeElement() + } + + + // ALERT PLUGIN DEFINITION + // ======================= + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.alert') + + if (!data) $this.data('bs.alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + var old = $.fn.alert + + $.fn.alert = Plugin + $.fn.alert.Constructor = Alert + + + // ALERT NO CONFLICT + // ================= + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + + // ALERT DATA-API + // ============== + + $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: button.js v3.3.1 + * http://getbootstrap.com/javascript/#buttons + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // BUTTON PUBLIC CLASS DEFINITION + // ============================== + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) + this.isLoading = false + } + + Button.VERSION = '3.3.1' + + Button.DEFAULTS = { + loadingText: 'loading...' + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + var $el = this.$element + var val = $el.is('input') ? 'val' : 'html' + var data = $el.data() + + state = state + 'Text' + + if (data.resetText == null) $el.data('resetText', $el[val]()) + + // push to event loop to allow forms to submit + setTimeout($.proxy(function () { + $el[val](data[state] == null ? this.options[state] : data[state]) + + if (state == 'loadingText') { + this.isLoading = true + $el.addClass(d).attr(d, d) + } else if (this.isLoading) { + this.isLoading = false + $el.removeClass(d).removeAttr(d) + } + }, this), 0) + } + + Button.prototype.toggle = function () { + var changed = true + var $parent = this.$element.closest('[data-toggle="buttons"]') + + if ($parent.length) { + var $input = this.$element.find('input') + if ($input.prop('type') == 'radio') { + if ($input.prop('checked') && this.$element.hasClass('active')) changed = false + else $parent.find('.active').removeClass('active') + } + if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') + } else { + this.$element.attr('aria-pressed', !this.$element.hasClass('active')) + } + + if (changed) this.$element.toggleClass('active') + } + + + // BUTTON PLUGIN DEFINITION + // ======================== + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.button') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.button', (data = new Button(this, options))) + + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + var old = $.fn.button + + $.fn.button = Plugin + $.fn.button.Constructor = Button + + + // BUTTON NO CONFLICT + // ================== + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + // BUTTON DATA-API + // =============== + + $(document) + .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + Plugin.call($btn, 'toggle') + e.preventDefault() + }) + .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { + $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: carousel.js v3.3.1 + * http://getbootstrap.com/javascript/#carousel + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // CAROUSEL CLASS DEFINITION + // ========================= + + var Carousel = function (element, options) { + this.$element = $(element) + this.$indicators = this.$element.find('.carousel-indicators') + this.options = options + this.paused = + this.sliding = + this.interval = + this.$active = + this.$items = null + + this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) + + this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element + .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) + .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) + } + + Carousel.VERSION = '3.3.1' + + Carousel.TRANSITION_DURATION = 600 + + Carousel.DEFAULTS = { + interval: 5000, + pause: 'hover', + wrap: true, + keyboard: true + } + + Carousel.prototype.keydown = function (e) { + if (/input|textarea/i.test(e.target.tagName)) return + switch (e.which) { + case 37: this.prev(); break + case 39: this.next(); break + default: return + } + + e.preventDefault() + } + + Carousel.prototype.cycle = function (e) { + e || (this.paused = false) + + this.interval && clearInterval(this.interval) + + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + + return this + } + + Carousel.prototype.getItemIndex = function (item) { + this.$items = item.parent().children('.item') + return this.$items.index(item || this.$active) + } + + Carousel.prototype.getItemForDirection = function (direction, active) { + var delta = direction == 'prev' ? -1 : 1 + var activeIndex = this.getItemIndex(active) + var itemIndex = (activeIndex + delta) % this.$items.length + return this.$items.eq(itemIndex) + } + + Carousel.prototype.to = function (pos) { + var that = this + var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) + + if (pos > (this.$items.length - 1) || pos < 0) return + + if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" + if (activeIndex == pos) return this.pause().cycle() + + return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) + } + + Carousel.prototype.pause = function (e) { + e || (this.paused = true) + + if (this.$element.find('.next, .prev').length && $.support.transition) { + this.$element.trigger($.support.transition.end) + this.cycle(true) + } + + this.interval = clearInterval(this.interval) + + return this + } + + Carousel.prototype.next = function () { + if (this.sliding) return + return this.slide('next') + } + + Carousel.prototype.prev = function () { + if (this.sliding) return + return this.slide('prev') + } + + Carousel.prototype.slide = function (type, next) { + var $active = this.$element.find('.item.active') + var $next = next || this.getItemForDirection(type, $active) + var isCycling = this.interval + var direction = type == 'next' ? 'left' : 'right' + var fallback = type == 'next' ? 'first' : 'last' + var that = this + + if (!$next.length) { + if (!this.options.wrap) return + $next = this.$element.find('.item')[fallback]() + } + + if ($next.hasClass('active')) return (this.sliding = false) + + var relatedTarget = $next[0] + var slideEvent = $.Event('slide.bs.carousel', { + relatedTarget: relatedTarget, + direction: direction + }) + this.$element.trigger(slideEvent) + if (slideEvent.isDefaultPrevented()) return + + this.sliding = true + + isCycling && this.pause() + + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) + $nextIndicator && $nextIndicator.addClass('active') + } + + var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" + if ($.support.transition && this.$element.hasClass('slide')) { + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + $active + .one('bsTransitionEnd', function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { + that.$element.trigger(slidEvent) + }, 0) + }) + .emulateTransitionEnd(Carousel.TRANSITION_DURATION) + } else { + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger(slidEvent) + } + + isCycling && this.cycle() + + return this + } + + + // CAROUSEL PLUGIN DEFINITION + // ========================== + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.carousel') + var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) + var action = typeof option == 'string' ? option : options.slide + + if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.pause().cycle() + }) + } + + var old = $.fn.carousel + + $.fn.carousel = Plugin + $.fn.carousel.Constructor = Carousel + + + // CAROUSEL NO CONFLICT + // ==================== + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + + // CAROUSEL DATA-API + // ================= + + var clickHandler = function (e) { + var href + var $this = $(this) + var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 + if (!$target.hasClass('carousel')) return + var options = $.extend({}, $target.data(), $this.data()) + var slideIndex = $this.attr('data-slide-to') + if (slideIndex) options.interval = false + + Plugin.call($target, options) + + if (slideIndex) { + $target.data('bs.carousel').to(slideIndex) + } + + e.preventDefault() + } + + $(document) + .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) + .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) + + $(window).on('load', function () { + $('[data-ride="carousel"]').each(function () { + var $carousel = $(this) + Plugin.call($carousel, $carousel.data()) + }) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: collapse.js v3.3.1 + * http://getbootstrap.com/javascript/#collapse + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // COLLAPSE PUBLIC CLASS DEFINITION + // ================================ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Collapse.DEFAULTS, options) + this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]') + this.transitioning = null + + if (this.options.parent) { + this.$parent = this.getParent() + } else { + this.addAriaAndCollapsedClass(this.$element, this.$trigger) + } + + if (this.options.toggle) this.toggle() + } + + Collapse.VERSION = '3.3.1' + + Collapse.TRANSITION_DURATION = 350 + + Collapse.DEFAULTS = { + toggle: true, + trigger: '[data-toggle="collapse"]' + } + + Collapse.prototype.dimension = function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + Collapse.prototype.show = function () { + if (this.transitioning || this.$element.hasClass('in')) return + + var activesData + var actives = this.$parent && this.$parent.find('> .panel').children('.in, .collapsing') + + if (actives && actives.length) { + activesData = actives.data('bs.collapse') + if (activesData && activesData.transitioning) return + } + + var startEvent = $.Event('show.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + if (actives && actives.length) { + Plugin.call(actives, 'hide') + activesData || actives.data('bs.collapse', null) + } + + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + .addClass('collapsing')[dimension](0) + .attr('aria-expanded', true) + + this.$trigger + .removeClass('collapsed') + .attr('aria-expanded', true) + + this.transitioning = 1 + + var complete = function () { + this.$element + .removeClass('collapsing') + .addClass('collapse in')[dimension]('') + this.transitioning = 0 + this.$element + .trigger('shown.bs.collapse') + } + + if (!$.support.transition) return complete.call(this) + + var scrollSize = $.camelCase(['scroll', dimension].join('-')) + + this.$element + .one('bsTransitionEnd', $.proxy(complete, this)) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) + } + + Collapse.prototype.hide = function () { + if (this.transitioning || !this.$element.hasClass('in')) return + + var startEvent = $.Event('hide.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + var dimension = this.dimension() + + this.$element[dimension](this.$element[dimension]())[0].offsetHeight + + this.$element + .addClass('collapsing') + .removeClass('collapse in') + .attr('aria-expanded', false) + + this.$trigger + .addClass('collapsed') + .attr('aria-expanded', false) + + this.transitioning = 1 + + var complete = function () { + this.transitioning = 0 + this.$element + .removeClass('collapsing') + .addClass('collapse') + .trigger('hidden.bs.collapse') + } + + if (!$.support.transition) return complete.call(this) + + this.$element + [dimension](0) + .one('bsTransitionEnd', $.proxy(complete, this)) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION) + } + + Collapse.prototype.toggle = function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + Collapse.prototype.getParent = function () { + return $(this.options.parent) + .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') + .each($.proxy(function (i, element) { + var $element = $(element) + this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) + }, this)) + .end() + } + + Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { + var isOpen = $element.hasClass('in') + + $element.attr('aria-expanded', isOpen) + $trigger + .toggleClass('collapsed', !isOpen) + .attr('aria-expanded', isOpen) + } + + function getTargetFromTrigger($trigger) { + var href + var target = $trigger.attr('data-target') + || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 + + return $(target) + } + + + // COLLAPSE PLUGIN DEFINITION + // ========================== + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.collapse') + var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) + + if (!data && options.toggle && option == 'show') options.toggle = false + if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + var old = $.fn.collapse + + $.fn.collapse = Plugin + $.fn.collapse.Constructor = Collapse + + + // COLLAPSE NO CONFLICT + // ==================== + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + // COLLAPSE DATA-API + // ================= + + $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { + var $this = $(this) + + if (!$this.attr('data-target')) e.preventDefault() + + var $target = getTargetFromTrigger($this) + var data = $target.data('bs.collapse') + var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this }) + + Plugin.call($target, option) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: dropdown.js v3.3.1 + * http://getbootstrap.com/javascript/#dropdowns + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // DROPDOWN CLASS DEFINITION + // ========================= + + var backdrop = '.dropdown-backdrop' + var toggle = '[data-toggle="dropdown"]' + var Dropdown = function (element) { + $(element).on('click.bs.dropdown', this.toggle) + } + + Dropdown.VERSION = '3.3.1' + + Dropdown.prototype.toggle = function (e) { + var $this = $(this) + + if ($this.is('.disabled, :disabled')) return + + var $parent = getParent($this) + var isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { + // if mobile we use a backdrop because click events don't delegate + $('