From 6fa0227f6ea586c6e866fb610fc3190fd26227c3 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Tue, 10 Oct 2017 15:54:38 -0700 Subject: [PATCH 01/56] created new rails project for Media Ranker --- .gitignore | 19 ++ Gemfile | 66 ++++++ Gemfile.lock | 222 ++++++++++++++++++ Rakefile | 6 + app/assets/config/manifest.js | 3 + app/assets/images/.keep | 0 app/assets/javascripts/application.js | 15 ++ app/assets/javascripts/cable.js | 13 + app/assets/javascripts/channels/.keep | 0 app/assets/stylesheets/application.css | 15 ++ app/channels/application_cable/channel.rb | 4 + app/channels/application_cable/connection.rb | 4 + app/controllers/application_controller.rb | 3 + app/controllers/concerns/.keep | 0 app/helpers/application_helper.rb | 2 + app/jobs/application_job.rb | 2 + app/mailers/application_mailer.rb | 4 + app/models/application_record.rb | 3 + app/models/concerns/.keep | 0 app/models/work.rb | 2 + app/views/layouts/application.html.erb | 14 ++ app/views/layouts/mailer.html.erb | 13 + app/views/layouts/mailer.text.erb | 1 + bin/bundle | 3 + bin/rails | 9 + bin/rake | 9 + bin/setup | 38 +++ bin/spring | 17 ++ bin/update | 29 +++ bin/yarn | 11 + config.ru | 5 + config/application.rb | 25 ++ config/boot.rb | 3 + config/cable.yml | 10 + config/database.yml | 85 +++++++ config/environment.rb | 5 + config/environments/development.rb | 54 +++++ config/environments/production.rb | 91 +++++++ config/environments/test.rb | 42 ++++ .../application_controller_renderer.rb | 8 + config/initializers/assets.rb | 14 ++ config/initializers/backtrace_silencers.rb | 7 + config/initializers/cookies_serializer.rb | 5 + .../initializers/filter_parameter_logging.rb | 4 + config/initializers/inflections.rb | 16 ++ config/initializers/mime_types.rb | 4 + config/initializers/wrap_parameters.rb | 14 ++ config/locales/en.yml | 33 +++ config/puma.rb | 56 +++++ config/routes.rb | 3 + config/secrets.yml | 32 +++ config/spring.rb | 6 + db/migrate/20171010225142_create_works.rb | 8 + db/seeds.rb | 7 + lib/assets/.keep | 0 lib/tasks/.keep | 0 log/.keep | 0 package.json | 5 + public/404.html | 67 ++++++ public/422.html | 67 ++++++ public/500.html | 66 ++++++ public/apple-touch-icon-precomposed.png | 0 public/apple-touch-icon.png | 0 public/favicon.ico | 0 public/robots.txt | 1 + test/application_system_test_case.rb | 5 + test/controllers/.keep | 0 test/fixtures/.keep | 0 test/fixtures/files/.keep | 0 test/fixtures/works.yml | 11 + test/helpers/.keep | 0 test/integration/.keep | 0 test/mailers/.keep | 0 test/models/.keep | 0 test/models/work_test.rb | 9 + test/system/.keep | 0 test/test_helper.rb | 26 ++ tmp/.keep | 0 vendor/.keep | 0 79 files changed, 1321 insertions(+) create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 Rakefile create mode 100644 app/assets/config/manifest.js create mode 100644 app/assets/images/.keep create mode 100644 app/assets/javascripts/application.js create mode 100644 app/assets/javascripts/cable.js create mode 100644 app/assets/javascripts/channels/.keep create mode 100644 app/assets/stylesheets/application.css create mode 100644 app/channels/application_cable/channel.rb create mode 100644 app/channels/application_cable/connection.rb create mode 100644 app/controllers/application_controller.rb create mode 100644 app/controllers/concerns/.keep create mode 100644 app/helpers/application_helper.rb create mode 100644 app/jobs/application_job.rb create mode 100644 app/mailers/application_mailer.rb create mode 100644 app/models/application_record.rb create mode 100644 app/models/concerns/.keep create mode 100644 app/models/work.rb create mode 100644 app/views/layouts/application.html.erb create mode 100644 app/views/layouts/mailer.html.erb create mode 100644 app/views/layouts/mailer.text.erb create mode 100755 bin/bundle create mode 100755 bin/rails create mode 100755 bin/rake create mode 100755 bin/setup create mode 100755 bin/spring create mode 100755 bin/update create mode 100755 bin/yarn create mode 100644 config.ru create mode 100644 config/application.rb create mode 100644 config/boot.rb create mode 100644 config/cable.yml create mode 100644 config/database.yml create mode 100644 config/environment.rb create mode 100644 config/environments/development.rb create mode 100644 config/environments/production.rb create mode 100644 config/environments/test.rb create mode 100644 config/initializers/application_controller_renderer.rb create mode 100644 config/initializers/assets.rb create mode 100644 config/initializers/backtrace_silencers.rb create mode 100644 config/initializers/cookies_serializer.rb create mode 100644 config/initializers/filter_parameter_logging.rb create mode 100644 config/initializers/inflections.rb create mode 100644 config/initializers/mime_types.rb create mode 100644 config/initializers/wrap_parameters.rb create mode 100644 config/locales/en.yml create mode 100644 config/puma.rb create mode 100644 config/routes.rb create mode 100644 config/secrets.yml create mode 100644 config/spring.rb create mode 100644 db/migrate/20171010225142_create_works.rb create mode 100644 db/seeds.rb create mode 100644 lib/assets/.keep create mode 100644 lib/tasks/.keep create mode 100644 log/.keep create mode 100644 package.json create mode 100644 public/404.html create mode 100644 public/422.html create mode 100644 public/500.html create mode 100644 public/apple-touch-icon-precomposed.png create mode 100644 public/apple-touch-icon.png create mode 100644 public/favicon.ico create mode 100644 public/robots.txt create mode 100644 test/application_system_test_case.rb create mode 100644 test/controllers/.keep create mode 100644 test/fixtures/.keep create mode 100644 test/fixtures/files/.keep create mode 100644 test/fixtures/works.yml create mode 100644 test/helpers/.keep create mode 100644 test/integration/.keep create mode 100644 test/mailers/.keep create mode 100644 test/models/.keep create mode 100644 test/models/work_test.rb create mode 100644 test/system/.keep create mode 100644 test/test_helper.rb create mode 100644 tmp/.keep create mode 100644 vendor/.keep diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..82701fedc8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +# 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 all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +/node_modules +/yarn-error.log + +.byebug_history diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000000..88aee9dc96 --- /dev/null +++ b/Gemfile @@ -0,0 +1,66 @@ +source 'https://rubygems.org' + +git_source(:github) do |repo_name| + repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") + "https://github.com/#{repo_name}.git" +end + + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '~> 5.1.4' +# Use postgresql as the database for Active Record +gem 'pg', '~> 0.18' +# Use Puma as the app server +gem 'puma', '~> 3.7' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0' +# See https://github.com/rails/execjs#readme for more supported runtimes +# gem 'therubyracer', platforms: :ruby + +# Use CoffeeScript for .coffee assets and views +# gem 'coffee-rails', '~> 4.2' +# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks +gem 'turbolinks', '~> 5' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.5' +# Use Redis adapter to run Action Cable in production +# gem 'redis', '~> 3.0' +# Use ActiveModel has_secure_password +# gem 'bcrypt', '~> 3.1.7' + +# 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', platforms: [:mri, :mingw, :x64_mingw] + # Adds support for Capybara system testing and selenium driver + gem 'capybara', '~> 2.13' + gem 'selenium-webdriver' +end + +group :development do + # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. + gem 'web-console', '>= 3.3.0' + gem 'listen', '>= 3.0.5', '< 3.2' + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'spring' + gem 'spring-watcher-listen', '~> 2.0.0' +end + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] + +gem 'jquery-turbolinks' +group :development do + gem 'better_errors' + gem 'pry-rails' + gem 'binding_of_caller' +end + +group :test do + gem 'minitest-rails' + gem 'minitest-reporters' +end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000000..406ab99cf2 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,222 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.1.4) + actionpack (= 5.1.4) + nio4r (~> 2.0) + websocket-driver (~> 0.6.1) + actionmailer (5.1.4) + actionpack (= 5.1.4) + actionview (= 5.1.4) + activejob (= 5.1.4) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.1.4) + actionview (= 5.1.4) + activesupport (= 5.1.4) + rack (~> 2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.1.4) + activesupport (= 5.1.4) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.1.4) + activesupport (= 5.1.4) + globalid (>= 0.3.6) + activemodel (5.1.4) + activesupport (= 5.1.4) + activerecord (5.1.4) + activemodel (= 5.1.4) + activesupport (= 5.1.4) + arel (~> 8.0) + activesupport (5.1.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + ansi (1.5.0) + arel (8.0.0) + better_errors (2.3.0) + coderay (>= 1.0.0) + erubi (>= 1.0.0) + rack (>= 0.9.0) + bindex (0.5.0) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) + builder (3.2.3) + byebug (9.1.0) + capybara (2.15.4) + addressable + mini_mime (>= 0.1.3) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + xpath (~> 2.0) + childprocess (0.8.0) + ffi (~> 1.0, >= 1.0.11) + coderay (1.1.2) + concurrent-ruby (1.0.5) + crass (1.0.2) + debug_inspector (0.0.3) + erubi (1.7.0) + execjs (2.7.0) + ffi (1.9.18) + globalid (0.4.0) + activesupport (>= 4.2.0) + i18n (0.8.6) + jbuilder (2.7.0) + activesupport (>= 4.2.0) + multi_json (>= 1.2) + jquery-turbolinks (2.1.0) + railties (>= 3.1.0) + turbolinks + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) + loofah (2.1.1) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.6.6) + mime-types (>= 1.16, < 4) + method_source (0.9.0) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_mime (0.1.4) + mini_portile2 (2.3.0) + minitest (5.10.3) + minitest-rails (3.0.0) + minitest (~> 5.8) + railties (~> 5.0) + minitest-reporters (1.1.18) + ansi + builder + minitest (>= 5.0) + ruby-progressbar + multi_json (1.12.2) + nio4r (2.1.0) + nokogiri (1.8.1) + mini_portile2 (~> 2.3.0) + pg (0.21.0) + pry (0.11.1) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + pry-rails (0.3.6) + pry (>= 0.10.4) + public_suffix (3.0.0) + puma (3.10.0) + rack (2.0.3) + rack-test (0.7.0) + rack (>= 1.0, < 3) + rails (5.1.4) + actioncable (= 5.1.4) + actionmailer (= 5.1.4) + actionpack (= 5.1.4) + actionview (= 5.1.4) + activejob (= 5.1.4) + activemodel (= 5.1.4) + activerecord (= 5.1.4) + activesupport (= 5.1.4) + bundler (>= 1.3.0) + railties (= 5.1.4) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + railties (5.1.4) + actionpack (= 5.1.4) + activesupport (= 5.1.4) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (12.1.0) + rb-fsevent (0.10.2) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) + ruby-progressbar (1.9.0) + ruby_dep (1.5.0) + rubyzip (1.2.1) + sass (3.5.2) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.0.6) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + selenium-webdriver (3.6.0) + childprocess (~> 0.5) + rubyzip (~> 1.0) + spring (2.0.2) + activesupport (>= 4.2) + spring-watcher-listen (2.0.1) + listen (>= 2.7, < 4.0) + spring (>= 1.2, < 3.0) + sprockets (3.7.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + thor (0.20.0) + thread_safe (0.3.6) + tilt (2.0.8) + turbolinks (5.0.1) + turbolinks-source (~> 5) + turbolinks-source (5.0.3) + tzinfo (1.2.3) + thread_safe (~> 0.1) + uglifier (3.2.0) + execjs (>= 0.3.0, < 3) + web-console (3.5.1) + actionview (>= 5.0) + activemodel (>= 5.0) + bindex (>= 0.4.0) + railties (>= 5.0) + websocket-driver (0.6.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) + xpath (2.1.0) + nokogiri (~> 1.3) + +PLATFORMS + ruby + +DEPENDENCIES + better_errors + binding_of_caller + byebug + capybara (~> 2.13) + jbuilder (~> 2.5) + jquery-turbolinks + listen (>= 3.0.5, < 3.2) + minitest-rails + minitest-reporters + pg (~> 0.18) + pry-rails + puma (~> 3.7) + rails (~> 5.1.4) + sass-rails (~> 5.0) + selenium-webdriver + spring + spring-watcher-listen (~> 2.0.0) + turbolinks (~> 5) + tzinfo-data + uglifier (>= 1.3.0) + web-console (>= 3.3.0) + +BUNDLED WITH + 1.13.6 diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000000..e85f913914 --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +# 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_relative 'config/application' + +Rails.application.load_tasks diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 0000000000..b16e53d6d5 --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,3 @@ +//= link_tree ../images +//= link_directory ../javascripts .js +//= link_directory ../stylesheets .css diff --git a/app/assets/images/.keep b/app/assets/images/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 0000000000..46b20359fa --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,15 @@ +// 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, or any plugin's +// vendor/assets/javascripts directory 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. JavaScript code in this file should be added after the last require_* statement. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require rails-ujs +//= require turbolinks +//= require_tree . diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js new file mode 100644 index 0000000000..739aa5f022 --- /dev/null +++ b/app/assets/javascripts/cable.js @@ -0,0 +1,13 @@ +// Action Cable provides the framework to deal with WebSockets in Rails. +// You can generate new channels where WebSocket features live using the `rails generate channel` command. +// +//= require action_cable +//= require_self +//= require_tree ./channels + +(function() { + this.App || (this.App = {}); + + App.cable = ActionCable.createConsumer(); + +}).call(this); diff --git a/app/assets/javascripts/channels/.keep b/app/assets/javascripts/channels/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 0000000000..d05ea0f511 --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * 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, or any plugin's + * vendor/assets/stylesheets directory 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 other CSS/SCSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb new file mode 100644 index 0000000000..d672697283 --- /dev/null +++ b/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb new file mode 100644 index 0000000000..0ff5442f47 --- /dev/null +++ b/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000000..1c07694e9d --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,3 @@ +class ApplicationController < ActionController::Base + protect_from_forgery with: :exception +end diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 0000000000..de6be7945c --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 0000000000..a009ace51c --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,2 @@ +class ApplicationJob < ActiveJob::Base +end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb new file mode 100644 index 0000000000..286b2239d1 --- /dev/null +++ b/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: 'from@example.com' + layout 'mailer' +end diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 0000000000..10a4cba84d --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true +end diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app/models/work.rb b/app/models/work.rb new file mode 100644 index 0000000000..95322dd45e --- /dev/null +++ b/app/models/work.rb @@ -0,0 +1,2 @@ +class Work < ApplicationRecord +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000000..6af511b830 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + MediaRanker + <%= csrf_meta_tags %> + + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> + + + + <%= yield %> + + diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000000..cbd34d2e9d --- /dev/null +++ b/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000000..37f0bddbd7 --- /dev/null +++ b/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000000..66e9889e8b --- /dev/null +++ b/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000000..5badb2fde0 --- /dev/null +++ b/bin/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +APP_PATH = File.expand_path('../config/application', __dir__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000000..d87d5f5781 --- /dev/null +++ b/bin/rake @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000000..78c4e861dc --- /dev/null +++ b/bin/setup @@ -0,0 +1,38 @@ +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +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') || system!('bundle install') + + # Install JavaScript dependencies if using Yarn + # system('bin/yarn') + + + # puts "\n== Copying sample files ==" + # unless File.exist?('config/database.yml') + # cp 'config/database.yml.sample', 'config/database.yml' + # end + + puts "\n== Preparing database ==" + system! 'bin/rails db:setup' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/bin/spring b/bin/spring new file mode 100755 index 0000000000..fb2ec2ebb4 --- /dev/null +++ b/bin/spring @@ -0,0 +1,17 @@ +#!/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' + + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + spring = lockfile.specs.detect { |spec| spec.name == "spring" } + if spring + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version + require 'spring/binstub' + end +end diff --git a/bin/update b/bin/update new file mode 100755 index 0000000000..a8e4462f20 --- /dev/null +++ b/bin/update @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a way to update your development environment automatically. + # Add necessary update steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + puts "\n== Updating database ==" + system! 'bin/rails db:migrate' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/bin/yarn b/bin/yarn new file mode 100755 index 0000000000..c2bacef836 --- /dev/null +++ b/bin/yarn @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby +VENDOR_PATH = File.expand_path('..', __dir__) +Dir.chdir(VENDOR_PATH) do + begin + exec "yarnpkg #{ARGV.join(" ")}" + rescue Errno::ENOENT + $stderr.puts "Yarn executable was not detected in the system." + $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" + exit 1 + end +end diff --git a/config.ru b/config.ru new file mode 100644 index 0000000000..f7ba0b527b --- /dev/null +++ b/config.ru @@ -0,0 +1,5 @@ +# This file is used by Rack-based servers to start the application. + +require_relative 'config/environment' + +run Rails.application diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 0000000000..e73bab908f --- /dev/null +++ b/config/application.rb @@ -0,0 +1,25 @@ +require_relative 'boot' + +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 MediaRanker + class Application < Rails::Application + config.generators do |g| + # Force new test files to be generated in the minitest-spec style + g.test_framework :minitest, spec: true + + # Always use .js files, never .coffee + g.javascript_engine :js + end + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 5.1 + + # 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. + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 0000000000..30f5120df6 --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/config/cable.yml b/config/cable.yml new file mode 100644 index 0000000000..3a27f13933 --- /dev/null +++ b/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: async + +production: + adapter: redis + url: redis://localhost:6379/1 + channel_prefix: MediaRanker_production diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000000..0bd2511123 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,85 @@ +# PostgreSQL. Versions 9.1 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: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + +development: + <<: *default + database: MediaRanker_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: MediaRanker + + # 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: MediaRanker_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: MediaRanker_production + username: MediaRanker + password: <%= ENV['MEDIARANKER_DATABASE_PASSWORD'] %> diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 0000000000..426333bb46 --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative 'application' + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 0000000000..5187e22186 --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,54 @@ +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. + config.consider_all_requests_local = true + + # Enable/disable caching. By default caching is disabled. + if Rails.root.join('tmp/caching-dev.txt').exist? + config.action_controller.perform_caching = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = 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 + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true + + # Use an evented file watcher to asynchronously detect changes in source code, + # routes, locales, etc. This feature depends on the listen gem. + config.file_watcher = ActiveSupport::EventedFileUpdateChecker +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 0000000000..d242dac65c --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,91 @@ +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 + + # Attempt to read encrypted secrets from `config/secrets.yml.enc`. + # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or + # `config/secrets.yml.key`. + config.read_encrypted_secrets = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # 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 + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # 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 + + # Mount Action Cable outside main process or domain + # config.action_cable.mount_path = nil + # config.action_cable.url = 'wss://example.com/cable' + # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment) + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "MediaRanker_#{Rails.env}" + config.action_mailer.perform_caching = false + + # 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 + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require 'syslog/logger' + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 0000000000..8e5cbde533 --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,42 @@ +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 public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}" + } + + # 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 + config.action_mailer.perform_caching = 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/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb new file mode 100644 index 0000000000..89d2efab2b --- /dev/null +++ b/config/initializers/application_controller_renderer.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# ActiveSupport::Reloader.to_prepare do +# ApplicationController.renderer.defaults.merge!( +# http_host: 'example.org', +# https: false +# ) +# end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 0000000000..4b828e80cb --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,14 @@ +# 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' + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path +# Add Yarn node_modules folder to the asset load path. +Rails.application.config.assets.paths << Rails.root.join('node_modules') + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000000..59385cdf37 --- /dev/null +++ b/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# 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/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000000..5a6a32d371 --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Specify a serializer for the signed and encrypted cookie jars. +# Valid options are :json, :marshal, and :hybrid. +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000000..4a994e1e7b --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# 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/config/initializers/inflections.rb b/config/initializers/inflections.rb new file mode 100644 index 0000000000..ac033bf9dc --- /dev/null +++ b/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# 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/config/initializers/mime_types.rb b/config/initializers/mime_types.rb new file mode 100644 index 0000000000..dc1899682b --- /dev/null +++ b/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# 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/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000000..bbfc3961bf --- /dev/null +++ b/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# 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] +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/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000000..decc5a8573 --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,33 @@ +# 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. +# +# The following keys must be escaped otherwise they will not be retrieved by +# the default I18n backend: +# +# true, false, on, off, yes, no +# +# Instead, surround them with single quotes. +# +# en: +# 'true': 'foo' +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 0000000000..1e19380dcb --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,56 @@ +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +# +threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +threads threads_count, threads_count + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +# +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +# +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the number of `workers` to boot in clustered mode. +# Workers are forked webserver processes. If using threads and workers together +# the concurrency of the application would be max `threads` * `workers`. +# Workers do not work on JRuby or Windows (both of which do not support +# processes). +# +# workers ENV.fetch("WEB_CONCURRENCY") { 2 } + +# Use the `preload_app!` method when specifying a `workers` number. +# This directive tells Puma to first boot the application and load code +# before forking the application. This takes advantage of Copy On Write +# process behavior so workers use less memory. If you use this option +# you need to make sure to reconnect any threads in the `on_worker_boot` +# block. +# +# preload_app! + +# If you are preloading your application and using Active Record, it's +# recommended that you close any connections to the database before workers +# are forked to prevent connection leakage. +# +# before_fork do +# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord) +# end + +# The code in the `on_worker_boot` will be called if you are using +# clustered mode by specifying a number of `workers`. After each worker +# process is booted, this block will be run. If you are using the `preload_app!` +# option, you will want to use this block to reconnect to any threads +# or connections that may have been created at application boot, as Ruby +# cannot share connections between processes. +# +# on_worker_boot do +# ActiveRecord::Base.establish_connection if defined?(ActiveRecord) +# end +# + +# Allow puma to be restarted by `rails restart` command. +plugin :tmp_restart diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000000..787824f888 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,3 @@ +Rails.application.routes.draw do + # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html +end diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 0000000000..80a9edca23 --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,32 @@ +# 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 `rails secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +# Shared secrets are available across all environments. + +# shared: +# api_key: a1B2c3D4e5F6 + +# Environmental secrets are only available for that specific environment. + +development: + secret_key_base: 85ac97afa9f0d5bf65bbffd7038c79da0145409805597f479d0bc3676d51bf8508b41599d566444c170ef5fecad6276bcf5d49aae5f7d5b7d5439b1991acbf29 + +test: + secret_key_base: cfc258ce488250b5cd96bae6deebc95e06240f262a27335c3bb7c844579fc963bbd8d4c7f22c77aa929425512ee890aec75d0528db8cce46ad39e521268acdbb + +# Do not keep production secrets in the unencrypted secrets file. +# Instead, either read values from the environment. +# Or, use `bin/rails secrets:setup` to configure encrypted secrets +# and move the `production:` environment over there. + +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/config/spring.rb b/config/spring.rb new file mode 100644 index 0000000000..c9119b40c0 --- /dev/null +++ b/config/spring.rb @@ -0,0 +1,6 @@ +%w( + .ruby-version + .rbenv-vars + tmp/restart.txt + tmp/caching-dev.txt +).each { |path| Spring.watch(path) } diff --git a/db/migrate/20171010225142_create_works.rb b/db/migrate/20171010225142_create_works.rb new file mode 100644 index 0000000000..f6be1bae70 --- /dev/null +++ b/db/migrate/20171010225142_create_works.rb @@ -0,0 +1,8 @@ +class CreateWorks < ActiveRecord::Migration[5.1] + def change + create_table :works do |t| + + t.timestamps + end + end +end diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 0000000000..1beea2accd --- /dev/null +++ b/db/seeds.rb @@ -0,0 +1,7 @@ +# 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 rails db:seed command (or created alongside the database with db:setup). +# +# Examples: +# +# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) +# Character.create(name: 'Luke', movie: movies.first) diff --git a/lib/assets/.keep b/lib/assets/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lib/tasks/.keep b/lib/tasks/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/log/.keep b/log/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/package.json b/package.json new file mode 100644 index 0000000000..625900f9d8 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "name": "MediaRanker", + "private": true, + "dependencies": {} +} diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000000..2be3af26fc --- /dev/null +++ b/public/404.html @@ -0,0 +1,67 @@ + + + + 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/public/422.html b/public/422.html new file mode 100644 index 0000000000..c08eac0d1d --- /dev/null +++ b/public/422.html @@ -0,0 +1,67 @@ + + + + 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/public/500.html b/public/500.html new file mode 100644 index 0000000000..78a030af22 --- /dev/null +++ b/public/500.html @@ -0,0 +1,66 @@ + + + + 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/public/apple-touch-icon-precomposed.png b/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000000..e69de29bb2 diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000000..e69de29bb2 diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000000..e69de29bb2 diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000000..37b576a4a0 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1 @@ +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb new file mode 100644 index 0000000000..d19212abd5 --- /dev/null +++ b/test/application_system_test_case.rb @@ -0,0 +1,5 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + driven_by :selenium, using: :chrome, screen_size: [1400, 1400] +end diff --git a/test/controllers/.keep b/test/controllers/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/.keep b/test/fixtures/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/works.yml b/test/fixtures/works.yml new file mode 100644 index 0000000000..dc3ee79b5d --- /dev/null +++ b/test/fixtures/works.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the "{}" from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/helpers/.keep b/test/helpers/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/integration/.keep b/test/integration/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/mailers/.keep b/test/mailers/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/models/.keep b/test/models/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/models/work_test.rb b/test/models/work_test.rb new file mode 100644 index 0000000000..f6fba7104d --- /dev/null +++ b/test/models/work_test.rb @@ -0,0 +1,9 @@ +require "test_helper" + +describe Work do + let(:work) { Work.new } + + it "must be valid" do + value(work).must_be :valid? + end +end diff --git a/test/system/.keep b/test/system/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000000..10594a3248 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,26 @@ +ENV["RAILS_ENV"] = "test" +require File.expand_path("../../config/environment", __FILE__) +require "rails/test_help" +require "minitest/rails" +require "minitest/reporters" # for Colorized output + +# For colorful output! +Minitest::Reporters.use!( + Minitest::Reporters::SpecReporter.new, + ENV, + Minitest.backtrace_filter +) + + +# To add Capybara feature tests add `gem "minitest-rails-capybara"` +# to the test group in the Gemfile and uncomment the following: +# require "minitest/rails/capybara" + +# Uncomment for awesome colorful output +# require "minitest/pride" + +class ActiveSupport::TestCase + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + # Add more helper methods to be used by all tests here... +end diff --git a/tmp/.keep b/tmp/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/.keep b/vendor/.keep new file mode 100644 index 0000000000..e69de29bb2 From fa1d4364a9d92f23a5dc2194fa70557217186242 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Tue, 10 Oct 2017 16:12:07 -0700 Subject: [PATCH 02/56] create work model and migrated. --- db/migrate/20171010225142_create_works.rb | 6 ++++- db/schema.rb | 27 +++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 db/schema.rb diff --git a/db/migrate/20171010225142_create_works.rb b/db/migrate/20171010225142_create_works.rb index f6be1bae70..fb22684f34 100644 --- a/db/migrate/20171010225142_create_works.rb +++ b/db/migrate/20171010225142_create_works.rb @@ -1,7 +1,11 @@ class CreateWorks < ActiveRecord::Migration[5.1] def change create_table :works do |t| - + t.string :category + t.string :title + t.integer :publication_year + t.text :description + t.timestamps end end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000000..09be9639ae --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,27 @@ +# 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: 20171010225142) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "works", force: :cascade do |t| + t.string "category" + t.string "title" + t.integer "publication_year" + t.text "description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end From 865f385280a323aa0cd94b209496c668b8b2eaf8 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Tue, 10 Oct 2017 20:48:52 -0700 Subject: [PATCH 03/56] Work Model: made migration, work table, and migrated. Work model tests are also underway. --- db/migrate/20171010225142_create_works.rb | 2 +- test/models/work_test.rb | 26 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/db/migrate/20171010225142_create_works.rb b/db/migrate/20171010225142_create_works.rb index fb22684f34..24109208bc 100644 --- a/db/migrate/20171010225142_create_works.rb +++ b/db/migrate/20171010225142_create_works.rb @@ -5,7 +5,7 @@ def change t.string :title t.integer :publication_year t.text :description - + t.timestamps end end diff --git a/test/models/work_test.rb b/test/models/work_test.rb index f6fba7104d..41631c4479 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -6,4 +6,30 @@ it "must be valid" do value(work).must_be :valid? end + + # the work must have: + # a category, + # title, + # creator, + # publication_year, + # description, + # and ability to save/create. + + it "requires a category" do + work = Work.new + is_valid = work.valid? + is_valid.must_be false + + work.errors.messages.must_include :category + + end + + it "requires a title " do # why is there only one test? + work = Work.new + is_valid = work.valid? + is_valid.must_equal false #why is it false, copied from the books example + work.errors.messages.must_include :title + end + + end From addefc8dd741cd1e357a1a7b90e270406fc9f668 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Tue, 10 Oct 2017 21:08:18 -0700 Subject: [PATCH 04/56] add main file to mediaRanker without filing it with code. --- app/views/main.html.erb | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/views/main.html.erb diff --git a/app/views/main.html.erb b/app/views/main.html.erb new file mode 100644 index 0000000000..e69de29bb2 From e81dc868bb6122d93be229877d016d23554e4723 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Tue, 10 Oct 2017 21:19:29 -0700 Subject: [PATCH 05/56] made headers for main page and then tested localhost and realized I have no routes. Now shifting to work on routes. --- app/views/main.html.erb | 5 +++++ config/routes.rb | 2 ++ 2 files changed, 7 insertions(+) diff --git a/app/views/main.html.erb b/app/views/main.html.erb index e69de29bb2..c36ff6e00c 100644 --- a/app/views/main.html.erb +++ b/app/views/main.html.erb @@ -0,0 +1,5 @@ +

+ Top Movies + Top Books + Top Albums +

diff --git a/config/routes.rb b/config/routes.rb index 787824f888..a59c7a484d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,5 @@ Rails.application.routes.draw do # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html + + end From 25bf2912d822d6d95a068e55b00eebe55f6a194a Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Thu, 12 Oct 2017 20:40:13 -0700 Subject: [PATCH 06/56] Add Work routes, made some Work tests, and add Foundation framework --- app/assets/stylesheets/foundation.css | 4001 +++++++++++++++++++++++++ config/routes.rb | 2 +- test/models/work_test.rb | 2 +- 3 files changed, 4003 insertions(+), 2 deletions(-) create mode 100644 app/assets/stylesheets/foundation.css diff --git a/app/assets/stylesheets/foundation.css b/app/assets/stylesheets/foundation.css new file mode 100644 index 0000000000..72a4ba0353 --- /dev/null +++ b/app/assets/stylesheets/foundation.css @@ -0,0 +1,4001 @@ +@charset "UTF-8"; +/** + * Foundation for Sites by ZURB + * Version 6.3.1 + * foundation.zurb.com + * Licensed under MIT Open Source + */ +/*! normalize-scss | MIT/GPLv2 License | bit.ly/normalize-scss */ +/* Document + ========================================================================== */ +/** + * 1. Change the default font family in all browsers (opinionated). + * 2. Correct the line height in all browsers. + * 3. Prevent adjustments of font size after orientation changes in + * IE on Windows Phone and in iOS. + */ +html { + font-family: sans-serif; + /* 1 */ + line-height: 1.15; + /* 2 */ + -ms-text-size-adjust: 100%; + /* 3 */ + -webkit-text-size-adjust: 100%; + /* 3 */ } + +/* Sections + ========================================================================== */ +/** + * Remove the margin in all browsers (opinionated). + */ +body { + margin: 0; } + +/** + * Add the correct display in IE 9-. + */ +article, +aside, +footer, +header, +nav, +section { + display: block; } + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ +h1 { + font-size: 2em; + margin: 0.67em 0; } + +/* Grouping content + ========================================================================== */ +/** + * Add the correct display in IE 9-. + */ +figcaption, +figure { + display: block; } + +/** + * Add the correct margin in IE 8. + */ +figure { + margin: 1em 40px; } + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ +hr { + -webkit-box-sizing: content-box; + box-sizing: content-box; + /* 1 */ + height: 0; + /* 1 */ + overflow: visible; + /* 2 */ } + +/** + * Add the correct display in IE. + */ +main { + display: block; } + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ +pre { + font-family: monospace, monospace; + /* 1 */ + font-size: 1em; + /* 2 */ } + +/* Links + ========================================================================== */ +/** + * 1. Remove the gray background on active links in IE 10. + * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. + */ +a { + background-color: transparent; + /* 1 */ + -webkit-text-decoration-skip: objects; + /* 2 */ } + +/** + * Remove the outline on focused links when they are also active or hovered + * in all browsers (opinionated). + */ +a:active, +a:hover { + outline-width: 0; } + +/* Text-level semantics + ========================================================================== */ +/** + * 1. Remove the bottom border in Firefox 39-. + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ +abbr[title] { + border-bottom: none; + /* 1 */ + text-decoration: underline; + /* 2 */ + text-decoration: underline dotted; + /* 2 */ } + +/** + * Prevent the duplicate application of `bolder` by the next rule in Safari 6. + */ +b, +strong { + font-weight: inherit; } + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ +b, +strong { + font-weight: bolder; } + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ +code, +kbd, +samp { + font-family: monospace, monospace; + /* 1 */ + font-size: 1em; + /* 2 */ } + +/** + * Add the correct font style in Android 4.3-. + */ +dfn { + font-style: italic; } + +/** + * Add the correct background and color in IE 9-. + */ +mark { + background-color: #ff0; + color: #000; } + +/** + * Add the correct font size in all browsers. + */ +small { + font-size: 80%; } + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; } + +sub { + bottom: -0.25em; } + +sup { + top: -0.5em; } + +/* Embedded content + ========================================================================== */ +/** + * Add the correct display in IE 9-. + */ +audio, +video { + display: inline-block; } + +/** + * Add the correct display in iOS 4-7. + */ +audio:not([controls]) { + display: none; + height: 0; } + +/** + * Remove the border on images inside links in IE 10-. + */ +img { + border-style: none; } + +/** + * Hide the overflow in IE. + */ +svg:not(:root) { + overflow: hidden; } + +/* Forms + ========================================================================== */ +/** + * 1. Change the font styles in all browsers (opinionated). + * 2. Remove the margin in Firefox and Safari. + */ +button, +input, +optgroup, +select, +textarea { + font-family: sans-serif; + /* 1 */ + font-size: 100%; + /* 1 */ + line-height: 1.15; + /* 1 */ + margin: 0; + /* 2 */ } + +/** + * Show the overflow in IE. + */ +button { + overflow: visible; } + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ +button, +select { + /* 1 */ + text-transform: none; } + +/** + * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` + * controls in Android 4. + * 2. Correct the inability to style clickable types in iOS and Safari. + */ +button, +html [type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; + /* 2 */ } + +button, +[type="button"], +[type="reset"], +[type="submit"] { + /** + * Remove the inner border and padding in Firefox. + */ + /** + * Restore the focus styles unset by the previous rule. + */ } + button::-moz-focus-inner, + [type="button"]::-moz-focus-inner, + [type="reset"]::-moz-focus-inner, + [type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; } + button:-moz-focusring, + [type="button"]:-moz-focusring, + [type="reset"]:-moz-focusring, + [type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; } + +/** + * Show the overflow in Edge. + */ +input { + overflow: visible; } + +/** + * 1. Add the correct box sizing in IE 10-. + * 2. Remove the padding in IE 10-. + */ +[type="checkbox"], +[type="radio"] { + -webkit-box-sizing: border-box; + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ } + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; } + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ +[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + outline-offset: -2px; + /* 2 */ + /** + * Remove the inner padding and cancel buttons in Chrome and Safari on macOS. + */ } + [type="search"]::-webkit-search-cancel-button, [type="search"]::-webkit-search-decoration { + -webkit-appearance: none; } + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ +::-webkit-file-upload-button { + -webkit-appearance: button; + /* 1 */ + font: inherit; + /* 2 */ } + +/** + * Change the border, margin, and padding in all browsers (opinionated). + */ +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; } + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ +legend { + -webkit-box-sizing: border-box; + box-sizing: border-box; + /* 1 */ + display: table; + /* 1 */ + max-width: 100%; + /* 1 */ + padding: 0; + /* 3 */ + color: inherit; + /* 2 */ + white-space: normal; + /* 1 */ } + +/** + * 1. Add the correct display in IE 9-. + * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ +progress { + display: inline-block; + /* 1 */ + vertical-align: baseline; + /* 2 */ } + +/** + * Remove the default vertical scrollbar in IE. + */ +textarea { + overflow: auto; } + +/* Interactive + ========================================================================== */ +/* + * Add the correct display in Edge, IE, and Firefox. + */ +details { + display: block; } + +/* + * Add the correct display in all browsers. + */ +summary { + display: list-item; } + +/* + * Add the correct display in IE 9-. + */ +menu { + display: block; } + +/* Scripting + ========================================================================== */ +/** + * Add the correct display in IE 9-. + */ +canvas { + display: inline-block; } + +/** + * Add the correct display in IE. + */ +template { + display: none; } + +/* Hidden + ========================================================================== */ +/** + * Add the correct display in IE 10-. + */ +[hidden] { + display: none; } + +.foundation-mq { + font-family: "small=0em&medium=40em&large=64em&xlarge=75em&xxlarge=90em"; } + +html { + -webkit-box-sizing: border-box; + box-sizing: border-box; + font-size: 100%; } + +*, +*::before, +*::after { + -webkit-box-sizing: inherit; + box-sizing: inherit; } + +body { + margin: 0; + padding: 0; + background: #fefefe; + font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; + font-weight: normal; + line-height: 1.5; + color: #0a0a0a; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } + +img { + display: inline-block; + vertical-align: middle; + max-width: 100%; + height: auto; + -ms-interpolation-mode: bicubic; } + +textarea { + height: auto; + min-height: 50px; + border-radius: 0; } + +select { + -webkit-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + border-radius: 0; } + +.map_canvas img, +.map_canvas embed, +.map_canvas object, +.mqa-display img, +.mqa-display embed, +.mqa-display object { + max-width: none !important; } + +button { + padding: 0; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border: 0; + border-radius: 0; + background: transparent; + line-height: 1; } + [data-whatinput='mouse'] button { + outline: 0; } + +pre { + overflow: auto; } + +.is-visible { + display: block !important; } + +.is-hidden { + display: none !important; } + +.row { + max-width: 75rem; + margin-right: auto; + margin-left: auto; } + .row::before, .row::after { + display: table; + content: ' '; } + .row::after { + clear: both; } + .row.collapse > .column, .row.collapse > .columns { + padding-right: 0; + padding-left: 0; } + .row .row { + margin-right: -0.625rem; + margin-left: -0.625rem; } + @media print, screen and (min-width: 40em) { + .row .row { + margin-right: -0.9375rem; + margin-left: -0.9375rem; } } + @media print, screen and (min-width: 64em) { + .row .row { + margin-right: -0.9375rem; + margin-left: -0.9375rem; } } + .row .row.collapse { + margin-right: 0; + margin-left: 0; } + .row.expanded { + max-width: none; } + .row.expanded .row { + margin-right: auto; + margin-left: auto; } + .row:not(.expanded) .row { + max-width: none; } + .row.gutter-small > .column, .row.gutter-small > .columns { + padding-right: 0.625rem; + padding-left: 0.625rem; } + .row.gutter-medium > .column, .row.gutter-medium > .columns { + padding-right: 0.9375rem; + padding-left: 0.9375rem; } + +.column, .columns { + width: 100%; + float: left; + padding-right: 0.625rem; + padding-left: 0.625rem; } + @media print, screen and (min-width: 40em) { + .column, .columns { + padding-right: 0.9375rem; + padding-left: 0.9375rem; } } + .column:last-child:not(:first-child), .columns:last-child:not(:first-child) { + float: right; } + .column.end:last-child:last-child, .end.columns:last-child:last-child { + float: left; } + +.column.row.row, .row.row.columns { + float: none; } + +.row .column.row.row, .row .row.row.columns { + margin-right: 0; + margin-left: 0; + padding-right: 0; + padding-left: 0; } + +.small-1 { + width: 8.33333%; } + +.small-push-1 { + position: relative; + left: 8.33333%; } + +.small-pull-1 { + position: relative; + left: -8.33333%; } + +.small-offset-0 { + margin-left: 0%; } + +.small-2 { + width: 16.66667%; } + +.small-push-2 { + position: relative; + left: 16.66667%; } + +.small-pull-2 { + position: relative; + left: -16.66667%; } + +.small-offset-1 { + margin-left: 8.33333%; } + +.small-3 { + width: 25%; } + +.small-push-3 { + position: relative; + left: 25%; } + +.small-pull-3 { + position: relative; + left: -25%; } + +.small-offset-2 { + margin-left: 16.66667%; } + +.small-4 { + width: 33.33333%; } + +.small-push-4 { + position: relative; + left: 33.33333%; } + +.small-pull-4 { + position: relative; + left: -33.33333%; } + +.small-offset-3 { + margin-left: 25%; } + +.small-5 { + width: 41.66667%; } + +.small-push-5 { + position: relative; + left: 41.66667%; } + +.small-pull-5 { + position: relative; + left: -41.66667%; } + +.small-offset-4 { + margin-left: 33.33333%; } + +.small-6 { + width: 50%; } + +.small-push-6 { + position: relative; + left: 50%; } + +.small-pull-6 { + position: relative; + left: -50%; } + +.small-offset-5 { + margin-left: 41.66667%; } + +.small-7 { + width: 58.33333%; } + +.small-push-7 { + position: relative; + left: 58.33333%; } + +.small-pull-7 { + position: relative; + left: -58.33333%; } + +.small-offset-6 { + margin-left: 50%; } + +.small-8 { + width: 66.66667%; } + +.small-push-8 { + position: relative; + left: 66.66667%; } + +.small-pull-8 { + position: relative; + left: -66.66667%; } + +.small-offset-7 { + margin-left: 58.33333%; } + +.small-9 { + width: 75%; } + +.small-push-9 { + position: relative; + left: 75%; } + +.small-pull-9 { + position: relative; + left: -75%; } + +.small-offset-8 { + margin-left: 66.66667%; } + +.small-10 { + width: 83.33333%; } + +.small-push-10 { + position: relative; + left: 83.33333%; } + +.small-pull-10 { + position: relative; + left: -83.33333%; } + +.small-offset-9 { + margin-left: 75%; } + +.small-11 { + width: 91.66667%; } + +.small-push-11 { + position: relative; + left: 91.66667%; } + +.small-pull-11 { + position: relative; + left: -91.66667%; } + +.small-offset-10 { + margin-left: 83.33333%; } + +.small-12 { + width: 100%; } + +.small-offset-11 { + margin-left: 91.66667%; } + +.small-up-1 > .column, .small-up-1 > .columns { + float: left; + width: 100%; } + .small-up-1 > .column:nth-of-type(1n), .small-up-1 > .columns:nth-of-type(1n) { + clear: none; } + .small-up-1 > .column:nth-of-type(1n+1), .small-up-1 > .columns:nth-of-type(1n+1) { + clear: both; } + .small-up-1 > .column:last-child, .small-up-1 > .columns:last-child { + float: left; } + +.small-up-2 > .column, .small-up-2 > .columns { + float: left; + width: 50%; } + .small-up-2 > .column:nth-of-type(1n), .small-up-2 > .columns:nth-of-type(1n) { + clear: none; } + .small-up-2 > .column:nth-of-type(2n+1), .small-up-2 > .columns:nth-of-type(2n+1) { + clear: both; } + .small-up-2 > .column:last-child, .small-up-2 > .columns:last-child { + float: left; } + +.small-up-3 > .column, .small-up-3 > .columns { + float: left; + width: 33.33333%; } + .small-up-3 > .column:nth-of-type(1n), .small-up-3 > .columns:nth-of-type(1n) { + clear: none; } + .small-up-3 > .column:nth-of-type(3n+1), .small-up-3 > .columns:nth-of-type(3n+1) { + clear: both; } + .small-up-3 > .column:last-child, .small-up-3 > .columns:last-child { + float: left; } + +.small-up-4 > .column, .small-up-4 > .columns { + float: left; + width: 25%; } + .small-up-4 > .column:nth-of-type(1n), .small-up-4 > .columns:nth-of-type(1n) { + clear: none; } + .small-up-4 > .column:nth-of-type(4n+1), .small-up-4 > .columns:nth-of-type(4n+1) { + clear: both; } + .small-up-4 > .column:last-child, .small-up-4 > .columns:last-child { + float: left; } + +.small-up-5 > .column, .small-up-5 > .columns { + float: left; + width: 20%; } + .small-up-5 > .column:nth-of-type(1n), .small-up-5 > .columns:nth-of-type(1n) { + clear: none; } + .small-up-5 > .column:nth-of-type(5n+1), .small-up-5 > .columns:nth-of-type(5n+1) { + clear: both; } + .small-up-5 > .column:last-child, .small-up-5 > .columns:last-child { + float: left; } + +.small-up-6 > .column, .small-up-6 > .columns { + float: left; + width: 16.66667%; } + .small-up-6 > .column:nth-of-type(1n), .small-up-6 > .columns:nth-of-type(1n) { + clear: none; } + .small-up-6 > .column:nth-of-type(6n+1), .small-up-6 > .columns:nth-of-type(6n+1) { + clear: both; } + .small-up-6 > .column:last-child, .small-up-6 > .columns:last-child { + float: left; } + +.small-up-7 > .column, .small-up-7 > .columns { + float: left; + width: 14.28571%; } + .small-up-7 > .column:nth-of-type(1n), .small-up-7 > .columns:nth-of-type(1n) { + clear: none; } + .small-up-7 > .column:nth-of-type(7n+1), .small-up-7 > .columns:nth-of-type(7n+1) { + clear: both; } + .small-up-7 > .column:last-child, .small-up-7 > .columns:last-child { + float: left; } + +.small-up-8 > .column, .small-up-8 > .columns { + float: left; + width: 12.5%; } + .small-up-8 > .column:nth-of-type(1n), .small-up-8 > .columns:nth-of-type(1n) { + clear: none; } + .small-up-8 > .column:nth-of-type(8n+1), .small-up-8 > .columns:nth-of-type(8n+1) { + clear: both; } + .small-up-8 > .column:last-child, .small-up-8 > .columns:last-child { + float: left; } + +.small-collapse > .column, .small-collapse > .columns { + padding-right: 0; + padding-left: 0; } + +.small-collapse .row { + margin-right: 0; + margin-left: 0; } + +.expanded.row .small-collapse.row { + margin-right: 0; + margin-left: 0; } + +.small-uncollapse > .column, .small-uncollapse > .columns { + padding-right: 0.625rem; + padding-left: 0.625rem; } + +.small-centered { + margin-right: auto; + margin-left: auto; } + .small-centered, .small-centered:last-child:not(:first-child) { + float: none; + clear: both; } + +.small-uncentered, +.small-push-0, +.small-pull-0 { + position: static; + float: left; + margin-right: 0; + margin-left: 0; } + +@media print, screen and (min-width: 40em) { + .medium-1 { + width: 8.33333%; } + .medium-push-1 { + position: relative; + left: 8.33333%; } + .medium-pull-1 { + position: relative; + left: -8.33333%; } + .medium-offset-0 { + margin-left: 0%; } + .medium-2 { + width: 16.66667%; } + .medium-push-2 { + position: relative; + left: 16.66667%; } + .medium-pull-2 { + position: relative; + left: -16.66667%; } + .medium-offset-1 { + margin-left: 8.33333%; } + .medium-3 { + width: 25%; } + .medium-push-3 { + position: relative; + left: 25%; } + .medium-pull-3 { + position: relative; + left: -25%; } + .medium-offset-2 { + margin-left: 16.66667%; } + .medium-4 { + width: 33.33333%; } + .medium-push-4 { + position: relative; + left: 33.33333%; } + .medium-pull-4 { + position: relative; + left: -33.33333%; } + .medium-offset-3 { + margin-left: 25%; } + .medium-5 { + width: 41.66667%; } + .medium-push-5 { + position: relative; + left: 41.66667%; } + .medium-pull-5 { + position: relative; + left: -41.66667%; } + .medium-offset-4 { + margin-left: 33.33333%; } + .medium-6 { + width: 50%; } + .medium-push-6 { + position: relative; + left: 50%; } + .medium-pull-6 { + position: relative; + left: -50%; } + .medium-offset-5 { + margin-left: 41.66667%; } + .medium-7 { + width: 58.33333%; } + .medium-push-7 { + position: relative; + left: 58.33333%; } + .medium-pull-7 { + position: relative; + left: -58.33333%; } + .medium-offset-6 { + margin-left: 50%; } + .medium-8 { + width: 66.66667%; } + .medium-push-8 { + position: relative; + left: 66.66667%; } + .medium-pull-8 { + position: relative; + left: -66.66667%; } + .medium-offset-7 { + margin-left: 58.33333%; } + .medium-9 { + width: 75%; } + .medium-push-9 { + position: relative; + left: 75%; } + .medium-pull-9 { + position: relative; + left: -75%; } + .medium-offset-8 { + margin-left: 66.66667%; } + .medium-10 { + width: 83.33333%; } + .medium-push-10 { + position: relative; + left: 83.33333%; } + .medium-pull-10 { + position: relative; + left: -83.33333%; } + .medium-offset-9 { + margin-left: 75%; } + .medium-11 { + width: 91.66667%; } + .medium-push-11 { + position: relative; + left: 91.66667%; } + .medium-pull-11 { + position: relative; + left: -91.66667%; } + .medium-offset-10 { + margin-left: 83.33333%; } + .medium-12 { + width: 100%; } + .medium-offset-11 { + margin-left: 91.66667%; } + .medium-up-1 > .column, .medium-up-1 > .columns { + float: left; + width: 100%; } + .medium-up-1 > .column:nth-of-type(1n), .medium-up-1 > .columns:nth-of-type(1n) { + clear: none; } + .medium-up-1 > .column:nth-of-type(1n+1), .medium-up-1 > .columns:nth-of-type(1n+1) { + clear: both; } + .medium-up-1 > .column:last-child, .medium-up-1 > .columns:last-child { + float: left; } + .medium-up-2 > .column, .medium-up-2 > .columns { + float: left; + width: 50%; } + .medium-up-2 > .column:nth-of-type(1n), .medium-up-2 > .columns:nth-of-type(1n) { + clear: none; } + .medium-up-2 > .column:nth-of-type(2n+1), .medium-up-2 > .columns:nth-of-type(2n+1) { + clear: both; } + .medium-up-2 > .column:last-child, .medium-up-2 > .columns:last-child { + float: left; } + .medium-up-3 > .column, .medium-up-3 > .columns { + float: left; + width: 33.33333%; } + .medium-up-3 > .column:nth-of-type(1n), .medium-up-3 > .columns:nth-of-type(1n) { + clear: none; } + .medium-up-3 > .column:nth-of-type(3n+1), .medium-up-3 > .columns:nth-of-type(3n+1) { + clear: both; } + .medium-up-3 > .column:last-child, .medium-up-3 > .columns:last-child { + float: left; } + .medium-up-4 > .column, .medium-up-4 > .columns { + float: left; + width: 25%; } + .medium-up-4 > .column:nth-of-type(1n), .medium-up-4 > .columns:nth-of-type(1n) { + clear: none; } + .medium-up-4 > .column:nth-of-type(4n+1), .medium-up-4 > .columns:nth-of-type(4n+1) { + clear: both; } + .medium-up-4 > .column:last-child, .medium-up-4 > .columns:last-child { + float: left; } + .medium-up-5 > .column, .medium-up-5 > .columns { + float: left; + width: 20%; } + .medium-up-5 > .column:nth-of-type(1n), .medium-up-5 > .columns:nth-of-type(1n) { + clear: none; } + .medium-up-5 > .column:nth-of-type(5n+1), .medium-up-5 > .columns:nth-of-type(5n+1) { + clear: both; } + .medium-up-5 > .column:last-child, .medium-up-5 > .columns:last-child { + float: left; } + .medium-up-6 > .column, .medium-up-6 > .columns { + float: left; + width: 16.66667%; } + .medium-up-6 > .column:nth-of-type(1n), .medium-up-6 > .columns:nth-of-type(1n) { + clear: none; } + .medium-up-6 > .column:nth-of-type(6n+1), .medium-up-6 > .columns:nth-of-type(6n+1) { + clear: both; } + .medium-up-6 > .column:last-child, .medium-up-6 > .columns:last-child { + float: left; } + .medium-up-7 > .column, .medium-up-7 > .columns { + float: left; + width: 14.28571%; } + .medium-up-7 > .column:nth-of-type(1n), .medium-up-7 > .columns:nth-of-type(1n) { + clear: none; } + .medium-up-7 > .column:nth-of-type(7n+1), .medium-up-7 > .columns:nth-of-type(7n+1) { + clear: both; } + .medium-up-7 > .column:last-child, .medium-up-7 > .columns:last-child { + float: left; } + .medium-up-8 > .column, .medium-up-8 > .columns { + float: left; + width: 12.5%; } + .medium-up-8 > .column:nth-of-type(1n), .medium-up-8 > .columns:nth-of-type(1n) { + clear: none; } + .medium-up-8 > .column:nth-of-type(8n+1), .medium-up-8 > .columns:nth-of-type(8n+1) { + clear: both; } + .medium-up-8 > .column:last-child, .medium-up-8 > .columns:last-child { + float: left; } + .medium-collapse > .column, .medium-collapse > .columns { + padding-right: 0; + padding-left: 0; } + .medium-collapse .row { + margin-right: 0; + margin-left: 0; } + .expanded.row .medium-collapse.row { + margin-right: 0; + margin-left: 0; } + .medium-uncollapse > .column, .medium-uncollapse > .columns { + padding-right: 0.9375rem; + padding-left: 0.9375rem; } + .medium-centered { + margin-right: auto; + margin-left: auto; } + .medium-centered, .medium-centered:last-child:not(:first-child) { + float: none; + clear: both; } + .medium-uncentered, + .medium-push-0, + .medium-pull-0 { + position: static; + float: left; + margin-right: 0; + margin-left: 0; } } + +@media print, screen and (min-width: 64em) { + .large-1 { + width: 8.33333%; } + .large-push-1 { + position: relative; + left: 8.33333%; } + .large-pull-1 { + position: relative; + left: -8.33333%; } + .large-offset-0 { + margin-left: 0%; } + .large-2 { + width: 16.66667%; } + .large-push-2 { + position: relative; + left: 16.66667%; } + .large-pull-2 { + position: relative; + left: -16.66667%; } + .large-offset-1 { + margin-left: 8.33333%; } + .large-3 { + width: 25%; } + .large-push-3 { + position: relative; + left: 25%; } + .large-pull-3 { + position: relative; + left: -25%; } + .large-offset-2 { + margin-left: 16.66667%; } + .large-4 { + width: 33.33333%; } + .large-push-4 { + position: relative; + left: 33.33333%; } + .large-pull-4 { + position: relative; + left: -33.33333%; } + .large-offset-3 { + margin-left: 25%; } + .large-5 { + width: 41.66667%; } + .large-push-5 { + position: relative; + left: 41.66667%; } + .large-pull-5 { + position: relative; + left: -41.66667%; } + .large-offset-4 { + margin-left: 33.33333%; } + .large-6 { + width: 50%; } + .large-push-6 { + position: relative; + left: 50%; } + .large-pull-6 { + position: relative; + left: -50%; } + .large-offset-5 { + margin-left: 41.66667%; } + .large-7 { + width: 58.33333%; } + .large-push-7 { + position: relative; + left: 58.33333%; } + .large-pull-7 { + position: relative; + left: -58.33333%; } + .large-offset-6 { + margin-left: 50%; } + .large-8 { + width: 66.66667%; } + .large-push-8 { + position: relative; + left: 66.66667%; } + .large-pull-8 { + position: relative; + left: -66.66667%; } + .large-offset-7 { + margin-left: 58.33333%; } + .large-9 { + width: 75%; } + .large-push-9 { + position: relative; + left: 75%; } + .large-pull-9 { + position: relative; + left: -75%; } + .large-offset-8 { + margin-left: 66.66667%; } + .large-10 { + width: 83.33333%; } + .large-push-10 { + position: relative; + left: 83.33333%; } + .large-pull-10 { + position: relative; + left: -83.33333%; } + .large-offset-9 { + margin-left: 75%; } + .large-11 { + width: 91.66667%; } + .large-push-11 { + position: relative; + left: 91.66667%; } + .large-pull-11 { + position: relative; + left: -91.66667%; } + .large-offset-10 { + margin-left: 83.33333%; } + .large-12 { + width: 100%; } + .large-offset-11 { + margin-left: 91.66667%; } + .large-up-1 > .column, .large-up-1 > .columns { + float: left; + width: 100%; } + .large-up-1 > .column:nth-of-type(1n), .large-up-1 > .columns:nth-of-type(1n) { + clear: none; } + .large-up-1 > .column:nth-of-type(1n+1), .large-up-1 > .columns:nth-of-type(1n+1) { + clear: both; } + .large-up-1 > .column:last-child, .large-up-1 > .columns:last-child { + float: left; } + .large-up-2 > .column, .large-up-2 > .columns { + float: left; + width: 50%; } + .large-up-2 > .column:nth-of-type(1n), .large-up-2 > .columns:nth-of-type(1n) { + clear: none; } + .large-up-2 > .column:nth-of-type(2n+1), .large-up-2 > .columns:nth-of-type(2n+1) { + clear: both; } + .large-up-2 > .column:last-child, .large-up-2 > .columns:last-child { + float: left; } + .large-up-3 > .column, .large-up-3 > .columns { + float: left; + width: 33.33333%; } + .large-up-3 > .column:nth-of-type(1n), .large-up-3 > .columns:nth-of-type(1n) { + clear: none; } + .large-up-3 > .column:nth-of-type(3n+1), .large-up-3 > .columns:nth-of-type(3n+1) { + clear: both; } + .large-up-3 > .column:last-child, .large-up-3 > .columns:last-child { + float: left; } + .large-up-4 > .column, .large-up-4 > .columns { + float: left; + width: 25%; } + .large-up-4 > .column:nth-of-type(1n), .large-up-4 > .columns:nth-of-type(1n) { + clear: none; } + .large-up-4 > .column:nth-of-type(4n+1), .large-up-4 > .columns:nth-of-type(4n+1) { + clear: both; } + .large-up-4 > .column:last-child, .large-up-4 > .columns:last-child { + float: left; } + .large-up-5 > .column, .large-up-5 > .columns { + float: left; + width: 20%; } + .large-up-5 > .column:nth-of-type(1n), .large-up-5 > .columns:nth-of-type(1n) { + clear: none; } + .large-up-5 > .column:nth-of-type(5n+1), .large-up-5 > .columns:nth-of-type(5n+1) { + clear: both; } + .large-up-5 > .column:last-child, .large-up-5 > .columns:last-child { + float: left; } + .large-up-6 > .column, .large-up-6 > .columns { + float: left; + width: 16.66667%; } + .large-up-6 > .column:nth-of-type(1n), .large-up-6 > .columns:nth-of-type(1n) { + clear: none; } + .large-up-6 > .column:nth-of-type(6n+1), .large-up-6 > .columns:nth-of-type(6n+1) { + clear: both; } + .large-up-6 > .column:last-child, .large-up-6 > .columns:last-child { + float: left; } + .large-up-7 > .column, .large-up-7 > .columns { + float: left; + width: 14.28571%; } + .large-up-7 > .column:nth-of-type(1n), .large-up-7 > .columns:nth-of-type(1n) { + clear: none; } + .large-up-7 > .column:nth-of-type(7n+1), .large-up-7 > .columns:nth-of-type(7n+1) { + clear: both; } + .large-up-7 > .column:last-child, .large-up-7 > .columns:last-child { + float: left; } + .large-up-8 > .column, .large-up-8 > .columns { + float: left; + width: 12.5%; } + .large-up-8 > .column:nth-of-type(1n), .large-up-8 > .columns:nth-of-type(1n) { + clear: none; } + .large-up-8 > .column:nth-of-type(8n+1), .large-up-8 > .columns:nth-of-type(8n+1) { + clear: both; } + .large-up-8 > .column:last-child, .large-up-8 > .columns:last-child { + float: left; } + .large-collapse > .column, .large-collapse > .columns { + padding-right: 0; + padding-left: 0; } + .large-collapse .row { + margin-right: 0; + margin-left: 0; } + .expanded.row .large-collapse.row { + margin-right: 0; + margin-left: 0; } + .large-uncollapse > .column, .large-uncollapse > .columns { + padding-right: 0.9375rem; + padding-left: 0.9375rem; } + .large-centered { + margin-right: auto; + margin-left: auto; } + .large-centered, .large-centered:last-child:not(:first-child) { + float: none; + clear: both; } + .large-uncentered, + .large-push-0, + .large-pull-0 { + position: static; + float: left; + margin-right: 0; + margin-left: 0; } } + +.column-block { + margin-bottom: 1.25rem; } + .column-block > :last-child { + margin-bottom: 0; } + @media print, screen and (min-width: 40em) { + .column-block { + margin-bottom: 1.875rem; } + .column-block > :last-child { + margin-bottom: 0; } } + +div, +dl, +dt, +dd, +ul, +ol, +li, +h1, +h2, +h3, +h4, +h5, +h6, +pre, +form, +p, +blockquote, +th, +td { + margin: 0; + padding: 0; } + +p { + margin-bottom: 1rem; + font-size: inherit; + line-height: 1.6; + text-rendering: optimizeLegibility; } + +em, +i { + font-style: italic; + line-height: inherit; } + +strong, +b { + font-weight: bold; + line-height: inherit; } + +small { + font-size: 80%; + line-height: inherit; } + +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; + font-style: normal; + font-weight: normal; + color: inherit; + text-rendering: optimizeLegibility; } + h1 small, + h2 small, + h3 small, + h4 small, + h5 small, + h6 small { + line-height: 0; + color: #cacaca; } + +h1 { + font-size: 1.5rem; + line-height: 1.4; + margin-top: 0; + margin-bottom: 0.5rem; } + +h2 { + font-size: 1.25rem; + line-height: 1.4; + margin-top: 0; + margin-bottom: 0.5rem; } + +h3 { + font-size: 1.1875rem; + line-height: 1.4; + margin-top: 0; + margin-bottom: 0.5rem; } + +h4 { + font-size: 1.125rem; + line-height: 1.4; + margin-top: 0; + margin-bottom: 0.5rem; } + +h5 { + font-size: 1.0625rem; + line-height: 1.4; + margin-top: 0; + margin-bottom: 0.5rem; } + +h6 { + font-size: 1rem; + line-height: 1.4; + margin-top: 0; + margin-bottom: 0.5rem; } + +@media print, screen and (min-width: 40em) { + h1 { + font-size: 3rem; } + h2 { + font-size: 2.5rem; } + h3 { + font-size: 1.9375rem; } + h4 { + font-size: 1.5625rem; } + h5 { + font-size: 1.25rem; } + h6 { + font-size: 1rem; } } + +a { + line-height: inherit; + color: #1779ba; + text-decoration: none; + cursor: pointer; } + a:hover, a:focus { + color: #1468a0; } + a img { + border: 0; } + +hr { + clear: both; + max-width: 75rem; + height: 0; + margin: 1.25rem auto; + border-top: 0; + border-right: 0; + border-bottom: 1px solid #cacaca; + border-left: 0; } + +ul, +ol, +dl { + margin-bottom: 1rem; + list-style-position: outside; + line-height: 1.6; } + +li { + font-size: inherit; } + +ul { + margin-left: 1.25rem; + list-style-type: disc; } + +ol { + margin-left: 1.25rem; } + +ul ul, ol ul, ul ol, ol ol { + margin-left: 1.25rem; + margin-bottom: 0; } + +dl { + margin-bottom: 1rem; } + dl dt { + margin-bottom: 0.3rem; + font-weight: bold; } + +blockquote { + margin: 0 0 1rem; + padding: 0.5625rem 1.25rem 0 1.1875rem; + border-left: 1px solid #cacaca; } + blockquote, blockquote p { + line-height: 1.6; + color: #8a8a8a; } + +cite { + display: block; + font-size: 0.8125rem; + color: #8a8a8a; } + cite:before { + content: "— "; } + +abbr { + border-bottom: 1px dotted #0a0a0a; + color: #0a0a0a; + cursor: help; } + +figure { + margin: 0; } + +code { + padding: 0.125rem 0.3125rem 0.0625rem; + border: 1px solid #cacaca; + background-color: #e6e6e6; + font-family: Consolas, "Liberation Mono", Courier, monospace; + font-weight: normal; + color: #0a0a0a; } + +kbd { + margin: 0; + padding: 0.125rem 0.25rem 0; + background-color: #e6e6e6; + font-family: Consolas, "Liberation Mono", Courier, monospace; + color: #0a0a0a; } + +.subheader { + margin-top: 0.2rem; + margin-bottom: 0.5rem; + font-weight: normal; + line-height: 1.4; + color: #8a8a8a; } + +.lead { + font-size: 125%; + line-height: 1.6; } + +.stat { + font-size: 2.5rem; + line-height: 1; } + p + .stat { + margin-top: -1rem; } + +.no-bullet { + margin-left: 0; + list-style: none; } + +.text-left { + text-align: left; } + +.text-right { + text-align: right; } + +.text-center { + text-align: center; } + +.text-justify { + text-align: justify; } + +@media print, screen and (min-width: 40em) { + .medium-text-left { + text-align: left; } + .medium-text-right { + text-align: right; } + .medium-text-center { + text-align: center; } + .medium-text-justify { + text-align: justify; } } + +@media print, screen and (min-width: 64em) { + .large-text-left { + text-align: left; } + .large-text-right { + text-align: right; } + .large-text-center { + text-align: center; } + .large-text-justify { + text-align: justify; } } + +.show-for-print { + display: none !important; } + +@media print { + * { + background: transparent !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + color: black !important; + text-shadow: none !important; } + .show-for-print { + display: block !important; } + .hide-for-print { + display: none !important; } + table.show-for-print { + display: table !important; } + thead.show-for-print { + display: table-header-group !important; } + tbody.show-for-print { + display: table-row-group !important; } + tr.show-for-print { + display: table-row !important; } + td.show-for-print { + display: table-cell !important; } + th.show-for-print { + display: table-cell !important; } + a, + a:visited { + text-decoration: underline; } + a[href]:after { + content: " (" attr(href) ")"; } + .ir a:after, + a[href^='javascript:']:after, + a[href^='#']:after { + content: ''; } + abbr[title]:after { + content: " (" attr(title) ")"; } + pre, + blockquote { + border: 1px solid #8a8a8a; + page-break-inside: avoid; } + thead { + display: table-header-group; } + tr, + img { + page-break-inside: avoid; } + img { + max-width: 100% !important; } + @page { + margin: 0.5cm; } + p, + h2, + h3 { + orphans: 3; + widows: 3; } + h2, + h3 { + page-break-after: avoid; } } + +[type='text'], [type='password'], [type='date'], [type='datetime'], [type='datetime-local'], [type='month'], [type='week'], [type='email'], [type='number'], [type='search'], [type='tel'], [type='time'], [type='url'], [type='color'], +textarea { + display: block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + height: 2.4375rem; + margin: 0 0 1rem; + padding: 0.5rem; + border: 1px solid #cacaca; + border-radius: 0; + background-color: #fefefe; + -webkit-box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1); + box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1); + font-family: inherit; + font-size: 1rem; + font-weight: normal; + color: #0a0a0a; + -webkit-transition: border-color 0.25s ease-in-out, -webkit-box-shadow 0.5s; + transition: border-color 0.25s ease-in-out, -webkit-box-shadow 0.5s; + transition: box-shadow 0.5s, border-color 0.25s ease-in-out; + transition: box-shadow 0.5s, border-color 0.25s ease-in-out, -webkit-box-shadow 0.5s; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; } + [type='text']:focus, [type='password']:focus, [type='date']:focus, [type='datetime']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='week']:focus, [type='email']:focus, [type='number']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='url']:focus, [type='color']:focus, + textarea:focus { + outline: none; + border: 1px solid #8a8a8a; + background-color: #fefefe; + -webkit-box-shadow: 0 0 5px #cacaca; + box-shadow: 0 0 5px #cacaca; + -webkit-transition: border-color 0.25s ease-in-out, -webkit-box-shadow 0.5s; + transition: border-color 0.25s ease-in-out, -webkit-box-shadow 0.5s; + transition: box-shadow 0.5s, border-color 0.25s ease-in-out; + transition: box-shadow 0.5s, border-color 0.25s ease-in-out, -webkit-box-shadow 0.5s; } + +textarea { + max-width: 100%; } + textarea[rows] { + height: auto; } + +input::-webkit-input-placeholder, +textarea::-webkit-input-placeholder { + color: #cacaca; } + +input::-moz-placeholder, +textarea::-moz-placeholder { + color: #cacaca; } + +input:-ms-input-placeholder, +textarea:-ms-input-placeholder { + color: #cacaca; } + +input::placeholder, +textarea::placeholder { + color: #cacaca; } + +input:disabled, input[readonly], +textarea:disabled, +textarea[readonly] { + background-color: #e6e6e6; + cursor: not-allowed; } + +[type='submit'], +[type='button'] { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border-radius: 0; } + +input[type='search'] { + -webkit-box-sizing: border-box; + box-sizing: border-box; } + +[type='file'], +[type='checkbox'], +[type='radio'] { + margin: 0 0 1rem; } + +[type='checkbox'] + label, +[type='radio'] + label { + display: inline-block; + vertical-align: baseline; + margin-left: 0.5rem; + margin-right: 1rem; + margin-bottom: 0; } + [type='checkbox'] + label[for], + [type='radio'] + label[for] { + cursor: pointer; } + +label > [type='checkbox'], +label > [type='radio'] { + margin-right: 0.5rem; } + +[type='file'] { + width: 100%; } + +label { + display: block; + margin: 0; + font-size: 0.875rem; + font-weight: normal; + line-height: 1.8; + color: #0a0a0a; } + label.middle { + margin: 0 0 1rem; + padding: 0.5625rem 0; } + +.help-text { + margin-top: -0.5rem; + font-size: 0.8125rem; + font-style: italic; + color: #0a0a0a; } + +.input-group { + display: table; + width: 100%; + margin-bottom: 1rem; } + .input-group > :first-child { + border-radius: 0 0 0 0; } + .input-group > :last-child > * { + border-radius: 0 0 0 0; } + +.input-group-label, .input-group-field, .input-group-button, .input-group-button a, +.input-group-button input, +.input-group-button button, +.input-group-button label { + margin: 0; + white-space: nowrap; + display: table-cell; + vertical-align: middle; } + +.input-group-label { + padding: 0 1rem; + border: 1px solid #cacaca; + background: #e6e6e6; + color: #0a0a0a; + text-align: center; + white-space: nowrap; + width: 1%; + height: 100%; } + .input-group-label:first-child { + border-right: 0; } + .input-group-label:last-child { + border-left: 0; } + +.input-group-field { + border-radius: 0; + height: 2.5rem; } + +.input-group-button { + padding-top: 0; + padding-bottom: 0; + text-align: center; + width: 1%; + height: 100%; } + .input-group-button a, + .input-group-button input, + .input-group-button button, + .input-group-button label { + height: 2.5rem; + padding-top: 0; + padding-bottom: 0; + font-size: 1rem; } + +.input-group .input-group-button { + display: table-cell; } + +fieldset { + margin: 0; + padding: 0; + border: 0; } + +legend { + max-width: 100%; + margin-bottom: 0.5rem; } + +.fieldset { + margin: 1.125rem 0; + padding: 1.25rem; + border: 1px solid #cacaca; } + .fieldset legend { + margin: 0; + margin-left: -0.1875rem; + padding: 0 0.1875rem; + background: #fefefe; } + +select { + height: 2.4375rem; + margin: 0 0 1rem; + padding: 0.5rem; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border: 1px solid #cacaca; + border-radius: 0; + background-color: #fefefe; + font-family: inherit; + font-size: 1rem; + line-height: normal; + color: #0a0a0a; + background-image: url("data:image/svg+xml;utf8,"); + -webkit-background-origin: content-box; + background-origin: content-box; + background-position: right -1rem center; + background-repeat: no-repeat; + -webkit-background-size: 9px 6px; + background-size: 9px 6px; + padding-right: 1.5rem; + -webkit-transition: border-color 0.25s ease-in-out, -webkit-box-shadow 0.5s; + transition: border-color 0.25s ease-in-out, -webkit-box-shadow 0.5s; + transition: box-shadow 0.5s, border-color 0.25s ease-in-out; + transition: box-shadow 0.5s, border-color 0.25s ease-in-out, -webkit-box-shadow 0.5s; } + @media screen and (min-width: 0\0) { + select { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAYCAYAAACbU/80AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIpJREFUeNrEkckNgDAMBBfRkEt0ObRBBdsGXUDgmQfK4XhH2m8czQAAy27R3tsw4Qfe2x8uOO6oYLb6GlOor3GF+swURAOmUJ+RwtEJs9WvTGEYxBXqI1MQAZhCfUQKRzDMVj+TwrAIV6jvSUEkYAr1LSkcyTBb/V+KYfX7xAeusq3sLDtGH3kEGACPWIflNZfhRQAAAABJRU5ErkJggg=="); } } + select:focus { + outline: none; + border: 1px solid #8a8a8a; + background-color: #fefefe; + -webkit-box-shadow: 0 0 5px #cacaca; + box-shadow: 0 0 5px #cacaca; + -webkit-transition: border-color 0.25s ease-in-out, -webkit-box-shadow 0.5s; + transition: border-color 0.25s ease-in-out, -webkit-box-shadow 0.5s; + transition: box-shadow 0.5s, border-color 0.25s ease-in-out; + transition: box-shadow 0.5s, border-color 0.25s ease-in-out, -webkit-box-shadow 0.5s; } + select:disabled { + background-color: #e6e6e6; + cursor: not-allowed; } + select::-ms-expand { + display: none; } + select[multiple] { + height: auto; + background-image: none; } + +.is-invalid-input:not(:focus) { + border-color: #cc4b37; + background-color: #f9ecea; } + .is-invalid-input:not(:focus)::-webkit-input-placeholder { + color: #cc4b37; } + .is-invalid-input:not(:focus)::-moz-placeholder { + color: #cc4b37; } + .is-invalid-input:not(:focus):-ms-input-placeholder { + color: #cc4b37; } + .is-invalid-input:not(:focus)::placeholder { + color: #cc4b37; } + +.is-invalid-label { + color: #cc4b37; } + +.form-error { + display: none; + margin-top: -0.5rem; + margin-bottom: 1rem; + font-size: 0.75rem; + font-weight: bold; + color: #cc4b37; } + .form-error.is-visible { + display: block; } + +.button { + display: inline-block; + vertical-align: middle; + margin: 0 0 1rem 0; + padding: 0.85em 1em; + -webkit-appearance: none; + border: 1px solid transparent; + border-radius: 0; + -webkit-transition: background-color 0.25s ease-out, color 0.25s ease-out; + transition: background-color 0.25s ease-out, color 0.25s ease-out; + font-size: 0.9rem; + line-height: 1; + text-align: center; + cursor: pointer; + background-color: #1779ba; + color: #fefefe; } + [data-whatinput='mouse'] .button { + outline: 0; } + .button:hover, .button:focus { + background-color: #14679e; + color: #fefefe; } + .button.tiny { + font-size: 0.6rem; } + .button.small { + font-size: 0.75rem; } + .button.large { + font-size: 1.25rem; } + .button.expanded { + display: block; + width: 100%; + margin-right: 0; + margin-left: 0; } + .button.primary { + background-color: #1779ba; + color: #fefefe; } + .button.primary:hover, .button.primary:focus { + background-color: #126195; + color: #fefefe; } + .button.secondary { + background-color: #767676; + color: #fefefe; } + .button.secondary:hover, .button.secondary:focus { + background-color: #5e5e5e; + color: #fefefe; } + .button.success { + background-color: #3adb76; + color: #0a0a0a; } + .button.success:hover, .button.success:focus { + background-color: #22bb5b; + color: #0a0a0a; } + .button.warning { + background-color: #ffae00; + color: #0a0a0a; } + .button.warning:hover, .button.warning:focus { + background-color: #cc8b00; + color: #0a0a0a; } + .button.alert { + background-color: #cc4b37; + color: #fefefe; } + .button.alert:hover, .button.alert:focus { + background-color: #a53b2a; + color: #fefefe; } + .button.hollow { + border: 1px solid #1779ba; + color: #1779ba; } + .button.hollow, .button.hollow:hover, .button.hollow:focus { + background-color: transparent; } + .button.hollow:hover, .button.hollow:focus { + border-color: #0c3d5d; + color: #0c3d5d; } + .button.hollow.primary { + border: 1px solid #1779ba; + color: #1779ba; } + .button.hollow.primary:hover, .button.hollow.primary:focus { + border-color: #0c3d5d; + color: #0c3d5d; } + .button.hollow.secondary { + border: 1px solid #767676; + color: #767676; } + .button.hollow.secondary:hover, .button.hollow.secondary:focus { + border-color: #3b3b3b; + color: #3b3b3b; } + .button.hollow.success { + border: 1px solid #3adb76; + color: #3adb76; } + .button.hollow.success:hover, .button.hollow.success:focus { + border-color: #157539; + color: #157539; } + .button.hollow.warning { + border: 1px solid #ffae00; + color: #ffae00; } + .button.hollow.warning:hover, .button.hollow.warning:focus { + border-color: #805700; + color: #805700; } + .button.hollow.alert { + border: 1px solid #cc4b37; + color: #cc4b37; } + .button.hollow.alert:hover, .button.hollow.alert:focus { + border-color: #67251a; + color: #67251a; } + .button.disabled, .button[disabled] { + opacity: 0.25; + cursor: not-allowed; } + .button.disabled, .button.disabled:hover, .button.disabled:focus, .button[disabled], .button[disabled]:hover, .button[disabled]:focus { + background-color: #1779ba; + color: #fefefe; } + .button.disabled.primary, .button[disabled].primary { + opacity: 0.25; + cursor: not-allowed; } + .button.disabled.primary, .button.disabled.primary:hover, .button.disabled.primary:focus, .button[disabled].primary, .button[disabled].primary:hover, .button[disabled].primary:focus { + background-color: #1779ba; + color: #fefefe; } + .button.disabled.secondary, .button[disabled].secondary { + opacity: 0.25; + cursor: not-allowed; } + .button.disabled.secondary, .button.disabled.secondary:hover, .button.disabled.secondary:focus, .button[disabled].secondary, .button[disabled].secondary:hover, .button[disabled].secondary:focus { + background-color: #767676; + color: #fefefe; } + .button.disabled.success, .button[disabled].success { + opacity: 0.25; + cursor: not-allowed; } + .button.disabled.success, .button.disabled.success:hover, .button.disabled.success:focus, .button[disabled].success, .button[disabled].success:hover, .button[disabled].success:focus { + background-color: #3adb76; + color: #0a0a0a; } + .button.disabled.warning, .button[disabled].warning { + opacity: 0.25; + cursor: not-allowed; } + .button.disabled.warning, .button.disabled.warning:hover, .button.disabled.warning:focus, .button[disabled].warning, .button[disabled].warning:hover, .button[disabled].warning:focus { + background-color: #ffae00; + color: #0a0a0a; } + .button.disabled.alert, .button[disabled].alert { + opacity: 0.25; + cursor: not-allowed; } + .button.disabled.alert, .button.disabled.alert:hover, .button.disabled.alert:focus, .button[disabled].alert, .button[disabled].alert:hover, .button[disabled].alert:focus { + background-color: #cc4b37; + color: #fefefe; } + .button.dropdown::after { + display: block; + width: 0; + height: 0; + border: inset 0.4em; + content: ''; + border-bottom-width: 0; + border-top-style: solid; + border-color: #fefefe transparent transparent; + position: relative; + top: 0.4em; + display: inline-block; + float: right; + margin-left: 1em; } + .button.arrow-only::after { + top: -0.1em; + float: none; + margin-left: 0; } + +.accordion { + margin-left: 0; + background: #fefefe; + list-style-type: none; } + +.accordion-item:first-child > :first-child { + border-radius: 0 0 0 0; } + +.accordion-item:last-child > :last-child { + border-radius: 0 0 0 0; } + +.accordion-title { + position: relative; + display: block; + padding: 1.25rem 1rem; + border: 1px solid #e6e6e6; + border-bottom: 0; + font-size: 0.75rem; + line-height: 1; + color: #1779ba; } + :last-child:not(.is-active) > .accordion-title { + border-bottom: 1px solid #e6e6e6; + border-radius: 0 0 0 0; } + .accordion-title:hover, .accordion-title:focus { + background-color: #e6e6e6; } + .accordion-title::before { + position: absolute; + top: 50%; + right: 1rem; + margin-top: -0.5rem; + content: '+'; } + .is-active > .accordion-title::before { + content: '\2013'; } + +.accordion-content { + display: none; + padding: 1rem; + border: 1px solid #e6e6e6; + border-bottom: 0; + background-color: #fefefe; + color: #0a0a0a; } + :last-child > .accordion-content:last-child { + border-bottom: 1px solid #e6e6e6; } + +.is-accordion-submenu-parent > a { + position: relative; } + .is-accordion-submenu-parent > a::after { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-bottom-width: 0; + border-top-style: solid; + border-color: #1779ba transparent transparent; + position: absolute; + top: 50%; + margin-top: -3px; + right: 1rem; } + +.is-accordion-submenu-parent[aria-expanded='true'] > a::after { + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transform-origin: 50% 50%; + -ms-transform-origin: 50% 50%; + transform-origin: 50% 50%; } + +.badge { + display: inline-block; + min-width: 2.1em; + padding: 0.3em; + border-radius: 50%; + font-size: 0.6rem; + text-align: center; + background: #1779ba; + color: #fefefe; } + .badge.primary { + background: #1779ba; + color: #fefefe; } + .badge.secondary { + background: #767676; + color: #fefefe; } + .badge.success { + background: #3adb76; + color: #0a0a0a; } + .badge.warning { + background: #ffae00; + color: #0a0a0a; } + .badge.alert { + background: #cc4b37; + color: #fefefe; } + +.breadcrumbs { + margin: 0 0 1rem 0; + list-style: none; } + .breadcrumbs::before, .breadcrumbs::after { + display: table; + content: ' '; } + .breadcrumbs::after { + clear: both; } + .breadcrumbs li { + float: left; + font-size: 0.6875rem; + color: #0a0a0a; + cursor: default; + text-transform: uppercase; } + .breadcrumbs li:not(:last-child)::after { + position: relative; + top: 1px; + margin: 0 0.75rem; + opacity: 1; + content: "/"; + color: #cacaca; } + .breadcrumbs a { + color: #1779ba; } + .breadcrumbs a:hover { + text-decoration: underline; } + .breadcrumbs .disabled { + color: #cacaca; + cursor: not-allowed; } + +.button-group { + margin-bottom: 1rem; + font-size: 0; } + .button-group::before, .button-group::after { + display: table; + content: ' '; } + .button-group::after { + clear: both; } + .button-group .button { + margin: 0; + margin-right: 1px; + margin-bottom: 1px; + font-size: 0.9rem; } + .button-group .button:last-child { + margin-right: 0; } + .button-group.tiny .button { + font-size: 0.6rem; } + .button-group.small .button { + font-size: 0.75rem; } + .button-group.large .button { + font-size: 1.25rem; } + .button-group.expanded { + margin-right: -1px; } + .button-group.expanded::before, .button-group.expanded::after { + display: none; } + .button-group.expanded .button:first-child:last-child { + width: 100%; } + .button-group.expanded .button:first-child:nth-last-child(2), .button-group.expanded .button:first-child:nth-last-child(2):first-child:nth-last-child(2) ~ .button { + display: inline-block; + width: calc(50% - 1px); + margin-right: 1px; } + .button-group.expanded .button:first-child:nth-last-child(2):last-child, .button-group.expanded .button:first-child:nth-last-child(2):first-child:nth-last-child(2) ~ .button:last-child { + margin-right: -6px; } + .button-group.expanded .button:first-child:nth-last-child(3), .button-group.expanded .button:first-child:nth-last-child(3):first-child:nth-last-child(3) ~ .button { + display: inline-block; + width: calc(33.33333% - 1px); + margin-right: 1px; } + .button-group.expanded .button:first-child:nth-last-child(3):last-child, .button-group.expanded .button:first-child:nth-last-child(3):first-child:nth-last-child(3) ~ .button:last-child { + margin-right: -6px; } + .button-group.expanded .button:first-child:nth-last-child(4), .button-group.expanded .button:first-child:nth-last-child(4):first-child:nth-last-child(4) ~ .button { + display: inline-block; + width: calc(25% - 1px); + margin-right: 1px; } + .button-group.expanded .button:first-child:nth-last-child(4):last-child, .button-group.expanded .button:first-child:nth-last-child(4):first-child:nth-last-child(4) ~ .button:last-child { + margin-right: -6px; } + .button-group.expanded .button:first-child:nth-last-child(5), .button-group.expanded .button:first-child:nth-last-child(5):first-child:nth-last-child(5) ~ .button { + display: inline-block; + width: calc(20% - 1px); + margin-right: 1px; } + .button-group.expanded .button:first-child:nth-last-child(5):last-child, .button-group.expanded .button:first-child:nth-last-child(5):first-child:nth-last-child(5) ~ .button:last-child { + margin-right: -6px; } + .button-group.expanded .button:first-child:nth-last-child(6), .button-group.expanded .button:first-child:nth-last-child(6):first-child:nth-last-child(6) ~ .button { + display: inline-block; + width: calc(16.66667% - 1px); + margin-right: 1px; } + .button-group.expanded .button:first-child:nth-last-child(6):last-child, .button-group.expanded .button:first-child:nth-last-child(6):first-child:nth-last-child(6) ~ .button:last-child { + margin-right: -6px; } + .button-group.primary .button { + background-color: #1779ba; + color: #fefefe; } + .button-group.primary .button:hover, .button-group.primary .button:focus { + background-color: #126195; + color: #fefefe; } + .button-group.secondary .button { + background-color: #767676; + color: #fefefe; } + .button-group.secondary .button:hover, .button-group.secondary .button:focus { + background-color: #5e5e5e; + color: #fefefe; } + .button-group.success .button { + background-color: #3adb76; + color: #0a0a0a; } + .button-group.success .button:hover, .button-group.success .button:focus { + background-color: #22bb5b; + color: #0a0a0a; } + .button-group.warning .button { + background-color: #ffae00; + color: #0a0a0a; } + .button-group.warning .button:hover, .button-group.warning .button:focus { + background-color: #cc8b00; + color: #0a0a0a; } + .button-group.alert .button { + background-color: #cc4b37; + color: #fefefe; } + .button-group.alert .button:hover, .button-group.alert .button:focus { + background-color: #a53b2a; + color: #fefefe; } + .button-group.stacked .button, .button-group.stacked-for-small .button, .button-group.stacked-for-medium .button { + width: 100%; } + .button-group.stacked .button:last-child, .button-group.stacked-for-small .button:last-child, .button-group.stacked-for-medium .button:last-child { + margin-bottom: 0; } + @media print, screen and (min-width: 40em) { + .button-group.stacked-for-small .button { + width: auto; + margin-bottom: 0; } } + @media print, screen and (min-width: 64em) { + .button-group.stacked-for-medium .button { + width: auto; + margin-bottom: 0; } } + @media screen and (max-width: 39.9375em) { + .button-group.stacked-for-small.expanded { + display: block; } + .button-group.stacked-for-small.expanded .button { + display: block; + margin-right: 0; } } + +.callout { + position: relative; + margin: 0 0 1rem 0; + padding: 1rem; + border: 1px solid rgba(10, 10, 10, 0.25); + border-radius: 0; + background-color: white; + color: #0a0a0a; } + .callout > :first-child { + margin-top: 0; } + .callout > :last-child { + margin-bottom: 0; } + .callout.primary { + background-color: #d7ecfa; + color: #0a0a0a; } + .callout.secondary { + background-color: #eaeaea; + color: #0a0a0a; } + .callout.success { + background-color: #e1faea; + color: #0a0a0a; } + .callout.warning { + background-color: #fff3d9; + color: #0a0a0a; } + .callout.alert { + background-color: #f7e4e1; + color: #0a0a0a; } + .callout.small { + padding-top: 0.5rem; + padding-right: 0.5rem; + padding-bottom: 0.5rem; + padding-left: 0.5rem; } + .callout.large { + padding-top: 3rem; + padding-right: 3rem; + padding-bottom: 3rem; + padding-left: 3rem; } + +.card { + margin-bottom: 1rem; + border: 1px solid #e6e6e6; + border-radius: 0; + background: #fefefe; + -webkit-box-shadow: none; + box-shadow: none; + overflow: hidden; + color: #0a0a0a; } + .card > :last-child { + margin-bottom: 0; } + +.card-divider { + padding: 1rem; + background: #e6e6e6; } + .card-divider > :last-child { + margin-bottom: 0; } + +.card-section { + padding: 1rem; } + .card-section > :last-child { + margin-bottom: 0; } + +.close-button { + position: absolute; + color: #8a8a8a; + cursor: pointer; } + [data-whatinput='mouse'] .close-button { + outline: 0; } + .close-button:hover, .close-button:focus { + color: #0a0a0a; } + .close-button.small { + right: 0.66rem; + top: 0.33em; + font-size: 1.5em; + line-height: 1; } + .close-button, .close-button.medium { + right: 1rem; + top: 0.5rem; + font-size: 2em; + line-height: 1; } + +.menu { + margin: 0; + list-style-type: none; } + .menu > li { + display: table-cell; + vertical-align: middle; } + [data-whatinput='mouse'] .menu > li { + outline: 0; } + .menu > li > a { + display: block; + padding: 0.7rem 1rem; + line-height: 1; } + .menu input, + .menu select, + .menu a, + .menu button { + margin-bottom: 0; } + .menu > li > a img, + .menu > li > a i, + .menu > li > a svg { + vertical-align: middle; } + .menu > li > a img + span, + .menu > li > a i + span, + .menu > li > a svg + span { + vertical-align: middle; } + .menu > li > a img, + .menu > li > a i, + .menu > li > a svg { + margin-right: 0.25rem; + display: inline-block; } + .menu > li, .menu.horizontal > li { + display: table-cell; } + .menu.expanded { + display: table; + width: 100%; + table-layout: fixed; } + .menu.expanded > li:first-child:last-child { + width: 100%; } + .menu.vertical > li { + display: block; } + @media print, screen and (min-width: 40em) { + .menu.medium-horizontal > li { + display: table-cell; } + .menu.medium-expanded { + display: table; + width: 100%; + table-layout: fixed; } + .menu.medium-expanded > li:first-child:last-child { + width: 100%; } + .menu.medium-vertical > li { + display: block; } } + @media print, screen and (min-width: 64em) { + .menu.large-horizontal > li { + display: table-cell; } + .menu.large-expanded { + display: table; + width: 100%; + table-layout: fixed; } + .menu.large-expanded > li:first-child:last-child { + width: 100%; } + .menu.large-vertical > li { + display: block; } } + .menu.simple li { + display: inline-block; + vertical-align: top; + line-height: 1; } + .menu.simple a { + padding: 0; } + .menu.simple li { + margin-left: 0; + margin-right: 1rem; } + .menu.simple.align-right li { + margin-right: 0; + margin-left: 1rem; } + .menu.align-right::before, .menu.align-right::after { + display: table; + content: ' '; } + .menu.align-right::after { + clear: both; } + .menu.align-right > li { + float: right; } + .menu.icon-top > li > a { + text-align: center; } + .menu.icon-top > li > a img, + .menu.icon-top > li > a i, + .menu.icon-top > li > a svg { + display: block; + margin: 0 auto 0.25rem; } + .menu.icon-top.vertical a > span { + margin: auto; } + .menu.nested { + margin-left: 1rem; } + .menu .active > a { + background: #1779ba; + color: #fefefe; } + .menu.menu-bordered li { + border: 1px solid #e6e6e6; } + .menu.menu-bordered li:not(:first-child) { + border-top: 0; } + .menu.menu-hover li:hover { + background-color: #e6e6e6; } + +.menu-text { + padding-top: 0; + padding-bottom: 0; + padding: 0.7rem 1rem; + font-weight: bold; + line-height: 1; + color: inherit; } + +.menu-centered { + text-align: center; } + .menu-centered > .menu { + display: inline-block; + vertical-align: top; } + +.no-js [data-responsive-menu] ul { + display: none; } + +.menu-icon { + position: relative; + display: inline-block; + vertical-align: middle; + width: 20px; + height: 16px; + cursor: pointer; } + .menu-icon::after { + position: absolute; + top: 0; + left: 0; + display: block; + width: 100%; + height: 2px; + background: #fefefe; + -webkit-box-shadow: 0 7px 0 #fefefe, 0 14px 0 #fefefe; + box-shadow: 0 7px 0 #fefefe, 0 14px 0 #fefefe; + content: ''; } + .menu-icon:hover::after { + background: #cacaca; + -webkit-box-shadow: 0 7px 0 #cacaca, 0 14px 0 #cacaca; + box-shadow: 0 7px 0 #cacaca, 0 14px 0 #cacaca; } + +.menu-icon.dark { + position: relative; + display: inline-block; + vertical-align: middle; + width: 20px; + height: 16px; + cursor: pointer; } + .menu-icon.dark::after { + position: absolute; + top: 0; + left: 0; + display: block; + width: 100%; + height: 2px; + background: #0a0a0a; + -webkit-box-shadow: 0 7px 0 #0a0a0a, 0 14px 0 #0a0a0a; + box-shadow: 0 7px 0 #0a0a0a, 0 14px 0 #0a0a0a; + content: ''; } + .menu-icon.dark:hover::after { + background: #8a8a8a; + -webkit-box-shadow: 0 7px 0 #8a8a8a, 0 14px 0 #8a8a8a; + box-shadow: 0 7px 0 #8a8a8a, 0 14px 0 #8a8a8a; } + +.is-drilldown { + position: relative; + overflow: hidden; } + .is-drilldown li { + display: block; } + .is-drilldown.animate-height { + -webkit-transition: height 0.5s; + transition: height 0.5s; } + +.is-drilldown-submenu { + position: absolute; + top: 0; + left: 100%; + z-index: -1; + width: 100%; + background: #fefefe; + -webkit-transition: -webkit-transform 0.15s linear; + transition: -webkit-transform 0.15s linear; + transition: transform 0.15s linear; + transition: transform 0.15s linear, -webkit-transform 0.15s linear; } + .is-drilldown-submenu.is-active { + z-index: 1; + display: block; + -webkit-transform: translateX(-100%); + -ms-transform: translateX(-100%); + transform: translateX(-100%); } + .is-drilldown-submenu.is-closing { + -webkit-transform: translateX(100%); + -ms-transform: translateX(100%); + transform: translateX(100%); } + +.drilldown-submenu-cover-previous { + min-height: 100%; } + +.is-drilldown-submenu-parent > a { + position: relative; } + .is-drilldown-submenu-parent > a::after { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-right-width: 0; + border-left-style: solid; + border-color: transparent transparent transparent #1779ba; + position: absolute; + top: 50%; + margin-top: -6px; + right: 1rem; } + +.js-drilldown-back > a::before { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-left-width: 0; + border-right-style: solid; + border-color: transparent #1779ba transparent transparent; + border-left-width: 0; + display: inline-block; + vertical-align: middle; + margin-right: 0.75rem; + border-left-width: 0; } + +.dropdown-pane { + position: absolute; + z-index: 10; + display: block; + width: 300px; + padding: 1rem; + visibility: hidden; + border: 1px solid #cacaca; + border-radius: 0; + background-color: #fefefe; + font-size: 1rem; } + .dropdown-pane.is-open { + visibility: visible; } + +.dropdown-pane.tiny { + width: 100px; } + +.dropdown-pane.small { + width: 200px; } + +.dropdown-pane.large { + width: 400px; } + +.dropdown.menu > li.opens-left > .is-dropdown-submenu { + top: 100%; + right: 0; + left: auto; } + +.dropdown.menu > li.opens-right > .is-dropdown-submenu { + top: 100%; + right: auto; + left: 0; } + +.dropdown.menu > li.is-dropdown-submenu-parent > a { + position: relative; + padding-right: 1.5rem; } + +.dropdown.menu > li.is-dropdown-submenu-parent > a::after { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-bottom-width: 0; + border-top-style: solid; + border-color: #1779ba transparent transparent; + right: 5px; + margin-top: -3px; } + +[data-whatinput='mouse'] .dropdown.menu a { + outline: 0; } + +.no-js .dropdown.menu ul { + display: none; } + +.dropdown.menu.vertical > li .is-dropdown-submenu { + top: 0; } + +.dropdown.menu.vertical > li.opens-left > .is-dropdown-submenu { + right: 100%; + left: auto; } + +.dropdown.menu.vertical > li.opens-right > .is-dropdown-submenu { + right: auto; + left: 100%; } + +.dropdown.menu.vertical > li > a::after { + right: 14px; } + +.dropdown.menu.vertical > li.opens-left > a::after { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-left-width: 0; + border-right-style: solid; + border-color: transparent #1779ba transparent transparent; } + +.dropdown.menu.vertical > li.opens-right > a::after { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-right-width: 0; + border-left-style: solid; + border-color: transparent transparent transparent #1779ba; } + +@media print, screen and (min-width: 40em) { + .dropdown.menu.medium-horizontal > li.opens-left > .is-dropdown-submenu { + top: 100%; + right: 0; + left: auto; } + .dropdown.menu.medium-horizontal > li.opens-right > .is-dropdown-submenu { + top: 100%; + right: auto; + left: 0; } + .dropdown.menu.medium-horizontal > li.is-dropdown-submenu-parent > a { + position: relative; + padding-right: 1.5rem; } + .dropdown.menu.medium-horizontal > li.is-dropdown-submenu-parent > a::after { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-bottom-width: 0; + border-top-style: solid; + border-color: #1779ba transparent transparent; + right: 5px; + margin-top: -3px; } + .dropdown.menu.medium-vertical > li .is-dropdown-submenu { + top: 0; } + .dropdown.menu.medium-vertical > li.opens-left > .is-dropdown-submenu { + right: 100%; + left: auto; } + .dropdown.menu.medium-vertical > li.opens-right > .is-dropdown-submenu { + right: auto; + left: 100%; } + .dropdown.menu.medium-vertical > li > a::after { + right: 14px; } + .dropdown.menu.medium-vertical > li.opens-left > a::after { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-left-width: 0; + border-right-style: solid; + border-color: transparent #1779ba transparent transparent; } + .dropdown.menu.medium-vertical > li.opens-right > a::after { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-right-width: 0; + border-left-style: solid; + border-color: transparent transparent transparent #1779ba; } } + +@media print, screen and (min-width: 64em) { + .dropdown.menu.large-horizontal > li.opens-left > .is-dropdown-submenu { + top: 100%; + right: 0; + left: auto; } + .dropdown.menu.large-horizontal > li.opens-right > .is-dropdown-submenu { + top: 100%; + right: auto; + left: 0; } + .dropdown.menu.large-horizontal > li.is-dropdown-submenu-parent > a { + position: relative; + padding-right: 1.5rem; } + .dropdown.menu.large-horizontal > li.is-dropdown-submenu-parent > a::after { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-bottom-width: 0; + border-top-style: solid; + border-color: #1779ba transparent transparent; + right: 5px; + margin-top: -3px; } + .dropdown.menu.large-vertical > li .is-dropdown-submenu { + top: 0; } + .dropdown.menu.large-vertical > li.opens-left > .is-dropdown-submenu { + right: 100%; + left: auto; } + .dropdown.menu.large-vertical > li.opens-right > .is-dropdown-submenu { + right: auto; + left: 100%; } + .dropdown.menu.large-vertical > li > a::after { + right: 14px; } + .dropdown.menu.large-vertical > li.opens-left > a::after { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-left-width: 0; + border-right-style: solid; + border-color: transparent #1779ba transparent transparent; } + .dropdown.menu.large-vertical > li.opens-right > a::after { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-right-width: 0; + border-left-style: solid; + border-color: transparent transparent transparent #1779ba; } } + +.dropdown.menu.align-right .is-dropdown-submenu.first-sub { + top: 100%; + right: 0; + left: auto; } + +.is-dropdown-menu.vertical { + width: 100px; } + .is-dropdown-menu.vertical.align-right { + float: right; } + +.is-dropdown-submenu-parent { + position: relative; } + .is-dropdown-submenu-parent a::after { + position: absolute; + top: 50%; + right: 5px; + margin-top: -6px; } + .is-dropdown-submenu-parent.opens-inner > .is-dropdown-submenu { + top: 100%; + left: auto; } + .is-dropdown-submenu-parent.opens-left > .is-dropdown-submenu { + right: 100%; + left: auto; } + .is-dropdown-submenu-parent.opens-right > .is-dropdown-submenu { + right: auto; + left: 100%; } + +.is-dropdown-submenu { + position: absolute; + top: 0; + left: 100%; + z-index: 1; + display: none; + min-width: 200px; + border: 1px solid #cacaca; + background: #fefefe; } + .is-dropdown-submenu .is-dropdown-submenu-parent > a::after { + right: 14px; } + .is-dropdown-submenu .is-dropdown-submenu-parent.opens-left > a::after { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-left-width: 0; + border-right-style: solid; + border-color: transparent #1779ba transparent transparent; } + .is-dropdown-submenu .is-dropdown-submenu-parent.opens-right > a::after { + display: block; + width: 0; + height: 0; + border: inset 6px; + content: ''; + border-right-width: 0; + border-left-style: solid; + border-color: transparent transparent transparent #1779ba; } + .is-dropdown-submenu .is-dropdown-submenu { + margin-top: -1px; } + .is-dropdown-submenu > li { + width: 100%; } + .is-dropdown-submenu.js-dropdown-active { + display: block; } + +.responsive-embed, +.flex-video { + position: relative; + height: 0; + margin-bottom: 1rem; + padding-bottom: 75%; + overflow: hidden; } + .responsive-embed iframe, + .responsive-embed object, + .responsive-embed embed, + .responsive-embed video, + .flex-video iframe, + .flex-video object, + .flex-video embed, + .flex-video video { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; } + .responsive-embed.widescreen, + .flex-video.widescreen { + padding-bottom: 56.25%; } + +.label { + display: inline-block; + padding: 0.33333rem 0.5rem; + border-radius: 0; + font-size: 0.8rem; + line-height: 1; + white-space: nowrap; + cursor: default; + background: #1779ba; + color: #fefefe; } + .label.primary { + background: #1779ba; + color: #fefefe; } + .label.secondary { + background: #767676; + color: #fefefe; } + .label.success { + background: #3adb76; + color: #0a0a0a; } + .label.warning { + background: #ffae00; + color: #0a0a0a; } + .label.alert { + background: #cc4b37; + color: #fefefe; } + +.media-object { + display: block; + margin-bottom: 1rem; } + .media-object img { + max-width: none; } + @media screen and (max-width: 39.9375em) { + .media-object.stack-for-small .media-object-section { + padding: 0; + padding-bottom: 1rem; + display: block; } + .media-object.stack-for-small .media-object-section img { + width: 100%; } } + +.media-object-section { + display: table-cell; + vertical-align: top; } + .media-object-section:first-child { + padding-right: 1rem; } + .media-object-section:last-child:not(:nth-child(2)) { + padding-left: 1rem; } + .media-object-section > :last-child { + margin-bottom: 0; } + .media-object-section.middle { + vertical-align: middle; } + .media-object-section.bottom { + vertical-align: bottom; } + +.is-off-canvas-open { + overflow: hidden; } + +.js-off-canvas-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + -webkit-transition: opacity 0.5s ease, visibility 0.5s ease; + transition: opacity 0.5s ease, visibility 0.5s ease; + background: rgba(254, 254, 254, 0.25); + opacity: 0; + visibility: hidden; + overflow: hidden; } + .js-off-canvas-overlay.is-visible { + opacity: 1; + visibility: visible; } + .js-off-canvas-overlay.is-closable { + cursor: pointer; } + .js-off-canvas-overlay.is-overlay-absolute { + position: absolute; } + .js-off-canvas-overlay.is-overlay-fixed { + position: fixed; } + +.off-canvas-wrapper { + position: relative; + overflow: hidden; } + +.off-canvas { + position: fixed; + z-index: 1; + -webkit-transition: -webkit-transform 0.5s ease; + transition: -webkit-transform 0.5s ease; + transition: transform 0.5s ease; + transition: transform 0.5s ease, -webkit-transform 0.5s ease; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + background: #e6e6e6; } + [data-whatinput='mouse'] .off-canvas { + outline: 0; } + .off-canvas.is-transition-overlap { + z-index: 10; } + .off-canvas.is-transition-overlap.is-open { + -webkit-box-shadow: 0 0 10px rgba(10, 10, 10, 0.7); + box-shadow: 0 0 10px rgba(10, 10, 10, 0.7); } + .off-canvas.is-open { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + transform: translate(0, 0); } + +.off-canvas-absolute { + position: absolute; + z-index: 1; + -webkit-transition: -webkit-transform 0.5s ease; + transition: -webkit-transform 0.5s ease; + transition: transform 0.5s ease; + transition: transform 0.5s ease, -webkit-transform 0.5s ease; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + background: #e6e6e6; } + [data-whatinput='mouse'] .off-canvas-absolute { + outline: 0; } + .off-canvas-absolute.is-transition-overlap { + z-index: 10; } + .off-canvas-absolute.is-transition-overlap.is-open { + -webkit-box-shadow: 0 0 10px rgba(10, 10, 10, 0.7); + box-shadow: 0 0 10px rgba(10, 10, 10, 0.7); } + .off-canvas-absolute.is-open { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + transform: translate(0, 0); } + +.position-left { + top: 0; + left: 0; + width: 250px; + height: 100%; + -webkit-transform: translateX(-250px); + -ms-transform: translateX(-250px); + transform: translateX(-250px); + overflow-y: auto; } + .position-left.is-open ~ .off-canvas-content { + -webkit-transform: translateX(250px); + -ms-transform: translateX(250px); + transform: translateX(250px); } + .position-left.is-transition-push::after { + position: absolute; + top: 0; + right: 0; + height: 100%; + width: 1px; + -webkit-box-shadow: 0 0 10px rgba(10, 10, 10, 0.7); + box-shadow: 0 0 10px rgba(10, 10, 10, 0.7); + content: " "; } + .position-left.is-transition-overlap.is-open ~ .off-canvas-content { + -webkit-transform: none; + -ms-transform: none; + transform: none; } + +.position-right { + top: 0; + right: 0; + width: 250px; + height: 100%; + -webkit-transform: translateX(250px); + -ms-transform: translateX(250px); + transform: translateX(250px); + overflow-y: auto; } + .position-right.is-open ~ .off-canvas-content { + -webkit-transform: translateX(-250px); + -ms-transform: translateX(-250px); + transform: translateX(-250px); } + .position-right.is-transition-push::after { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 1px; + -webkit-box-shadow: 0 0 10px rgba(10, 10, 10, 0.7); + box-shadow: 0 0 10px rgba(10, 10, 10, 0.7); + content: " "; } + .position-right.is-transition-overlap.is-open ~ .off-canvas-content { + -webkit-transform: none; + -ms-transform: none; + transform: none; } + +.position-top { + top: 0; + left: 0; + width: 100%; + height: 250px; + -webkit-transform: translateY(-250px); + -ms-transform: translateY(-250px); + transform: translateY(-250px); + overflow-x: auto; } + .position-top.is-open ~ .off-canvas-content { + -webkit-transform: translateY(250px); + -ms-transform: translateY(250px); + transform: translateY(250px); } + .position-top.is-transition-push::after { + position: absolute; + bottom: 0; + left: 0; + height: 1px; + width: 100%; + -webkit-box-shadow: 0 0 10px rgba(10, 10, 10, 0.7); + box-shadow: 0 0 10px rgba(10, 10, 10, 0.7); + content: " "; } + .position-top.is-transition-overlap.is-open ~ .off-canvas-content { + -webkit-transform: none; + -ms-transform: none; + transform: none; } + +.position-bottom { + bottom: 0; + left: 0; + width: 100%; + height: 250px; + -webkit-transform: translateY(250px); + -ms-transform: translateY(250px); + transform: translateY(250px); + overflow-x: auto; } + .position-bottom.is-open ~ .off-canvas-content { + -webkit-transform: translateY(-250px); + -ms-transform: translateY(-250px); + transform: translateY(-250px); } + .position-bottom.is-transition-push::after { + position: absolute; + top: 0; + left: 0; + height: 1px; + width: 100%; + -webkit-box-shadow: 0 0 10px rgba(10, 10, 10, 0.7); + box-shadow: 0 0 10px rgba(10, 10, 10, 0.7); + content: " "; } + .position-bottom.is-transition-overlap.is-open ~ .off-canvas-content { + -webkit-transform: none; + -ms-transform: none; + transform: none; } + +.off-canvas-content { + -webkit-transition: -webkit-transform 0.5s ease; + transition: -webkit-transform 0.5s ease; + transition: transform 0.5s ease; + transition: transform 0.5s ease, -webkit-transform 0.5s ease; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } + +@media print, screen and (min-width: 40em) { + .position-left.reveal-for-medium { + -webkit-transform: none; + -ms-transform: none; + transform: none; + z-index: 1; } + .position-left.reveal-for-medium ~ .off-canvas-content { + margin-left: 250px; } + .position-right.reveal-for-medium { + -webkit-transform: none; + -ms-transform: none; + transform: none; + z-index: 1; } + .position-right.reveal-for-medium ~ .off-canvas-content { + margin-right: 250px; } + .position-top.reveal-for-medium { + -webkit-transform: none; + -ms-transform: none; + transform: none; + z-index: 1; } + .position-top.reveal-for-medium ~ .off-canvas-content { + margin-top: 250px; } + .position-bottom.reveal-for-medium { + -webkit-transform: none; + -ms-transform: none; + transform: none; + z-index: 1; } + .position-bottom.reveal-for-medium ~ .off-canvas-content { + margin-bottom: 250px; } } + +@media print, screen and (min-width: 64em) { + .position-left.reveal-for-large { + -webkit-transform: none; + -ms-transform: none; + transform: none; + z-index: 1; } + .position-left.reveal-for-large ~ .off-canvas-content { + margin-left: 250px; } + .position-right.reveal-for-large { + -webkit-transform: none; + -ms-transform: none; + transform: none; + z-index: 1; } + .position-right.reveal-for-large ~ .off-canvas-content { + margin-right: 250px; } + .position-top.reveal-for-large { + -webkit-transform: none; + -ms-transform: none; + transform: none; + z-index: 1; } + .position-top.reveal-for-large ~ .off-canvas-content { + margin-top: 250px; } + .position-bottom.reveal-for-large { + -webkit-transform: none; + -ms-transform: none; + transform: none; + z-index: 1; } + .position-bottom.reveal-for-large ~ .off-canvas-content { + margin-bottom: 250px; } } + +.orbit { + position: relative; } + +.orbit-container { + position: relative; + height: 0; + margin: 0; + list-style: none; + overflow: hidden; } + +.orbit-slide { + width: 100%; } + .orbit-slide.no-motionui.is-active { + top: 0; + left: 0; } + +.orbit-figure { + margin: 0; } + +.orbit-image { + width: 100%; + max-width: 100%; + margin: 0; } + +.orbit-caption { + position: absolute; + bottom: 0; + width: 100%; + margin-bottom: 0; + padding: 1rem; + background-color: rgba(10, 10, 10, 0.5); + color: #fefefe; } + +.orbit-previous, .orbit-next { + position: absolute; + top: 50%; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); + z-index: 10; + padding: 1rem; + color: #fefefe; } + [data-whatinput='mouse'] .orbit-previous, [data-whatinput='mouse'] .orbit-next { + outline: 0; } + .orbit-previous:hover, .orbit-next:hover, .orbit-previous:active, .orbit-next:active, .orbit-previous:focus, .orbit-next:focus { + background-color: rgba(10, 10, 10, 0.5); } + +.orbit-previous { + left: 0; } + +.orbit-next { + left: auto; + right: 0; } + +.orbit-bullets { + position: relative; + margin-top: 0.8rem; + margin-bottom: 0.8rem; + text-align: center; } + [data-whatinput='mouse'] .orbit-bullets { + outline: 0; } + .orbit-bullets button { + width: 1.2rem; + height: 1.2rem; + margin: 0.1rem; + border-radius: 50%; + background-color: #cacaca; } + .orbit-bullets button:hover { + background-color: #8a8a8a; } + .orbit-bullets button.is-active { + background-color: #8a8a8a; } + +.pagination { + margin-left: 0; + margin-bottom: 1rem; } + .pagination::before, .pagination::after { + display: table; + content: ' '; } + .pagination::after { + clear: both; } + .pagination li { + margin-right: 0.0625rem; + border-radius: 0; + font-size: 0.875rem; + display: none; } + .pagination li:last-child, .pagination li:first-child { + display: inline-block; } + @media print, screen and (min-width: 40em) { + .pagination li { + display: inline-block; } } + .pagination a, + .pagination button { + display: block; + padding: 0.1875rem 0.625rem; + border-radius: 0; + color: #0a0a0a; } + .pagination a:hover, + .pagination button:hover { + background: #e6e6e6; } + .pagination .current { + padding: 0.1875rem 0.625rem; + background: #1779ba; + color: #fefefe; + cursor: default; } + .pagination .disabled { + padding: 0.1875rem 0.625rem; + color: #cacaca; + cursor: not-allowed; } + .pagination .disabled:hover { + background: transparent; } + .pagination .ellipsis::after { + padding: 0.1875rem 0.625rem; + content: '\2026'; + color: #0a0a0a; } + +.pagination-previous a::before, +.pagination-previous.disabled::before { + display: inline-block; + margin-right: 0.5rem; + content: '\00ab'; } + +.pagination-next a::after, +.pagination-next.disabled::after { + display: inline-block; + margin-left: 0.5rem; + content: '\00bb'; } + +.progress { + height: 1rem; + margin-bottom: 1rem; + border-radius: 0; + background-color: #cacaca; } + .progress.primary .progress-meter { + background-color: #1779ba; } + .progress.secondary .progress-meter { + background-color: #767676; } + .progress.success .progress-meter { + background-color: #3adb76; } + .progress.warning .progress-meter { + background-color: #ffae00; } + .progress.alert .progress-meter { + background-color: #cc4b37; } + +.progress-meter { + position: relative; + display: block; + width: 0%; + height: 100%; + background-color: #1779ba; } + +.progress-meter-text { + position: absolute; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + position: absolute; + margin: 0; + font-size: 0.75rem; + font-weight: bold; + color: #fefefe; + white-space: nowrap; } + +.slider { + position: relative; + height: 0.5rem; + margin-top: 1.25rem; + margin-bottom: 2.25rem; + background-color: #e6e6e6; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -ms-touch-action: none; + touch-action: none; } + +.slider-fill { + position: absolute; + top: 0; + left: 0; + display: inline-block; + max-width: 100%; + height: 0.5rem; + background-color: #cacaca; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; } + .slider-fill.is-dragging { + -webkit-transition: all 0s linear; + transition: all 0s linear; } + +.slider-handle { + position: absolute; + top: 50%; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); + position: absolute; + left: 0; + z-index: 1; + display: inline-block; + width: 1.4rem; + height: 1.4rem; + border-radius: 0; + background-color: #1779ba; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + -ms-touch-action: manipulation; + touch-action: manipulation; } + [data-whatinput='mouse'] .slider-handle { + outline: 0; } + .slider-handle:hover { + background-color: #14679e; } + .slider-handle.is-dragging { + -webkit-transition: all 0s linear; + transition: all 0s linear; } + +.slider.disabled, +.slider[disabled] { + opacity: 0.25; + cursor: not-allowed; } + +.slider.vertical { + display: inline-block; + width: 0.5rem; + height: 12.5rem; + margin: 0 1.25rem; + -webkit-transform: scale(1, -1); + -ms-transform: scale(1, -1); + transform: scale(1, -1); } + .slider.vertical .slider-fill { + top: 0; + width: 0.5rem; + max-height: 100%; } + .slider.vertical .slider-handle { + position: absolute; + top: 0; + left: 50%; + width: 1.4rem; + height: 1.4rem; + -webkit-transform: translateX(-50%); + -ms-transform: translateX(-50%); + transform: translateX(-50%); } + +.sticky-container { + position: relative; } + +.sticky { + position: relative; + z-index: 0; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); } + +.sticky.is-stuck { + position: fixed; + z-index: 5; } + .sticky.is-stuck.is-at-top { + top: 0; } + .sticky.is-stuck.is-at-bottom { + bottom: 0; } + +.sticky.is-anchored { + position: relative; + right: auto; + left: auto; } + .sticky.is-anchored.is-at-bottom { + bottom: 0; } + +body.is-reveal-open { + overflow: hidden; } + +html.is-reveal-open, +html.is-reveal-open body { + min-height: 100%; + overflow: hidden; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } + +.reveal-overlay { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1005; + display: none; + background-color: rgba(10, 10, 10, 0.45); + overflow-y: scroll; } + +.reveal { + z-index: 1006; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + display: none; + padding: 1rem; + border: 1px solid #cacaca; + border-radius: 0; + background-color: #fefefe; + position: relative; + top: 100px; + margin-right: auto; + margin-left: auto; + overflow-y: auto; } + [data-whatinput='mouse'] .reveal { + outline: 0; } + @media print, screen and (min-width: 40em) { + .reveal { + min-height: 0; } } + .reveal .column, .reveal .columns, + .reveal .columns { + min-width: 0; } + .reveal > :last-child { + margin-bottom: 0; } + @media print, screen and (min-width: 40em) { + .reveal { + width: 600px; + max-width: 75rem; } } + @media print, screen and (min-width: 40em) { + .reveal .reveal { + right: auto; + left: auto; + margin: 0 auto; } } + .reveal.collapse { + padding: 0; } + @media print, screen and (min-width: 40em) { + .reveal.tiny { + width: 30%; + max-width: 75rem; } } + @media print, screen and (min-width: 40em) { + .reveal.small { + width: 50%; + max-width: 75rem; } } + @media print, screen and (min-width: 40em) { + .reveal.large { + width: 90%; + max-width: 75rem; } } + .reveal.full { + top: 0; + left: 0; + width: 100%; + max-width: none; + height: 100%; + height: 100vh; + min-height: 100vh; + margin-left: 0; + border: 0; + border-radius: 0; } + @media screen and (max-width: 39.9375em) { + .reveal { + top: 0; + left: 0; + width: 100%; + max-width: none; + height: 100%; + height: 100vh; + min-height: 100vh; + margin-left: 0; + border: 0; + border-radius: 0; } } + .reveal.without-overlay { + position: fixed; } + +.switch { + height: 2rem; + position: relative; + margin-bottom: 1rem; + outline: 0; + font-size: 0.875rem; + font-weight: bold; + color: #fefefe; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } + +.switch-input { + position: absolute; + margin-bottom: 0; + opacity: 0; } + +.switch-paddle { + position: relative; + display: block; + width: 4rem; + height: 2rem; + border-radius: 0; + background: #cacaca; + -webkit-transition: all 0.25s ease-out; + transition: all 0.25s ease-out; + font-weight: inherit; + color: inherit; + cursor: pointer; } + input + .switch-paddle { + margin: 0; } + .switch-paddle::after { + position: absolute; + top: 0.25rem; + left: 0.25rem; + display: block; + width: 1.5rem; + height: 1.5rem; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + border-radius: 0; + background: #fefefe; + -webkit-transition: all 0.25s ease-out; + transition: all 0.25s ease-out; + content: ''; } + input:checked ~ .switch-paddle { + background: #1779ba; } + input:checked ~ .switch-paddle::after { + left: 2.25rem; } + [data-whatinput='mouse'] input:focus ~ .switch-paddle { + outline: 0; } + +.switch-active, .switch-inactive { + position: absolute; + top: 50%; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); } + +.switch-active { + left: 8%; + display: none; } + input:checked + label > .switch-active { + display: block; } + +.switch-inactive { + right: 15%; } + input:checked + label > .switch-inactive { + display: none; } + +.switch.tiny { + height: 1.5rem; } + .switch.tiny .switch-paddle { + width: 3rem; + height: 1.5rem; + font-size: 0.625rem; } + .switch.tiny .switch-paddle::after { + top: 0.25rem; + left: 0.25rem; + width: 1rem; + height: 1rem; } + .switch.tiny input:checked ~ .switch-paddle::after { + left: 1.75rem; } + +.switch.small { + height: 1.75rem; } + .switch.small .switch-paddle { + width: 3.5rem; + height: 1.75rem; + font-size: 0.75rem; } + .switch.small .switch-paddle::after { + top: 0.25rem; + left: 0.25rem; + width: 1.25rem; + height: 1.25rem; } + .switch.small input:checked ~ .switch-paddle::after { + left: 2rem; } + +.switch.large { + height: 2.5rem; } + .switch.large .switch-paddle { + width: 5rem; + height: 2.5rem; + font-size: 1rem; } + .switch.large .switch-paddle::after { + top: 0.25rem; + left: 0.25rem; + width: 2rem; + height: 2rem; } + .switch.large input:checked ~ .switch-paddle::after { + left: 2.75rem; } + +table { + width: 100%; + margin-bottom: 1rem; + border-radius: 0; } + table thead, + table tbody, + table tfoot { + border: 1px solid #f1f1f1; + background-color: #fefefe; } + table caption { + padding: 0.5rem 0.625rem 0.625rem; + font-weight: bold; } + table thead { + background: #f8f8f8; + color: #0a0a0a; } + table tfoot { + background: #f1f1f1; + color: #0a0a0a; } + table thead tr, + table tfoot tr { + background: transparent; } + table thead th, + table thead td, + table tfoot th, + table tfoot td { + padding: 0.5rem 0.625rem 0.625rem; + font-weight: bold; + text-align: left; } + table tbody th, + table tbody td { + padding: 0.5rem 0.625rem 0.625rem; } + table tbody tr:nth-child(even) { + border-bottom: 0; + background-color: #f1f1f1; } + table.unstriped tbody { + background-color: #fefefe; } + table.unstriped tbody tr { + border-bottom: 0; + border-bottom: 1px solid #f1f1f1; + background-color: #fefefe; } + +@media screen and (max-width: 63.9375em) { + table.stack thead { + display: none; } + table.stack tfoot { + display: none; } + table.stack tr, + table.stack th, + table.stack td { + display: block; } + table.stack td { + border-top: 0; } } + +table.scroll { + display: block; + width: 100%; + overflow-x: auto; } + +table.hover thead tr:hover { + background-color: #f3f3f3; } + +table.hover tfoot tr:hover { + background-color: #ececec; } + +table.hover tbody tr:hover { + background-color: #f9f9f9; } + +table.hover:not(.unstriped) tr:nth-of-type(even):hover { + background-color: #ececec; } + +.table-scroll { + overflow-x: auto; } + .table-scroll table { + width: auto; } + +.tabs { + margin: 0; + border: 1px solid #e6e6e6; + background: #fefefe; + list-style-type: none; } + .tabs::before, .tabs::after { + display: table; + content: ' '; } + .tabs::after { + clear: both; } + +.tabs.vertical > li { + display: block; + float: none; + width: auto; } + +.tabs.simple > li > a { + padding: 0; } + .tabs.simple > li > a:hover { + background: transparent; } + +.tabs.primary { + background: #1779ba; } + .tabs.primary > li > a { + color: #fefefe; } + .tabs.primary > li > a:hover, .tabs.primary > li > a:focus { + background: #1673b1; } + +.tabs-title { + float: left; } + .tabs-title > a { + display: block; + padding: 1.25rem 1.5rem; + font-size: 0.75rem; + line-height: 1; + color: #1779ba; } + .tabs-title > a:hover { + background: #fefefe; + color: #1468a0; } + .tabs-title > a:focus, .tabs-title > a[aria-selected='true'] { + background: #e6e6e6; + color: #1779ba; } + +.tabs-content { + border: 1px solid #e6e6e6; + border-top: 0; + background: #fefefe; + color: #0a0a0a; + -webkit-transition: all 0.5s ease; + transition: all 0.5s ease; } + +.tabs-content.vertical { + border: 1px solid #e6e6e6; + border-left: 0; } + +.tabs-panel { + display: none; + padding: 1rem; } + .tabs-panel[aria-hidden="false"] { + display: block; } + +.thumbnail { + display: inline-block; + max-width: 100%; + margin-bottom: 1rem; + border: solid 4px #fefefe; + border-radius: 0; + -webkit-box-shadow: 0 0 0 1px rgba(10, 10, 10, 0.2); + box-shadow: 0 0 0 1px rgba(10, 10, 10, 0.2); + line-height: 0; } + +a.thumbnail { + -webkit-transition: -webkit-box-shadow 200ms ease-out; + transition: -webkit-box-shadow 200ms ease-out; + transition: box-shadow 200ms ease-out; + transition: box-shadow 200ms ease-out, -webkit-box-shadow 200ms ease-out; } + a.thumbnail:hover, a.thumbnail:focus { + -webkit-box-shadow: 0 0 6px 1px rgba(23, 121, 186, 0.5); + box-shadow: 0 0 6px 1px rgba(23, 121, 186, 0.5); } + a.thumbnail image { + -webkit-box-shadow: none; + box-shadow: none; } + +.title-bar { + padding: 0.5rem; + background: #0a0a0a; + color: #fefefe; } + .title-bar::before, .title-bar::after { + display: table; + content: ' '; } + .title-bar::after { + clear: both; } + .title-bar .menu-icon { + margin-left: 0.25rem; + margin-right: 0.25rem; } + +.title-bar-left { + float: left; } + +.title-bar-right { + float: right; + text-align: right; } + +.title-bar-title { + display: inline-block; + vertical-align: middle; + font-weight: bold; } + +.has-tip { + position: relative; + display: inline-block; + border-bottom: dotted 1px #8a8a8a; + font-weight: bold; + cursor: help; } + +.tooltip { + position: absolute; + top: calc(100% + 0.6495rem); + z-index: 1200; + max-width: 10rem; + padding: 0.75rem; + border-radius: 0; + background-color: #0a0a0a; + font-size: 80%; + color: #fefefe; } + .tooltip::before { + display: block; + width: 0; + height: 0; + border: inset 0.75rem; + content: ''; + border-top-width: 0; + border-bottom-style: solid; + border-color: transparent transparent #0a0a0a; + position: absolute; + bottom: 100%; + left: 50%; + -webkit-transform: translateX(-50%); + -ms-transform: translateX(-50%); + transform: translateX(-50%); } + .tooltip.top::before { + display: block; + width: 0; + height: 0; + border: inset 0.75rem; + content: ''; + border-bottom-width: 0; + border-top-style: solid; + border-color: #0a0a0a transparent transparent; + top: 100%; + bottom: auto; } + .tooltip.left::before { + display: block; + width: 0; + height: 0; + border: inset 0.75rem; + content: ''; + border-right-width: 0; + border-left-style: solid; + border-color: transparent transparent transparent #0a0a0a; + top: 50%; + bottom: auto; + left: 100%; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); } + .tooltip.right::before { + display: block; + width: 0; + height: 0; + border: inset 0.75rem; + content: ''; + border-left-width: 0; + border-right-style: solid; + border-color: transparent #0a0a0a transparent transparent; + top: 50%; + right: 100%; + bottom: auto; + left: auto; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); } + +.top-bar { + padding: 0.5rem; } + .top-bar::before, .top-bar::after { + display: table; + content: ' '; } + .top-bar::after { + clear: both; } + .top-bar, + .top-bar ul { + background-color: #e6e6e6; } + .top-bar input { + max-width: 200px; + margin-right: 1rem; } + .top-bar .input-group-field { + width: 100%; + margin-right: 0; } + .top-bar input.button { + width: auto; } + .top-bar .top-bar-left, + .top-bar .top-bar-right { + width: 100%; } + @media print, screen and (min-width: 40em) { + .top-bar .top-bar-left, + .top-bar .top-bar-right { + width: auto; } } + @media screen and (max-width: 63.9375em) { + .top-bar.stacked-for-medium .top-bar-left, + .top-bar.stacked-for-medium .top-bar-right { + width: 100%; } } + @media screen and (max-width: 74.9375em) { + .top-bar.stacked-for-large .top-bar-left, + .top-bar.stacked-for-large .top-bar-right { + width: 100%; } } + +.top-bar-title { + display: inline-block; + float: left; + padding: 0.5rem 1rem 0.5rem 0; } + .top-bar-title .menu-icon { + bottom: 2px; } + +.top-bar-left { + float: left; } + +.top-bar-right { + float: right; } + +.hide { + display: none !important; } + +.invisible { + visibility: hidden; } + +@media screen and (max-width: 39.9375em) { + .hide-for-small-only { + display: none !important; } } + +@media screen and (max-width: 0em), screen and (min-width: 40em) { + .show-for-small-only { + display: none !important; } } + +@media print, screen and (min-width: 40em) { + .hide-for-medium { + display: none !important; } } + +@media screen and (max-width: 39.9375em) { + .show-for-medium { + display: none !important; } } + +@media screen and (min-width: 40em) and (max-width: 63.9375em) { + .hide-for-medium-only { + display: none !important; } } + +@media screen and (max-width: 39.9375em), screen and (min-width: 64em) { + .show-for-medium-only { + display: none !important; } } + +@media print, screen and (min-width: 64em) { + .hide-for-large { + display: none !important; } } + +@media screen and (max-width: 63.9375em) { + .show-for-large { + display: none !important; } } + +@media screen and (min-width: 64em) and (max-width: 74.9375em) { + .hide-for-large-only { + display: none !important; } } + +@media screen and (max-width: 63.9375em), screen and (min-width: 75em) { + .show-for-large-only { + display: none !important; } } + +.show-for-sr, +.show-on-focus { + position: absolute !important; + width: 1px; + height: 1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); } + +.show-on-focus:active, .show-on-focus:focus { + position: static !important; + width: auto; + height: auto; + overflow: visible; + clip: auto; } + +.show-for-landscape, +.hide-for-portrait { + display: block !important; } + @media screen and (orientation: landscape) { + .show-for-landscape, + .hide-for-portrait { + display: block !important; } } + @media screen and (orientation: portrait) { + .show-for-landscape, + .hide-for-portrait { + display: none !important; } } + +.hide-for-landscape, +.show-for-portrait { + display: none !important; } + @media screen and (orientation: landscape) { + .hide-for-landscape, + .show-for-portrait { + display: none !important; } } + @media screen and (orientation: portrait) { + .hide-for-landscape, + .show-for-portrait { + display: block !important; } } + +.float-left { + float: left !important; } + +.float-right { + float: right !important; } + +.float-center { + display: block; + margin-right: auto; + margin-left: auto; } + +.clearfix::before, .clearfix::after { + display: table; + content: ' '; } + +.clearfix::after { + clear: both; } + +/*# sourceMappingURL=foundation.css.map */ diff --git a/config/routes.rb b/config/routes.rb index a59c7a484d..acbbb20943 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,5 @@ Rails.application.routes.draw do # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html - + resources :work end diff --git a/test/models/work_test.rb b/test/models/work_test.rb index 41631c4479..42c5f4e494 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -24,7 +24,7 @@ end - it "requires a title " do # why is there only one test? + it "requires a title invalid without" do # why is there only one test? work = Work.new is_valid = work.valid? is_valid.must_equal false #why is it false, copied from the books example From 1e6f51071d97d2c01b78c791fbbc8dcf2fbdef09 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Fri, 13 Oct 2017 12:29:16 -0700 Subject: [PATCH 07/56] made seed.rb file and user seed data file with seed seed data --- .DS_Store | Bin 0 -> 6148 bytes db/.DS_Store | Bin 0 -> 6148 bytes db/{ => seed_data}/media_seeds.csv | 0 db/seed_data/user_seeds.csv | 1 + db/seeds.rb | 78 +++++++++++++++++++++++++++++ 5 files changed, 79 insertions(+) create mode 100644 .DS_Store create mode 100644 db/.DS_Store rename db/{ => seed_data}/media_seeds.csv (100%) create mode 100644 db/seed_data/user_seeds.csv diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..380ad3887f52be96eeef8b471abe2a5fb1326501 GIT binary patch literal 6148 zcmeH~u?oUK42F~HP;lw!c#99<8yuxRfiECZaFGgv&iCm4$z`!ROOZd2e3x89+kfaa zBBK3c+>3M~(!!0hvoJG7-pDBD=kY#WZ_@?2)y$d-&r$1SwjbLB6`%rCfC^9nDzG30 z;v8=`3wkC#3KgIN%TU0+4+(C}!BXj;4g?jDS;a)h^^03>!4Z{cp(PqqMauvDS~jhxTkKrCz0GQJqaquuTzwbV=tI8OW&NCh`V2gKbKR1)=^9kqP;0-%o!%zO} z{`qD9lqa93Dk}w~fE17dQa}p)LILl+wE1nKq7;wR+`j)_T!)$n2UWUC3q;^{oUMLDb|DoOz< zaH_y{ZWrGF*YpeX|0zj3DIf*@l>#0j)_5MKIlaK47e^bDe%_{d;zW$6-@vD literal 0 HcmV?d00001 diff --git a/db/media_seeds.csv b/db/seed_data/media_seeds.csv similarity index 100% rename from db/media_seeds.csv rename to db/seed_data/media_seeds.csv diff --git a/db/seed_data/user_seeds.csv b/db/seed_data/user_seeds.csv new file mode 100644 index 0000000000..348959e951 --- /dev/null +++ b/db/seed_data/user_seeds.csv @@ -0,0 +1 @@ +firstname Aaron Aaron Abbey Abbie Abby Abdul Abe Abel Abigail Abraham Abram Ada Adah Adalberto Adaline Adam Adam Adan Addie Adela Adelaida Adelaide Adele Adelia Adelina Adeline Adell Adella Adelle Adena Adina Adolfo Adolph Adria Adrian Adrian Adriana Adriane Adrianna Adrianne Adrien Adriene Adrienne Afton Agatha Agnes Agnus Agripina Agueda Agustin Agustina Ahmad Ahmed Ai Aida Aide Aiko Aileen Ailene Aimee Aisha Aja Akiko Akilah Al Alaina Alaine Alan Alana Alane Alanna Alayna Alba Albert Albert Alberta Albertha Albertina Albertine Alberto Albina Alda Alden Aldo Alease Alec Alecia Aleen Aleida Aleisha Alejandra Alejandrina Alejandro Alena Alene Alesha Aleshia Alesia Alessandra Aleta Aletha Alethea Alethia Alex Alex Alexa Alexander Alexander Alexandra Alexandria Alexia Alexis Alexis Alfonso Alfonzo Alfred Alfreda Alfredia Alfredo Ali Ali Alia Alica Alice Alicia Alida Alina Aline Alisa Alise Alisha Alishia Alisia Alison Alissa Alita Alix Aliza Alla Allan Alleen Allegra Allen Allen Allena Allene Allie Alline Allison Allyn Allyson Alma Almeda Almeta Alona Alonso Alonzo Alpha Alphonse Alphonso Alta Altagracia Altha Althea Alton Alva Alva Alvaro Alvera Alverta Alvin Alvina Alyce Alycia Alysa Alyse Alysha Alysia Alyson Alyssa Amada Amado Amal Amalia Amanda Amber Amberly Ambrose Amee Amelia America Ami Amie Amiee Amina Amira Ammie Amos Amparo Amy An Ana Anabel Analisa Anamaria Anastacia Anastasia Andera Anderson Andra Andre Andre Andrea Andrea Andreas Andree Andres Andrew Andrew Andria Andy Anette Angel Angel Angela Angele Angelena Angeles Angelia Angelic Angelica Angelika Angelina Angeline Angelique Angelita Angella Angelo Angelo Angelyn Angie Angila Angla Angle Anglea Anh Anibal Anika Anisa Anisha Anissa Anita Anitra Anja Anjanette Anjelica Ann Anna Annabel Annabell Annabelle Annalee Annalisa Annamae Annamaria Annamarie Anne Anneliese Annelle Annemarie Annett Annetta Annette Annice Annie Annika Annis Annita Annmarie Anthony Anthony Antione Antionette Antoine Antoinette Anton Antone Antonetta Antonette Antonia Antonia Antonietta Antonina Antonio Antonio Antony Antwan Anya Apolonia April Apryl Ara Araceli Aracelis Aracely Arcelia Archie Ardath Ardelia Ardell Ardella Ardelle Arden Ardis Ardith Aretha Argelia Argentina Ariana Ariane Arianna Arianne Arica Arie Ariel Ariel Arielle Arla Arlean Arleen Arlen Arlena Arlene Arletha Arletta Arlette Arlie Arlinda Arline Arlyne Armand Armanda Armandina Armando Armida Arminda Arnetta Arnette Arnita Arnold Arnoldo Arnulfo Aron Arron Art Arthur Arthur Artie Arturo Arvilla Asa Asha Ashanti Ashely Ashlea Ashlee Ashleigh Ashley Ashley Ashli Ashlie Ashly Ashlyn Ashton Asia Asley Assunta Astrid Asuncion Athena Aubrey Aubrey Audie Audra Audrea Audrey Audria Audrie Audry August Augusta Augustina Augustine Augustine Augustus Aundrea Aura Aurea Aurelia Aurelio Aurora Aurore Austin Austin Autumn Ava Avelina Avery Avery Avis Avril Awilda Ayako Ayana Ayanna Ayesha Azalee Azucena Azzie Babara Babette Bailey Bambi Bao Barabara Barb Barbar Barbara Barbera Barbie Barbra Bari Barney Barrett Barrie Barry Bart Barton Basil Basilia Bea Beata Beatrice Beatris Beatriz Beau Beaulah Bebe Becki Beckie Becky Bee Belen Belia Belinda Belkis Bell Bella Belle Belva Ben Benedict Benita Benito Benjamin Bennett Bennie Bennie Benny Benton Berenice Berna Bernadette Bernadine Bernard Bernarda Bernardina Bernardine Bernardo Berneice Bernetta Bernice Bernie Bernie Berniece Bernita Berry Berry Bert Berta Bertha Bertie Bertram Beryl Bess Bessie Beth Bethanie Bethann Bethany Bethel Betsey Betsy Bette Bettie Bettina Betty Bettyann Bettye Beula Beulah Bev Beverlee Beverley Beverly Bianca Bibi Bill Billi Billie Billie Billy Billy Billye Birdie Birgit Blaine Blair Blair Blake Blake Blanca Blanch Blanche Blondell Blossom Blythe Bo Bob Bobbi Bobbie Bobbie Bobby Bobby Bobbye Bobette Bok Bong Bonita Bonnie Bonny Booker Boris Boyce Boyd Brad Bradford Bradley Bradly Brady Brain Branda Brande Brandee Branden Brandi Brandie Brandon Brandon Brandy Brant Breana Breann Breanna Breanne Bree Brenda Brendan Brendon Brenna Brent Brenton Bret Brett Brett Brian Brian Briana Brianna Brianne Brice Bridget Bridgett Bridgette Brigette Brigid Brigida Brigitte Brinda Britany Britney Britni Britt Britt Britta Brittaney Brittani Brittanie Brittany Britteny Brittney Brittni Brittny Brock Broderick Bronwyn Brook Brooke Brooks Bruce Bruna Brunilda Bruno Bryan Bryanna Bryant Bryce Brynn Bryon Buck Bud Buddy Buena Buffy Buford Bula Bulah Bunny Burl Burma Burt Burton Buster Byron Caitlin Caitlyn Calandra Caleb Calista Callie Calvin Camelia Camellia Cameron Cameron Cami Camie Camila Camilla Camille Cammie Cammy Candace Candance Candelaria Candi Candice Candida Candie Candis Candra Candy Candyce Caprice Cara Caren Carey Carey Cari Caridad Carie Carin Carina Carisa Carissa Carita Carl Carl Carla Carlee Carleen Carlena Carlene Carletta Carley Carli Carlie Carline Carlita Carlo Carlos Carlos Carlota Carlotta Carlton Carly Carlyn Carma Carman Carmel Carmela Carmelia Carmelina Carmelita Carmella Carmelo Carmen Carmen Carmina Carmine Carmon Carol Carol Carola Carolann Carole Carolee Carolin Carolina Caroline Caroll Carolyn Carolyne Carolynn Caron Caroyln Carri Carrie Carrol Carrol Carroll Carroll Carry Carson Carter Cary Cary Caryl Carylon Caryn Casandra Casey Casey Casie Casimira Cassandra Cassaundra Cassey Cassi Cassidy Cassie Cassondra Cassy Catalina Catarina Caterina Catharine Catherin Catherina Catherine Cathern Catheryn Cathey Cathi Cathie Cathleen Cathrine Cathryn Cathy Catina Catrice Catrina Cayla Cecelia Cecil Cecil Cecila Cecile Cecilia Cecille Cecily Cedric Cedrick Celena Celesta Celeste Celestina Celestine Celia Celina Celinda Celine Celsa Ceola Cesar Chad Chadwick Chae Chan Chana Chance Chanda Chandra Chanel Chanell Chanelle Chang Chang Chantal Chantay Chante Chantel Chantell Chantelle Chara Charis Charise Charissa Charisse Charita Charity Charla Charleen Charlena Charlene Charles Charles Charlesetta Charlette Charley Charlie Charlie Charline Charlott Charlotte Charlsie Charlyn Charmain Charmaine Charolette Chas Chase Chasidy Chasity Chassidy Chastity Chau Chauncey Chaya Chelsea Chelsey Chelsie Cher Chere Cheree Cherelle Cheri Cherie Cherilyn Cherise Cherish Cherly Cherlyn Cherri Cherrie Cherry Cherryl Chery Cheryl Cheryle Cheryll Chester Chet Cheyenne Chi Chi Chia Chieko Chin China Ching Chiquita Chloe Chong Chong Chris Chris Chrissy Christa Christal Christeen Christel Christen Christena Christene Christi Christia Christian Christian Christiana Christiane Christie Christin Christina Christine Christinia Christoper Christopher Christopher Christy Chrystal Chu Chuck Chun Chung Chung Ciara Cicely Ciera Cierra Cinda Cinderella Cindi Cindie Cindy Cinthia Cira Clair Clair Claire Clara Clare Clarence Clarence Claretha Claretta Claribel Clarice Clarinda Clarine Claris Clarisa Clarissa Clarita Clark Classie Claud Claude Claude Claudette Claudia Claudie Claudine Claudio Clay Clayton Clelia Clemencia Clement Clemente Clementina Clementine Clemmie Cleo Cleo Cleopatra Cleora Cleotilde Cleta Cletus Cleveland Cliff Clifford Clifton Clint Clinton Clora Clorinda Clotilde Clyde Clyde Codi Cody Cody Colby Colby Cole Coleen Coleman Colene Coletta Colette Colin Colleen Collen Collene Collette Collin Colton Columbus Concepcion Conception Concetta Concha Conchita Connie Connie Conrad Constance Consuela Consuelo Contessa Cora Coral Coralee Coralie Corazon Cordelia Cordell Cordia Cordie Coreen Corene Coretta Corey Corey Cori Corie Corina Corine Corinna Corinne Corliss Cornelia Cornelius Cornell Corrie Corrin Corrina Corrine Corrinne Cortez Cortney Cory Cory Courtney Courtney Coy Craig Creola Cris Criselda Crissy Crista Cristal Cristen Cristi Cristie Cristin Cristina Cristine Cristobal Cristopher Cristy Cruz Cruz Crysta Crystal Crystle Cuc Curt Curtis Curtis Cyndi Cyndy Cynthia Cyril Cyrstal Cyrus Cythia Dacia Dagmar Dagny Dahlia Daina Daine Daisey Daisy Dakota Dale Dale Dalene Dalia Dalila Dallas Dallas Dalton Damaris Damian Damien Damion Damon Dan Dan Dana Dana Danae Dane Danelle Danette Dani Dania Danial Danica Daniel Daniel Daniela Daniele Daniell Daniella Danielle Danika Danille Danilo Danita Dann Danna Dannette Dannie Dannie Dannielle Danny Dante Danuta Danyel Danyell Danyelle Daphine Daphne Dara Darby Darcel Darcey Darci Darcie Darcy Darell Daren Daria Darin Dario Darius Darla Darleen Darlena Darlene Darline Darnell Darnell Daron Darrel Darrell Darren Darrick Darrin Darron Darryl Darwin Daryl Daryl Dave David David Davida Davina Davis Dawn Dawna Dawne Dayle Dayna Daysi Deadra Dean Dean Deana Deandra Deandre Deandrea Deane Deangelo Deann Deanna Deanne Deb Debbi Debbie Debbra Debby Debera Debi Debora Deborah Debra Debrah Debroah Dede Dedra Dee Dee Deeann Deeanna Deedee Deedra Deena Deetta Deidra Deidre Deirdre Deja Del Delaine Delana Delbert Delcie Delena Delfina Delia Delicia Delila Delilah Delinda Delisa Dell Della Delma Delmar Delmer Delmy Delois Deloise Delora Deloras Delores Deloris Delorse Delpha Delphia Delphine Delsie Delta Demarcus Demetra Demetria Demetrice Demetrius Demetrius Dena Denae Deneen Denese Denice Denis Denise Denisha Denisse Denita Denna Dennis Dennis Dennise Denny Denny Denver Denyse Deon Deon Deonna Derek Derick Derrick Deshawn Desirae Desire Desiree Desmond Despina Dessie Destiny Detra Devin Devin Devon Devon Devona Devora Devorah Dewayne Dewey Dewitt Dexter Dia Diamond Dian Diana Diane Diann Dianna Dianne Dick Diedra Diedre Diego Dierdre Digna Dillon Dimple Dina Dinah Dino Dinorah Dion Dion Dione Dionna Dionne Dirk Divina Dixie Dodie Dollie Dolly Dolores Doloris Domenic Domenica Dominga Domingo Dominic Dominica Dominick Dominique Dominique Dominque Domitila Domonique Don Dona Donald Donald Donella Donetta Donette Dong Dong Donita Donn Donna Donnell Donnetta Donnette Donnie Donnie Donny Donovan Donte Donya Dora Dorathy Dorcas Doreatha Doreen Dorene Doretha Dorethea Doretta Dori Doria Dorian Dorian Dorie Dorinda Dorine Doris Dorla Dorotha Dorothea Dorothy Dorris Dorsey Dortha Dorthea Dorthey Dorthy Dot Dottie Dotty Doug Douglas Douglass Dovie Doyle Dreama Drema Drew Drew Drucilla Drusilla Duane Dudley Dulce Dulcie Duncan Dung Dusti Dustin Dusty Dusty Dwain Dwana Dwayne Dwight Dyan Dylan Earl Earle Earlean Earleen Earlene Earlie Earline Earnest Earnestine Eartha Easter Eboni Ebonie Ebony Echo Ed Eda Edda Eddie Eddie Eddy Edelmira Eden Edgar Edgardo Edie Edison Edith Edmond Edmund Edmundo Edna Edra Edris Eduardo Edward Edward Edwardo Edwin Edwina Edyth Edythe Effie Efrain Efren Ehtel Eileen Eilene Ela Eladia Elaina Elaine Elana Elane Elanor Elayne Elba Elbert Elda Elden Eldon Eldora Eldridge Eleanor Eleanora Eleanore Elease Elena Elene Eleni Elenor Elenora Elenore Eleonor Eleonora Eleonore Elfreda Elfrieda Elfriede Eli Elia Eliana Elias Elicia Elida Elidia Elijah Elin Elina Elinor Elinore Elisa Elisabeth Elise Eliseo Elisha Elisha Elissa Eliz Eliza Elizabet Elizabeth Elizbeth Elizebeth Elke Ella Ellamae Ellan Ellen Ellena Elli Ellie Elliot Elliott Ellis Ellis Ellsworth Elly Ellyn Elma Elmer Elmer Elmira Elmo Elna Elnora Elodia Elois Eloisa Eloise Elouise Eloy Elroy Elsa Else Elsie Elsy Elton Elva Elvera Elvia Elvie Elvin Elvina Elvira Elvis Elwanda Elwood Elyse Elza Ema Emanuel Emelda Emelia Emelina Emeline Emely Emerald Emerita Emerson Emery Emiko Emil Emile Emilee Emilia Emilie Emilio Emily Emma Emmaline Emmanuel Emmett Emmie Emmitt Emmy Emogene Emory Ena Enda Enedina Eneida Enid Enoch Enola Enrique Enriqueta Epifania Era Erasmo Eric Eric Erica Erich Erick Ericka Erik Erika Erin Erin Erinn Erlene Erlinda Erline Erma Ermelinda Erminia Erna Ernest Ernestina Ernestine Ernesto Ernie Errol Ervin Erwin Eryn Esmeralda Esperanza Essie Esta Esteban Estefana Estela Estell Estella Estelle Ester Esther Estrella Etha Ethan Ethel Ethelene Ethelyn Ethyl Etsuko Etta Ettie Eufemia Eugena Eugene Eugene Eugenia Eugenie Eugenio Eula Eulah Eulalia Eun Euna Eunice Eura Eusebia Eusebio Eustolia Eva Evalyn Evan Evan Evangelina Evangeline Eve Evelia Evelin Evelina Eveline Evelyn Evelyne Evelynn Everett Everette Evette Evia Evie Evita Evon Evonne Ewa Exie Ezekiel Ezequiel Ezra Fabian Fabiola Fae Fairy Faith Fallon Fannie Fanny Farah Farrah Fatima Fatimah Faustina Faustino Fausto Faviola Fawn Fay Faye Fe Federico Felecia Felica Felice Felicia Felicidad Felicita Felicitas Felipa Felipe Felisa Felisha Felix Felton Ferdinand Fermin Fermina Fern Fernanda Fernande Fernando Ferne Fidel Fidela Fidelia Filiberto Filomena Fiona Flavia Fleta Fletcher Flo Flor Flora Florance Florence Florencia Florencio Florene Florentina Florentino Floretta Floria Florida Florinda Florine Florrie Flossie Floy Floyd Fonda Forest Forrest Foster Fran France Francene Frances Frances Francesca Francesco Franchesca Francie Francina Francine Francis Francis Francisca Francisco Francisco Francoise Frank Frank Frankie Frankie Franklin Franklyn Fransisca Fred Fred Freda Fredda Freddie Freddie Freddy Frederic Frederica Frederick Fredericka Fredia Fredric Fredrick Fredricka Freeda Freeman Freida Frida Frieda Fritz Fumiko Gabriel Gabriel Gabriela Gabriele Gabriella Gabrielle Gail Gail Gala Gale Gale Galen Galina Garfield Garland Garnet Garnett Garret Garrett Garry Garth Gary Gary Gaston Gavin Gay Gaye Gayla Gayle Gayle Gaylene Gaylord Gaynell Gaynelle Gearldine Gema Gemma Gena Genaro Gene Gene Genesis Geneva Genevie Genevieve Genevive Genia Genie Genna Gennie Genny Genoveva Geoffrey Georgann George George Georgeann Georgeanna Georgene Georgetta Georgette Georgia Georgiana Georgiann Georgianna Georgianne Georgie Georgina Georgine Gerald Gerald Geraldine Geraldo Geralyn Gerard Gerardo Gerda Geri Germaine German Gerri Gerry Gerry Gertha Gertie Gertrud Gertrude Gertrudis Gertude Ghislaine Gia Gianna Gidget Gigi Gil Gilbert Gilberte Gilberto Gilda Gillian Gilma Gina Ginette Ginger Ginny Gino Giovanna Giovanni Gisela Gisele Giselle Gita Giuseppe Giuseppina Gladis Glady Gladys Glayds Glen Glenda Glendora Glenn Glenn Glenna Glennie Glennis Glinda Gloria Glory Glynda Glynis Golda Golden Goldie Gonzalo Gordon Grace Gracia Gracie Graciela Grady Graham Graig Grant Granville Grayce Grazyna Greg Gregg Gregoria Gregorio Gregory Gregory Greta Gretchen Gretta Gricelda Grisel Griselda Grover Guadalupe Guadalupe Gudrun Guillermina Guillermo Gus Gussie Gustavo Guy Gwen Gwenda Gwendolyn Gwenn Gwyn Gwyneth Ha Hae Hai Hailey Hal Haley Halina Halley Hallie Han Hana Hang Hanh Hank Hanna Hannah Hannelore Hans Harlan Harland Harley Harmony Harold Harold Harriet Harriett Harriette Harris Harrison Harry Harvey Hassan Hassie Hattie Haydee Hayden Hayley Haywood Hazel Heath Heather Hector Hedwig Hedy Hee Heide Heidi Heidy Heike Helaine Helen Helena Helene Helga Hellen Henrietta Henriette Henry Henry Herb Herbert Heriberto Herlinda Herma Herman Hermelinda Hermila Hermina Hermine Herminia Herschel Hershel Herta Hertha Hester Hettie Hiedi Hien Hilaria Hilario Hilary Hilda Hilde Hildegard Hildegarde Hildred Hillary Hilma Hilton Hipolito Hiram Hiroko Hisako Hoa Hobert Holley Holli Hollie Hollis Hollis Holly Homer Honey Hong Hong Hope Horace Horacio Hortencia Hortense Hortensia Hosea Houston Howard Hoyt Hsiu Hubert Hue Huey Hugh Hugo Hui Hulda Humberto Hung Hunter Huong Hwa Hyacinth Hye Hyman Hyo Hyon Hyun Ian Ida Idalia Idell Idella Iesha Ignacia Ignacio Ike Ila Ilana Ilda Ileana Ileen Ilene Iliana Illa Ilona Ilse Iluminada Ima Imelda Imogene In Ina India Indira Inell Ines Inez Inga Inge Ingeborg Inger Ingrid Inocencia Iola Iona Ione Ira Ira Iraida Irena Irene Irina Iris Irish Irma Irmgard Irvin Irving Irwin Isa Isaac Isabel Isabell Isabella Isabelle Isadora Isaiah Isaias Isaura Isela Isiah Isidra Isidro Isis Ismael Isobel Israel Isreal Issac Iva Ivan Ivana Ivelisse Ivette Ivey Ivonne Ivory Ivory Ivy Izetta Izola Ja Jacalyn Jacelyn Jacinda Jacinta Jacinto Jack Jack Jackeline Jackelyn Jacki Jackie Jackie Jacklyn Jackqueline Jackson Jaclyn Jacob Jacqualine Jacque Jacquelin Jacqueline Jacquelyn Jacquelyne Jacquelynn Jacques Jacquetta Jacqui Jacquie Jacquiline Jacquline Jacqulyn Jada Jade Jadwiga Jae Jae Jaime Jaime Jaimee Jaimie Jake Jaleesa Jalisa Jama Jamaal Jamal Jamar Jame Jame Jamee Jamel James James Jamey Jamey Jami Jamie Jamie Jamika Jamila Jamison Jammie Jan Jan Jana Janae Janay Jane Janean Janee Janeen Janel Janell Janella Janelle Janene Janessa Janet Janeth Janett Janetta Janette Janey Jani Janice Janie Janiece Janina Janine Janis Janise Janita Jann Janna Jannet Jannette Jannie January Janyce Jaqueline Jaquelyn Jared Jarod Jarred Jarrett Jarrod Jarvis Jasmin Jasmine Jason Jason Jasper Jaunita Javier Jay Jay Jaye Jayme Jaymie Jayna Jayne Jayson Jazmin Jazmine Jc Jean Jean Jeana Jeane Jeanelle Jeanene Jeanett Jeanetta Jeanette Jeanice Jeanie Jeanine Jeanmarie Jeanna Jeanne Jeannetta Jeannette Jeannie Jeannine Jed Jeff Jefferey Jefferson Jeffery Jeffie Jeffrey Jeffrey Jeffry Jen Jena Jenae Jene Jenee Jenell Jenelle Jenette Jeneva Jeni Jenice Jenifer Jeniffer Jenine Jenise Jenna Jennefer Jennell Jennette Jenni Jennie Jennifer Jenniffer Jennine Jenny Jerald Jeraldine Jeramy Jere Jeremiah Jeremy Jeremy Jeri Jerica Jerilyn Jerlene Jermaine Jerold Jerome Jeromy Jerrell Jerri Jerrica Jerrie Jerrod Jerrold Jerry Jerry Jesenia Jesica Jess Jesse Jesse Jessenia Jessi Jessia Jessica Jessie Jessie Jessika Jestine Jesus Jesus Jesusa Jesusita Jetta Jettie Jewel Jewel Jewell Jewell Ji Jill Jillian Jim Jimmie Jimmie Jimmy Jimmy Jin Jina Jinny Jo Joan Joan Joana Joane Joanie Joann Joanna Joanne Joannie Joaquin Joaquina Jocelyn Jodee Jodi Jodie Jody Jody Joe Joe Joeann Joel Joel Joella Joelle Joellen Joesph Joetta Joette Joey Joey Johana Johanna Johanne John John Johna Johnathan Johnathon Johnetta Johnette Johnie Johnie Johnna Johnnie Johnnie Johnny Johnny Johnsie Johnson Joi Joie Jolanda Joleen Jolene Jolie Joline Jolyn Jolynn Jon Jon Jona Jonah Jonas Jonathan Jonathon Jone Jonell Jonelle Jong Joni Jonie Jonna Jonnie Jordan Jordan Jordon Jorge Jose Jose Josef Josefa Josefina Josefine Joselyn Joseph Joseph Josephina Josephine Josette Josh Joshua Joshua Josiah Josie Joslyn Jospeh Josphine Josue Jovan Jovita Joy Joya Joyce Joycelyn Joye Juan Juan Juana Juanita Jude Jude Judi Judie Judith Judson Judy Jule Julee Julene Jules Juli Julia Julian Julian Juliana Juliane Juliann Julianna Julianne Julie Julieann Julienne Juliet Julieta Julietta Juliette Julio Julio Julissa Julius June Jung Junie Junior Junita Junko Justa Justin Justin Justina Justine Jutta Ka Kacey Kaci Kacie Kacy Kai Kaila Kaitlin Kaitlyn Kala Kaleigh Kaley Kali Kallie Kalyn Kam Kamala Kami Kamilah Kandace Kandi Kandice Kandis Kandra Kandy Kanesha Kanisha Kara Karan Kareem Kareen Karen Karena Karey Kari Karie Karima Karin Karina Karine Karisa Karissa Karl Karl Karla Karleen Karlene Karly Karlyn Karma Karmen Karol Karole Karoline Karolyn Karon Karren Karri Karrie Karry Kary Karyl Karyn Kasandra Kasey Kasey Kasha Kasi Kasie Kassandra Kassie Kate Katelin Katelyn Katelynn Katerine Kathaleen Katharina Katharine Katharyn Kathe Katheleen Katherin Katherina Katherine Kathern Katheryn Kathey Kathi Kathie Kathleen Kathlene Kathline Kathlyn Kathrin Kathrine Kathryn Kathryne Kathy Kathyrn Kati Katia Katie Katina Katlyn Katrice Katrina Kattie Katy Kay Kayce Kaycee Kaye Kayla Kaylee Kayleen Kayleigh Kaylene Kazuko Kecia Keeley Keely Keena Keenan Keesha Keiko Keila Keira Keisha Keith Keith Keitha Keli Kelle Kellee Kelley Kelley Kelli Kellie Kelly Kelly Kellye Kelsey Kelsi Kelsie Kelvin Kemberly Ken Kena Kenda Kendal Kendall Kendall Kendra Kendrick Keneth Kenia Kenisha Kenna Kenneth Kenneth Kennith Kenny Kent Kenton Kenya Kenyatta Kenyetta Kera Keren Keri Kermit Kerri Kerrie Kerry Kerry Kerstin Kesha Keshia Keturah Keva Keven Kevin Kevin Khadijah Khalilah Kia Kiana Kiara Kiera Kiersten Kiesha Kieth Kiley Kim Kim Kimber Kimberely Kimberlee Kimberley Kimberli Kimberlie Kimberly Kimbery Kimbra Kimi Kimiko Kina Kindra King Kip Kira Kirby Kirby Kirk Kirsten Kirstie Kirstin Kisha Kit Kittie Kitty Kiyoko Kizzie Kizzy Klara Korey Kori Kortney Kory Kourtney Kraig Kris Kris Krishna Krissy Krista Kristal Kristan Kristeen Kristel Kristen Kristi Kristian Kristie Kristin Kristina Kristine Kristle Kristofer Kristopher Kristy Kristyn Krysta Krystal Krysten Krystin Krystina Krystle Krystyna Kum Kurt Kurtis Kyla Kyle Kyle Kylee Kylie Kym Kymberly Kyoko Kyong Kyra Kyung Lacey Lachelle Laci Lacie Lacresha Lacy Lacy Ladawn Ladonna Lady Lael Lahoma Lai Laila Laine Lajuana Lakeesha Lakeisha Lakendra Lakenya Lakesha Lakeshia Lakia Lakiesha Lakisha Lakita Lala Lamar Lamonica Lamont Lan Lana Lance Landon Lane Lane Lanell Lanelle Lanette Lang Lani Lanie Lanita Lannie Lanny Lanora Laquanda Laquita Lara Larae Laraine Laree Larhonda Larisa Larissa Larita Laronda Larraine Larry Larry Larue Lasandra Lashanda Lashandra Lashaun Lashaunda Lashawn Lashawna Lashawnda Lashay Lashell Lashon Lashonda Lashunda Lasonya Latanya Latarsha Latasha Latashia Latesha Latia Laticia Latina Latisha Latonia Latonya Latoria Latosha Latoya Latoyia Latrice Latricia Latrina Latrisha Launa Laura Lauralee Lauran Laure Laureen Laurel Lauren Lauren Laurena Laurence Laurence Laurene Lauretta Laurette Lauri Laurice Laurie Laurinda Laurine Lauryn Lavada Lavelle Lavenia Lavera Lavern Lavern Laverna Laverne Laverne Laveta Lavette Lavina Lavinia Lavon Lavona Lavonda Lavone Lavonia Lavonna Lavonne Lawana Lawanda Lawanna Lawerence Lawrence Lawrence Layla Layne Lazaro Le Lea Leah Lean Leana Leandra Leandro Leann Leanna Leanne Leanora Leatha Leatrice Lecia Leda Lee Lee Leeann Leeanna Leeanne Leena Leesa Leia Leida Leif Leigh Leigh Leigha Leighann Leila Leilani Leisa Leisha Lekisha Lela Lelah Leland Lelia Lemuel Len Lena Lenard Lenita Lenna Lennie Lenny Lenora Lenore Leo Leo Leola Leoma Leon Leon Leona Leonard Leonarda Leonardo Leone Leonel Leonia Leonida Leonie Leonila Leonor Leonora Leonore Leontine Leopoldo Leora Leota Lera Leroy Les Lesa Lesha Lesia Leslee Lesley Lesley Lesli Leslie Leslie Lessie Lester Lester Leta Letha Leticia Letisha Letitia Lettie Letty Levi Lewis Lewis Lexie Lezlie Li Lia Liana Liane Lianne Libbie Libby Liberty Librada Lida Lidia Lien Lieselotte Ligia Lila Lili Lilia Lilian Liliana Lilla Lilli Lillia Lilliam Lillian Lilliana Lillie Lilly Lily Lin Lina Lincoln Linda Lindsay Lindsay Lindsey Lindsey Lindsy Lindy Linette Ling Linh Linn Linnea Linnie Lino Linsey Linwood Lionel Lisa Lisabeth Lisandra Lisbeth Lise Lisette Lisha Lissa Lissette Lita Livia Liz Liza Lizabeth Lizbeth Lizeth Lizette Lizzette Lizzie Lloyd Loan Logan Logan Loida Lois Loise Lola Lolita Loma Lon Lona Londa Long Loni Lonna Lonnie Lonnie Lonny Lora Loraine Loralee Lore Lorean Loree Loreen Lorelei Loren Loren Lorena Lorene Lorenza Lorenzo Loreta Loretta Lorette Lori Loria Loriann Lorie Lorilee Lorina Lorinda Lorine Loris Lorita Lorna Lorraine Lorretta Lorri Lorriane Lorrie Lorrine Lory Lottie Lou Lou Louann Louanne Louella Louetta Louie Louie Louis Louis Louisa Louise Loura Lourdes Lourie Louvenia Love Lovella Lovetta Lovie Lowell Loyce Loyd Lu Luana Luann Luanna Luanne Luba Lucas Luci Lucia Luciana Luciano Lucie Lucien Lucienne Lucila Lucile Lucilla Lucille Lucina Lucinda Lucio Lucius Lucrecia Lucretia Lucy Ludie Ludivina Lue Luella Luetta Luigi Luis Luis Luisa Luise Luke Lula Lulu Luna Lupe Lupe Lupita Lura Lurlene Lurline Luther Luvenia Luz Lyda Lydia Lyla Lyle Lyman Lyn Lynda Lyndia Lyndon Lyndsay Lyndsey Lynell Lynelle Lynetta Lynette Lynn Lynn Lynna Lynne Lynnette Lynsey Lynwood Ma Mabel Mabelle Mable Mac Machelle Macie Mack Mackenzie Macy Madalene Madaline Madalyn Maddie Madelaine Madeleine Madelene Madeline Madelyn Madge Madie Madison Madlyn Madonna Mae Maegan Mafalda Magali Magaly Magan Magaret Magda Magdalen Magdalena Magdalene Magen Maggie Magnolia Mahalia Mai Maia Maida Maile Maira Maire Maisha Maisie Major Majorie Makeda Malcolm Malcom Malena Malia Malik Malika Malinda Malisa Malissa Malka Mallie Mallory Malorie Malvina Mamie Mammie Man Man Mana Manda Mandi Mandie Mandy Manie Manual Manuel Manuela Many Mao Maple Mara Maragaret Maragret Maranda Marc Marcel Marcela Marcelene Marcelina Marceline Marcelino Marcell Marcella Marcelle Marcellus Marcelo Marcene Marchelle Marci Marcia Marcie Marco Marcos Marcus Marcy Mardell Maren Marg Margaret Margareta Margarete Margarett Margaretta Margarette Margarita Margarite Margarito Margart Marge Margene Margeret Margert Margery Marget Margherita Margie Margit Margo Margorie Margot Margret Margrett Marguerita Marguerite Margurite Margy Marhta Mari Maria Maria Mariah Mariam Marian Mariana Marianela Mariann Marianna Marianne Mariano Maribel Maribeth Marica Maricela Maricruz Marie Mariel Mariela Mariella Marielle Marietta Mariette Mariko Marilee Marilou Marilu Marilyn Marilynn Marin Marina Marinda Marine Mario Mario Marion Marion Maris Marisa Marisela Marisha Marisol Marissa Marita Maritza Marivel Marjorie Marjory Mark Mark Marketta Markita Markus Marla Marlana Marleen Marlen Marlena Marlene Marlin Marlin Marline Marlo Marlon Marlyn Marlys Marna Marni Marnie Marquerite Marquetta Marquis Marquita Marquitta Marry Marsha Marshall Marshall Marta Marth Martha Marti Martin Martin Martina Martine Marty Marty Marva Marvel Marvella Marvin Marvis Marx Mary Mary Marya Maryalice Maryam Maryann Maryanna Maryanne Marybelle Marybeth Maryellen Maryetta Maryjane Maryjo Maryland Marylee Marylin Maryln Marylou Marylouise Marylyn Marylynn Maryrose Masako Mason Matha Mathew Mathilda Mathilde Matilda Matilde Matt Matthew Matthew Mattie Maud Maude Maudie Maura Maureen Maurice Maurice Mauricio Maurine Maurita Mauro Mavis Max Maxie Maxima Maximina Maximo Maxine Maxwell May Maya Maybell Maybelle Maye Mayme Maynard Mayola Mayra Mazie Mckenzie Mckinley Meagan Meaghan Mechelle Meda Mee Meg Megan Meggan Meghan Meghann Mei Mel Melaine Melani Melania Melanie Melany Melba Melda Melia Melida Melina Melinda Melisa Melissa Melissia Melita Mellie Mellisa Mellissa Melodee Melodi Melodie Melody Melonie Melony Melva Melvin Melvin Melvina Melynda Mendy Mercedes Mercedez Mercy Meredith Meri Merideth Meridith Merilyn Merissa Merle Merle Merlene Merlin Merlyn Merna Merri Merrie Merrilee Merrill Merrill Merry Mertie Mervin Meryl Meta Mi Mia Mica Micaela Micah Micah Micha Michael Michael Michaela Michaele Michal Michal Michale Micheal Micheal Michel Michel Michele Michelina Micheline Michell Michelle Michiko Mickey Mickey Micki Mickie Miesha Migdalia Mignon Miguel Miguelina Mika Mikaela Mike Mike Mikel Miki Mikki Mila Milagro Milagros Milan Milda Mildred Miles Milford Milissa Millard Millicent Millie Milly Milo Milton Mimi Min Mina Minda Mindi Mindy Minerva Ming Minh Minh Minna Minnie Minta Miquel Mira Miranda Mireille Mirella Mireya Miriam Mirian Mirna Mirta Mirtha Misha Miss Missy Misti Mistie Misty Mitch Mitchel Mitchell Mitchell Mitsue Mitsuko Mittie Mitzi Mitzie Miyoko Modesta Modesto Mohamed Mohammad Mohammed Moira Moises Mollie Molly Mona Monet Monica Monika Monique Monnie Monroe Monserrate Monte Monty Moon Mora Morgan Morgan Moriah Morris Morton Mose Moses Moshe Mozell Mozella Mozelle Mui Muoi Muriel Murray My Myesha Myles Myong Myra Myriam Myrl Myrle Myrna Myron Myrta Myrtice Myrtie Myrtis Myrtle Myung Na Nada Nadene Nadia Nadine Naida Nakesha Nakia Nakisha Nakita Nam Nan Nana Nancee Nancey Nanci Nancie Nancy Nanette Nannette Nannie Naoma Naomi Napoleon Narcisa Natacha Natalia Natalie Natalya Natasha Natashia Nathalie Nathan Nathanael Nathanial Nathaniel Natisha Natividad Natosha Neal Necole Ned Neda Nedra Neely Neida Neil Nelda Nelia Nelida Nell Nella Nelle Nellie Nelly Nelson Nena Nenita Neoma Neomi Nereida Nerissa Nery Nestor Neta Nettie Neva Nevada Neville Newton Nga Ngan Ngoc Nguyet Nia Nichelle Nichol Nicholas Nichole Nicholle Nick Nicki Nickie Nickolas Nickole Nicky Nicky Nicol Nicola Nicolas Nicolasa Nicole Nicolette Nicolle Nida Nidia Niesha Nieves Nigel Niki Nikia Nikita Nikki Nikole Nila Nilda Nilsa Nina Ninfa Nisha Nita Noah Noble Nobuko Noe Noel Noel Noelia Noella Noelle Noemi Nohemi Nola Nolan Noma Nona Nora Norah Norbert Norberto Noreen Norene Noriko Norine Norma Norman Norman Normand Norris Nova Novella Nu Nubia Numbers Numbers Nydia Nyla Obdulia Ocie Octavia Octavio Oda Odelia Odell Odell Odessa Odette Odilia Odis Ofelia Ok Ola Olen Olene Oleta Olevia Olga Olimpia Olin Olinda Oliva Olive Oliver Olivia Ollie Ollie Olympia Oma Omar Omega Omer Ona Oneida Onie Onita Opal Ophelia Ora Oralee Oralia Oren Oretha Orlando Orpha Orval Orville Oscar Oscar Ossie Osvaldo Oswaldo Otelia Otha Otha Otilia Otis Otto Ouida Owen Ozell Ozella Ozie Pa Pablo Page Paige Palma Palmer Palmira Pam Pamala Pamela Pamelia Pamella Pamila Pamula Pandora Pansy Paola Paris Paris Parker Parthenia Particia Pasquale Pasty Pat Pat Patience Patria Patrica Patrice Patricia Patricia Patrick Patrick Patrina Patsy Patti Pattie Patty Paul Paul Paula Paulene Pauletta Paulette Paulina Pauline Paulita Paz Pearl Pearle Pearlene Pearlie Pearline Pearly Pedro Peg Peggie Peggy Pei Penelope Penney Penni Pennie Penny Percy Perla Perry Perry Pete Peter Peter Petra Petrina Petronila Phebe Phil Philip Phillip Phillis Philomena Phoebe Phung Phuong Phylicia Phylis Phyliss Phyllis Pia Piedad Pierre Pilar Ping Pinkie Piper Pok Polly Porfirio Porsche Porsha Porter Portia Precious Preston Pricilla Prince Princess Priscila Priscilla Providencia Prudence Pura Qiana Queen Queenie Quentin Quiana Quincy Quinn Quinn Quintin Quinton Quyen Rachael Rachal Racheal Rachel Rachele Rachell Rachelle Racquel Rae Raeann Raelene Rafael Rafaela Raguel Raina Raisa Raleigh Ralph Ramiro Ramon Ramona Ramonita Rana Ranae Randa Randal Randall Randee Randell Randi Randolph Randy Randy Ranee Raphael Raquel Rashad Rasheeda Rashida Raul Raven Ray Ray Raye Rayford Raylene Raymon Raymond Raymond Raymonde Raymundo Rayna Rea Reagan Reanna Reatha Reba Rebbeca Rebbecca Rebeca Rebecca Rebecka Rebekah Reda Reed Reena Refugia Refugio Refugio Regan Regena Regenia Reggie Regina Reginald Regine Reginia Reid Reiko Reina Reinaldo Reita Rema Remedios Remona Rena Renae Renaldo Renata Renate Renato Renay Renda Rene Rene Renea Renee Renetta Renita Renna Ressie Reta Retha Retta Reuben Reva Rex Rey Reyes Reyna Reynalda Reynaldo Rhea Rheba Rhett Rhiannon Rhoda Rhona Rhonda Ria Ricarda Ricardo Rich Richard Richard Richelle Richie Rick Rickey Ricki Rickie Rickie Ricky Rico Rigoberto Rikki Riley Rima Rina Risa Rita Riva Rivka Rob Robbi Robbie Robbie Robbin Robby Robbyn Robena Robert Robert Roberta Roberto Roberto Robin Robin Robt Robyn Rocco Rochel Rochell Rochelle Rocio Rocky Rod Roderick Rodger Rodney Rodolfo Rodrick Rodrigo Rogelio Roger Roland Rolanda Rolande Rolando Rolf Rolland Roma Romaine Roman Romana Romelia Romeo Romona Ron Rona Ronald Ronald Ronda Roni Ronna Ronni Ronnie Ronnie Ronny Roosevelt Rory Rory Rosa Rosalba Rosalee Rosalia Rosalie Rosalina Rosalind Rosalinda Rosaline Rosalva Rosalyn Rosamaria Rosamond Rosana Rosann Rosanna Rosanne Rosaria Rosario Rosario Rosaura Roscoe Rose Roseann Roseanna Roseanne Roselee Roselia Roseline Rosella Roselle Roselyn Rosemarie Rosemary Rosena Rosenda Rosendo Rosetta Rosette Rosia Rosie Rosina Rosio Rosita Roslyn Ross Rossana Rossie Rosy Rowena Roxana Roxane Roxann Roxanna Roxanne Roxie Roxy Roy Roy Royal Royce Royce Rozanne Rozella Ruben Rubi Rubie Rubin Ruby Rubye Rudolf Rudolph Rudy Rudy Rueben Rufina Rufus Rupert Russ Russel Russell Russell Rusty Ruth Rutha Ruthann Ruthanne Ruthe Ruthie Ryan Ryan Ryann Sabina Sabine Sabra Sabrina Sacha Sachiko Sade Sadie Sadye Sage Sal Salena Salina Salley Sallie Sally Salome Salvador Salvatore Sam Sam Samantha Samara Samatha Samella Samira Sammie Sammie Sammy Sammy Samual Samuel Samuel Sana Sanda Sandee Sandi Sandie Sandra Sandy Sandy Sanford Sang Sang Sanjuana Sanjuanita Sanora Santa Santana Santiago Santina Santo Santos Santos Sara Sarah Sarai Saran Sari Sarina Sarita Sasha Saturnina Sau Saul Saundra Savanna Savannah Scarlet Scarlett Scot Scott Scott Scottie Scottie Scotty Sean Sean Season Sebastian Sebrina See Seema Selena Selene Selina Selma Sena Senaida September Serafina Serena Sergio Serina Serita Seth Setsuko Seymour Sha Shad Shae Shaina Shakia Shakira Shakita Shala Shalanda Shalon Shalonda Shameka Shamika Shan Shana Shanae Shanda Shandi Shandra Shane Shane Shaneka Shanel Shanell Shanelle Shani Shanice Shanika Shaniqua Shanita Shanna Shannan Shannon Shannon Shanon Shanta Shantae Shantay Shante Shantel Shantell Shantelle Shanti Shaquana Shaquita Shara Sharan Sharda Sharee Sharell Sharen Shari Sharice Sharie Sharika Sharilyn Sharita Sharla Sharleen Sharlene Sharmaine Sharolyn Sharon Sharonda Sharri Sharron Sharyl Sharyn Shasta Shaun Shaun Shauna Shaunda Shaunna Shaunta Shaunte Shavon Shavonda Shavonne Shawana Shawanda Shawanna Shawn Shawn Shawna Shawnda Shawnee Shawnna Shawnta Shay Shayla Shayna Shayne Shayne Shea Sheba Sheena Sheila Sheilah Shela Shelba Shelby Shelby Sheldon Shelia Shella Shelley Shelli Shellie Shelly Shelton Shemeka Shemika Shena Shenika Shenita Shenna Shera Sheree Sherell Sheri Sherice Sheridan Sherie Sherika Sherill Sherilyn Sherise Sherita Sherlene Sherley Sherly Sherlyn Sherman Sheron Sherrell Sherri Sherrie Sherril Sherrill Sherron Sherry Sherryl Sherwood Shery Sheryl Sheryll Shiela Shila Shiloh Shin Shira Shirely Shirl Shirlee Shirleen Shirlene Shirley Shirley Shirly Shizue Shizuko Shon Shona Shonda Shondra Shonna Shonta Shoshana Shu Shyla Sibyl Sid Sidney Sidney Sierra Signe Sigrid Silas Silva Silvana Silvia Sima Simon Simona Simone Simonne Sina Sindy Siobhan Sirena Siu Sixta Skye Slyvia So Socorro Sofia Soila Sol Sol Solange Soledad Solomon Somer Sommer Son Son Sona Sondra Song Sonia Sonja Sonny Sonya Soo Sook Soon Sophia Sophie Soraya Sparkle Spencer Spring Stacee Stacey Stacey Staci Stacia Stacie Stacy Stacy Stan Stanford Stanley Stanton Star Starla Starr Stasia Stefan Stefani Stefania Stefanie Stefany Steffanie Stella Stepanie Stephaine Stephan Stephane Stephani Stephania Stephanie Stephany Stephen Stephen Stephenie Stephine Stephnie Sterling Steve Steven Steven Stevie Stevie Stewart Stormy Stuart Su Suanne Sudie Sue Sueann Suellen Suk Sulema Sumiko Summer Sun Sunday Sung Sung Sunni Sunny Sunshine Susan Susana Susann Susanna Susannah Susanne Susie Susy Suzan Suzann Suzanna Suzanne Suzette Suzi Suzie Suzy Svetlana Sybil Syble Sydney Sydney Sylvester Sylvia Sylvie Synthia Syreeta Ta Tabatha Tabetha Tabitha Tad Tai Taina Taisha Tajuana Takako Takisha Talia Talisha Talitha Tam Tama Tamala Tamar Tamara Tamatha Tambra Tameika Tameka Tamekia Tamela Tamera Tamesha Tami Tamica Tamie Tamika Tamiko Tamisha Tammara Tammera Tammi Tammie Tammy Tamra Tana Tandra Tandy Taneka Tanesha Tangela Tania Tanika Tanisha Tanja Tanna Tanner Tanya Tara Tarah Taren Tari Tarra Tarsha Taryn Tasha Tashia Tashina Tasia Tatiana Tatum Tatyana Taunya Tawana Tawanda Tawanna Tawna Tawny Tawnya Taylor Taylor Tayna Ted Teddy Teena Tegan Teisha Telma Temeka Temika Tempie Temple Tena Tenesha Tenisha Tennie Tennille Teodora Teodoro Teofila Tequila Tera Tereasa Terence Teresa Terese Teresia Teresita Teressa Teri Terica Terina Terisa Terra Terrance Terrell Terrell Terrence Terresa Terri Terrie Terrilyn Terry Terry Tesha Tess Tessa Tessie Thad Thaddeus Thalia Thanh Thanh Thao Thea Theda Thelma Theo Theo Theodora Theodore Theola Theresa Therese Theresia Theressa Theron Thersa Thi Thomas Thomas Thomasena Thomasina Thomasine Thora Thresa Thu Thurman Thuy Tia Tiana Tianna Tiara Tien Tiera Tierra Tiesha Tifany Tiffaney Tiffani Tiffanie Tiffany Tiffiny Tijuana Tilda Tillie Tim Timika Timmy Timothy Timothy Tina Tinisha Tiny Tisa Tish Tisha Titus Tobi Tobias Tobie Toby Toby Toccara Tod Todd Toi Tom Tomas Tomasa Tomeka Tomi Tomika Tomiko Tommie Tommie Tommy Tommy Tommye Tomoko Tona Tonda Tonette Toney Toni Tonia Tonie Tonisha Tonita Tonja Tony Tony Tonya Tora Tori Torie Torri Torrie Tory Tory Tosha Toshia Toshiko Tova Towanda Toya Tracee Tracey Tracey Traci Tracie Tracy Tracy Tran Trang Travis Travis Treasa Treena Trena Trent Trenton Tresa Tressa Tressie Treva Trevor Trey Tricia Trina Trinh Trinidad Trinidad Trinity Trish Trisha Trista Tristan Tristan Troy Troy Trudi Trudie Trudy Trula Truman Tu Tuan Tula Tuyet Twana Twanda Twanna Twila Twyla Ty Tyesha Tyisha Tyler Tyler Tynisha Tyra Tyree Tyrell Tyron Tyrone Tyson Ula Ulrike Ulysses Un Una Ursula Usha Ute Vada Val Val Valarie Valda Valencia Valene Valentin Valentina Valentine Valentine Valeri Valeria Valerie Valery Vallie Valorie Valrie Van Van Vance Vanda Vanesa Vanessa Vanetta Vania Vanita Vanna Vannesa Vannessa Vashti Vasiliki Vaughn Veda Velda Velia Vella Velma Velva Velvet Vena Venessa Venetta Venice Venita Vennie Venus Veola Vera Verda Verdell Verdie Verena Vergie Verla Verlene Verlie Verline Vern Verna Vernell Vernetta Vernia Vernice Vernie Vernita Vernon Vernon Verona Veronica Veronika Veronique Versie Vertie Vesta Veta Vi Vicenta Vicente Vickey Vicki Vickie Vicky Victor Victor Victoria Victorina Vida Viki Vikki Vilma Vina Vince Vincent Vincenza Vincenzo Vinita Vinnie Viola Violet Violeta Violette Virgen Virgie Virgil Virgil Virgilio Virgina Virginia Vita Vito Viva Vivan Vivian Viviana Vivien Vivienne Von Voncile Vonda Vonnie Wade Wai Waldo Walker Wallace Wally Walter Walter Walton Waltraud Wan Wanda Waneta Wanetta Wanita Ward Warner Warren Wava Waylon Wayne Wei Weldon Wen Wendell Wendi Wendie Wendolyn Wendy Wenona Werner Wes Wesley Wesley Weston Whitley Whitney Whitney Wilber Wilbert Wilbur Wilburn Wilda Wiley Wilford Wilfred Wilfredo Wilhelmina Wilhemina Will Willa Willard Willena Willene Willetta Willette Willia William William Williams Willian Willie Willie Williemae Willis Willodean Willow Willy Wilma Wilmer Wilson Wilton Windy Winford Winfred Winifred Winnie Winnifred Winona Winston Winter Wm Wonda Woodrow Wyatt Wynell Wynona Xavier Xenia Xiao Xiomara Xochitl Xuan Yadira Yaeko Yael Yahaira Yajaira Yan Yang Yanira Yasmin Yasmine Yasuko Yee Yelena Yen Yer Yesenia Yessenia Yetta Yevette Yi Ying Yoko Yolanda Yolande Yolando Yolonda Yon Yong Yong Yoshie Yoshiko Youlanda Young Young Yu Yuette Yuk Yuki Yukiko Yuko Yulanda Yun Yung Yuonne Yuri Yuriko Yvette Yvone Yvonne Zachariah Zachary Zachery Zack Zackary Zada Zaida Zana Zandra Zane Zelda Zella Zelma Zena Zenaida Zenia Zenobia Zetta Zina Zita Zoe Zofia Zoila Zola Zona Zonia Zora Zoraida Zula Zulema Zulma \ No newline at end of file diff --git a/db/seeds.rb b/db/seeds.rb index 1beea2accd..15d3340c7b 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,3 +5,81 @@ # # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # Character.create(name: 'Luke', movie: movies.first) + +require 'csv' + +WORK_FILE = Rails.root.join('db', 'seed_data', 'works.csv') +puts "Loading raw work data from #{WORK_FILE}" + +work_failures = [] +CSV.foreach(WORK_FILE, :headers => true) do |row| + work = Work.new + work.id = row['id'] + work.name = row['name'] + work.vin = row['vin'] + puts "Created work: #{work.inspect}" + successful = work.save + if !successful + work_failures << work + end +end + +puts "Added #{Work.count} work records" +puts "#{work_failures.length} works failed to save" + + + +USER_FILE = Rails.root.join('db', 'seed_data', 'users.csv') +puts "Loading raw user data from #{USER_FILE}" + +user_failures = [] +CSV.foreach(USER_FILE, :headers => true) do |row| + user = User.new + user.id = row['id'] + user.name = row['name'] + user.phone_num = row['phone_num'] + puts "Created user: #{user.inspect}" + successful = user.save + if !successful + user_failures << user + end +end + +puts "Added #{User.count} user records" +puts "#{user_failures.length} users failed to save" + + + +VOTE_FILE = Rails.root.join('db', 'seed_data', 'votes.csv') +puts "Loading raw vote data from #{VOTE_FILE}" + +vote_failures = [] +CSV.foreach(VOTE_FILE, :headers => true) do |row| + vote = Trip.new + vote.id = row['id'] + vote.work_id = row['work_id'] + vote.user_id = row['user_id'] + vote.date = Date.strptime(row['date'], '%Y-%m-%d') + vote.rating = row['rating'] + vote.cost = row['cost'] + puts "Created vote: #{vote.inspect}" + successful = vote.save + if !successful + vote_failures << vote + end +end + +puts "Added #{Trip.count} vote records" +puts "#{vote_failures.length} votes failed to save" + + +# Since we set the primary key (the ID) manually on each of the +# tables, we've got to tell postgres to reload the latest ID +# values. Otherwise when we create a new record it will try +# to start at ID 1, which will be a conflict. +puts "Manually resetting PK sequence on each table" +ActiveRecord::Base.connection.tables.each do |t| + ActiveRecord::Base.connection.reset_pk_sequence!(t) +end + +puts "done" From f9e58000043c8bf9c72d08a94b0af335148b46dc Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Fri, 13 Oct 2017 13:10:32 -0700 Subject: [PATCH 08/56] made user and vote models --- app/models/user.rb | 2 ++ app/models/vote.rb | 2 ++ db/migrate/20171013200800_create_votes.rb | 8 ++++++ db/migrate/20171013200923_create_users.rb | 8 ++++++ db/seed_data/media_seeds.csv | 2 +- db/seed_data/user_seeds.csv | 12 ++++++++- db/seed_data/vote_seeds.csv | 19 ++++++++++++++ db/seeds.rb | 30 ++++++++++++----------- test/fixtures/users.yml | 11 +++++++++ test/fixtures/votes.yml | 11 +++++++++ test/models/user_test.rb | 9 +++++++ test/models/vote_test.rb | 9 +++++++ 12 files changed, 107 insertions(+), 16 deletions(-) create mode 100644 app/models/user.rb create mode 100644 app/models/vote.rb create mode 100644 db/migrate/20171013200800_create_votes.rb create mode 100644 db/migrate/20171013200923_create_users.rb create mode 100644 db/seed_data/vote_seeds.csv create mode 100644 test/fixtures/users.yml create mode 100644 test/fixtures/votes.yml create mode 100644 test/models/user_test.rb create mode 100644 test/models/vote_test.rb diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 0000000000..379658a509 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,2 @@ +class User < ApplicationRecord +end diff --git a/app/models/vote.rb b/app/models/vote.rb new file mode 100644 index 0000000000..4c58e4f3d5 --- /dev/null +++ b/app/models/vote.rb @@ -0,0 +1,2 @@ +class Vote < ApplicationRecord +end diff --git a/db/migrate/20171013200800_create_votes.rb b/db/migrate/20171013200800_create_votes.rb new file mode 100644 index 0000000000..0d346db502 --- /dev/null +++ b/db/migrate/20171013200800_create_votes.rb @@ -0,0 +1,8 @@ +class CreateVotes < ActiveRecord::Migration[5.1] + def change + create_table :votes do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20171013200923_create_users.rb b/db/migrate/20171013200923_create_users.rb new file mode 100644 index 0000000000..a588bf5a68 --- /dev/null +++ b/db/migrate/20171013200923_create_users.rb @@ -0,0 +1,8 @@ +class CreateUsers < ActiveRecord::Migration[5.1] + def change + create_table :users do |t| + + t.timestamps + end + end +end diff --git a/db/seed_data/media_seeds.csv b/db/seed_data/media_seeds.csv index b5101408d0..eb9ef1e985 100644 --- a/db/seed_data/media_seeds.csv +++ b/db/seed_data/media_seeds.csv @@ -24,4 +24,4 @@ book,Hidden Figures,Margot Lee Shetterly,2016,Good book that came before the mov book,Practical Object-Oriented Design in Ruby,Sandi Metz,2012,Good programming book book,Kindred,Octavia E. Butler,1979,Good sci-fi book book,Parable of the Sower,Octavia E. Butler,1993, -book,A Wizard of Earthsea,Ursula K. Leguin,1968, \ No newline at end of file +book,A Wizard of Earthsea,Ursula K. Leguin,1968, diff --git a/db/seed_data/user_seeds.csv b/db/seed_data/user_seeds.csv index 348959e951..5f9051658c 100644 --- a/db/seed_data/user_seeds.csv +++ b/db/seed_data/user_seeds.csv @@ -1 +1,11 @@ -firstname Aaron Aaron Abbey Abbie Abby Abdul Abe Abel Abigail Abraham Abram Ada Adah Adalberto Adaline Adam Adam Adan Addie Adela Adelaida Adelaide Adele Adelia Adelina Adeline Adell Adella Adelle Adena Adina Adolfo Adolph Adria Adrian Adrian Adriana Adriane Adrianna Adrianne Adrien Adriene Adrienne Afton Agatha Agnes Agnus Agripina Agueda Agustin Agustina Ahmad Ahmed Ai Aida Aide Aiko Aileen Ailene Aimee Aisha Aja Akiko Akilah Al Alaina Alaine Alan Alana Alane Alanna Alayna Alba Albert Albert Alberta Albertha Albertina Albertine Alberto Albina Alda Alden Aldo Alease Alec Alecia Aleen Aleida Aleisha Alejandra Alejandrina Alejandro Alena Alene Alesha Aleshia Alesia Alessandra Aleta Aletha Alethea Alethia Alex Alex Alexa Alexander Alexander Alexandra Alexandria Alexia Alexis Alexis Alfonso Alfonzo Alfred Alfreda Alfredia Alfredo Ali Ali Alia Alica Alice Alicia Alida Alina Aline Alisa Alise Alisha Alishia Alisia Alison Alissa Alita Alix Aliza Alla Allan Alleen Allegra Allen Allen Allena Allene Allie Alline Allison Allyn Allyson Alma Almeda Almeta Alona Alonso Alonzo Alpha Alphonse Alphonso Alta Altagracia Altha Althea Alton Alva Alva Alvaro Alvera Alverta Alvin Alvina Alyce Alycia Alysa Alyse Alysha Alysia Alyson Alyssa Amada Amado Amal Amalia Amanda Amber Amberly Ambrose Amee Amelia America Ami Amie Amiee Amina Amira Ammie Amos Amparo Amy An Ana Anabel Analisa Anamaria Anastacia Anastasia Andera Anderson Andra Andre Andre Andrea Andrea Andreas Andree Andres Andrew Andrew Andria Andy Anette Angel Angel Angela Angele Angelena Angeles Angelia Angelic Angelica Angelika Angelina Angeline Angelique Angelita Angella Angelo Angelo Angelyn Angie Angila Angla Angle Anglea Anh Anibal Anika Anisa Anisha Anissa Anita Anitra Anja Anjanette Anjelica Ann Anna Annabel Annabell Annabelle Annalee Annalisa Annamae Annamaria Annamarie Anne Anneliese Annelle Annemarie Annett Annetta Annette Annice Annie Annika Annis Annita Annmarie Anthony Anthony Antione Antionette Antoine Antoinette Anton Antone Antonetta Antonette Antonia Antonia Antonietta Antonina Antonio Antonio Antony Antwan Anya Apolonia April Apryl Ara Araceli Aracelis Aracely Arcelia Archie Ardath Ardelia Ardell Ardella Ardelle Arden Ardis Ardith Aretha Argelia Argentina Ariana Ariane Arianna Arianne Arica Arie Ariel Ariel Arielle Arla Arlean Arleen Arlen Arlena Arlene Arletha Arletta Arlette Arlie Arlinda Arline Arlyne Armand Armanda Armandina Armando Armida Arminda Arnetta Arnette Arnita Arnold Arnoldo Arnulfo Aron Arron Art Arthur Arthur Artie Arturo Arvilla Asa Asha Ashanti Ashely Ashlea Ashlee Ashleigh Ashley Ashley Ashli Ashlie Ashly Ashlyn Ashton Asia Asley Assunta Astrid Asuncion Athena Aubrey Aubrey Audie Audra Audrea Audrey Audria Audrie Audry August Augusta Augustina Augustine Augustine Augustus Aundrea Aura Aurea Aurelia Aurelio Aurora Aurore Austin Austin Autumn Ava Avelina Avery Avery Avis Avril Awilda Ayako Ayana Ayanna Ayesha Azalee Azucena Azzie Babara Babette Bailey Bambi Bao Barabara Barb Barbar Barbara Barbera Barbie Barbra Bari Barney Barrett Barrie Barry Bart Barton Basil Basilia Bea Beata Beatrice Beatris Beatriz Beau Beaulah Bebe Becki Beckie Becky Bee Belen Belia Belinda Belkis Bell Bella Belle Belva Ben Benedict Benita Benito Benjamin Bennett Bennie Bennie Benny Benton Berenice Berna Bernadette Bernadine Bernard Bernarda Bernardina Bernardine Bernardo Berneice Bernetta Bernice Bernie Bernie Berniece Bernita Berry Berry Bert Berta Bertha Bertie Bertram Beryl Bess Bessie Beth Bethanie Bethann Bethany Bethel Betsey Betsy Bette Bettie Bettina Betty Bettyann Bettye Beula Beulah Bev Beverlee Beverley Beverly Bianca Bibi Bill Billi Billie Billie Billy Billy Billye Birdie Birgit Blaine Blair Blair Blake Blake Blanca Blanch Blanche Blondell Blossom Blythe Bo Bob Bobbi Bobbie Bobbie Bobby Bobby Bobbye Bobette Bok Bong Bonita Bonnie Bonny Booker Boris Boyce Boyd Brad Bradford Bradley Bradly Brady Brain Branda Brande Brandee Branden Brandi Brandie Brandon Brandon Brandy Brant Breana Breann Breanna Breanne Bree Brenda Brendan Brendon Brenna Brent Brenton Bret Brett Brett Brian Brian Briana Brianna Brianne Brice Bridget Bridgett Bridgette Brigette Brigid Brigida Brigitte Brinda Britany Britney Britni Britt Britt Britta Brittaney Brittani Brittanie Brittany Britteny Brittney Brittni Brittny Brock Broderick Bronwyn Brook Brooke Brooks Bruce Bruna Brunilda Bruno Bryan Bryanna Bryant Bryce Brynn Bryon Buck Bud Buddy Buena Buffy Buford Bula Bulah Bunny Burl Burma Burt Burton Buster Byron Caitlin Caitlyn Calandra Caleb Calista Callie Calvin Camelia Camellia Cameron Cameron Cami Camie Camila Camilla Camille Cammie Cammy Candace Candance Candelaria Candi Candice Candida Candie Candis Candra Candy Candyce Caprice Cara Caren Carey Carey Cari Caridad Carie Carin Carina Carisa Carissa Carita Carl Carl Carla Carlee Carleen Carlena Carlene Carletta Carley Carli Carlie Carline Carlita Carlo Carlos Carlos Carlota Carlotta Carlton Carly Carlyn Carma Carman Carmel Carmela Carmelia Carmelina Carmelita Carmella Carmelo Carmen Carmen Carmina Carmine Carmon Carol Carol Carola Carolann Carole Carolee Carolin Carolina Caroline Caroll Carolyn Carolyne Carolynn Caron Caroyln Carri Carrie Carrol Carrol Carroll Carroll Carry Carson Carter Cary Cary Caryl Carylon Caryn Casandra Casey Casey Casie Casimira Cassandra Cassaundra Cassey Cassi Cassidy Cassie Cassondra Cassy Catalina Catarina Caterina Catharine Catherin Catherina Catherine Cathern Catheryn Cathey Cathi Cathie Cathleen Cathrine Cathryn Cathy Catina Catrice Catrina Cayla Cecelia Cecil Cecil Cecila Cecile Cecilia Cecille Cecily Cedric Cedrick Celena Celesta Celeste Celestina Celestine Celia Celina Celinda Celine Celsa Ceola Cesar Chad Chadwick Chae Chan Chana Chance Chanda Chandra Chanel Chanell Chanelle Chang Chang Chantal Chantay Chante Chantel Chantell Chantelle Chara Charis Charise Charissa Charisse Charita Charity Charla Charleen Charlena Charlene Charles Charles Charlesetta Charlette Charley Charlie Charlie Charline Charlott Charlotte Charlsie Charlyn Charmain Charmaine Charolette Chas Chase Chasidy Chasity Chassidy Chastity Chau Chauncey Chaya Chelsea Chelsey Chelsie Cher Chere Cheree Cherelle Cheri Cherie Cherilyn Cherise Cherish Cherly Cherlyn Cherri Cherrie Cherry Cherryl Chery Cheryl Cheryle Cheryll Chester Chet Cheyenne Chi Chi Chia Chieko Chin China Ching Chiquita Chloe Chong Chong Chris Chris Chrissy Christa Christal Christeen Christel Christen Christena Christene Christi Christia Christian Christian Christiana Christiane Christie Christin Christina Christine Christinia Christoper Christopher Christopher Christy Chrystal Chu Chuck Chun Chung Chung Ciara Cicely Ciera Cierra Cinda Cinderella Cindi Cindie Cindy Cinthia Cira Clair Clair Claire Clara Clare Clarence Clarence Claretha Claretta Claribel Clarice Clarinda Clarine Claris Clarisa Clarissa Clarita Clark Classie Claud Claude Claude Claudette Claudia Claudie Claudine Claudio Clay Clayton Clelia Clemencia Clement Clemente Clementina Clementine Clemmie Cleo Cleo Cleopatra Cleora Cleotilde Cleta Cletus Cleveland Cliff Clifford Clifton Clint Clinton Clora Clorinda Clotilde Clyde Clyde Codi Cody Cody Colby Colby Cole Coleen Coleman Colene Coletta Colette Colin Colleen Collen Collene Collette Collin Colton Columbus Concepcion Conception Concetta Concha Conchita Connie Connie Conrad Constance Consuela Consuelo Contessa Cora Coral Coralee Coralie Corazon Cordelia Cordell Cordia Cordie Coreen Corene Coretta Corey Corey Cori Corie Corina Corine Corinna Corinne Corliss Cornelia Cornelius Cornell Corrie Corrin Corrina Corrine Corrinne Cortez Cortney Cory Cory Courtney Courtney Coy Craig Creola Cris Criselda Crissy Crista Cristal Cristen Cristi Cristie Cristin Cristina Cristine Cristobal Cristopher Cristy Cruz Cruz Crysta Crystal Crystle Cuc Curt Curtis Curtis Cyndi Cyndy Cynthia Cyril Cyrstal Cyrus Cythia Dacia Dagmar Dagny Dahlia Daina Daine Daisey Daisy Dakota Dale Dale Dalene Dalia Dalila Dallas Dallas Dalton Damaris Damian Damien Damion Damon Dan Dan Dana Dana Danae Dane Danelle Danette Dani Dania Danial Danica Daniel Daniel Daniela Daniele Daniell Daniella Danielle Danika Danille Danilo Danita Dann Danna Dannette Dannie Dannie Dannielle Danny Dante Danuta Danyel Danyell Danyelle Daphine Daphne Dara Darby Darcel Darcey Darci Darcie Darcy Darell Daren Daria Darin Dario Darius Darla Darleen Darlena Darlene Darline Darnell Darnell Daron Darrel Darrell Darren Darrick Darrin Darron Darryl Darwin Daryl Daryl Dave David David Davida Davina Davis Dawn Dawna Dawne Dayle Dayna Daysi Deadra Dean Dean Deana Deandra Deandre Deandrea Deane Deangelo Deann Deanna Deanne Deb Debbi Debbie Debbra Debby Debera Debi Debora Deborah Debra Debrah Debroah Dede Dedra Dee Dee Deeann Deeanna Deedee Deedra Deena Deetta Deidra Deidre Deirdre Deja Del Delaine Delana Delbert Delcie Delena Delfina Delia Delicia Delila Delilah Delinda Delisa Dell Della Delma Delmar Delmer Delmy Delois Deloise Delora Deloras Delores Deloris Delorse Delpha Delphia Delphine Delsie Delta Demarcus Demetra Demetria Demetrice Demetrius Demetrius Dena Denae Deneen Denese Denice Denis Denise Denisha Denisse Denita Denna Dennis Dennis Dennise Denny Denny Denver Denyse Deon Deon Deonna Derek Derick Derrick Deshawn Desirae Desire Desiree Desmond Despina Dessie Destiny Detra Devin Devin Devon Devon Devona Devora Devorah Dewayne Dewey Dewitt Dexter Dia Diamond Dian Diana Diane Diann Dianna Dianne Dick Diedra Diedre Diego Dierdre Digna Dillon Dimple Dina Dinah Dino Dinorah Dion Dion Dione Dionna Dionne Dirk Divina Dixie Dodie Dollie Dolly Dolores Doloris Domenic Domenica Dominga Domingo Dominic Dominica Dominick Dominique Dominique Dominque Domitila Domonique Don Dona Donald Donald Donella Donetta Donette Dong Dong Donita Donn Donna Donnell Donnetta Donnette Donnie Donnie Donny Donovan Donte Donya Dora Dorathy Dorcas Doreatha Doreen Dorene Doretha Dorethea Doretta Dori Doria Dorian Dorian Dorie Dorinda Dorine Doris Dorla Dorotha Dorothea Dorothy Dorris Dorsey Dortha Dorthea Dorthey Dorthy Dot Dottie Dotty Doug Douglas Douglass Dovie Doyle Dreama Drema Drew Drew Drucilla Drusilla Duane Dudley Dulce Dulcie Duncan Dung Dusti Dustin Dusty Dusty Dwain Dwana Dwayne Dwight Dyan Dylan Earl Earle Earlean Earleen Earlene Earlie Earline Earnest Earnestine Eartha Easter Eboni Ebonie Ebony Echo Ed Eda Edda Eddie Eddie Eddy Edelmira Eden Edgar Edgardo Edie Edison Edith Edmond Edmund Edmundo Edna Edra Edris Eduardo Edward Edward Edwardo Edwin Edwina Edyth Edythe Effie Efrain Efren Ehtel Eileen Eilene Ela Eladia Elaina Elaine Elana Elane Elanor Elayne Elba Elbert Elda Elden Eldon Eldora Eldridge Eleanor Eleanora Eleanore Elease Elena Elene Eleni Elenor Elenora Elenore Eleonor Eleonora Eleonore Elfreda Elfrieda Elfriede Eli Elia Eliana Elias Elicia Elida Elidia Elijah Elin Elina Elinor Elinore Elisa Elisabeth Elise Eliseo Elisha Elisha Elissa Eliz Eliza Elizabet Elizabeth Elizbeth Elizebeth Elke Ella Ellamae Ellan Ellen Ellena Elli Ellie Elliot Elliott Ellis Ellis Ellsworth Elly Ellyn Elma Elmer Elmer Elmira Elmo Elna Elnora Elodia Elois Eloisa Eloise Elouise Eloy Elroy Elsa Else Elsie Elsy Elton Elva Elvera Elvia Elvie Elvin Elvina Elvira Elvis Elwanda Elwood Elyse Elza Ema Emanuel Emelda Emelia Emelina Emeline Emely Emerald Emerita Emerson Emery Emiko Emil Emile Emilee Emilia Emilie Emilio Emily Emma Emmaline Emmanuel Emmett Emmie Emmitt Emmy Emogene Emory Ena Enda Enedina Eneida Enid Enoch Enola Enrique Enriqueta Epifania Era Erasmo Eric Eric Erica Erich Erick Ericka Erik Erika Erin Erin Erinn Erlene Erlinda Erline Erma Ermelinda Erminia Erna Ernest Ernestina Ernestine Ernesto Ernie Errol Ervin Erwin Eryn Esmeralda Esperanza Essie Esta Esteban Estefana Estela Estell Estella Estelle Ester Esther Estrella Etha Ethan Ethel Ethelene Ethelyn Ethyl Etsuko Etta Ettie Eufemia Eugena Eugene Eugene Eugenia Eugenie Eugenio Eula Eulah Eulalia Eun Euna Eunice Eura Eusebia Eusebio Eustolia Eva Evalyn Evan Evan Evangelina Evangeline Eve Evelia Evelin Evelina Eveline Evelyn Evelyne Evelynn Everett Everette Evette Evia Evie Evita Evon Evonne Ewa Exie Ezekiel Ezequiel Ezra Fabian Fabiola Fae Fairy Faith Fallon Fannie Fanny Farah Farrah Fatima Fatimah Faustina Faustino Fausto Faviola Fawn Fay Faye Fe Federico Felecia Felica Felice Felicia Felicidad Felicita Felicitas Felipa Felipe Felisa Felisha Felix Felton Ferdinand Fermin Fermina Fern Fernanda Fernande Fernando Ferne Fidel Fidela Fidelia Filiberto Filomena Fiona Flavia Fleta Fletcher Flo Flor Flora Florance Florence Florencia Florencio Florene Florentina Florentino Floretta Floria Florida Florinda Florine Florrie Flossie Floy Floyd Fonda Forest Forrest Foster Fran France Francene Frances Frances Francesca Francesco Franchesca Francie Francina Francine Francis Francis Francisca Francisco Francisco Francoise Frank Frank Frankie Frankie Franklin Franklyn Fransisca Fred Fred Freda Fredda Freddie Freddie Freddy Frederic Frederica Frederick Fredericka Fredia Fredric Fredrick Fredricka Freeda Freeman Freida Frida Frieda Fritz Fumiko Gabriel Gabriel Gabriela Gabriele Gabriella Gabrielle Gail Gail Gala Gale Gale Galen Galina Garfield Garland Garnet Garnett Garret Garrett Garry Garth Gary Gary Gaston Gavin Gay Gaye Gayla Gayle Gayle Gaylene Gaylord Gaynell Gaynelle Gearldine Gema Gemma Gena Genaro Gene Gene Genesis Geneva Genevie Genevieve Genevive Genia Genie Genna Gennie Genny Genoveva Geoffrey Georgann George George Georgeann Georgeanna Georgene Georgetta Georgette Georgia Georgiana Georgiann Georgianna Georgianne Georgie Georgina Georgine Gerald Gerald Geraldine Geraldo Geralyn Gerard Gerardo Gerda Geri Germaine German Gerri Gerry Gerry Gertha Gertie Gertrud Gertrude Gertrudis Gertude Ghislaine Gia Gianna Gidget Gigi Gil Gilbert Gilberte Gilberto Gilda Gillian Gilma Gina Ginette Ginger Ginny Gino Giovanna Giovanni Gisela Gisele Giselle Gita Giuseppe Giuseppina Gladis Glady Gladys Glayds Glen Glenda Glendora Glenn Glenn Glenna Glennie Glennis Glinda Gloria Glory Glynda Glynis Golda Golden Goldie Gonzalo Gordon Grace Gracia Gracie Graciela Grady Graham Graig Grant Granville Grayce Grazyna Greg Gregg Gregoria Gregorio Gregory Gregory Greta Gretchen Gretta Gricelda Grisel Griselda Grover Guadalupe Guadalupe Gudrun Guillermina Guillermo Gus Gussie Gustavo Guy Gwen Gwenda Gwendolyn Gwenn Gwyn Gwyneth Ha Hae Hai Hailey Hal Haley Halina Halley Hallie Han Hana Hang Hanh Hank Hanna Hannah Hannelore Hans Harlan Harland Harley Harmony Harold Harold Harriet Harriett Harriette Harris Harrison Harry Harvey Hassan Hassie Hattie Haydee Hayden Hayley Haywood Hazel Heath Heather Hector Hedwig Hedy Hee Heide Heidi Heidy Heike Helaine Helen Helena Helene Helga Hellen Henrietta Henriette Henry Henry Herb Herbert Heriberto Herlinda Herma Herman Hermelinda Hermila Hermina Hermine Herminia Herschel Hershel Herta Hertha Hester Hettie Hiedi Hien Hilaria Hilario Hilary Hilda Hilde Hildegard Hildegarde Hildred Hillary Hilma Hilton Hipolito Hiram Hiroko Hisako Hoa Hobert Holley Holli Hollie Hollis Hollis Holly Homer Honey Hong Hong Hope Horace Horacio Hortencia Hortense Hortensia Hosea Houston Howard Hoyt Hsiu Hubert Hue Huey Hugh Hugo Hui Hulda Humberto Hung Hunter Huong Hwa Hyacinth Hye Hyman Hyo Hyon Hyun Ian Ida Idalia Idell Idella Iesha Ignacia Ignacio Ike Ila Ilana Ilda Ileana Ileen Ilene Iliana Illa Ilona Ilse Iluminada Ima Imelda Imogene In Ina India Indira Inell Ines Inez Inga Inge Ingeborg Inger Ingrid Inocencia Iola Iona Ione Ira Ira Iraida Irena Irene Irina Iris Irish Irma Irmgard Irvin Irving Irwin Isa Isaac Isabel Isabell Isabella Isabelle Isadora Isaiah Isaias Isaura Isela Isiah Isidra Isidro Isis Ismael Isobel Israel Isreal Issac Iva Ivan Ivana Ivelisse Ivette Ivey Ivonne Ivory Ivory Ivy Izetta Izola Ja Jacalyn Jacelyn Jacinda Jacinta Jacinto Jack Jack Jackeline Jackelyn Jacki Jackie Jackie Jacklyn Jackqueline Jackson Jaclyn Jacob Jacqualine Jacque Jacquelin Jacqueline Jacquelyn Jacquelyne Jacquelynn Jacques Jacquetta Jacqui Jacquie Jacquiline Jacquline Jacqulyn Jada Jade Jadwiga Jae Jae Jaime Jaime Jaimee Jaimie Jake Jaleesa Jalisa Jama Jamaal Jamal Jamar Jame Jame Jamee Jamel James James Jamey Jamey Jami Jamie Jamie Jamika Jamila Jamison Jammie Jan Jan Jana Janae Janay Jane Janean Janee Janeen Janel Janell Janella Janelle Janene Janessa Janet Janeth Janett Janetta Janette Janey Jani Janice Janie Janiece Janina Janine Janis Janise Janita Jann Janna Jannet Jannette Jannie January Janyce Jaqueline Jaquelyn Jared Jarod Jarred Jarrett Jarrod Jarvis Jasmin Jasmine Jason Jason Jasper Jaunita Javier Jay Jay Jaye Jayme Jaymie Jayna Jayne Jayson Jazmin Jazmine Jc Jean Jean Jeana Jeane Jeanelle Jeanene Jeanett Jeanetta Jeanette Jeanice Jeanie Jeanine Jeanmarie Jeanna Jeanne Jeannetta Jeannette Jeannie Jeannine Jed Jeff Jefferey Jefferson Jeffery Jeffie Jeffrey Jeffrey Jeffry Jen Jena Jenae Jene Jenee Jenell Jenelle Jenette Jeneva Jeni Jenice Jenifer Jeniffer Jenine Jenise Jenna Jennefer Jennell Jennette Jenni Jennie Jennifer Jenniffer Jennine Jenny Jerald Jeraldine Jeramy Jere Jeremiah Jeremy Jeremy Jeri Jerica Jerilyn Jerlene Jermaine Jerold Jerome Jeromy Jerrell Jerri Jerrica Jerrie Jerrod Jerrold Jerry Jerry Jesenia Jesica Jess Jesse Jesse Jessenia Jessi Jessia Jessica Jessie Jessie Jessika Jestine Jesus Jesus Jesusa Jesusita Jetta Jettie Jewel Jewel Jewell Jewell Ji Jill Jillian Jim Jimmie Jimmie Jimmy Jimmy Jin Jina Jinny Jo Joan Joan Joana Joane Joanie Joann Joanna Joanne Joannie Joaquin Joaquina Jocelyn Jodee Jodi Jodie Jody Jody Joe Joe Joeann Joel Joel Joella Joelle Joellen Joesph Joetta Joette Joey Joey Johana Johanna Johanne John John Johna Johnathan Johnathon Johnetta Johnette Johnie Johnie Johnna Johnnie Johnnie Johnny Johnny Johnsie Johnson Joi Joie Jolanda Joleen Jolene Jolie Joline Jolyn Jolynn Jon Jon Jona Jonah Jonas Jonathan Jonathon Jone Jonell Jonelle Jong Joni Jonie Jonna Jonnie Jordan Jordan Jordon Jorge Jose Jose Josef Josefa Josefina Josefine Joselyn Joseph Joseph Josephina Josephine Josette Josh Joshua Joshua Josiah Josie Joslyn Jospeh Josphine Josue Jovan Jovita Joy Joya Joyce Joycelyn Joye Juan Juan Juana Juanita Jude Jude Judi Judie Judith Judson Judy Jule Julee Julene Jules Juli Julia Julian Julian Juliana Juliane Juliann Julianna Julianne Julie Julieann Julienne Juliet Julieta Julietta Juliette Julio Julio Julissa Julius June Jung Junie Junior Junita Junko Justa Justin Justin Justina Justine Jutta Ka Kacey Kaci Kacie Kacy Kai Kaila Kaitlin Kaitlyn Kala Kaleigh Kaley Kali Kallie Kalyn Kam Kamala Kami Kamilah Kandace Kandi Kandice Kandis Kandra Kandy Kanesha Kanisha Kara Karan Kareem Kareen Karen Karena Karey Kari Karie Karima Karin Karina Karine Karisa Karissa Karl Karl Karla Karleen Karlene Karly Karlyn Karma Karmen Karol Karole Karoline Karolyn Karon Karren Karri Karrie Karry Kary Karyl Karyn Kasandra Kasey Kasey Kasha Kasi Kasie Kassandra Kassie Kate Katelin Katelyn Katelynn Katerine Kathaleen Katharina Katharine Katharyn Kathe Katheleen Katherin Katherina Katherine Kathern Katheryn Kathey Kathi Kathie Kathleen Kathlene Kathline Kathlyn Kathrin Kathrine Kathryn Kathryne Kathy Kathyrn Kati Katia Katie Katina Katlyn Katrice Katrina Kattie Katy Kay Kayce Kaycee Kaye Kayla Kaylee Kayleen Kayleigh Kaylene Kazuko Kecia Keeley Keely Keena Keenan Keesha Keiko Keila Keira Keisha Keith Keith Keitha Keli Kelle Kellee Kelley Kelley Kelli Kellie Kelly Kelly Kellye Kelsey Kelsi Kelsie Kelvin Kemberly Ken Kena Kenda Kendal Kendall Kendall Kendra Kendrick Keneth Kenia Kenisha Kenna Kenneth Kenneth Kennith Kenny Kent Kenton Kenya Kenyatta Kenyetta Kera Keren Keri Kermit Kerri Kerrie Kerry Kerry Kerstin Kesha Keshia Keturah Keva Keven Kevin Kevin Khadijah Khalilah Kia Kiana Kiara Kiera Kiersten Kiesha Kieth Kiley Kim Kim Kimber Kimberely Kimberlee Kimberley Kimberli Kimberlie Kimberly Kimbery Kimbra Kimi Kimiko Kina Kindra King Kip Kira Kirby Kirby Kirk Kirsten Kirstie Kirstin Kisha Kit Kittie Kitty Kiyoko Kizzie Kizzy Klara Korey Kori Kortney Kory Kourtney Kraig Kris Kris Krishna Krissy Krista Kristal Kristan Kristeen Kristel Kristen Kristi Kristian Kristie Kristin Kristina Kristine Kristle Kristofer Kristopher Kristy Kristyn Krysta Krystal Krysten Krystin Krystina Krystle Krystyna Kum Kurt Kurtis Kyla Kyle Kyle Kylee Kylie Kym Kymberly Kyoko Kyong Kyra Kyung Lacey Lachelle Laci Lacie Lacresha Lacy Lacy Ladawn Ladonna Lady Lael Lahoma Lai Laila Laine Lajuana Lakeesha Lakeisha Lakendra Lakenya Lakesha Lakeshia Lakia Lakiesha Lakisha Lakita Lala Lamar Lamonica Lamont Lan Lana Lance Landon Lane Lane Lanell Lanelle Lanette Lang Lani Lanie Lanita Lannie Lanny Lanora Laquanda Laquita Lara Larae Laraine Laree Larhonda Larisa Larissa Larita Laronda Larraine Larry Larry Larue Lasandra Lashanda Lashandra Lashaun Lashaunda Lashawn Lashawna Lashawnda Lashay Lashell Lashon Lashonda Lashunda Lasonya Latanya Latarsha Latasha Latashia Latesha Latia Laticia Latina Latisha Latonia Latonya Latoria Latosha Latoya Latoyia Latrice Latricia Latrina Latrisha Launa Laura Lauralee Lauran Laure Laureen Laurel Lauren Lauren Laurena Laurence Laurence Laurene Lauretta Laurette Lauri Laurice Laurie Laurinda Laurine Lauryn Lavada Lavelle Lavenia Lavera Lavern Lavern Laverna Laverne Laverne Laveta Lavette Lavina Lavinia Lavon Lavona Lavonda Lavone Lavonia Lavonna Lavonne Lawana Lawanda Lawanna Lawerence Lawrence Lawrence Layla Layne Lazaro Le Lea Leah Lean Leana Leandra Leandro Leann Leanna Leanne Leanora Leatha Leatrice Lecia Leda Lee Lee Leeann Leeanna Leeanne Leena Leesa Leia Leida Leif Leigh Leigh Leigha Leighann Leila Leilani Leisa Leisha Lekisha Lela Lelah Leland Lelia Lemuel Len Lena Lenard Lenita Lenna Lennie Lenny Lenora Lenore Leo Leo Leola Leoma Leon Leon Leona Leonard Leonarda Leonardo Leone Leonel Leonia Leonida Leonie Leonila Leonor Leonora Leonore Leontine Leopoldo Leora Leota Lera Leroy Les Lesa Lesha Lesia Leslee Lesley Lesley Lesli Leslie Leslie Lessie Lester Lester Leta Letha Leticia Letisha Letitia Lettie Letty Levi Lewis Lewis Lexie Lezlie Li Lia Liana Liane Lianne Libbie Libby Liberty Librada Lida Lidia Lien Lieselotte Ligia Lila Lili Lilia Lilian Liliana Lilla Lilli Lillia Lilliam Lillian Lilliana Lillie Lilly Lily Lin Lina Lincoln Linda Lindsay Lindsay Lindsey Lindsey Lindsy Lindy Linette Ling Linh Linn Linnea Linnie Lino Linsey Linwood Lionel Lisa Lisabeth Lisandra Lisbeth Lise Lisette Lisha Lissa Lissette Lita Livia Liz Liza Lizabeth Lizbeth Lizeth Lizette Lizzette Lizzie Lloyd Loan Logan Logan Loida Lois Loise Lola Lolita Loma Lon Lona Londa Long Loni Lonna Lonnie Lonnie Lonny Lora Loraine Loralee Lore Lorean Loree Loreen Lorelei Loren Loren Lorena Lorene Lorenza Lorenzo Loreta Loretta Lorette Lori Loria Loriann Lorie Lorilee Lorina Lorinda Lorine Loris Lorita Lorna Lorraine Lorretta Lorri Lorriane Lorrie Lorrine Lory Lottie Lou Lou Louann Louanne Louella Louetta Louie Louie Louis Louis Louisa Louise Loura Lourdes Lourie Louvenia Love Lovella Lovetta Lovie Lowell Loyce Loyd Lu Luana Luann Luanna Luanne Luba Lucas Luci Lucia Luciana Luciano Lucie Lucien Lucienne Lucila Lucile Lucilla Lucille Lucina Lucinda Lucio Lucius Lucrecia Lucretia Lucy Ludie Ludivina Lue Luella Luetta Luigi Luis Luis Luisa Luise Luke Lula Lulu Luna Lupe Lupe Lupita Lura Lurlene Lurline Luther Luvenia Luz Lyda Lydia Lyla Lyle Lyman Lyn Lynda Lyndia Lyndon Lyndsay Lyndsey Lynell Lynelle Lynetta Lynette Lynn Lynn Lynna Lynne Lynnette Lynsey Lynwood Ma Mabel Mabelle Mable Mac Machelle Macie Mack Mackenzie Macy Madalene Madaline Madalyn Maddie Madelaine Madeleine Madelene Madeline Madelyn Madge Madie Madison Madlyn Madonna Mae Maegan Mafalda Magali Magaly Magan Magaret Magda Magdalen Magdalena Magdalene Magen Maggie Magnolia Mahalia Mai Maia Maida Maile Maira Maire Maisha Maisie Major Majorie Makeda Malcolm Malcom Malena Malia Malik Malika Malinda Malisa Malissa Malka Mallie Mallory Malorie Malvina Mamie Mammie Man Man Mana Manda Mandi Mandie Mandy Manie Manual Manuel Manuela Many Mao Maple Mara Maragaret Maragret Maranda Marc Marcel Marcela Marcelene Marcelina Marceline Marcelino Marcell Marcella Marcelle Marcellus Marcelo Marcene Marchelle Marci Marcia Marcie Marco Marcos Marcus Marcy Mardell Maren Marg Margaret Margareta Margarete Margarett Margaretta Margarette Margarita Margarite Margarito Margart Marge Margene Margeret Margert Margery Marget Margherita Margie Margit Margo Margorie Margot Margret Margrett Marguerita Marguerite Margurite Margy Marhta Mari Maria Maria Mariah Mariam Marian Mariana Marianela Mariann Marianna Marianne Mariano Maribel Maribeth Marica Maricela Maricruz Marie Mariel Mariela Mariella Marielle Marietta Mariette Mariko Marilee Marilou Marilu Marilyn Marilynn Marin Marina Marinda Marine Mario Mario Marion Marion Maris Marisa Marisela Marisha Marisol Marissa Marita Maritza Marivel Marjorie Marjory Mark Mark Marketta Markita Markus Marla Marlana Marleen Marlen Marlena Marlene Marlin Marlin Marline Marlo Marlon Marlyn Marlys Marna Marni Marnie Marquerite Marquetta Marquis Marquita Marquitta Marry Marsha Marshall Marshall Marta Marth Martha Marti Martin Martin Martina Martine Marty Marty Marva Marvel Marvella Marvin Marvis Marx Mary Mary Marya Maryalice Maryam Maryann Maryanna Maryanne Marybelle Marybeth Maryellen Maryetta Maryjane Maryjo Maryland Marylee Marylin Maryln Marylou Marylouise Marylyn Marylynn Maryrose Masako Mason Matha Mathew Mathilda Mathilde Matilda Matilde Matt Matthew Matthew Mattie Maud Maude Maudie Maura Maureen Maurice Maurice Mauricio Maurine Maurita Mauro Mavis Max Maxie Maxima Maximina Maximo Maxine Maxwell May Maya Maybell Maybelle Maye Mayme Maynard Mayola Mayra Mazie Mckenzie Mckinley Meagan Meaghan Mechelle Meda Mee Meg Megan Meggan Meghan Meghann Mei Mel Melaine Melani Melania Melanie Melany Melba Melda Melia Melida Melina Melinda Melisa Melissa Melissia Melita Mellie Mellisa Mellissa Melodee Melodi Melodie Melody Melonie Melony Melva Melvin Melvin Melvina Melynda Mendy Mercedes Mercedez Mercy Meredith Meri Merideth Meridith Merilyn Merissa Merle Merle Merlene Merlin Merlyn Merna Merri Merrie Merrilee Merrill Merrill Merry Mertie Mervin Meryl Meta Mi Mia Mica Micaela Micah Micah Micha Michael Michael Michaela Michaele Michal Michal Michale Micheal Micheal Michel Michel Michele Michelina Micheline Michell Michelle Michiko Mickey Mickey Micki Mickie Miesha Migdalia Mignon Miguel Miguelina Mika Mikaela Mike Mike Mikel Miki Mikki Mila Milagro Milagros Milan Milda Mildred Miles Milford Milissa Millard Millicent Millie Milly Milo Milton Mimi Min Mina Minda Mindi Mindy Minerva Ming Minh Minh Minna Minnie Minta Miquel Mira Miranda Mireille Mirella Mireya Miriam Mirian Mirna Mirta Mirtha Misha Miss Missy Misti Mistie Misty Mitch Mitchel Mitchell Mitchell Mitsue Mitsuko Mittie Mitzi Mitzie Miyoko Modesta Modesto Mohamed Mohammad Mohammed Moira Moises Mollie Molly Mona Monet Monica Monika Monique Monnie Monroe Monserrate Monte Monty Moon Mora Morgan Morgan Moriah Morris Morton Mose Moses Moshe Mozell Mozella Mozelle Mui Muoi Muriel Murray My Myesha Myles Myong Myra Myriam Myrl Myrle Myrna Myron Myrta Myrtice Myrtie Myrtis Myrtle Myung Na Nada Nadene Nadia Nadine Naida Nakesha Nakia Nakisha Nakita Nam Nan Nana Nancee Nancey Nanci Nancie Nancy Nanette Nannette Nannie Naoma Naomi Napoleon Narcisa Natacha Natalia Natalie Natalya Natasha Natashia Nathalie Nathan Nathanael Nathanial Nathaniel Natisha Natividad Natosha Neal Necole Ned Neda Nedra Neely Neida Neil Nelda Nelia Nelida Nell Nella Nelle Nellie Nelly Nelson Nena Nenita Neoma Neomi Nereida Nerissa Nery Nestor Neta Nettie Neva Nevada Neville Newton Nga Ngan Ngoc Nguyet Nia Nichelle Nichol Nicholas Nichole Nicholle Nick Nicki Nickie Nickolas Nickole Nicky Nicky Nicol Nicola Nicolas Nicolasa Nicole Nicolette Nicolle Nida Nidia Niesha Nieves Nigel Niki Nikia Nikita Nikki Nikole Nila Nilda Nilsa Nina Ninfa Nisha Nita Noah Noble Nobuko Noe Noel Noel Noelia Noella Noelle Noemi Nohemi Nola Nolan Noma Nona Nora Norah Norbert Norberto Noreen Norene Noriko Norine Norma Norman Norman Normand Norris Nova Novella Nu Nubia Numbers Numbers Nydia Nyla Obdulia Ocie Octavia Octavio Oda Odelia Odell Odell Odessa Odette Odilia Odis Ofelia Ok Ola Olen Olene Oleta Olevia Olga Olimpia Olin Olinda Oliva Olive Oliver Olivia Ollie Ollie Olympia Oma Omar Omega Omer Ona Oneida Onie Onita Opal Ophelia Ora Oralee Oralia Oren Oretha Orlando Orpha Orval Orville Oscar Oscar Ossie Osvaldo Oswaldo Otelia Otha Otha Otilia Otis Otto Ouida Owen Ozell Ozella Ozie Pa Pablo Page Paige Palma Palmer Palmira Pam Pamala Pamela Pamelia Pamella Pamila Pamula Pandora Pansy Paola Paris Paris Parker Parthenia Particia Pasquale Pasty Pat Pat Patience Patria Patrica Patrice Patricia Patricia Patrick Patrick Patrina Patsy Patti Pattie Patty Paul Paul Paula Paulene Pauletta Paulette Paulina Pauline Paulita Paz Pearl Pearle Pearlene Pearlie Pearline Pearly Pedro Peg Peggie Peggy Pei Penelope Penney Penni Pennie Penny Percy Perla Perry Perry Pete Peter Peter Petra Petrina Petronila Phebe Phil Philip Phillip Phillis Philomena Phoebe Phung Phuong Phylicia Phylis Phyliss Phyllis Pia Piedad Pierre Pilar Ping Pinkie Piper Pok Polly Porfirio Porsche Porsha Porter Portia Precious Preston Pricilla Prince Princess Priscila Priscilla Providencia Prudence Pura Qiana Queen Queenie Quentin Quiana Quincy Quinn Quinn Quintin Quinton Quyen Rachael Rachal Racheal Rachel Rachele Rachell Rachelle Racquel Rae Raeann Raelene Rafael Rafaela Raguel Raina Raisa Raleigh Ralph Ramiro Ramon Ramona Ramonita Rana Ranae Randa Randal Randall Randee Randell Randi Randolph Randy Randy Ranee Raphael Raquel Rashad Rasheeda Rashida Raul Raven Ray Ray Raye Rayford Raylene Raymon Raymond Raymond Raymonde Raymundo Rayna Rea Reagan Reanna Reatha Reba Rebbeca Rebbecca Rebeca Rebecca Rebecka Rebekah Reda Reed Reena Refugia Refugio Refugio Regan Regena Regenia Reggie Regina Reginald Regine Reginia Reid Reiko Reina Reinaldo Reita Rema Remedios Remona Rena Renae Renaldo Renata Renate Renato Renay Renda Rene Rene Renea Renee Renetta Renita Renna Ressie Reta Retha Retta Reuben Reva Rex Rey Reyes Reyna Reynalda Reynaldo Rhea Rheba Rhett Rhiannon Rhoda Rhona Rhonda Ria Ricarda Ricardo Rich Richard Richard Richelle Richie Rick Rickey Ricki Rickie Rickie Ricky Rico Rigoberto Rikki Riley Rima Rina Risa Rita Riva Rivka Rob Robbi Robbie Robbie Robbin Robby Robbyn Robena Robert Robert Roberta Roberto Roberto Robin Robin Robt Robyn Rocco Rochel Rochell Rochelle Rocio Rocky Rod Roderick Rodger Rodney Rodolfo Rodrick Rodrigo Rogelio Roger Roland Rolanda Rolande Rolando Rolf Rolland Roma Romaine Roman Romana Romelia Romeo Romona Ron Rona Ronald Ronald Ronda Roni Ronna Ronni Ronnie Ronnie Ronny Roosevelt Rory Rory Rosa Rosalba Rosalee Rosalia Rosalie Rosalina Rosalind Rosalinda Rosaline Rosalva Rosalyn Rosamaria Rosamond Rosana Rosann Rosanna Rosanne Rosaria Rosario Rosario Rosaura Roscoe Rose Roseann Roseanna Roseanne Roselee Roselia Roseline Rosella Roselle Roselyn Rosemarie Rosemary Rosena Rosenda Rosendo Rosetta Rosette Rosia Rosie Rosina Rosio Rosita Roslyn Ross Rossana Rossie Rosy Rowena Roxana Roxane Roxann Roxanna Roxanne Roxie Roxy Roy Roy Royal Royce Royce Rozanne Rozella Ruben Rubi Rubie Rubin Ruby Rubye Rudolf Rudolph Rudy Rudy Rueben Rufina Rufus Rupert Russ Russel Russell Russell Rusty Ruth Rutha Ruthann Ruthanne Ruthe Ruthie Ryan Ryan Ryann Sabina Sabine Sabra Sabrina Sacha Sachiko Sade Sadie Sadye Sage Sal Salena Salina Salley Sallie Sally Salome Salvador Salvatore Sam Sam Samantha Samara Samatha Samella Samira Sammie Sammie Sammy Sammy Samual Samuel Samuel Sana Sanda Sandee Sandi Sandie Sandra Sandy Sandy Sanford Sang Sang Sanjuana Sanjuanita Sanora Santa Santana Santiago Santina Santo Santos Santos Sara Sarah Sarai Saran Sari Sarina Sarita Sasha Saturnina Sau Saul Saundra Savanna Savannah Scarlet Scarlett Scot Scott Scott Scottie Scottie Scotty Sean Sean Season Sebastian Sebrina See Seema Selena Selene Selina Selma Sena Senaida September Serafina Serena Sergio Serina Serita Seth Setsuko Seymour Sha Shad Shae Shaina Shakia Shakira Shakita Shala Shalanda Shalon Shalonda Shameka Shamika Shan Shana Shanae Shanda Shandi Shandra Shane Shane Shaneka Shanel Shanell Shanelle Shani Shanice Shanika Shaniqua Shanita Shanna Shannan Shannon Shannon Shanon Shanta Shantae Shantay Shante Shantel Shantell Shantelle Shanti Shaquana Shaquita Shara Sharan Sharda Sharee Sharell Sharen Shari Sharice Sharie Sharika Sharilyn Sharita Sharla Sharleen Sharlene Sharmaine Sharolyn Sharon Sharonda Sharri Sharron Sharyl Sharyn Shasta Shaun Shaun Shauna Shaunda Shaunna Shaunta Shaunte Shavon Shavonda Shavonne Shawana Shawanda Shawanna Shawn Shawn Shawna Shawnda Shawnee Shawnna Shawnta Shay Shayla Shayna Shayne Shayne Shea Sheba Sheena Sheila Sheilah Shela Shelba Shelby Shelby Sheldon Shelia Shella Shelley Shelli Shellie Shelly Shelton Shemeka Shemika Shena Shenika Shenita Shenna Shera Sheree Sherell Sheri Sherice Sheridan Sherie Sherika Sherill Sherilyn Sherise Sherita Sherlene Sherley Sherly Sherlyn Sherman Sheron Sherrell Sherri Sherrie Sherril Sherrill Sherron Sherry Sherryl Sherwood Shery Sheryl Sheryll Shiela Shila Shiloh Shin Shira Shirely Shirl Shirlee Shirleen Shirlene Shirley Shirley Shirly Shizue Shizuko Shon Shona Shonda Shondra Shonna Shonta Shoshana Shu Shyla Sibyl Sid Sidney Sidney Sierra Signe Sigrid Silas Silva Silvana Silvia Sima Simon Simona Simone Simonne Sina Sindy Siobhan Sirena Siu Sixta Skye Slyvia So Socorro Sofia Soila Sol Sol Solange Soledad Solomon Somer Sommer Son Son Sona Sondra Song Sonia Sonja Sonny Sonya Soo Sook Soon Sophia Sophie Soraya Sparkle Spencer Spring Stacee Stacey Stacey Staci Stacia Stacie Stacy Stacy Stan Stanford Stanley Stanton Star Starla Starr Stasia Stefan Stefani Stefania Stefanie Stefany Steffanie Stella Stepanie Stephaine Stephan Stephane Stephani Stephania Stephanie Stephany Stephen Stephen Stephenie Stephine Stephnie Sterling Steve Steven Steven Stevie Stevie Stewart Stormy Stuart Su Suanne Sudie Sue Sueann Suellen Suk Sulema Sumiko Summer Sun Sunday Sung Sung Sunni Sunny Sunshine Susan Susana Susann Susanna Susannah Susanne Susie Susy Suzan Suzann Suzanna Suzanne Suzette Suzi Suzie Suzy Svetlana Sybil Syble Sydney Sydney Sylvester Sylvia Sylvie Synthia Syreeta Ta Tabatha Tabetha Tabitha Tad Tai Taina Taisha Tajuana Takako Takisha Talia Talisha Talitha Tam Tama Tamala Tamar Tamara Tamatha Tambra Tameika Tameka Tamekia Tamela Tamera Tamesha Tami Tamica Tamie Tamika Tamiko Tamisha Tammara Tammera Tammi Tammie Tammy Tamra Tana Tandra Tandy Taneka Tanesha Tangela Tania Tanika Tanisha Tanja Tanna Tanner Tanya Tara Tarah Taren Tari Tarra Tarsha Taryn Tasha Tashia Tashina Tasia Tatiana Tatum Tatyana Taunya Tawana Tawanda Tawanna Tawna Tawny Tawnya Taylor Taylor Tayna Ted Teddy Teena Tegan Teisha Telma Temeka Temika Tempie Temple Tena Tenesha Tenisha Tennie Tennille Teodora Teodoro Teofila Tequila Tera Tereasa Terence Teresa Terese Teresia Teresita Teressa Teri Terica Terina Terisa Terra Terrance Terrell Terrell Terrence Terresa Terri Terrie Terrilyn Terry Terry Tesha Tess Tessa Tessie Thad Thaddeus Thalia Thanh Thanh Thao Thea Theda Thelma Theo Theo Theodora Theodore Theola Theresa Therese Theresia Theressa Theron Thersa Thi Thomas Thomas Thomasena Thomasina Thomasine Thora Thresa Thu Thurman Thuy Tia Tiana Tianna Tiara Tien Tiera Tierra Tiesha Tifany Tiffaney Tiffani Tiffanie Tiffany Tiffiny Tijuana Tilda Tillie Tim Timika Timmy Timothy Timothy Tina Tinisha Tiny Tisa Tish Tisha Titus Tobi Tobias Tobie Toby Toby Toccara Tod Todd Toi Tom Tomas Tomasa Tomeka Tomi Tomika Tomiko Tommie Tommie Tommy Tommy Tommye Tomoko Tona Tonda Tonette Toney Toni Tonia Tonie Tonisha Tonita Tonja Tony Tony Tonya Tora Tori Torie Torri Torrie Tory Tory Tosha Toshia Toshiko Tova Towanda Toya Tracee Tracey Tracey Traci Tracie Tracy Tracy Tran Trang Travis Travis Treasa Treena Trena Trent Trenton Tresa Tressa Tressie Treva Trevor Trey Tricia Trina Trinh Trinidad Trinidad Trinity Trish Trisha Trista Tristan Tristan Troy Troy Trudi Trudie Trudy Trula Truman Tu Tuan Tula Tuyet Twana Twanda Twanna Twila Twyla Ty Tyesha Tyisha Tyler Tyler Tynisha Tyra Tyree Tyrell Tyron Tyrone Tyson Ula Ulrike Ulysses Un Una Ursula Usha Ute Vada Val Val Valarie Valda Valencia Valene Valentin Valentina Valentine Valentine Valeri Valeria Valerie Valery Vallie Valorie Valrie Van Van Vance Vanda Vanesa Vanessa Vanetta Vania Vanita Vanna Vannesa Vannessa Vashti Vasiliki Vaughn Veda Velda Velia Vella Velma Velva Velvet Vena Venessa Venetta Venice Venita Vennie Venus Veola Vera Verda Verdell Verdie Verena Vergie Verla Verlene Verlie Verline Vern Verna Vernell Vernetta Vernia Vernice Vernie Vernita Vernon Vernon Verona Veronica Veronika Veronique Versie Vertie Vesta Veta Vi Vicenta Vicente Vickey Vicki Vickie Vicky Victor Victor Victoria Victorina Vida Viki Vikki Vilma Vina Vince Vincent Vincenza Vincenzo Vinita Vinnie Viola Violet Violeta Violette Virgen Virgie Virgil Virgil Virgilio Virgina Virginia Vita Vito Viva Vivan Vivian Viviana Vivien Vivienne Von Voncile Vonda Vonnie Wade Wai Waldo Walker Wallace Wally Walter Walter Walton Waltraud Wan Wanda Waneta Wanetta Wanita Ward Warner Warren Wava Waylon Wayne Wei Weldon Wen Wendell Wendi Wendie Wendolyn Wendy Wenona Werner Wes Wesley Wesley Weston Whitley Whitney Whitney Wilber Wilbert Wilbur Wilburn Wilda Wiley Wilford Wilfred Wilfredo Wilhelmina Wilhemina Will Willa Willard Willena Willene Willetta Willette Willia William William Williams Willian Willie Willie Williemae Willis Willodean Willow Willy Wilma Wilmer Wilson Wilton Windy Winford Winfred Winifred Winnie Winnifred Winona Winston Winter Wm Wonda Woodrow Wyatt Wynell Wynona Xavier Xenia Xiao Xiomara Xochitl Xuan Yadira Yaeko Yael Yahaira Yajaira Yan Yang Yanira Yasmin Yasmine Yasuko Yee Yelena Yen Yer Yesenia Yessenia Yetta Yevette Yi Ying Yoko Yolanda Yolande Yolando Yolonda Yon Yong Yong Yoshie Yoshiko Youlanda Young Young Yu Yuette Yuk Yuki Yukiko Yuko Yulanda Yun Yung Yuonne Yuri Yuriko Yvette Yvone Yvonne Zachariah Zachary Zachery Zack Zackary Zada Zaida Zana Zandra Zane Zelda Zella Zelma Zena Zenaida Zenia Zenobia Zetta Zina Zita Zoe Zofia Zoila Zola Zona Zonia Zora Zoraida Zula Zulema Zulma \ No newline at end of file +name +Angela, +Anders, +Sarah, +Tanisha, +Saira, +Julia, +Eva, +Rebecca, +Lauren, +Bennett, diff --git a/db/seed_data/vote_seeds.csv b/db/seed_data/vote_seeds.csv new file mode 100644 index 0000000000..78765f7ade --- /dev/null +++ b/db/seed_data/vote_seeds.csv @@ -0,0 +1,19 @@ +work_id, user_id +1, 1, +1, 24, +1, 3, +1, 4, +2, 1, +3, 1, +4, 1, +5, 1, +6, 1, +7, 1, +2, 24, +3, 24, +4, 24, +5, 24, +6, 24, +5, 27, +9, 27, +4, 14, diff --git a/db/seeds.rb b/db/seeds.rb index 15d3340c7b..faf76c3ae1 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -11,12 +11,16 @@ WORK_FILE = Rails.root.join('db', 'seed_data', 'works.csv') puts "Loading raw work data from #{WORK_FILE}" + + work_failures = [] CSV.foreach(WORK_FILE, :headers => true) do |row| work = Work.new - work.id = row['id'] - work.name = row['name'] - work.vin = row['vin'] + work.category = row['category'] + work.title = row['title'] + work.creator = row['creator'] + work.publication_year = row['publication_year'] + work.description = row['description'] puts "Created work: #{work.inspect}" successful = work.save if !successful @@ -35,9 +39,9 @@ user_failures = [] CSV.foreach(USER_FILE, :headers => true) do |row| user = User.new - user.id = row['id'] + user.name = row['name'] - user.phone_num = row['phone_num'] + puts "Created user: #{user.inspect}" successful = user.save if !successful @@ -55,13 +59,11 @@ vote_failures = [] CSV.foreach(VOTE_FILE, :headers => true) do |row| - vote = Trip.new - vote.id = row['id'] + vote = Vote.new + vote.work_id = row['work_id'] vote.user_id = row['user_id'] - vote.date = Date.strptime(row['date'], '%Y-%m-%d') - vote.rating = row['rating'] - vote.cost = row['cost'] + puts "Created vote: #{vote.inspect}" successful = vote.save if !successful @@ -77,9 +79,9 @@ # tables, we've got to tell postgres to reload the latest ID # values. Otherwise when we create a new record it will try # to start at ID 1, which will be a conflict. -puts "Manually resetting PK sequence on each table" -ActiveRecord::Base.connection.tables.each do |t| - ActiveRecord::Base.connection.reset_pk_sequence!(t) -end +# puts "Manually resetting PK sequence on each table" +# ActiveRecord::Base.connection.tables.each do |t| +# ActiveRecord::Base.connection.reset_pk_sequence!(t) +# end puts "done" diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 0000000000..dc3ee79b5d --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the "{}" from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/votes.yml b/test/fixtures/votes.yml new file mode 100644 index 0000000000..dc3ee79b5d --- /dev/null +++ b/test/fixtures/votes.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the "{}" from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 0000000000..cc862ac2d9 --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,9 @@ +require "test_helper" + +describe User do + let(:user) { User.new } + + it "must be valid" do + value(user).must_be :valid? + end +end diff --git a/test/models/vote_test.rb b/test/models/vote_test.rb new file mode 100644 index 0000000000..fc15947bd3 --- /dev/null +++ b/test/models/vote_test.rb @@ -0,0 +1,9 @@ +require "test_helper" + +describe Vote do + let(:vote) { Vote.new } + + it "must be valid" do + value(vote).must_be :valid? + end +end From 656ccc823a3ccda77c7d6460e07ce582de4ac58b Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Fri, 13 Oct 2017 13:13:34 -0700 Subject: [PATCH 09/56] made both controllers user and vote --- app/assets/javascripts/user.js | 2 ++ app/assets/javascripts/vote.js | 2 ++ app/assets/stylesheets/user.scss | 3 +++ app/assets/stylesheets/vote.scss | 3 +++ app/controllers/user_controller.rb | 2 ++ app/controllers/vote_controller.rb | 2 ++ app/helpers/user_helper.rb | 2 ++ app/helpers/vote_helper.rb | 2 ++ test/controllers/user_controller_test.rb | 7 +++++++ test/controllers/vote_controller_test.rb | 7 +++++++ 10 files changed, 32 insertions(+) create mode 100644 app/assets/javascripts/user.js create mode 100644 app/assets/javascripts/vote.js create mode 100644 app/assets/stylesheets/user.scss create mode 100644 app/assets/stylesheets/vote.scss create mode 100644 app/controllers/user_controller.rb create mode 100644 app/controllers/vote_controller.rb create mode 100644 app/helpers/user_helper.rb create mode 100644 app/helpers/vote_helper.rb create mode 100644 test/controllers/user_controller_test.rb create mode 100644 test/controllers/vote_controller_test.rb diff --git a/app/assets/javascripts/user.js b/app/assets/javascripts/user.js new file mode 100644 index 0000000000..dee720facd --- /dev/null +++ b/app/assets/javascripts/user.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/javascripts/vote.js b/app/assets/javascripts/vote.js new file mode 100644 index 0000000000..dee720facd --- /dev/null +++ b/app/assets/javascripts/vote.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/user.scss b/app/assets/stylesheets/user.scss new file mode 100644 index 0000000000..7c5eca9cc1 --- /dev/null +++ b/app/assets/stylesheets/user.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the user 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/vote.scss b/app/assets/stylesheets/vote.scss new file mode 100644 index 0000000000..c96a1f0bef --- /dev/null +++ b/app/assets/stylesheets/vote.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the vote 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/user_controller.rb b/app/controllers/user_controller.rb new file mode 100644 index 0000000000..11046fdff5 --- /dev/null +++ b/app/controllers/user_controller.rb @@ -0,0 +1,2 @@ +class UserController < ApplicationController +end diff --git a/app/controllers/vote_controller.rb b/app/controllers/vote_controller.rb new file mode 100644 index 0000000000..96cb5e2e07 --- /dev/null +++ b/app/controllers/vote_controller.rb @@ -0,0 +1,2 @@ +class VoteController < ApplicationController +end diff --git a/app/helpers/user_helper.rb b/app/helpers/user_helper.rb new file mode 100644 index 0000000000..0147c3fe6a --- /dev/null +++ b/app/helpers/user_helper.rb @@ -0,0 +1,2 @@ +module UserHelper +end diff --git a/app/helpers/vote_helper.rb b/app/helpers/vote_helper.rb new file mode 100644 index 0000000000..8d6f8ca206 --- /dev/null +++ b/app/helpers/vote_helper.rb @@ -0,0 +1,2 @@ +module VoteHelper +end diff --git a/test/controllers/user_controller_test.rb b/test/controllers/user_controller_test.rb new file mode 100644 index 0000000000..362a4b744a --- /dev/null +++ b/test/controllers/user_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +describe UserController do + # it "must be a real test" do + # flunk "Need real tests" + # end +end diff --git a/test/controllers/vote_controller_test.rb b/test/controllers/vote_controller_test.rb new file mode 100644 index 0000000000..0bee545cf4 --- /dev/null +++ b/test/controllers/vote_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +describe VoteController do + # it "must be a real test" do + # flunk "Need real tests" + # end +end From 85ee849f2e7d2f131855a6326e3d082200e31d11 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Fri, 13 Oct 2017 13:24:41 -0700 Subject: [PATCH 10/56] populate use and vote tables and ran migration --- db/migrate/20171013200800_create_votes.rb | 2 ++ db/migrate/20171013200923_create_users.rb | 1 + db/schema.rb | 15 ++++++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/db/migrate/20171013200800_create_votes.rb b/db/migrate/20171013200800_create_votes.rb index 0d346db502..34468c0114 100644 --- a/db/migrate/20171013200800_create_votes.rb +++ b/db/migrate/20171013200800_create_votes.rb @@ -1,6 +1,8 @@ class CreateVotes < ActiveRecord::Migration[5.1] def change create_table :votes do |t| + t.integer :work_id + t.integer :user_id t.timestamps end diff --git a/db/migrate/20171013200923_create_users.rb b/db/migrate/20171013200923_create_users.rb index a588bf5a68..db0e1e3734 100644 --- a/db/migrate/20171013200923_create_users.rb +++ b/db/migrate/20171013200923_create_users.rb @@ -1,6 +1,7 @@ class CreateUsers < ActiveRecord::Migration[5.1] def change create_table :users do |t| + t.string :name t.timestamps end diff --git a/db/schema.rb b/db/schema.rb index 09be9639ae..fc25f793b3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,11 +10,24 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171010225142) do +ActiveRecord::Schema.define(version: 20171013200923) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" + create_table "users", force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "votes", force: :cascade do |t| + t.integer "work_id" + t.integer "user_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "works", force: :cascade do |t| t.string "category" t.string "title" From 979787b8a4035acdff0eb3182e30dc18939efece Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Fri, 13 Oct 2017 13:59:18 -0700 Subject: [PATCH 11/56] add column to the Works table and seed db --- app/models/user.rb | 1 + app/models/vote.rb | 2 ++ app/models/work.rb | 1 + db/migrate/20171013203749_add_creator_column_to_db.rb | 5 +++++ db/schema.rb | 3 ++- db/seed_data/{media_seeds.csv => work_seeds.csv} | 0 db/seeds.rb | 10 +++++----- 7 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20171013203749_add_creator_column_to_db.rb rename db/seed_data/{media_seeds.csv => work_seeds.csv} (100%) diff --git a/app/models/user.rb b/app/models/user.rb index 379658a509..db11855600 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,2 +1,3 @@ class User < ApplicationRecord + has_many :votes end diff --git a/app/models/vote.rb b/app/models/vote.rb index 4c58e4f3d5..68bda1c814 100644 --- a/app/models/vote.rb +++ b/app/models/vote.rb @@ -1,2 +1,4 @@ class Vote < ApplicationRecord + belongs_to :work + belongs_to :user end diff --git a/app/models/work.rb b/app/models/work.rb index 95322dd45e..0ee427352c 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -1,2 +1,3 @@ class Work < ApplicationRecord + has_many :votes end diff --git a/db/migrate/20171013203749_add_creator_column_to_db.rb b/db/migrate/20171013203749_add_creator_column_to_db.rb new file mode 100644 index 0000000000..acba256b85 --- /dev/null +++ b/db/migrate/20171013203749_add_creator_column_to_db.rb @@ -0,0 +1,5 @@ +class AddCreatorColumnToDb < ActiveRecord::Migration[5.1] + def change + add_column :works, :creator, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index fc25f793b3..1ecca07a24 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171013200923) do +ActiveRecord::Schema.define(version: 20171013203749) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -35,6 +35,7 @@ t.text "description" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "creator" end end diff --git a/db/seed_data/media_seeds.csv b/db/seed_data/work_seeds.csv similarity index 100% rename from db/seed_data/media_seeds.csv rename to db/seed_data/work_seeds.csv diff --git a/db/seeds.rb b/db/seeds.rb index faf76c3ae1..ece4becfd0 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -8,7 +8,7 @@ require 'csv' -WORK_FILE = Rails.root.join('db', 'seed_data', 'works.csv') +WORK_FILE = Rails.root.join('db', 'seed_data', 'work_seeds.csv') puts "Loading raw work data from #{WORK_FILE}" @@ -33,7 +33,7 @@ -USER_FILE = Rails.root.join('db', 'seed_data', 'users.csv') +USER_FILE = Rails.root.join('db', 'seed_data', 'user_seeds.csv') puts "Loading raw user data from #{USER_FILE}" user_failures = [] @@ -41,7 +41,7 @@ user = User.new user.name = row['name'] - + puts "Created user: #{user.inspect}" successful = user.save if !successful @@ -54,7 +54,7 @@ -VOTE_FILE = Rails.root.join('db', 'seed_data', 'votes.csv') +VOTE_FILE = Rails.root.join('db', 'seed_data', 'vote_seeds.csv') puts "Loading raw vote data from #{VOTE_FILE}" vote_failures = [] @@ -71,7 +71,7 @@ end end -puts "Added #{Trip.count} vote records" +puts "Added #{Vote.count} vote records" puts "#{vote_failures.length} votes failed to save" From d23f1d5048f9f27ebd7834e902f58f657fd9e231 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 14 Oct 2017 09:18:45 -0700 Subject: [PATCH 12/56] working on work index view. --- app/assets/javascripts/main.js | 2 ++ app/assets/javascripts/users.js | 2 ++ app/assets/javascripts/votes.js | 2 ++ app/assets/javascripts/work.js | 2 ++ app/assets/javascripts/works.js | 2 ++ app/assets/stylesheets/main.scss | 3 +++ app/assets/stylesheets/users.scss | 3 +++ app/assets/stylesheets/votes.scss | 3 +++ app/assets/stylesheets/work.scss | 3 +++ app/assets/stylesheets/works.scss | 3 +++ app/controllers/main_controller.rb | 2 ++ app/controllers/user_controller.rb | 2 -- app/controllers/users_controller.rb | 2 ++ app/controllers/vote_controller.rb | 2 -- app/controllers/votes_controller.rb | 2 ++ app/controllers/works_controller.rb | 7 +++++ app/helpers/main_helper.rb | 2 ++ app/helpers/users_helper.rb | 2 ++ app/helpers/votes_helper.rb | 2 ++ app/helpers/work_helper.rb | 2 ++ app/helpers/works_helper.rb | 2 ++ app/models/user.rb | 3 --- app/models/vote.rb | 4 --- app/models/work.rb | 1 - .../{main.html.erb => main/index.html.erb} | 0 app/views/works/index.html.erb | 24 +++++++++++++++++ config/routes.rb | 2 +- db/migrate/20171010225142_create_works.rb | 12 --------- db/migrate/20171013200800_create_votes.rb | 10 ------- db/migrate/20171013200923_create_users.rb | 9 ------- db/schema.rb | 7 ++++- test/controllers/main_controller_test.rb | 7 +++++ test/controllers/users_controller_test.rb | 7 +++++ test/controllers/votes_controller_test.rb | 7 +++++ test/controllers/work_controller_test.rb | 7 +++++ test/controllers/works_controller_test.rb | 7 +++++ test/fixtures/{users.yml => mains.yml} | 0 test/fixtures/votes.yml | 11 -------- test/models/main_test.rb | 9 +++++++ test/models/user_test.rb | 9 ------- test/models/vote_test.rb | 9 ------- test/models/work_test.rb | 26 ------------------- 42 files changed, 123 insertions(+), 100 deletions(-) create mode 100644 app/assets/javascripts/main.js create mode 100644 app/assets/javascripts/users.js create mode 100644 app/assets/javascripts/votes.js create mode 100644 app/assets/javascripts/work.js create mode 100644 app/assets/javascripts/works.js create mode 100644 app/assets/stylesheets/main.scss create mode 100644 app/assets/stylesheets/users.scss create mode 100644 app/assets/stylesheets/votes.scss create mode 100644 app/assets/stylesheets/work.scss create mode 100644 app/assets/stylesheets/works.scss create mode 100644 app/controllers/main_controller.rb delete mode 100644 app/controllers/user_controller.rb create mode 100644 app/controllers/users_controller.rb delete mode 100644 app/controllers/vote_controller.rb create mode 100644 app/controllers/votes_controller.rb create mode 100644 app/controllers/works_controller.rb create mode 100644 app/helpers/main_helper.rb create mode 100644 app/helpers/users_helper.rb create mode 100644 app/helpers/votes_helper.rb create mode 100644 app/helpers/work_helper.rb create mode 100644 app/helpers/works_helper.rb delete mode 100644 app/models/user.rb delete mode 100644 app/models/vote.rb rename app/views/{main.html.erb => main/index.html.erb} (100%) create mode 100644 app/views/works/index.html.erb delete mode 100644 db/migrate/20171010225142_create_works.rb delete mode 100644 db/migrate/20171013200800_create_votes.rb delete mode 100644 db/migrate/20171013200923_create_users.rb create mode 100644 test/controllers/main_controller_test.rb create mode 100644 test/controllers/users_controller_test.rb create mode 100644 test/controllers/votes_controller_test.rb create mode 100644 test/controllers/work_controller_test.rb create mode 100644 test/controllers/works_controller_test.rb rename test/fixtures/{users.yml => mains.yml} (100%) delete mode 100644 test/fixtures/votes.yml create mode 100644 test/models/main_test.rb delete mode 100644 test/models/user_test.rb delete mode 100644 test/models/vote_test.rb diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js new file mode 100644 index 0000000000..dee720facd --- /dev/null +++ b/app/assets/javascripts/main.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/javascripts/users.js b/app/assets/javascripts/users.js new file mode 100644 index 0000000000..dee720facd --- /dev/null +++ b/app/assets/javascripts/users.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/javascripts/votes.js b/app/assets/javascripts/votes.js new file mode 100644 index 0000000000..dee720facd --- /dev/null +++ b/app/assets/javascripts/votes.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/javascripts/work.js b/app/assets/javascripts/work.js new file mode 100644 index 0000000000..dee720facd --- /dev/null +++ b/app/assets/javascripts/work.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/javascripts/works.js b/app/assets/javascripts/works.js new file mode 100644 index 0000000000..dee720facd --- /dev/null +++ b/app/assets/javascripts/works.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss new file mode 100644 index 0000000000..a0d94c17c1 --- /dev/null +++ b/app/assets/stylesheets/main.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the main 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/users.scss b/app/assets/stylesheets/users.scss new file mode 100644 index 0000000000..1efc835ccd --- /dev/null +++ b/app/assets/stylesheets/users.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the users controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/votes.scss b/app/assets/stylesheets/votes.scss new file mode 100644 index 0000000000..4756424f13 --- /dev/null +++ b/app/assets/stylesheets/votes.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the votes 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/work.scss b/app/assets/stylesheets/work.scss new file mode 100644 index 0000000000..aa6af81f18 --- /dev/null +++ b/app/assets/stylesheets/work.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the work 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/works.scss b/app/assets/stylesheets/works.scss new file mode 100644 index 0000000000..8c84be8c43 --- /dev/null +++ b/app/assets/stylesheets/works.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the works 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/main_controller.rb b/app/controllers/main_controller.rb new file mode 100644 index 0000000000..6519d7b997 --- /dev/null +++ b/app/controllers/main_controller.rb @@ -0,0 +1,2 @@ +class MainController < ApplicationController +end diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb deleted file mode 100644 index 11046fdff5..0000000000 --- a/app/controllers/user_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class UserController < ApplicationController -end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb new file mode 100644 index 0000000000..3e74dea87f --- /dev/null +++ b/app/controllers/users_controller.rb @@ -0,0 +1,2 @@ +class UsersController < ApplicationController +end diff --git a/app/controllers/vote_controller.rb b/app/controllers/vote_controller.rb deleted file mode 100644 index 96cb5e2e07..0000000000 --- a/app/controllers/vote_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class VoteController < ApplicationController -end diff --git a/app/controllers/votes_controller.rb b/app/controllers/votes_controller.rb new file mode 100644 index 0000000000..ffdb2760e0 --- /dev/null +++ b/app/controllers/votes_controller.rb @@ -0,0 +1,2 @@ +class VotesController < ApplicationController +end diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb new file mode 100644 index 0000000000..4aad994a7b --- /dev/null +++ b/app/controllers/works_controller.rb @@ -0,0 +1,7 @@ +class WorksController < ApplicationController + def index + @works = Work.all + + end + +end diff --git a/app/helpers/main_helper.rb b/app/helpers/main_helper.rb new file mode 100644 index 0000000000..826effed96 --- /dev/null +++ b/app/helpers/main_helper.rb @@ -0,0 +1,2 @@ +module MainHelper +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb new file mode 100644 index 0000000000..2310a240d7 --- /dev/null +++ b/app/helpers/users_helper.rb @@ -0,0 +1,2 @@ +module UsersHelper +end diff --git a/app/helpers/votes_helper.rb b/app/helpers/votes_helper.rb new file mode 100644 index 0000000000..5a82eed07d --- /dev/null +++ b/app/helpers/votes_helper.rb @@ -0,0 +1,2 @@ +module VotesHelper +end diff --git a/app/helpers/work_helper.rb b/app/helpers/work_helper.rb new file mode 100644 index 0000000000..df0dd47fb4 --- /dev/null +++ b/app/helpers/work_helper.rb @@ -0,0 +1,2 @@ +module WorkHelper +end diff --git a/app/helpers/works_helper.rb b/app/helpers/works_helper.rb new file mode 100644 index 0000000000..ccb78c2b73 --- /dev/null +++ b/app/helpers/works_helper.rb @@ -0,0 +1,2 @@ +module WorksHelper +end diff --git a/app/models/user.rb b/app/models/user.rb deleted file mode 100644 index db11855600..0000000000 --- a/app/models/user.rb +++ /dev/null @@ -1,3 +0,0 @@ -class User < ApplicationRecord - has_many :votes -end diff --git a/app/models/vote.rb b/app/models/vote.rb deleted file mode 100644 index 68bda1c814..0000000000 --- a/app/models/vote.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Vote < ApplicationRecord - belongs_to :work - belongs_to :user -end diff --git a/app/models/work.rb b/app/models/work.rb index 0ee427352c..95322dd45e 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -1,3 +1,2 @@ class Work < ApplicationRecord - has_many :votes end diff --git a/app/views/main.html.erb b/app/views/main/index.html.erb similarity index 100% rename from app/views/main.html.erb rename to app/views/main/index.html.erb diff --git a/app/views/works/index.html.erb b/app/views/works/index.html.erb new file mode 100644 index 0000000000..3a9a841c76 --- /dev/null +++ b/app/views/works/index.html.erb @@ -0,0 +1,24 @@ +

stuff

+ + + + + + <% @works.each do |work| %> + <% if work.category == "album" %> + + + + + + + + + + + <% end %> + <% end %> +
TitleCreatorPublication Year
<%= work.title %><%= work.creator %><%= work.publication_year %>
+ + + diff --git a/config/routes.rb b/config/routes.rb index acbbb20943..9e0a3a905d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,5 @@ Rails.application.routes.draw do # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html - resources :work + resources :works end diff --git a/db/migrate/20171010225142_create_works.rb b/db/migrate/20171010225142_create_works.rb deleted file mode 100644 index 24109208bc..0000000000 --- a/db/migrate/20171010225142_create_works.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateWorks < ActiveRecord::Migration[5.1] - def change - create_table :works do |t| - t.string :category - t.string :title - t.integer :publication_year - t.text :description - - t.timestamps - end - end -end diff --git a/db/migrate/20171013200800_create_votes.rb b/db/migrate/20171013200800_create_votes.rb deleted file mode 100644 index 34468c0114..0000000000 --- a/db/migrate/20171013200800_create_votes.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateVotes < ActiveRecord::Migration[5.1] - def change - create_table :votes do |t| - t.integer :work_id - t.integer :user_id - - t.timestamps - end - end -end diff --git a/db/migrate/20171013200923_create_users.rb b/db/migrate/20171013200923_create_users.rb deleted file mode 100644 index db0e1e3734..0000000000 --- a/db/migrate/20171013200923_create_users.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateUsers < ActiveRecord::Migration[5.1] - def change - create_table :users do |t| - t.string :name - - t.timestamps - end - end -end diff --git a/db/schema.rb b/db/schema.rb index 1ecca07a24..62241e882a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,11 +10,16 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171013203749) do +ActiveRecord::Schema.define(version: 20171014135608) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" + create_table "mains", force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "users", force: :cascade do |t| t.string "name" t.datetime "created_at", null: false diff --git a/test/controllers/main_controller_test.rb b/test/controllers/main_controller_test.rb new file mode 100644 index 0000000000..33c8140433 --- /dev/null +++ b/test/controllers/main_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +describe MainController do + # it "must be a real test" do + # flunk "Need real tests" + # end +end diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb new file mode 100644 index 0000000000..89decb54e0 --- /dev/null +++ b/test/controllers/users_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +describe UsersController do + # it "must be a real test" do + # flunk "Need real tests" + # end +end diff --git a/test/controllers/votes_controller_test.rb b/test/controllers/votes_controller_test.rb new file mode 100644 index 0000000000..cf4d03935f --- /dev/null +++ b/test/controllers/votes_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +describe VotesController do + # it "must be a real test" do + # flunk "Need real tests" + # end +end diff --git a/test/controllers/work_controller_test.rb b/test/controllers/work_controller_test.rb new file mode 100644 index 0000000000..541e5a383a --- /dev/null +++ b/test/controllers/work_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +describe WorkController do + # it "must be a real test" do + # flunk "Need real tests" + # end +end diff --git a/test/controllers/works_controller_test.rb b/test/controllers/works_controller_test.rb new file mode 100644 index 0000000000..d95073c22e --- /dev/null +++ b/test/controllers/works_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +describe WorksController do + # it "must be a real test" do + # flunk "Need real tests" + # end +end diff --git a/test/fixtures/users.yml b/test/fixtures/mains.yml similarity index 100% rename from test/fixtures/users.yml rename to test/fixtures/mains.yml diff --git a/test/fixtures/votes.yml b/test/fixtures/votes.yml deleted file mode 100644 index dc3ee79b5d..0000000000 --- a/test/fixtures/votes.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the "{}" from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/models/main_test.rb b/test/models/main_test.rb new file mode 100644 index 0000000000..b5bbebd3a8 --- /dev/null +++ b/test/models/main_test.rb @@ -0,0 +1,9 @@ +require "test_helper" + +describe Main do + let(:main) { Main.new } + + it "must be valid" do + value(main).must_be :valid? + end +end diff --git a/test/models/user_test.rb b/test/models/user_test.rb deleted file mode 100644 index cc862ac2d9..0000000000 --- a/test/models/user_test.rb +++ /dev/null @@ -1,9 +0,0 @@ -require "test_helper" - -describe User do - let(:user) { User.new } - - it "must be valid" do - value(user).must_be :valid? - end -end diff --git a/test/models/vote_test.rb b/test/models/vote_test.rb deleted file mode 100644 index fc15947bd3..0000000000 --- a/test/models/vote_test.rb +++ /dev/null @@ -1,9 +0,0 @@ -require "test_helper" - -describe Vote do - let(:vote) { Vote.new } - - it "must be valid" do - value(vote).must_be :valid? - end -end diff --git a/test/models/work_test.rb b/test/models/work_test.rb index 42c5f4e494..f6fba7104d 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -6,30 +6,4 @@ it "must be valid" do value(work).must_be :valid? end - - # the work must have: - # a category, - # title, - # creator, - # publication_year, - # description, - # and ability to save/create. - - it "requires a category" do - work = Work.new - is_valid = work.valid? - is_valid.must_be false - - work.errors.messages.must_include :category - - end - - it "requires a title invalid without" do # why is there only one test? - work = Work.new - is_valid = work.valid? - is_valid.must_equal false #why is it false, copied from the books example - work.errors.messages.must_include :title - end - - end From b5bb2166dc843d5c2f10320e76e19a2f700f38f0 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 14 Oct 2017 09:55:47 -0700 Subject: [PATCH 13/56] complete work index view HMTL, given time DRY up code --- app/views/works/index.html.erb | 54 +++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/app/views/works/index.html.erb b/app/views/works/index.html.erb index 3a9a841c76..b3f84a22c2 100644 --- a/app/views/works/index.html.erb +++ b/app/views/works/index.html.erb @@ -1,24 +1,56 @@ -

stuff

- +# Want to DRY up code and will think about it later. +

Albums

+
+ <% @works.each do |work| %> <% if work.category == "album" %> - - - - - - + + + + + + <% end %> + <% end %> +
Title Creator Publication Year
<%= work.title %><%= work.creator %><%= work.publication_year %>
<%= work.title %><%= work.creator %><%= work.publication_year %>
+

Books

+ + + + - <% end %> - <% end %> + <% @works.each do |work| %> + <% if work.category == "book" %> + + + + + + <% end %> + <% end %>
TitleCreatorPublication Year
<%= work.title %><%= work.creator %><%= work.publication_year %>
+

Movies

- + + + + + + + <% @works.each do |work| %> + <% if work.category == "movie" %> + + + + + + <% end %> + <% end %> +
TitleCreatorPublication Year
<%= work.title %><%= work.creator %><%= work.publication_year %>
From 3629e4c30881e7d689ed225c55e76349b007fd85 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 14 Oct 2017 11:14:09 -0700 Subject: [PATCH 14/56] inadvertantly worked on work controller. CRUD function skeletons created without code guts. --- app/controllers/works_controller.rb | 22 ++++++++++++++++++++++ test/controllers/user_controller_test.rb | 7 ------- test/controllers/vote_controller_test.rb | 7 ------- test/controllers/work_controller_test.rb | 7 ------- test/models/main_test.rb | 14 +++++++------- test/models/work_test.rb | 16 ++++++++++++++-- 6 files changed, 43 insertions(+), 30 deletions(-) delete mode 100644 test/controllers/user_controller_test.rb delete mode 100644 test/controllers/vote_controller_test.rb delete mode 100644 test/controllers/work_controller_test.rb diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index 4aad994a7b..f90e8a1c0e 100644 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -1,7 +1,29 @@ class WorksController < ApplicationController def index @works = Work.all + end + + def new + + end + + def create end + def show + + end + + def edit + + end + + def update + + end + + def destroy + + end end diff --git a/test/controllers/user_controller_test.rb b/test/controllers/user_controller_test.rb deleted file mode 100644 index 362a4b744a..0000000000 --- a/test/controllers/user_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require "test_helper" - -describe UserController do - # it "must be a real test" do - # flunk "Need real tests" - # end -end diff --git a/test/controllers/vote_controller_test.rb b/test/controllers/vote_controller_test.rb deleted file mode 100644 index 0bee545cf4..0000000000 --- a/test/controllers/vote_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require "test_helper" - -describe VoteController do - # it "must be a real test" do - # flunk "Need real tests" - # end -end diff --git a/test/controllers/work_controller_test.rb b/test/controllers/work_controller_test.rb deleted file mode 100644 index 541e5a383a..0000000000 --- a/test/controllers/work_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require "test_helper" - -describe WorkController do - # it "must be a real test" do - # flunk "Need real tests" - # end -end diff --git a/test/models/main_test.rb b/test/models/main_test.rb index b5bbebd3a8..33138aecde 100644 --- a/test/models/main_test.rb +++ b/test/models/main_test.rb @@ -1,9 +1,9 @@ require "test_helper" -describe Main do - let(:main) { Main.new } - - it "must be valid" do - value(main).must_be :valid? - end -end +# describe Main do +# let(:main) { Main.new } +# +# it "must be valid" do +# value(main).must_be :valid? +# end +# end diff --git a/test/models/work_test.rb b/test/models/work_test.rb index f6fba7104d..539847dcf1 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -2,8 +2,20 @@ describe Work do let(:work) { Work.new } + describe "validations" do + it "create work with all fields" do + + end + # work = Work.new( + # category: "album", + # title: "test work", + # publication_year: 2017, + # desciption: "", + # creator: "me", + # ) + + # work.must_be :valid? - it "must be valid" do - value(work).must_be :valid? end + end From 471ce0022642acdbeb34262440cb20337383c29d Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 14 Oct 2017 11:19:18 -0700 Subject: [PATCH 15/56] add has many votes relationship to work model --- app/controllers/works_controller.rb | 4 +++- app/models/work.rb | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index f90e8a1c0e..adac6eeca9 100644 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -4,7 +4,9 @@ def index end def new - + if params[:id] + + end end def create diff --git a/app/models/work.rb b/app/models/work.rb index 95322dd45e..d719641392 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -1,2 +1,5 @@ class Work < ApplicationRecord + has_many :votes + + end From ed45614d76a5c7c01c844185b3ddaf5730685776 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 14 Oct 2017 11:37:06 -0700 Subject: [PATCH 16/56] add validation to work model --- app/models/work.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/work.rb b/app/models/work.rb index d719641392..4652a3f66c 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -1,5 +1,6 @@ class Work < ApplicationRecord has_many :votes - + validates :category, presence: true {message: "Must have category"} + validates :title, presence: true end From aa9097f4af7e404f0cfb0366384ca38757136a83 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 14 Oct 2017 12:46:01 -0700 Subject: [PATCH 17/56] add work new functionality to controller. --- app/controllers/main_controller.rb | 3 +++ app/controllers/works_controller.rb | 5 +++-- app/models/vote.rb | 5 +++++ app/models/work.rb | 10 ++++++++-- app/views/layouts/application.html.erb | 10 ++++++++++ app/views/main/index.html.erb | 6 +++++- config/routes.rb | 2 +- test/fixtures/votes.yml | 11 +++++++++++ test/models/vote_test.rb | 9 +++++++++ 9 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 app/models/vote.rb create mode 100644 test/fixtures/votes.yml create mode 100644 test/models/vote_test.rb diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 6519d7b997..25b21d72f2 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -1,2 +1,5 @@ class MainController < ApplicationController + def index + + end end diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index adac6eeca9..93656121fa 100644 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -4,8 +4,9 @@ def index end def new - if params[:id] - + @works = Work.new + if params[:creator] + @works.creator = params[:creator] end end diff --git a/app/models/vote.rb b/app/models/vote.rb new file mode 100644 index 0000000000..1ddb558060 --- /dev/null +++ b/app/models/vote.rb @@ -0,0 +1,5 @@ +class Vote < ApplicationRecord + belongs_to :work + belongs_to :user + +end diff --git a/app/models/work.rb b/app/models/work.rb index 4652a3f66c..b9e7133991 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -1,6 +1,12 @@ class Work < ApplicationRecord has_many :votes - validates :category, presence: true {message: "Must have category"} - validates :title, presence: true + # validates :category, presence: true {message: "Must have category"} + # validates :title, presence: true + + def self.spotlight + works = Work.all + spotlight = works.max_by {|work| work.votes.count} + spotlight.title + end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6af511b830..d746fed584 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -9,6 +9,16 @@ + +

Media Ranker

+ <%= yield %> diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index c36ff6e00c..2e7f46be82 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -1,5 +1,9 @@

+ Media spotlight: <%= link_to Work.spotlight %> +

+ +

Top Movies Top Books Top Albums -

+ diff --git a/config/routes.rb b/config/routes.rb index 9e0a3a905d..03341adc90 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,5 @@ Rails.application.routes.draw do # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html - + root 'main#index' resources :works end diff --git a/test/fixtures/votes.yml b/test/fixtures/votes.yml new file mode 100644 index 0000000000..dc3ee79b5d --- /dev/null +++ b/test/fixtures/votes.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the "{}" from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/vote_test.rb b/test/models/vote_test.rb new file mode 100644 index 0000000000..fc15947bd3 --- /dev/null +++ b/test/models/vote_test.rb @@ -0,0 +1,9 @@ +require "test_helper" + +describe Vote do + let(:vote) { Vote.new } + + it "must be valid" do + value(vote).must_be :valid? + end +end From 12a95dc615175097d4e126f63b93dc3935d0ab42 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 14 Oct 2017 13:11:30 -0700 Subject: [PATCH 18/56] add New functionality to controller and add new view (form_for) --- app/views/works/new.html.erb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/views/works/new.html.erb diff --git a/app/views/works/new.html.erb b/app/views/works/new.html.erb new file mode 100644 index 0000000000..9fa8def5b9 --- /dev/null +++ b/app/views/works/new.html.erb @@ -0,0 +1,18 @@ +

Add a media

+ +<%= form_for @works do |f| %> + <%= f.label :category %> + <%= f.text_field :category %> + + <%= f.label :title %> + <%= f.text_field :title %> + + <%= f.label :creator %> + <%= f.text_field :creator %> + + <%= f.label :publication_year %> + <%= f.text_field :publication_year %> + + <%= f.label :description %> + <%= f.text_field :description %> +<% end %> From 43f40c52adeb01ee857c64c53c0be0d86a59bf32 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 14 Oct 2017 14:03:57 -0700 Subject: [PATCH 19/56] implement new work functionality and view --- app/controllers/works_controller.rb | 18 +++++++++++++++--- app/views/works/new.html.erb | 2 ++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index 93656121fa..fab23c3bc9 100644 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -4,14 +4,20 @@ def index end def new - @works = Work.new + @work = Work.new if params[:creator] - @works.creator = params[:creator] + @work.creator = params[:creator] end end def create - + @work = Work.new(work_params + ) + if @work.save + redirect_to works_path + else + render :new + end end def show @@ -29,4 +35,10 @@ def update def destroy end + + private + + def work_params + return params.require(:work).permit(:catergory, :title, :creator, :publication_year, :description) + end end diff --git a/app/views/works/new.html.erb b/app/views/works/new.html.erb index 9fa8def5b9..1cef8967e4 100644 --- a/app/views/works/new.html.erb +++ b/app/views/works/new.html.erb @@ -15,4 +15,6 @@ <%= f.label :description %> <%= f.text_field :description %> + + <%= f.submit "Create Media" %> <% end %> From e57991a1d8db991c20e5936763b0b6a3061d2abd Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 14 Oct 2017 15:58:53 -0700 Subject: [PATCH 20/56] check ou New-work branch to add error message accounting, complete error message accounting. --- app/models/work.rb | 2 +- app/views/layouts/_error_messages.html.erb | 19 +++++++++++++++++++ app/views/works/new.html.erb | 4 +++- test/models/work_test.rb | 16 +++++++++++++--- 4 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 app/views/layouts/_error_messages.html.erb diff --git a/app/models/work.rb b/app/models/work.rb index b9e7133991..88d8b7de3e 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -1,7 +1,7 @@ class Work < ApplicationRecord has_many :votes - # validates :category, presence: true {message: "Must have category"} + validates :category, presence: { message: "Must have category" } # validates :title, presence: true def self.spotlight diff --git a/app/views/layouts/_error_messages.html.erb b/app/views/layouts/_error_messages.html.erb new file mode 100644 index 0000000000..179363e32a --- /dev/null +++ b/app/views/layouts/_error_messages.html.erb @@ -0,0 +1,19 @@ + + +<% if model.errors.messages.length > 0 %> +
+

Error Happened!

+
    + <% model.errors.messages.each do |field, problems| %> + <% problems.each do |problem| %> +
      + + <%= field %>: + + <%= problem %> +
    + <% end %> + <% end %> +
+
+<% end %> diff --git a/app/views/works/new.html.erb b/app/views/works/new.html.erb index 1cef8967e4..80a9cb4653 100644 --- a/app/views/works/new.html.erb +++ b/app/views/works/new.html.erb @@ -1,6 +1,8 @@

Add a media

+ +<%= render partial: 'layouts/error_messages', locals:{ model: @work} %> -<%= form_for @works do |f| %> +<%= form_for @work do |f| %> <%= f.label :category %> <%= f.text_field :category %> diff --git a/test/models/work_test.rb b/test/models/work_test.rb index 539847dcf1..d85131a620 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -3,9 +3,9 @@ describe Work do let(:work) { Work.new } describe "validations" do - it "create work with all fields" do - - end + # it "create work with all fields" do + # + # end # work = Work.new( # category: "album", # title: "test work", @@ -16,6 +16,16 @@ # work.must_be :valid? + + # it "requires category" do + # work = Work.new + # + # result = work.valid? + # result.must_be false + # work.errors.messages.must_include :category + # + # + # end end end From 9cc68249c5abb6a743939f240f9168cf47937a61 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 14 Oct 2017 19:01:03 -0700 Subject: [PATCH 21/56] working on votes in the homepage view and discovered votes did not seed correctly. So rails db:reset and now both user and votes are not seeding. Going to work on something different. --- app/controllers/users_controller.rb | 4 ++++ app/models/work.rb | 14 ++++++++++++-- app/views/main/index.html.erb | 12 ++++++++++-- db/seeds.rb | 1 - 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3e74dea87f..661909d8c7 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,2 +1,6 @@ class UsersController < ApplicationController + + def new + + end end diff --git a/app/models/work.rb b/app/models/work.rb index 88d8b7de3e..7a018235b4 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -2,11 +2,21 @@ class Work < ApplicationRecord has_many :votes validates :category, presence: { message: "Must have category" } - # validates :title, presence: true + validates :title, presence: { message: "Must have a title" } def self.spotlight works = Work.all spotlight = works.max_by {|work| work.votes.count} - spotlight.title + + return spotlight.title + end + + def self.sort(category) + return Work.all.where(category: category).sort_by{|work| -work.votes.count} + end + + def self.top_ten(category) + top_ten = self.sort(category) + return top_ten end end diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index 2e7f46be82..c0fe97205e 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -3,7 +3,15 @@

- Top Movies - Top Books Top Albums

+
    + <% Work.top_ten("album").each do |album| %> +
  • + <%= album.title %> + <%= album.votes.count %> +
  • + + <% end %> + +
diff --git a/db/seeds.rb b/db/seeds.rb index ece4becfd0..4c99d8b263 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -39,7 +39,6 @@ user_failures = [] CSV.foreach(USER_FILE, :headers => true) do |row| user = User.new - user.name = row['name'] puts "Created user: #{user.inspect}" From 3bede695080d6929503fc23dbfa94366c8491bf1 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 14 Oct 2017 19:47:24 -0700 Subject: [PATCH 22/56] create helper method find_work_by_params_id for show method in work controller. apply this helper method as before_actio to show, edit, update, and destroy. --- app/controllers/works_controller.rb | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index fab23c3bc9..89e4c6559d 100644 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -1,4 +1,6 @@ class WorksController < ApplicationController + before_action :find_work_by_params_id, only: [:show, :edit, :update, :destroy] + def index @works = Work.all end @@ -20,25 +22,26 @@ def create end end - def show + def show ; end - end + def edit ; end - def edit + def update ; end - end + def destroy ; end - def update + private + def work_params + return params.require(:work).permit(:catergory, :title, :creator, :publication_year, :description) end - def destroy + def find_work_by_params_id + @work = Work.find_by(id: params[:id]) - end - - private + unless @work + head :not_found + end - def work_params - return params.require(:work).permit(:catergory, :title, :creator, :publication_year, :description) end end From 494a0e7563e3882b5619bf918e3bbac30a8871dc Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 14 Oct 2017 20:46:07 -0700 Subject: [PATCH 23/56] complete work show view. still needs the UpVote functionality and desplaying Users who voted for work. --- app/controllers/works_controller.rb | 8 ++++++-- app/models/work.rb | 4 ++-- app/views/main/index.html.erb | 4 ++-- app/views/works/show.html.erb | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 app/views/works/show.html.erb diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index 89e4c6559d..a82639a8f7 100644 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -26,9 +26,13 @@ def show ; end def edit ; end - def update ; end + def update - def destroy ; end + end + + def destroy + + end private diff --git a/app/models/work.rb b/app/models/work.rb index 7a018235b4..ba659ad2cb 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -2,13 +2,13 @@ class Work < ApplicationRecord has_many :votes validates :category, presence: { message: "Must have category" } - validates :title, presence: { message: "Must have a title" } + validates :title, presence: { message: "Must have a title" } def self.spotlight works = Work.all spotlight = works.max_by {|work| work.votes.count} - return spotlight.title + return spotlight end def self.sort(category) diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index c0fe97205e..f32e7aca8d 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -1,5 +1,5 @@

- Media spotlight: <%= link_to Work.spotlight %> + Media spotlight: <%= link_to Work.spotlight.title, work_path(Work.spotlight.id) %>

@@ -8,7 +8,7 @@
    <% Work.top_ten("album").each do |album| %>
  • - <%= album.title %> + <%= link_to album.title %> <%= album.votes.count %>
  • diff --git a/app/views/works/show.html.erb b/app/views/works/show.html.erb new file mode 100644 index 0000000000..5c8780d082 --- /dev/null +++ b/app/views/works/show.html.erb @@ -0,0 +1,18 @@ +

    Need to work on UpVote and displaying the users who voted for this work.



    + + +

    + <%= @work.title %> +

    +
    +

    Created by: <%= @work.creator %>

    +

    Published: <%= @work.publication_year %>

    + +
    + +
    + <%= link_to "Home", works_path %> + <%= link_to "Edit", edit_work_path %> + <%= link_to "UpVote" %> + <%= link_to "Delete", work_path, method: :destroy, data: { confirm: "Are you sure?" } %> +
    From 2dee4a5bddf5fb8f3ed0dd8c1701f2dcdd11e496 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 14 Oct 2017 22:57:26 -0700 Subject: [PATCH 24/56] add user model and reset database. project is back on trackgit add . --- app/models/user.rb | 2 ++ db/seed_data/vote_seeds.csv | 38 ++++++++++++++++++------------------- test/fixtures/users.yml | 11 +++++++++++ test/models/user_test.rb | 9 +++++++++ 4 files changed, 41 insertions(+), 19 deletions(-) create mode 100644 app/models/user.rb create mode 100644 test/fixtures/users.yml create mode 100644 test/models/user_test.rb diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 0000000000..379658a509 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,2 @@ +class User < ApplicationRecord +end diff --git a/db/seed_data/vote_seeds.csv b/db/seed_data/vote_seeds.csv index 78765f7ade..e2ca83dfcf 100644 --- a/db/seed_data/vote_seeds.csv +++ b/db/seed_data/vote_seeds.csv @@ -1,19 +1,19 @@ -work_id, user_id -1, 1, -1, 24, -1, 3, -1, 4, -2, 1, -3, 1, -4, 1, -5, 1, -6, 1, -7, 1, -2, 24, -3, 24, -4, 24, -5, 24, -6, 24, -5, 27, -9, 27, -4, 14, +user_id,work_id +1,1, +1,24, +1,3, +1,4, +2,1, +3,1, +4,1, +5,1, +6,1, +7,1, +2,24, +3,24, +4,24, +5,24, +6,24, +5,23, +9,23, +4,14, diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 0000000000..dc3ee79b5d --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the "{}" from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 0000000000..cc862ac2d9 --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,9 @@ +require "test_helper" + +describe User do + let(:user) { User.new } + + it "must be valid" do + value(user).must_be :valid? + end +end From fd19994b09b0f5caa2e5fa46a946e1ac343057d5 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 15 Oct 2017 08:53:38 -0700 Subject: [PATCH 25/56] complete Show view for Work --- app/models/user.rb | 1 + app/models/work.rb | 4 +++- app/views/main/index.html.erb | 10 +++++++--- app/views/works/show.html.erb | 19 ++++++++++++++++--- config/routes.rb | 4 ++++ 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 379658a509..db11855600 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,2 +1,3 @@ class User < ApplicationRecord + has_many :votes end diff --git a/app/models/work.rb b/app/models/work.rb index ba659ad2cb..b21fc10bf4 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -4,6 +4,8 @@ class Work < ApplicationRecord validates :category, presence: { message: "Must have category" } validates :title, presence: { message: "Must have a title" } + +# feedback from rideshare noted using an instance variable instead of .self. I worked on using @blah and was unsuccessful. def self.spotlight works = Work.all spotlight = works.max_by {|work| work.votes.count} @@ -16,7 +18,7 @@ def self.sort(category) end def self.top_ten(category) - top_ten = self.sort(category) + top_ten = self.sort(category)[0..9] return top_ten end end diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index f32e7aca8d..e7e402e110 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -1,5 +1,9 @@ + +

    - Media spotlight: <%= link_to Work.spotlight.title, work_path(Work.spotlight.id) %> + Media spotlight: <%= link_to Work.spotlight.title, work_path(Work.spotlight.id) %> by: + <%= Work.spotlight.creator %> + <%= Work.spotlight.votes.count %> votes

    @@ -8,8 +12,8 @@
      <% Work.top_ten("album").each do |album| %>
    • - <%= link_to album.title %> - <%= album.votes.count %> + <%= link_to album.title, work_path(album.id)%> by: <%= Work.spotlight.creator %> + <%= album.votes.count %> votes
    • <% end %> diff --git a/app/views/works/show.html.erb b/app/views/works/show.html.erb index 5c8780d082..f4c1a7cda4 100644 --- a/app/views/works/show.html.erb +++ b/app/views/works/show.html.erb @@ -1,4 +1,7 @@ -

      Need to work on UpVote and displaying the users who voted for this work.



      +

      Need to work on UpVote and displaying the users who voted for this work. + +<%= params %> +



      @@ -7,12 +10,22 @@

      Created by: <%= @work.creator %>

      Published: <%= @work.publication_year %>

      - +
      - <%= link_to "Home", works_path %> + <%= link_to "Home", root_path %> <%= link_to "Edit", edit_work_path %> <%= link_to "UpVote" %> <%= link_to "Delete", work_path, method: :destroy, data: { confirm: "Are you sure?" } %>
      + +
        + <% @work.votes.each do |vote| %> + +
      • + <%= link_to User.find(vote.user_id).name, work_user_path(:work_id) %> +
      • +
        + <% end %> +
      diff --git a/config/routes.rb b/config/routes.rb index 03341adc90..f306447cbf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,4 +2,8 @@ # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html root 'main#index' resources :works + + resources :works do + resources :user, only: [:show] + end end From 6218f18bd49a34206b73ff8d403b38d1029acdf0 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 15 Oct 2017 09:22:46 -0700 Subject: [PATCH 26/56] making sure work is on GitHub --- app/views/main/index.html.erb | 35 +++++++++++++++++++++++++++++++---- config/routes.rb | 2 +- test/models/user_test.rb | 6 +++--- test/models/vote_test.rb | 6 +++--- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index e7e402e110..26a6d74fd5 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -1,4 +1,6 @@ - +

      Media spotlight: <%= link_to Work.spotlight.title, work_path(Work.spotlight.id) %> by: @@ -9,13 +11,38 @@

      Top Albums

      +
        - <% Work.top_ten("album").each do |album| %> + <% Work.top_ten("album").each do |work| %>
      • - <%= link_to album.title, work_path(album.id)%> by: <%= Work.spotlight.creator %> - <%= album.votes.count %> votes + <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> + <%= work.votes.count %> votes
      • + <% end %> +
      +

      + Top Books +

      + +
        + <% Work.top_ten("book").each do |work| %> +
      • + <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> + <%= work.votes.count %> votes +
      • <% end %> +
      + +

      + Top Movies +

      +
        + <% Work.top_ten("movie").each do |work| %> +
      • + <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> + <%= work.votes.count %> votes +
      • + <% end %>
      diff --git a/config/routes.rb b/config/routes.rb index f306447cbf..f175b338da 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,6 +4,6 @@ resources :works resources :works do - resources :user, only: [:show] + resources :user, only: [:show, :edit, :delete] end end diff --git a/test/models/user_test.rb b/test/models/user_test.rb index cc862ac2d9..b507720193 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -3,7 +3,7 @@ describe User do let(:user) { User.new } - it "must be valid" do - value(user).must_be :valid? - end + # it "must be valid" do + # value(user).must_be :valid? + # end end diff --git a/test/models/vote_test.rb b/test/models/vote_test.rb index fc15947bd3..6a6dc42750 100644 --- a/test/models/vote_test.rb +++ b/test/models/vote_test.rb @@ -3,7 +3,7 @@ describe Vote do let(:vote) { Vote.new } - it "must be valid" do - value(vote).must_be :valid? - end + # it "must be valid" do + # value(vote).must_be :valid? + # end end From f3f03ae6979568cffa3928e521818020932eff28 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 15 Oct 2017 10:07:31 -0700 Subject: [PATCH 27/56] made partial for New and Edit forms. implement partial in each of their views. --- app/controllers/works_controller.rb | 9 ++++++++- app/views/layouts/_error_messages.html.erb | 6 ++---- app/views/works/_form.html.erb | 20 ++++++++++++++++++++ app/views/works/edit.html.erb | 5 +++++ app/views/works/new.html.erb | 19 +------------------ 5 files changed, 36 insertions(+), 23 deletions(-) create mode 100644 app/views/works/_form.html.erb create mode 100644 app/views/works/edit.html.erb diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index a82639a8f7..39d8a94168 100644 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -27,7 +27,14 @@ def show ; end def edit ; end def update - + @work.update_attributes(work_params) + if save_and_flash(@work) + redirect_to work_path(@work) + return + else + render :edit, status: :bad_request + return + end end def destroy diff --git a/app/views/layouts/_error_messages.html.erb b/app/views/layouts/_error_messages.html.erb index 179363e32a..5acd4df225 100644 --- a/app/views/layouts/_error_messages.html.erb +++ b/app/views/layouts/_error_messages.html.erb @@ -7,10 +7,8 @@ <% model.errors.messages.each do |field, problems| %> <% problems.each do |problem| %>
        - - <%= field %>: - - <%= problem %> + <%= field.capitalize %>: <%= problem %> +
      <% end %> <% end %> diff --git a/app/views/works/_form.html.erb b/app/views/works/_form.html.erb new file mode 100644 index 0000000000..b8be6ea36e --- /dev/null +++ b/app/views/works/_form.html.erb @@ -0,0 +1,20 @@ +
      + <%= form_for @work do |f| %> + <%= f.label :category %> + <%= f.text_field :category %> + + <%= f.label :title %> + <%= f.text_field :title %> + + <%= f.label :creator %> + <%= f.text_field :creator %> + + <%= f.label :publication_year %> + <%= f.text_field :publication_year %> + + <%= f.label :description %> + <%= f.text_field :description %> + + <%= f.submit button_text %> + <% end %> +
      diff --git a/app/views/works/edit.html.erb b/app/views/works/edit.html.erb new file mode 100644 index 0000000000..b73d88f678 --- /dev/null +++ b/app/views/works/edit.html.erb @@ -0,0 +1,5 @@ +

      Edit Media

      + +<%= render partial: 'layouts/error_messages', locals: { model: @work } %> + +<%= render partial: 'form', locals: { button_text: "Edit Media"} %> diff --git a/app/views/works/new.html.erb b/app/views/works/new.html.erb index 80a9cb4653..a0ea940794 100644 --- a/app/views/works/new.html.erb +++ b/app/views/works/new.html.erb @@ -2,21 +2,4 @@ <%= render partial: 'layouts/error_messages', locals:{ model: @work} %> -<%= form_for @work do |f| %> - <%= f.label :category %> - <%= f.text_field :category %> - - <%= f.label :title %> - <%= f.text_field :title %> - - <%= f.label :creator %> - <%= f.text_field :creator %> - - <%= f.label :publication_year %> - <%= f.text_field :publication_year %> - - <%= f.label :description %> - <%= f.text_field :description %> - - <%= f.submit "Create Media" %> -<% end %> +<%= render partial: 'form', locals: { button_text: "Create Media" } %> From 13c0ab76e3affd9be495c71a7f520f8bbc734f40 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 15 Oct 2017 11:13:16 -0700 Subject: [PATCH 28/56] update works without ouputing 'success' message. --- app/controllers/application_controller.rb | 17 +++++++++++++++++ app/controllers/works_controller.rb | 4 ++-- config/routes.rb | 1 + test/models/work_test.rb | 9 ++++----- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1c07694e9d..55ead23dc4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,20 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception + + protected + + def save_and_flash(model) + result = model.save + + if result + flash[:status] = :success + flash[:message] = "Successfully saved #{model.class} #{model.id}" + else + flash.now[:status] = :failure + flash.now[:message] = "Failed to save #{model.class}" + flash.now[:details] = model.errors.messages + end + return result + end + end diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index 39d8a94168..54820773d0 100644 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -15,10 +15,10 @@ def new def create @work = Work.new(work_params ) - if @work.save + if save_and_flash(@work) redirect_to works_path else - render :new + render :new, status: :bad_request end end diff --git a/config/routes.rb b/config/routes.rb index f175b338da..4042ef98e4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,6 +2,7 @@ # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html root 'main#index' resources :works + resources :user resources :works do resources :user, only: [:show, :edit, :delete] diff --git a/test/models/work_test.rb b/test/models/work_test.rb index d85131a620..1c5756670e 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -3,9 +3,7 @@ describe Work do let(:work) { Work.new } describe "validations" do - # it "create work with all fields" do - # - # end + it "create work with all fields" do # work = Work.new( # category: "album", # title: "test work", @@ -13,8 +11,10 @@ # desciption: "", # creator: "me", # ) - + # # work.must_be :valid? + end + # it "requires category" do @@ -27,5 +27,4 @@ # # end end - end From c84f73738cc516cab54840b6d1a083d874e24a17 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 15 Oct 2017 12:13:00 -0700 Subject: [PATCH 29/56] made link to work detail page from all works page --- app/controllers/works_controller.rb | 3 +++ app/views/works/index.html.erb | 2 +- app/views/works/show.html.erb | 26 +++++++++++++++++--------- config/routes.rb | 2 +- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index 54820773d0..7d6f993397 100644 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -26,6 +26,7 @@ def show ; end def edit ; end +# "success" message from the #save_and_flash method is not working. however database is updated. def update @work.update_attributes(work_params) if save_and_flash(@work) @@ -38,6 +39,8 @@ def update end def destroy + @work.destroy + redirect_to works_path end diff --git a/app/views/works/index.html.erb b/app/views/works/index.html.erb index b3f84a22c2..8dd1b7d860 100644 --- a/app/views/works/index.html.erb +++ b/app/views/works/index.html.erb @@ -9,7 +9,7 @@ <% @works.each do |work| %> <% if work.category == "album" %> - <%= work.title %> + <%= link_to work.title, work_path(work.id) %> <%= work.creator %> <%= work.publication_year %> diff --git a/app/views/works/show.html.erb b/app/views/works/show.html.erb index f4c1a7cda4..7b87a149a9 100644 --- a/app/views/works/show.html.erb +++ b/app/views/works/show.html.erb @@ -19,13 +19,21 @@ <%= link_to "UpVote" %> <%= link_to "Delete", work_path, method: :destroy, data: { confirm: "Are you sure?" } %> + + + + + -
        - <% @work.votes.each do |vote| %> - -
      • - <%= link_to User.find(vote.user_id).name, work_user_path(:work_id) %> -
      • -
        - <% end %> -
      + + + <% @work.votes.each do |vote| %> + + + + + + + <% end %> + +
      UserDate
      <%= link_to User.find(vote.user_id).name, work_user_path(:work_id) %><%= Vote.find(vote.user_id).updated_at %>
      diff --git a/config/routes.rb b/config/routes.rb index 4042ef98e4..9c97834533 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,7 +3,7 @@ root 'main#index' resources :works resources :user - + resources :works do resources :user, only: [:show, :edit, :delete] end From f31502af521e5827fb021ab78cc33b7e05efed8a Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 15 Oct 2017 13:14:54 -0700 Subject: [PATCH 30/56] write tests for work model's validations and description limit --- app/views/works/show.html.erb | 10 +++---- test/models/work_test.rb | 56 +++++++++++++++++++++++++++++------ 2 files changed, 52 insertions(+), 14 deletions(-) diff --git a/app/views/works/show.html.erb b/app/views/works/show.html.erb index 7b87a149a9..bd0fcbafca 100644 --- a/app/views/works/show.html.erb +++ b/app/views/works/show.html.erb @@ -1,8 +1,8 @@ -

      Need to work on UpVote and displaying the users who voted for this work. - +

      Need to work on UpVote.



      +

      <%= params %> -



      - +

      +

      <%= @work.title %> @@ -17,7 +17,7 @@ <%= link_to "Home", root_path %> <%= link_to "Edit", edit_work_path %> <%= link_to "UpVote" %> - <%= link_to "Delete", work_path, method: :destroy, data: { confirm: "Are you sure?" } %> + <%= link_to "Delete", work_path(@work), method: :delete, data: { confirm: "Are you sure?" } %> diff --git a/test/models/work_test.rb b/test/models/work_test.rb index 1c5756670e..78124ec39b 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -3,6 +3,8 @@ describe Work do let(:work) { Work.new } describe "validations" do + + #for the following tests I understand the are 'wet' and could be DRYed. At the moment, I am focuesed on completing the assignment. If there is time I will go back and figure out how to utilize the DRYing method taught in class. it "create work with all fields" do # work = Work.new( # category: "album", @@ -17,14 +19,50 @@ - # it "requires category" do - # work = Work.new - # - # result = work.valid? - # result.must_be false - # work.errors.messages.must_include :category - # - # - # end + it "requires category" do + work = Work.new + + result = work.valid? + result.must_be false + work.errors.messages.must_include :category + end + + it "requires title" do + work = Work.new + + result = work.valid? + result.must_be false + work.errors.messages.must_include :title + end + end # end describe + + describe "description" do + it "rejects descriptions >500 char" do + desc = "a" * 501 + + work = Work.new(description: desc) + + result = work.valid? + result.must_be false + work.errors.messages.must_include :description + end # end it + + it "allows description <= 500 char" do + descriptions = [ + "a" * 500, + "a" * 10, + "a" * 0 + ] + + descriptions.each do |desc| + result = Work.new(category: "album", title: "test", description: desc) + + result.must_be :valid? + end + end + end # end description + + describe "" do + end end From 6653a852c5c17ac39bf284dac4f6a79656b76d03 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 15 Oct 2017 13:43:55 -0700 Subject: [PATCH 31/56] populated work and vote yml files with fixture data --- app/models/work.rb | 9 +++------ test/fixtures/votes.yml | 10 ++++++---- test/fixtures/works.yml | 18 ++++++++++++++---- test/models/work_test.rb | 4 +++- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/app/models/work.rb b/app/models/work.rb index b21fc10bf4..164c863729 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -13,12 +13,9 @@ def self.spotlight return spotlight end - def self.sort(category) - return Work.all.where(category: category).sort_by{|work| -work.votes.count} - end - def self.top_ten(category) - top_ten = self.sort(category)[0..9] - return top_ten + return Work.all.where(category: category).sort_by{|work| -work.votes.count}[0..9] end + + end diff --git a/test/fixtures/votes.yml b/test/fixtures/votes.yml index dc3ee79b5d..c9d7197e1c 100644 --- a/test/fixtures/votes.yml +++ b/test/fixtures/votes.yml @@ -4,8 +4,10 @@ # model remove the "{}" from the fixture names and add the columns immediately # below each fixture, per the syntax in the comments below # -one: {} -# column: value +vote_one: + user_id: 1 + work_id: 1 # -two: {} -# column: value +vote_two: + user_id: 2 + work_id: 3 diff --git a/test/fixtures/works.yml b/test/fixtures/works.yml index dc3ee79b5d..7c8a656e5e 100644 --- a/test/fixtures/works.yml +++ b/test/fixtures/works.yml @@ -4,8 +4,18 @@ # model remove the "{}" from the fixture names and add the columns immediately # below each fixture, per the syntax in the comments below # -one: {} -# column: value +work_one: + category: album + title: test_record + creator: me + desciption: stuff + publication_year: 2017 + vote: vote_two # -two: {} -# column: value +work_two: + category: movie + title: indiana jones + create: speilberg + description: action-adventure + publication_year: 1987 + vote: vote_one diff --git a/test/models/work_test.rb b/test/models/work_test.rb index 78124ec39b..fd4041fc01 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -62,7 +62,9 @@ end end # end description - describe "" do + describe "relations" do + it "has many votes" do + end end end From 0ecb9e0fba23916ad4e6b6719af9b08af8392d5b Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 15 Oct 2017 14:07:55 -0700 Subject: [PATCH 32/56] not sure how to use fixture data. Did tests the hard way. write one test for work relationship to votes. --- test/fixtures/works.yml | 4 ++-- test/models/work_test.rb | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/fixtures/works.yml b/test/fixtures/works.yml index 7c8a656e5e..45d41fd1ff 100644 --- a/test/fixtures/works.yml +++ b/test/fixtures/works.yml @@ -10,7 +10,7 @@ work_one: creator: me desciption: stuff publication_year: 2017 - vote: vote_two + # work_two: category: movie @@ -18,4 +18,4 @@ work_two: create: speilberg description: action-adventure publication_year: 1987 - vote: vote_one + diff --git a/test/models/work_test.rb b/test/models/work_test.rb index fd4041fc01..4627dd2d09 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -64,7 +64,12 @@ describe "relations" do it "has many votes" do - + work = Work.new(title: "test") + work.must_respond_to :votes end + end #end description + + describe " " do + end end From 3cf4abbdca18e3cbf72537612c2b48fe525e5f1c Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 15 Oct 2017 14:33:48 -0700 Subject: [PATCH 33/56] work model custom tests written --- test/models/work_test.rb | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/test/models/work_test.rb b/test/models/work_test.rb index 4627dd2d09..9ab35c1ca3 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -69,7 +69,22 @@ end end #end description - describe " " do - + describe "custom methods" do + it "spotlight returns highest media based of num votes" do + Work.spotlight.title.must_be "Can't Buy a Thrill" + end + + it "top_ten returns top_ten works in each category" do + works = Work.top_ten("album") + + works.must_be_kind_of [] + + works.first.must_be_instance_of Work + works.last.must_be_instance_of Work + + works.first.title.must_be "Can't Buy a Thrill" + works.last.title.must_be "No Regrets" + + end end end From 86ce672bb00ea3db27c4b71a72e1802678050d00 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 15 Oct 2017 15:08:03 -0700 Subject: [PATCH 34/56] write work controller index tests --- test/controllers/works_controller_test.rb | 46 +++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/test/controllers/works_controller_test.rb b/test/controllers/works_controller_test.rb index d95073c22e..a29ef7cb81 100644 --- a/test/controllers/works_controller_test.rb +++ b/test/controllers/works_controller_test.rb @@ -4,4 +4,50 @@ # it "must be a real test" do # flunk "Need real tests" # end + + describe "index" do + it "returns a success status for all books" do + get works_path + must_respond_with :success + end + + it "returns a sucess status when there are no works" do + Work.destroy_all + get works_path + must_respond_with :success + end + + + # I am unsure if this applies. + it "returns a success status when given a valid user_id" do + get work_user_path(User.first) + must_respond_with :success + end + end # end describe + + describe "new" do + it "works with a valid work id" do + get + end + end + end + + + + + + + + + + + + + + + + + + +puts From 36d15acc3dbba00e94d6b7c4f4cca61e13994a24 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 15 Oct 2017 17:30:44 -0700 Subject: [PATCH 35/56] successful deploy to Heroku however, website has an error message --- app/views/layouts/application.html.erb | 2 +- test/controllers/works_controller_test.rb | 63 ++++++++++++++++++++++- 2 files changed, 62 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index d746fed584..e6f0d07cea 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -10,7 +10,7 @@ -

      Media Ranker

      +

      Rank Media

      + + + + + <% @users.each do |user| %> + + + + + + <% end %> +
      User NameVotesJoined
      <%= link_to user.name, user_path(user.id) %><%= user.votes.count %><%= user.created_at %>
      diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb new file mode 100644 index 0000000000..3f5b10a554 --- /dev/null +++ b/app/views/users/show.html.erb @@ -0,0 +1,18 @@ +

      User Details: <%= link_to @user.name, user_path(@user.id) %>

      +Joined site: <%= @user.created_at %> + +

      Votes

      + + + + + + + + <% Vote.user_votes_arary(@user.id).each do |vote| %> + + + + + <% end %> +
      Media Title Created By Published Category Voted On
      <%= vote %>
      diff --git a/config/routes.rb b/config/routes.rb index 9c97834533..0492a3dfc6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,9 +2,11 @@ # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html root 'main#index' resources :works - resources :user - + resources :users + resources :works do resources :user, only: [:show, :edit, :delete] end + + end From ecfb9cd01feea7e731c3244410a2f12fc00da600 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 15 Oct 2017 21:20:08 -0700 Subject: [PATCH 39/56] user view page complete: thier media votes with details on the media, links to user index and home page. --- app/models/work.rb | 11 ++++++++--- app/views/users/show.html.erb | 18 ++++++++++++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/models/work.rb b/app/models/work.rb index 6449efd789..c0f18302f0 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -18,9 +18,14 @@ def self.top_ten(category) end # added during wave two so no test - def work_from_user_vote_array(user_id) - - end + # not sure if I am going to utilize this method. If you do not see it used, I forgot to delet/comment it out. + # def work_from_user_vote_array(user_id) + # Vote.user_votes_arary(user_id).each do |vote| + # works_array = [] + # works_array << Work.find(vote.work_id) + # end + # return works_array + # end end diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 3f5b10a554..bec1b63b0a 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -9,10 +9,24 @@ Category Voted On + <% Vote.user_votes_arary(@user.id).each do |vote| %> -<%= vote %> - + + <%= Work.find(vote.work_id).title %> + <%= Work.find(vote.work_id).creator %> + <%= Work.find(vote.work_id).publication_year %> + <%= Work.find(vote.work_id).category %> + <%= vote.created_at %> <% end %> + +
        +
      1. + <%= link_to "View All Users", users_path %> +
      2. +
      3. + <%= link_to "Home", root_path %> +
      4. +
      From 21d74b455a73b34a9d77b2ac0d9651f407634b1f Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 15 Oct 2017 21:42:41 -0700 Subject: [PATCH 40/56] found bug in work view page. bug was for linking the user show page. --- app/views/works/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/works/show.html.erb b/app/views/works/show.html.erb index bd0fcbafca..cfff880954 100644 --- a/app/views/works/show.html.erb +++ b/app/views/works/show.html.erb @@ -30,7 +30,7 @@ <% @work.votes.each do |vote| %> - <%= link_to User.find(vote.user_id).name, work_user_path(:work_id) %> + <%= link_to User.find(vote.user_id).name, user_path(vote.user_id) %> <%= Vote.find(vote.user_id).updated_at %> From e112efb50ee4f12bd4a54626eba56a288b838dfd Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Mon, 16 Oct 2017 11:58:05 -0700 Subject: [PATCH 41/56] effot to push to heroku --- ...20171013203749_add_creator_column_to_db.rb | 5 ---- .../20171016185334_rebuild_all_tables.rb | 26 +++++++++++++++++++ db/schema.rb | 11 +++----- test/fixtures/mains.yml | 11 -------- test/fixtures/works.yml | 5 ++-- test/models/main_test.rb | 9 ------- 6 files changed, 31 insertions(+), 36 deletions(-) delete mode 100644 db/migrate/20171013203749_add_creator_column_to_db.rb create mode 100644 db/migrate/20171016185334_rebuild_all_tables.rb delete mode 100644 test/fixtures/mains.yml delete mode 100644 test/models/main_test.rb diff --git a/db/migrate/20171013203749_add_creator_column_to_db.rb b/db/migrate/20171013203749_add_creator_column_to_db.rb deleted file mode 100644 index acba256b85..0000000000 --- a/db/migrate/20171013203749_add_creator_column_to_db.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddCreatorColumnToDb < ActiveRecord::Migration[5.1] - def change - add_column :works, :creator, :string - end -end diff --git a/db/migrate/20171016185334_rebuild_all_tables.rb b/db/migrate/20171016185334_rebuild_all_tables.rb new file mode 100644 index 0000000000..5a516f37f1 --- /dev/null +++ b/db/migrate/20171016185334_rebuild_all_tables.rb @@ -0,0 +1,26 @@ +class RebuildAllTables < ActiveRecord::Migration[5.1] + def change + create_table :users do |t| + t.string :name + + t.timestamps + end + + create_table :works do |t| + t.string :title + t.string :category + t.integer :publication_year + t.text :description + t.string :creator + + t.timestamps + end + + create_table :votes do |t| + t.integer "work_id" + t.integer "user_id" + t.timestamps + + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 62241e882a..c54fec26d2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,16 +10,11 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171014135608) do +ActiveRecord::Schema.define(version: 20171016185334) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" - create_table "mains", force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - create_table "users", force: :cascade do |t| t.string "name" t.datetime "created_at", null: false @@ -34,13 +29,13 @@ end create_table "works", force: :cascade do |t| - t.string "category" t.string "title" + t.string "category" t.integer "publication_year" t.text "description" + t.string "creator" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.string "creator" end end diff --git a/test/fixtures/mains.yml b/test/fixtures/mains.yml deleted file mode 100644 index dc3ee79b5d..0000000000 --- a/test/fixtures/mains.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the "{}" from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/works.yml b/test/fixtures/works.yml index 45d41fd1ff..80a51d1d3c 100644 --- a/test/fixtures/works.yml +++ b/test/fixtures/works.yml @@ -8,14 +8,13 @@ work_one: category: album title: test_record creator: me - desciption: stuff + description: stuff publication_year: 2017 # work_two: category: movie title: indiana jones - create: speilberg + creator: speilberg description: action-adventure publication_year: 1987 - diff --git a/test/models/main_test.rb b/test/models/main_test.rb deleted file mode 100644 index 33138aecde..0000000000 --- a/test/models/main_test.rb +++ /dev/null @@ -1,9 +0,0 @@ -require "test_helper" - -# describe Main do -# let(:main) { Main.new } -# -# it "must be valid" do -# value(main).must_be :valid? -# end -# end From 762f3a1e199c5586dc53129adc65376aaab42f59 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 28 Oct 2017 12:09:12 -0700 Subject: [PATCH 42/56] add semantic tags to html --- app/controllers/users_controller.rb | 19 ++++- app/controllers/works_controller.rb | 5 +- app/views/layouts/_error_messages.html.erb | 30 ++++--- app/views/main/index.html.erb | 99 +++++++++++----------- app/views/users/index.html.erb | 28 +++--- app/views/users/show.html.erb | 59 +++++++------ app/views/works/_form.html.erb | 33 ++++---- app/views/works/edit.html.erb | 9 +- app/views/works/index.html.erb | 91 ++++++++++---------- app/views/works/new.html.erb | 10 ++- app/views/works/show.html.erb | 69 +++++++-------- config/routes.rb | 2 - 12 files changed, 244 insertions(+), 210 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index be5d10e5ed..4240090e31 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -11,7 +11,7 @@ def new end def create - @user = User.new(user_parauser ) + @user = User.new(user_params) if save_and_flash(@user) redirect_to users_path else @@ -19,6 +19,21 @@ def create end end + def login + username = params[:email] + user = User.find_by(username: username) + # session is created in Rails when the user arrives on the app. A session is a hash and we are filling it with a key-value pair. + session[:uid] = user.id + end + + # votes#create + def create + user_id = session[:uid] + current_user = User.find(user_id) + Vote.create(work: work, user: current_user) + # session[:uid] = user.id # may not need this line of code + end + def show ; end def edit ; end @@ -29,7 +44,7 @@ def update redirect_to user_path(@user) return else - render :edit, status: :bad_request + render( :edit, {status: :bad_request}) return end end diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index 80e33bdd39..76bdc8f9ab 100644 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -14,7 +14,7 @@ def new # end end - # the new media is not saving to DB. Not sure why. The code structure below is from rails library and theoretically should work. I am still unfamiliar with binding.pry for debugging and pry in the terminal is only so useful. + # the new media is not saving to DB. Not sure why. The code structure below is from rails library and theoretically should work. I am still unfamiliar with binding.pry for debugging and pry in the terminal is only so useful. def create @work = Work.new(work_params ) @@ -56,9 +56,8 @@ def work_params def find_work_by_params_id @work = Work.find_by(id: params[:id]) - unless @work + unless @work # unless is the same as if !@work then we respond with 404 Not Found. Head is just the bare bones part of the response without the body. head :not_found end - end end diff --git a/app/views/layouts/_error_messages.html.erb b/app/views/layouts/_error_messages.html.erb index 5acd4df225..3d9a6626bb 100644 --- a/app/views/layouts/_error_messages.html.erb +++ b/app/views/layouts/_error_messages.html.erb @@ -1,17 +1,19 @@ - + + -<% if model.errors.messages.length > 0 %> -
      -

      Error Happened!

      -
        - <% model.errors.messages.each do |field, problems| %> - <% problems.each do |problem| %> -
          - <%= field.capitalize %>: <%= problem %> + <% if model.errors.messages.length > 0 %> +
          +

          Error Happened!

          +
            + <% model.errors.messages.each do |field, problems| %> + <% problems.each do |problem| %> +
              + <%= field.capitalize %>: <%= problem %> -
            +
          + <% end %> <% end %> - <% end %> -
        -
      -<% end %> +
    + + <% end %> + diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index 26a6d74fd5..0d32e955f7 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -1,48 +1,51 @@ - - -

    - Media spotlight: <%= link_to Work.spotlight.title, work_path(Work.spotlight.id) %> by: - <%= Work.spotlight.creator %> - <%= Work.spotlight.votes.count %> votes -

    - -

    - Top Albums -

    - -
      - <% Work.top_ten("album").each do |work| %> -
    • - <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> - <%= work.votes.count %> votes -
    • - <% end %> -
    - -

    - Top Books -

    - -
      - <% Work.top_ten("book").each do |work| %> -
    • - <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> - <%= work.votes.count %> votes -
    • - <% end %> -
    - -

    - Top Movies -

    - -
      - <% Work.top_ten("movie").each do |work| %> -
    • - <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> - <%= work.votes.count %> votes -
    • - <% end %> -
    + + + +

    + Media spotlight: <%= link_to Work.spotlight.title, work_path(Work.spotlight.id) %> by: + <%= Work.spotlight.creator %> + <%= Work.spotlight.votes.count %> votes +

    + + +

    + Top Albums +

    + +
      + <% Work.top_ten("album").each do |work| %> +
    • + <%= link_to(work.title, work_path(work.id)) %> by: <%= work.creator %> + <%= work.votes.count %> votes +
    • + <% end %> +
    + +

    + Top Books +

    + +
      + <% Work.top_ten("book").each do |work| %> +
    • + <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> + <%= work.votes.count %> votes +
    • + <% end %> +
    + +

    + Top Movies +

    + +
      + <% Work.top_ten("movie").each do |work| %> +
    • + <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> + <%= work.votes.count %> votes +
    • + <% end %> +
    + diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 459b0edc02..3a8b61005a 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,15 +1,17 @@ -

    List of Users

    + +

    List of Users

    - - - - +
    User NameVotesJoined
    + + + - <% @users.each do |user| %> - - - - - - <% end %> -
    User NameVotesJoined
    <%= link_to user.name, user_path(user.id) %><%= user.votes.count %><%= user.created_at %>
    + <% @users.each do |user| %> + + <%= link_to user.name, user_path(user.id) %> + <%= user.votes.count %> + <%= user.created_at %> + + <% end %> + + diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index bec1b63b0a..c1c902866c 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,32 +1,35 @@ -

    User Details: <%= link_to @user.name, user_path(@user.id) %>

    -Joined site: <%= @user.created_at %> + -

    Votes

    - - - - - - +

    User Details: <%= link_to @user.name, user_path(@user.id) %>

    + Joined site: <%= @user.created_at %> +

    Votes

    +
    Media Title Created By Published Category Voted On
    + + + + + - <% Vote.user_votes_arary(@user.id).each do |vote| %> - - - - - - - - - <% end %> -
    Media Title Created By Published Category Voted On
    <%= Work.find(vote.work_id).title %><%= Work.find(vote.work_id).creator %><%= Work.find(vote.work_id).publication_year %><%= Work.find(vote.work_id).category %><%= vote.created_at %>
    -
      -
    1. - <%= link_to "View All Users", users_path %> -
    2. -
    3. - <%= link_to "Home", root_path %> -
    4. -
    + <% Vote.user_votes_arary(@user.id).each do |vote| %> + + + <%= Work.find(vote.work_id).title %> + <%= Work.find(vote.work_id).creator %> + <%= Work.find(vote.work_id).publication_year %> + <%= Work.find(vote.work_id).category %> + <%= vote.created_at %> + + <% end %> + + +
      +
    1. + <%= link_to "View All Users", users_path %> +
    2. +
    3. + <%= link_to "Home", root_path %> +
    4. +
    + diff --git a/app/views/works/_form.html.erb b/app/views/works/_form.html.erb index b8be6ea36e..1fc3b83f90 100644 --- a/app/views/works/_form.html.erb +++ b/app/views/works/_form.html.erb @@ -1,20 +1,23 @@ -
    - <%= form_for @work do |f| %> - <%= f.label :category %> - <%= f.text_field :category %> - <%= f.label :title %> - <%= f.text_field :title %> + +
    + <%= form_for @work do |f| %> + <%= f.label :category %> + <%= f.text_field :category %> - <%= f.label :creator %> - <%= f.text_field :creator %> + <%= f.label :title %> + <%= f.text_field :title %> - <%= f.label :publication_year %> - <%= f.text_field :publication_year %> + <%= f.label :creator %> + <%= f.text_field :creator %> - <%= f.label :description %> - <%= f.text_field :description %> + <%= f.label :publication_year %> + <%= f.text_field :publication_year %> - <%= f.submit button_text %> - <% end %> -
    + <%= f.label :description %> + <%= f.text_field :description %> + + <%= f.submit button_text %> + <% end %> +
    + diff --git a/app/views/works/edit.html.erb b/app/views/works/edit.html.erb index b73d88f678..244d999899 100644 --- a/app/views/works/edit.html.erb +++ b/app/views/works/edit.html.erb @@ -1,5 +1,8 @@ -

    Edit Media

    + -<%= render partial: 'layouts/error_messages', locals: { model: @work } %> +

    Edit Media

    -<%= render partial: 'form', locals: { button_text: "Edit Media"} %> + <%= render partial: 'layouts/error_messages', locals: { model: @work } %> + + <%= render partial: 'form', locals: { button_text: "Edit Media"} %> + diff --git a/app/views/works/index.html.erb b/app/views/works/index.html.erb index 8dd1b7d860..7380a705cd 100644 --- a/app/views/works/index.html.erb +++ b/app/views/works/index.html.erb @@ -1,56 +1,57 @@ -# Want to DRY up code and will think about it later. - -

    Albums

    - - - - - - <% @works.each do |work| %> - <% if work.category == "album" %> - - - - - + + # Want to DRY up code and will think about it later. +

    Albums

    +
    TitleCreatorPublication Year
    <%= link_to work.title, work_path(work.id) %><%= work.creator %><%= work.publication_year %>
    + + + + + <% @works.each do |work| %> + <% if work.category == "album" %> + + + + + + <% end %> <% end %> - <% end %> -
    TitleCreatorPublication Year
    <%= link_to work.title, work_path(work.id) %><%= work.creator %><%= work.publication_year %>
    + -

    Books

    +

    Books

    - - - - +
    TitleCreatorPublication Year
    + + + - <% @works.each do |work| %> - <% if work.category == "book" %> - - - - - + <% @works.each do |work| %> + <% if work.category == "book" %> + + + + + + <% end %> <% end %> - <% end %> -
    TitleCreatorPublication Year
    <%= work.title %><%= work.creator %><%= work.publication_year %>
    <%= link_to work.title, work_path(work.id) %><%= work.creator %><%= work.publication_year %>
    + -

    Movies

    +

    Movies

    - - - - +
    TitleCreatorPublication Year
    + + + - <% @works.each do |work| %> - <% if work.category == "movie" %> - - - - - + <% @works.each do |work| %> + <% if work.category == "movie" %> + + + + + + <% end %> <% end %> - <% end %> -
    TitleCreatorPublication Year
    <%= work.title %><%= work.creator %><%= work.publication_year %>
    <%= link_to work.title, work_path(work.id) %><%= work.creator %><%= work.publication_year %>
    + + diff --git a/app/views/works/new.html.erb b/app/views/works/new.html.erb index a0ea940794..452ea2d16d 100644 --- a/app/views/works/new.html.erb +++ b/app/views/works/new.html.erb @@ -1,5 +1,7 @@ -

    Add a media

    - -<%= render partial: 'layouts/error_messages', locals:{ model: @work} %> + +

    Add a media

    + + <%= render partial: 'layouts/error_messages', locals:{ model: @work} %> -<%= render partial: 'form', locals: { button_text: "Create Media" } %> + <%= render partial: 'form', locals: { button_text: "Create Media" } %> + diff --git a/app/views/works/show.html.erb b/app/views/works/show.html.erb index cfff880954..3ecfe353ce 100644 --- a/app/views/works/show.html.erb +++ b/app/views/works/show.html.erb @@ -1,39 +1,42 @@ -

    Need to work on UpVote.



    -

    -<%= params %> -

    -

    + +

    Need to work on UpVote.



    +

    + <%= params %> +

    +

    -

    - <%= @work.title %> -

    -
    -

    Created by: <%= @work.creator %>

    -

    Published: <%= @work.publication_year %>

    +

    + <%= @work.title %> +

    +
    +

    Created by: <%= @work.creator %>

    +

    Published: <%= @work.publication_year %>

    -
    +
    -
    - <%= link_to "Home", root_path %> - <%= link_to "Edit", edit_work_path %> - <%= link_to "UpVote" %> - <%= link_to "Delete", work_path(@work), method: :delete, data: { confirm: "Are you sure?" } %> -
    - - - - - +
    + <%= link_to "Home", root_path %> + <%= link_to "Edit", edit_work_path %> + <%= link_to "UpVote" %> + <%= link_to "Delete", work_path(@work), method: :delete, data: { confirm: "Are you sure?" } %> +
    +
    UserDate
    + + + + + + <% @work.votes.includes(:user).each do |vote| %> + + + + + + + + <% end %> - <% @work.votes.each do |vote| %> - - - - - - - <% end %> - -
    UserDate
    <%= link_to vote.user.name, user_path(vote.user_id) %><%= vote.updated_at %>
    <%= link_to User.find(vote.user_id).name, user_path(vote.user_id) %><%= Vote.find(vote.user_id).updated_at %>
    + + diff --git a/config/routes.rb b/config/routes.rb index 0492a3dfc6..953f73ea35 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,6 +7,4 @@ resources :works do resources :user, only: [:show, :edit, :delete] end - - end From c4df3c3c2aa841390f63fde60fb529096d199f61 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 29 Oct 2017 23:48:13 -0700 Subject: [PATCH 43/56] corrected html semantic tags and wrote work model tests utilizing fixtures --- app/controllers/users_controller.rb | 21 ++++- app/models/work.rb | 12 ++- app/views/layouts/_error_messages.html.erb | 31 ++++--- app/views/layouts/application.html.erb | 49 +++++----- app/views/main/index.html.erb | 100 ++++++++++----------- app/views/users/index.html.erb | 28 +++--- app/views/users/login_form.html.erb | 13 +++ app/views/users/show.html.erb | 59 ++++++------ app/views/works/_form.html.erb | 33 ++++--- app/views/works/edit.html.erb | 9 +- app/views/works/index.html.erb | 90 +++++++++---------- app/views/works/new.html.erb | 10 +-- app/views/works/show.html.erb | 70 +++++++-------- config/routes.rb | 4 + test/fixtures/users.yml | 8 +- test/fixtures/votes.yml | 16 ++-- test/fixtures/works.yml | 74 ++++++++++++++- test/models/work_test.rb | 97 ++++++++++---------- 18 files changed, 413 insertions(+), 311 deletions(-) create mode 100644 app/views/users/login_form.html.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4240090e31..e3c3942be1 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -19,11 +19,26 @@ def create end end + def login_form + + end + def login - username = params[:email] - user = User.find_by(username: username) + + name = params[:name] + user = User.find_by(name: name) # session is created in Rails when the user arrives on the app. A session is a hash and we are filling it with a key-value pair. - session[:uid] = user.id + + if user + session[:uid] = user.id + redirect_to root_path + else + # is flash stored in the session? + flash.now[:status] = :failure + flash.now[:message] = "No user found with username #{username}" + render login_form + end + end # votes#create diff --git a/app/models/work.rb b/app/models/work.rb index c0f18302f0..1e59d9507d 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -6,11 +6,19 @@ class Work < ApplicationRecord # feedback from rideshare noted using an instance variable instead of .self. I worked on using @blah and was unsuccessful. + def self.top_ten(category) + where(category: category).order(vote_count: :desc).limit(10) + end + def self.spotlight works = Work.all - spotlight = works.max_by {|work| work.votes.count} + if works == [] + return "No media on website, please enter a media" + else + spotlight = works.max_by {|work| work.votes.count} - return spotlight + return spotlight + end end def self.top_ten(category) diff --git a/app/views/layouts/_error_messages.html.erb b/app/views/layouts/_error_messages.html.erb index 3d9a6626bb..76418dde1a 100644 --- a/app/views/layouts/_error_messages.html.erb +++ b/app/views/layouts/_error_messages.html.erb @@ -1,19 +1,18 @@ - - - <% if model.errors.messages.length > 0 %> -
    -

    Error Happened!

    -
      - <% model.errors.messages.each do |field, problems| %> - <% problems.each do |problem| %> -
        - <%= field.capitalize %>: <%= problem %> + -
      - <% end %> +<% if model.errors.messages.length > 0 %> +
      +

      Error Happened!

      +
        + <% model.errors.messages.each do |field, problems| %> + <% problems.each do |problem| %> +
          + <%= field.capitalize %>: <%= problem %> + +
        <% end %> -
      -
      - <% end %> - + <% end %> +
    +
    +<% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 5462466425..ec81ee065c 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -9,26 +9,35 @@ +
    -

    Rank Media

    - - <%= yield %> +

    Rank Media

    + +
    + +
    + <%= yield %> +
    diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index 0d32e955f7..22669ac759 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -1,51 +1,49 @@ - - - -

    - Media spotlight: <%= link_to Work.spotlight.title, work_path(Work.spotlight.id) %> by: - <%= Work.spotlight.creator %> - <%= Work.spotlight.votes.count %> votes -

    - - -

    - Top Albums -

    - -
      - <% Work.top_ten("album").each do |work| %> -
    • - <%= link_to(work.title, work_path(work.id)) %> by: <%= work.creator %> - <%= work.votes.count %> votes -
    • - <% end %> -
    - -

    - Top Books -

    - -
      - <% Work.top_ten("book").each do |work| %> -
    • - <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> - <%= work.votes.count %> votes -
    • - <% end %> -
    - -

    - Top Movies -

    - -
      - <% Work.top_ten("movie").each do |work| %> -
    • - <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> - <%= work.votes.count %> votes -
    • - <% end %> -
    - + + +

    + Media spotlight: <%= link_to Work.spotlight.title, work_path(Work.spotlight.id) %> by: + <%= Work.spotlight.creator %> + <%= Work.spotlight.votes.count %> votes +

    + + +

    + Top Albums +

    + +
      + <% Work.top_ten("album").each do |work| %> +
    • + <%= link_to(work.title, work_path(work.id)) %> by: <%= work.creator %> + <%= work.votes.count %> votes +
    • + <% end %> +
    + +

    + Top Books +

    + +
      + <% Work.top_ten("book").each do |work| %> +
    • + <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> + <%= work.votes.count %> votes +
    • + <% end %> +
    + +

    + Top Movies +

    + +
      + <% Work.top_ten("movie").each do |work| %> +
    • + <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> + <%= work.votes.count %> votes +
    • + <% end %> +
    diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 3a8b61005a..459b0edc02 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,17 +1,15 @@ - -

    List of Users

    +

    List of Users

    - - - - +
    User NameVotesJoined
    + + + - <% @users.each do |user| %> - - - - - - <% end %> -
    User NameVotesJoined
    <%= link_to user.name, user_path(user.id) %><%= user.votes.count %><%= user.created_at %>
    - + <% @users.each do |user| %> + + <%= link_to user.name, user_path(user.id) %> + <%= user.votes.count %> + <%= user.created_at %> + + <% end %> + diff --git a/app/views/users/login_form.html.erb b/app/views/users/login_form.html.erb new file mode 100644 index 0000000000..9a4f4edd5c --- /dev/null +++ b/app/views/users/login_form.html.erb @@ -0,0 +1,13 @@ + +
    + <%= form_for do %> + <%= label_tag "Username" %> + <%= text_field :user, :name %> + <%= submit_tag "Login" %> + + + + <% end %> +
    + diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index c1c902866c..bec1b63b0a 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,35 +1,32 @@ - +

    User Details: <%= link_to @user.name, user_path(@user.id) %>

    +Joined site: <%= @user.created_at %> -

    User Details: <%= link_to @user.name, user_path(@user.id) %>

    - Joined site: <%= @user.created_at %> +

    Votes

    + + + + + + -

    Votes

    -
    Media Title Created By Published Category Voted On
    - - - - - + <% Vote.user_votes_arary(@user.id).each do |vote| %> + + + + + + + + + <% end %> +
    Media Title Created By Published Category Voted On
    <%= Work.find(vote.work_id).title %><%= Work.find(vote.work_id).creator %><%= Work.find(vote.work_id).publication_year %><%= Work.find(vote.work_id).category %><%= vote.created_at %>
    - <% Vote.user_votes_arary(@user.id).each do |vote| %> - - - <%= Work.find(vote.work_id).title %> - <%= Work.find(vote.work_id).creator %> - <%= Work.find(vote.work_id).publication_year %> - <%= Work.find(vote.work_id).category %> - <%= vote.created_at %> - - <% end %> - - -
      -
    1. - <%= link_to "View All Users", users_path %> -
    2. -
    3. - <%= link_to "Home", root_path %> -
    4. -
    - +
      +
    1. + <%= link_to "View All Users", users_path %> +
    2. +
    3. + <%= link_to "Home", root_path %> +
    4. +
    diff --git a/app/views/works/_form.html.erb b/app/views/works/_form.html.erb index 1fc3b83f90..b8be6ea36e 100644 --- a/app/views/works/_form.html.erb +++ b/app/views/works/_form.html.erb @@ -1,23 +1,20 @@ +
    + <%= form_for @work do |f| %> + <%= f.label :category %> + <%= f.text_field :category %> - -
    - <%= form_for @work do |f| %> - <%= f.label :category %> - <%= f.text_field :category %> + <%= f.label :title %> + <%= f.text_field :title %> - <%= f.label :title %> - <%= f.text_field :title %> + <%= f.label :creator %> + <%= f.text_field :creator %> - <%= f.label :creator %> - <%= f.text_field :creator %> + <%= f.label :publication_year %> + <%= f.text_field :publication_year %> - <%= f.label :publication_year %> - <%= f.text_field :publication_year %> + <%= f.label :description %> + <%= f.text_field :description %> - <%= f.label :description %> - <%= f.text_field :description %> - - <%= f.submit button_text %> - <% end %> -
    - + <%= f.submit button_text %> + <% end %> +
    diff --git a/app/views/works/edit.html.erb b/app/views/works/edit.html.erb index 244d999899..b73d88f678 100644 --- a/app/views/works/edit.html.erb +++ b/app/views/works/edit.html.erb @@ -1,8 +1,5 @@ - +

    Edit Media

    -

    Edit Media

    +<%= render partial: 'layouts/error_messages', locals: { model: @work } %> - <%= render partial: 'layouts/error_messages', locals: { model: @work } %> - - <%= render partial: 'form', locals: { button_text: "Edit Media"} %> - +<%= render partial: 'form', locals: { button_text: "Edit Media"} %> diff --git a/app/views/works/index.html.erb b/app/views/works/index.html.erb index 7380a705cd..41233cb2c2 100644 --- a/app/views/works/index.html.erb +++ b/app/views/works/index.html.erb @@ -1,57 +1,55 @@ - - # Want to DRY up code and will think about it later. -

    Albums

    - - - - - - <% @works.each do |work| %> - <% if work.category == "album" %> - - - - - - <% end %> +# Want to DRY up code and will think about it later. +

    Albums

    +
    TitleCreatorPublication Year
    <%= link_to work.title, work_path(work.id) %><%= work.creator %><%= work.publication_year %>
    + + + + + <% @works.each do |work| %> + <% if work.category == "album" %> + + + + + <% end %> -
    TitleCreatorPublication Year
    <%= link_to work.title, work_path(work.id) %><%= work.creator %><%= work.publication_year %>
    + <% end %> + -

    Books

    +

    Books

    - - - - +
    TitleCreatorPublication Year
    + + + - <% @works.each do |work| %> - <% if work.category == "book" %> - - - - - - <% end %> + <% @works.each do |work| %> + <% if work.category == "book" %> + + + + + <% end %> -
    TitleCreatorPublication Year
    <%= link_to work.title, work_path(work.id) %><%= work.creator %><%= work.publication_year %>
    <%= link_to work.title, work_path(work.id) %><%= work.creator %><%= work.publication_year %>
    + <% end %> + -

    Movies

    +

    Movies

    - - - - +
    TitleCreatorPublication Year
    + + + - <% @works.each do |work| %> - <% if work.category == "movie" %> - - - - - - <% end %> + <% @works.each do |work| %> + <% if work.category == "movie" %> + + + + + <% end %> -
    TitleCreatorPublication Year
    <%= link_to work.title, work_path(work.id) %><%= work.creator %><%= work.publication_year %>
    <%= link_to work.title, work_path(work.id) %><%= work.creator %><%= work.publication_year %>
    - + <% end %> + diff --git a/app/views/works/new.html.erb b/app/views/works/new.html.erb index 452ea2d16d..a0ea940794 100644 --- a/app/views/works/new.html.erb +++ b/app/views/works/new.html.erb @@ -1,7 +1,5 @@ - -

    Add a media

    - - <%= render partial: 'layouts/error_messages', locals:{ model: @work} %> +

    Add a media

    + +<%= render partial: 'layouts/error_messages', locals:{ model: @work} %> - <%= render partial: 'form', locals: { button_text: "Create Media" } %> - +<%= render partial: 'form', locals: { button_text: "Create Media" } %> diff --git a/app/views/works/show.html.erb b/app/views/works/show.html.erb index 3ecfe353ce..4a1cb2b8d2 100644 --- a/app/views/works/show.html.erb +++ b/app/views/works/show.html.erb @@ -1,42 +1,40 @@ - -

    Need to work on UpVote.



    -

    - <%= params %> -

    -

    +

    Need to work on UpVote.



    +

    +<%= params %> +

    +

    -

    - <%= @work.title %> -

    -
    -

    Created by: <%= @work.creator %>

    -

    Published: <%= @work.publication_year %>

    +

    + <%= @work.title %> +

    +
    +

    Created by: <%= @work.creator %>

    +

    Published: <%= @work.publication_year %>

    -
    +
    -
    - <%= link_to "Home", root_path %> - <%= link_to "Edit", edit_work_path %> - <%= link_to "UpVote" %> - <%= link_to "Delete", work_path(@work), method: :delete, data: { confirm: "Are you sure?" } %> -
    - - - - - +
    + <%= link_to "Home", root_path %> + <%= link_to "Edit", edit_work_path %> + <%= link_to "UpVote" %> + <%= link_to "Delete", work_path(@work), method: :delete, data: { confirm: "Are you sure?" } %> +
    +
    UserDate
    + + + + - - <% @work.votes.includes(:user).each do |vote| %> - - - - - - - - <% end %> + + <% @work.votes.includes(:user).each do |vote| %> + + + + + + + + <% end %> -
    UserDate
    <%= link_to vote.user.name, user_path(vote.user_id) %><%= vote.updated_at %>
    <%= link_to vote.user.name, user_path(vote.user_id) %><%= vote.updated_at %>
    - + diff --git a/config/routes.rb b/config/routes.rb index 953f73ea35..ab737f5392 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,10 +1,14 @@ Rails.application.routes.draw do # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html root 'main#index' + get 'login', to: 'users#login_form', as: 'login' + post '/login', to: 'users#login' + resources :works resources :users resources :works do resources :user, only: [:show, :edit, :delete] end + end diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index dc3ee79b5d..8d2f45de48 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -4,8 +4,8 @@ # model remove the "{}" from the fixture names and add the columns immediately # below each fixture, per the syntax in the comments below # -one: {} -# column: value +user1: + name: angela # -two: {} -# column: value +user2: + name: jordan diff --git a/test/fixtures/votes.yml b/test/fixtures/votes.yml index c9d7197e1c..cd2959413b 100644 --- a/test/fixtures/votes.yml +++ b/test/fixtures/votes.yml @@ -4,10 +4,14 @@ # model remove the "{}" from the fixture names and add the columns immediately # below each fixture, per the syntax in the comments below # -vote_one: - user_id: 1 - work_id: 1 +vote1: + user_id: user1 + work_id: work1 # -vote_two: - user_id: 2 - work_id: 3 +vote2: + user_id: user1 + work_id: work1 + +vote3: + user_id: user2 + work_id: work3 diff --git a/test/fixtures/works.yml b/test/fixtures/works.yml index 80a51d1d3c..bcb6590555 100644 --- a/test/fixtures/works.yml +++ b/test/fixtures/works.yml @@ -4,7 +4,7 @@ # model remove the "{}" from the fixture names and add the columns immediately # below each fixture, per the syntax in the comments below # -work_one: +work1: category: album title: test_record creator: me @@ -12,9 +12,79 @@ work_one: publication_year: 2017 # -work_two: +work2: category: movie title: indiana jones creator: speilberg description: action-adventure publication_year: 1987 + +work3: + category: movie + title: trick + creator: speilberg + description: action-adventure + publication_year: 1987 + +work4: + category: movie + title: treat + creator: speilberg + description: action-adventure + publication_year: 1987 + +work5: + category: movie + title: wedding + creator: speilberg + description: action-adventure + publication_year: 1987 + +work6: + category: movie + title: chair + creator: speilberg + description: action-adventure + publication_year: 1987 + +work7: + category: movie + title: scare + creator: speilberg + description: action-adventure + publication_year: 1987 + +work8: + category: movie + title: flar + creator: speilberg + description: action-adventure + publication_year: 1987 + +work9: + category: movie + title: ouch + creator: speilberg + description: action-adventure + publication_year: 1987 + +work10: + category: movie + title: too + creator: speilberg + description: action-adventure + publication_year: 1987 + +work11: + category: movie + title: many + creator: speilberg + description: action-adventure + publication_year: 1987 + +work12: + category: movie + title: slay + creator: speilberg + description: action-adventure + publication_year: 1987 diff --git a/test/models/work_test.rb b/test/models/work_test.rb index 9ab35c1ca3..fd03d21070 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -2,28 +2,34 @@ describe Work do let(:work) { Work.new } + + describe "relations" do + it "has many votes" do + work = Work.new(title: "test") + work.must_respond_to :votes + end + end #end description + describe "validations" do #for the following tests I understand the are 'wet' and could be DRYed. At the moment, I am focuesed on completing the assignment. If there is time I will go back and figure out how to utilize the DRYing method taught in class. it "create work with all fields" do - # work = Work.new( - # category: "album", - # title: "test work", - # publication_year: 2017, - # desciption: "", - # creator: "me", - # ) - # - # work.must_be :valid? + work = Work.create!( + category: "album", + title: "test work", + publication_year: 2017, + description: "test", + creator: "me", + ) + + work.must_be :valid? end - - it "requires category" do work = Work.new result = work.valid? - result.must_be false + result.must_equal false work.errors.messages.must_include :category end @@ -31,60 +37,53 @@ work = Work.new result = work.valid? - result.must_be false + result.must_equal false work.errors.messages.must_include :title end end # end describe - describe "description" do - it "rejects descriptions >500 char" do - desc = "a" * 501 - - work = Work.new(description: desc) - - result = work.valid? - result.must_be false - work.errors.messages.must_include :description - end # end it - - it "allows description <= 500 char" do - descriptions = [ - "a" * 500, - "a" * 10, - "a" * 0 - ] - - descriptions.each do |desc| - result = Work.new(category: "album", title: "test", description: desc) - - result.must_be :valid? - end + describe "custom methods" do + it "spotlight returns highest media based of num votes" do + Work.spotlight.title.must_equal "test_record" end - end # end description - describe "relations" do - it "has many votes" do - work = Work.new(title: "test") - work.must_respond_to :votes - end - end #end description + it "spotlight returns 'no work' when no works are present" do + Work.destroy_all - describe "custom methods" do - it "spotlight returns highest media based of num votes" do - Work.spotlight.title.must_be "Can't Buy a Thrill" + Work.spotlight.must_equal "No media on website, please enter a media" end it "top_ten returns top_ten works in each category" do works = Work.top_ten("album") - works.must_be_kind_of [] + works.must_be_kind_of Array + + works.first.must_be_instance_of Work + works.last.must_be_instance_of Work + + works.first.title.must_equal "test_record" + works.last.title.must_equal "test_record" + + works.length.must_be :<=, 10 + + #testing movie + works = Work.top_ten("movie") + + works.must_be_kind_of Array works.first.must_be_instance_of Work works.last.must_be_instance_of Work - works.first.title.must_be "Can't Buy a Thrill" - works.last.title.must_be "No Regrets" + works.first.title.must_equal "indiana jones" + works.last.title.must_equal "many" + + works.must_be :<=, 10 + + #testing book + works = Work.top_ten("book") + works.must_equal [] + works.length.must_be :<=, 10 end end end From 154e27adf28366568be7a39aea445a5d8429f5d0 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Mon, 30 Oct 2017 18:40:25 -0700 Subject: [PATCH 44/56] vote model validation tests: user_id, work_id present and uniqueness for double votes --- app/controllers/votes_controller.rb | 10 ++++++++ app/controllers/works_controller.rb | 2 ++ app/models/vote.rb | 3 +++ config/routes.rb | 7 +++--- test/fixtures/votes.yml | 12 ++++----- test/models/vote_test.rb | 38 +++++++++++++++++++++++++++++ 6 files changed, 63 insertions(+), 9 deletions(-) diff --git a/app/controllers/votes_controller.rb b/app/controllers/votes_controller.rb index ffdb2760e0..4c893a9626 100644 --- a/app/controllers/votes_controller.rb +++ b/app/controllers/votes_controller.rb @@ -1,2 +1,12 @@ class VotesController < ApplicationController + + # def up_vote + # # check that user is logged in + # # if yes than check to see if session user_id matches the votes user id than + # + # end + + def show + + end end diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index 76bdc8f9ab..01ea81597a 100644 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -1,3 +1,5 @@ +# session comparisions are always made in the controller + class WorksController < ApplicationController before_action :find_work_by_params_id, only: [:show, :edit, :update, :destroy] diff --git a/app/models/vote.rb b/app/models/vote.rb index 3a41a8d4a0..3fd0e361c2 100644 --- a/app/models/vote.rb +++ b/app/models/vote.rb @@ -2,6 +2,9 @@ class Vote < ApplicationRecord belongs_to :work belongs_to :user + validates :work_id, presence: true + validates :user_id, presence: true, uniqueness: {scope: :work_id, message: "You've already voled for this work"} + # again not sure how to implement the @user_votes_arary method. see original comment in work.rb's custom methods def self.user_votes_arary(user_id) Vote.where(user_id: user_id) diff --git a/config/routes.rb b/config/routes.rb index ab737f5392..9ac5cd18c5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,9 +6,10 @@ resources :works resources :users + resources :votes - resources :works do - resources :user, only: [:show, :edit, :delete] - end + # resources :works do + # resources :user, only: [:show, :edit, :delete] + # end end diff --git a/test/fixtures/votes.yml b/test/fixtures/votes.yml index cd2959413b..6c7de1fa7b 100644 --- a/test/fixtures/votes.yml +++ b/test/fixtures/votes.yml @@ -5,13 +5,13 @@ # below each fixture, per the syntax in the comments below # vote1: - user_id: user1 - work_id: work1 + user: user1 + work: work1 # vote2: - user_id: user1 - work_id: work1 + user: user2 + work: work1 vote3: - user_id: user2 - work_id: work3 + user: user2 + work: work3 diff --git a/test/models/vote_test.rb b/test/models/vote_test.rb index 6a6dc42750..916d82c494 100644 --- a/test/models/vote_test.rb +++ b/test/models/vote_test.rb @@ -3,7 +3,45 @@ describe Vote do let(:vote) { Vote.new } + # it "must be valid" do # value(vote).must_be :valid? # end + describe "relations" do + it "relations to both work and user" do + vote = votes(:vote1) + + # work relation + vote.must_respond_to :work + + # user relation + vote.must_respond_to :user + end + end + + describe "validations" do + it "work_id is present, vote is valid" do + vote = votes(:vote1) + vote.must_be :valid? + end + + it "work_id is NOT present, invalid vote" do + vote = Vote.new + + vote.valid?.must_equal false + vote.errors.messages.must_include :work_id + end + + it "user cannot double vote on a work" do + vote1 = votes(:vote1) + + # make another vote for the same work from same user. + vote2 = Vote.create(user_id: users(:user1).id, work_id: works(:work1).id) + # Prevent vote from being saved to database + vote2.valid?.must_equal false + # tell user they cannot vote on the same work + + vote2.errors.messages.must_include :user_id + end + end end From 22236615d35f2f3f1c2ce73826225c92f412d36f Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Tue, 31 Oct 2017 12:40:32 -0700 Subject: [PATCH 45/56] working on the upvote. still not functioning. --- app/controllers/votes_controller.rb | 19 ++++++++++++++++++- app/models/vote.rb | 9 +++++++++ app/models/work.rb | 6 +++--- app/views/main/index.html.erb | 13 ++++++++++--- app/views/users/login_form.html.erb | 22 ++++++++++------------ app/views/works/show.html.erb | 8 ++++---- config/routes.rb | 4 +++- 7 files changed, 57 insertions(+), 24 deletions(-) diff --git a/app/controllers/votes_controller.rb b/app/controllers/votes_controller.rb index 4c893a9626..9df2cfea56 100644 --- a/app/controllers/votes_controller.rb +++ b/app/controllers/votes_controller.rb @@ -6,7 +6,24 @@ class VotesController < ApplicationController # # end - def show + # def create + # # if user is logged in then allow voting + # # else do not allow voting + # + # @vote = Vote.new(vote_params) + # if @vote.save + # flash[:message] = "Successfully upvoted!" + # flash[:status] = :success + # else + # flash[:message] = "You've already voted for this work" + # flash[:status] = :failure + # end + # redirect_to works_path + # end + + private + def vote_params + return params.permit(:work_id) end end diff --git a/app/models/vote.rb b/app/models/vote.rb index 3fd0e361c2..e0226051c5 100644 --- a/app/models/vote.rb +++ b/app/models/vote.rb @@ -10,4 +10,13 @@ def self.user_votes_arary(user_id) Vote.where(user_id: user_id) end + + + + def initialize(work_id, user_id) + @work_id = work_id + @user_id = user_id + end + + end diff --git a/app/models/work.rb b/app/models/work.rb index 1e59d9507d..75637d48b0 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -6,9 +6,9 @@ class Work < ApplicationRecord # feedback from rideshare noted using an instance variable instead of .self. I worked on using @blah and was unsuccessful. - def self.top_ten(category) - where(category: category).order(vote_count: :desc).limit(10) - end + # def self.top_ten(category) + # where(category: category).order(vote_count: :desc).limit(10) + # end def self.spotlight works = Work.all diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index 22669ac759..048dfbb4cc 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -3,9 +3,16 @@ The code for Top media per category could be rolled into a partial. Do it later.-->

    - Media spotlight: <%= link_to Work.spotlight.title, work_path(Work.spotlight.id) %> by: - <%= Work.spotlight.creator %> - <%= Work.spotlight.votes.count %> votes + <% if Work.all == [] %> + Work.spotlight + <% else %> + Media spotlight: <%= link_to Work.spotlight.title, work_path(Work.spotlight.id) %> by: + <%= Work.spotlight.creator %> + <%= Work.spotlight.votes.count %> votes + <% end %> +

    diff --git a/app/views/users/login_form.html.erb b/app/views/users/login_form.html.erb index 9a4f4edd5c..3c53cf9395 100644 --- a/app/views/users/login_form.html.erb +++ b/app/views/users/login_form.html.erb @@ -1,13 +1,11 @@ - -
    - <%= form_for do %> - <%= label_tag "Username" %> - <%= text_field :user, :name %> - <%= submit_tag "Login" %> - +
    + <%= form_for do %> + <%= label_tag "Username" %> + <%= text_field :user, :name %> + <%= submit_tag "Login" %> + - - <% end %> -
    - + + <% end %> +
    diff --git a/app/views/works/show.html.erb b/app/views/works/show.html.erb index 4a1cb2b8d2..1e872024d0 100644 --- a/app/views/works/show.html.erb +++ b/app/views/works/show.html.erb @@ -14,10 +14,10 @@
    - <%= link_to "Home", root_path %> - <%= link_to "Edit", edit_work_path %> - <%= link_to "UpVote" %> - <%= link_to "Delete", work_path(@work), method: :delete, data: { confirm: "Are you sure?" } %> + <%= link_to "Home", root_path, class: "button" %> + <%= link_to "Edit", edit_work_path, class: "button" %> + <%= link_to "UpVote", votes_path(work_id: @work.id), method: :post, class: "button" %> + <%= link_to "Delete", work_path(@work), method: :delete, data: { confirm: "Are you sure?" }, class: "button" %>
    diff --git a/config/routes.rb b/config/routes.rb index 9ac5cd18c5..3a5b49ae5d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,7 +6,9 @@ resources :works resources :users - resources :votes + + post '/votes/:work_id', to: 'votes#create', as: 'votes' + # resources :works do # resources :user, only: [:show, :edit, :delete] From 08698e193d2190f15594042b4abacddfcfb38f17 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Tue, 31 Oct 2017 19:48:22 -0700 Subject: [PATCH 46/56] hmtl for work show page --- app/assets/stylesheets/application.css | 201 +++++++++++++++++++++++++ app/models/vote.rb | 11 +- app/views/layouts/application.html.erb | 36 ++--- app/views/users/index.html.erb | 2 + app/views/users/show.html.erb | 24 ++- app/views/works/index.html.erb | 3 + app/views/works/show.html.erb | 72 +++++---- 7 files changed, 276 insertions(+), 73 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index d05ea0f511..b45edf32ae 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -13,3 +13,204 @@ *= require_tree . *= require_self */ + + .page-header { + max-width: 100%; + background-color: #B2DFDB; + border-bottom: 1px solid #EEEEEE; + margin-bottom: 10px; + padding: 25px 20px 10px 20px; + } + + .page-header h2 { + text-align: center; + margin: 25px auto 40px auto; +} + +.page-header h2 a { + color: var(--orange); + padding-right: 25px; + margin-right: 15px; + border-right: white 2px solid; +} + + .row { + max-width: 75rem; + margin-right: auto; + margin-left: auto; +} + +header { + display: block; +} + + + + +/* copy paste from Inspect*/ + + +.button { + background-color: #26A69A; +} + +application-033…82025955.css:1 +.button { + display: inline-block; + vertical-align: middle; + margin: 0 0 1rem 0; + padding: 0.85em 1em; + -webkit-appearance: none; + border: 1px solid transparent; + border-radius: 0; + transition: background-color 0.25s ease-out, color 0.25s ease-out; + font-size: 0.9rem; + line-height: 1; + text-align: center; + cursor: pointer; + background-color: #1779ba; + color: #fefefe; +} +application-033…82025955.css:1 +.button { + background-color: #26A69A; +} +application-033…82025955.css:1 +.button { + display: inline-block; + vertical-align: middle; + margin: 0 0 1rem 0; + padding: 0.85em 1em; + -webkit-appearance: none; + border: 1px solid transparent; + border-radius: 0; + transition: background-color 0.25s ease-out, color 0.25s ease-out; + font-size: 0.9rem; + line-height: 1; + text-align: center; + cursor: pointer; + background-color: #1779ba; + color: #fefefe; +} +application-033…82025955.css:1 +a, h3 { + color: #26A69A; +} +application-033…82025955.css:1 +a { + line-height: inherit; + color: #1779ba; + text-decoration: none; + cursor: pointer; +} +application-033…82025955.css:1 +a { + background-color: transparent; + -webkit-text-decoration-skip: objects; +} +application-033…82025955.css:1 +a, h3 { + color: #26A69A; +} +application-033…82025955.css:1 +a { + line-height: inherit; + color: #1779ba; + text-decoration: none; + cursor: pointer; +} +application-033…82025955.css:1 +a { + background-color: transparent; + -webkit-text-decoration-skip: objects; +} +application-033…82025955.css:1 +*, *::before, *::after { + box-sizing: inherit; +} +application-033…82025955.css:1 +*, *::before, *::after { + box-sizing: inherit; +} +user agent stylesheet +a:-webkit-any-link { + color: -webkit-link; + cursor: auto; + text-decoration: underline; +} +Inherited from body +application-033…82025955.css:1 +body, h1, h2, h3, h4, h5 { + font-family: "Gudea", sans-serif; +} +application-033…82025955.css:1 +body { + margin: 0; + padding: 0; + background: #fefefe; + font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; + font-weight: normal; + line-height: 1.5; + color: #0a0a0a; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +application-033…82025955.css:1 +body, h1, h2, h3, h4, h5 { + font-family: "Gudea", sans-serif; +} +application-033…82025955.css:1 +body { + margin: 0; + padding: 0; + background: #fefefe; + font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; + font-weight: normal; + line-height: 1.5; + color: #0a0a0a; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +Inherited from html.cye-disabled.cye-nm +application-033…82025955.css:1 +html { + box-sizing: border-box; + font-size: 100%; +} +application-033…82025955.css:1 +html { + font-family: sans-serif; + line-height: 1.15; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} +application-033…82025955.css:1 +html { + box-sizing: border-box; + font-size: 100%; +} +application-033…82025955.css:1 +html { + font-family: sans-serif; + line-height: 1.15; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} +Pseudo ::before element +application-033…82025955.css:1 +*, *::before, *::after { + box-sizing: inherit; +} +application-033…82025955.css:1 +*, *::before, *::after { + box-sizing: inherit; +} +Pseudo ::after element +application-033…82025955.css:1 +*, *::before, *::after { + box-sizing: inherit; +} +application-033…82025955.css:1 +*, *::before, *::after { + box-sizing: inherit; +} diff --git a/app/models/vote.rb b/app/models/vote.rb index e0226051c5..ddba880fbf 100644 --- a/app/models/vote.rb +++ b/app/models/vote.rb @@ -12,11 +12,12 @@ def self.user_votes_arary(user_id) end +# create session through ip + def initialize(work_id, user_id) + @work_id = work_id + + @user_id = user_id + end - def initialize(work_id, user_id) - @work_id = work_id - @user_id = user_id - end - end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ec81ee065c..46f0aea34a 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -3,40 +3,30 @@ MediaRanker <%= csrf_meta_tags %> - + <%= stylesheet_link_tag 'application', 'https://fonts.googleapis.com/css?family=Gudea:400,700|Hammersmith+One' %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> + <%= favicon_link_tag 'owl.jpg'%> + -
    + -
    +
    <%= yield %>
    diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 459b0edc02..4b96cb0674 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -13,3 +13,5 @@
    <% end %>
    + +<%= link_to "Back to Media List", works_path, class: "button" %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index bec1b63b0a..6317b5f8e3 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -10,23 +10,21 @@ Voted On - <% Vote.user_votes_arary(@user.id).each do |vote| %> + <% @user.votes.each do |vote| %> - <%= Work.find(vote.work_id).title %> - <%= Work.find(vote.work_id).creator %> - <%= Work.find(vote.work_id).publication_year %> - <%= Work.find(vote.work_id).category %> + <%= link_to vote.work.title, work_path(vote.work.id) %> + <%= vote.work.creator %> + <%= vote.work.publication_year %> + <%= vote.work.category %> <%= vote.created_at %> <% end %> -
      -
    1. - <%= link_to "View All Users", users_path %> -
    2. -
    3. - <%= link_to "Home", root_path %> -
    4. -
    +
    + + <%= link_to "View All Users", users_path, class: "button" %> + + <%= link_to "Home", root_path, class: "button" %> +
    diff --git a/app/views/works/index.html.erb b/app/views/works/index.html.erb index 41233cb2c2..40378e3940 100644 --- a/app/views/works/index.html.erb +++ b/app/views/works/index.html.erb @@ -53,3 +53,6 @@ <% end %> <% end %> + +<%= link_to "View top media", root_path, class: "button"%> +<%= link_to "Add a new work", new_work_path, class: "button"%> diff --git a/app/views/works/show.html.erb b/app/views/works/show.html.erb index 1e872024d0..d0e547c591 100644 --- a/app/views/works/show.html.erb +++ b/app/views/works/show.html.erb @@ -3,38 +3,46 @@ <%= params %>

+
+

+ <%= @work.title %> +

+ +

Created by: <%= @work.creator %>

+

Published: <%= @work.publication_year %>

+

<%= @work.description %>

+ +
+ <%= link_to "Home", root_path, class: "button" %> + <%= link_to "Edit", edit_work_path, class: "button" %> + <%= link_to "UpVote", votes_path(work_id: @work.id), method: :post, class: "button" %> + <%= link_to "Delete", work_path(@work), method: :delete, data: { confirm: "Are you sure?" }, class: "alert button" %> +
+

- <%= @work.title %> + <%= @work.votes.count %> Votes for this <%= @work.category.capitalize %>

-
-

Created by: <%= @work.creator %>

-

Published: <%= @work.publication_year %>

- -
- -
- <%= link_to "Home", root_path, class: "button" %> - <%= link_to "Edit", edit_work_path, class: "button" %> - <%= link_to "UpVote", votes_path(work_id: @work.id), method: :post, class: "button" %> - <%= link_to "Delete", work_path(@work), method: :delete, data: { confirm: "Are you sure?" }, class: "button" %> -
- - - - - - - - - <% @work.votes.includes(:user).each do |vote| %> - - - - - - - - <% end %> - -
UserDate
<%= link_to vote.user.name, user_path(vote.user_id) %><%= vote.updated_at %>
+ +
+ + + + + + + + + + <% @work.votes.includes(:user).each do |vote| %> + + + + + + + + <% end %> + +
UserDate
<%= link_to vote.user.name, user_path(vote.user_id) %><%= vote.updated_at %>
+
From 89b513985adbd28e79f8c0e7abc8294443251887 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Thu, 2 Nov 2017 10:24:49 -0700 Subject: [PATCH 47/56] work on styles for header --- app/assets/stylesheets/application.css | 245 ++++++++++--------------- app/assets/stylesheets/main.scss | 3 - app/controllers/votes_controller.rb | 10 +- app/models/vote.rb | 15 +- app/views/main/index.html.erb | 84 +++++---- app/views/works/_form.html.erb | 2 +- test/models/vote_test.rb | 33 ++++ 7 files changed, 193 insertions(+), 199 deletions(-) delete mode 100644 app/assets/stylesheets/main.scss diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index b45edf32ae..dae6251b61 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -14,152 +14,122 @@ *= require_self */ - .page-header { - max-width: 100%; - background-color: #B2DFDB; - border-bottom: 1px solid #EEEEEE; - margin-bottom: 10px; - padding: 25px 20px 10px 20px; - } - - .page-header h2 { +.page-header { + max-width: 100%; + background-color: #B2DFDB; + border-bottom: 1px solid #EEEEEE; + margin-bottom: 10px; + padding: 25px 20px 10px 20px; +} + +.page-header h1 { text-align: center; margin: 25px auto 40px auto; } -.page-header h2 a { - color: var(--orange); +.page-header h1 a { + color: #FF5722; padding-right: 25px; margin-right: 15px; border-right: white 2px solid; } - .row { - max-width: 75rem; - margin-right: auto; - margin-left: auto; +.row { + max-width: 75rem; + margin-right: auto; + margin-left: auto; } header { - display: block; + display: block; } -/* copy paste from Inspect*/ +.page-header h1 small { + color: white; +} +/*small { + font-size: 80%; + line-height: inherit; +}*/ -.button { - background-color: #26A69A; -} +/* +Button +*/ -application-033…82025955.css:1 -.button { - display: inline-block; - vertical-align: middle; - margin: 0 0 1rem 0; - padding: 0.85em 1em; - -webkit-appearance: none; - border: 1px solid transparent; - border-radius: 0; - transition: background-color 0.25s ease-out, color 0.25s ease-out; - font-size: 0.9rem; - line-height: 1; - text-align: center; - cursor: pointer; - background-color: #1779ba; - color: #fefefe; -} -application-033…82025955.css:1 .button { - background-color: #26A69A; + background-color: #26A69A; } -application-033…82025955.css:1 + .button { - display: inline-block; - vertical-align: middle; - margin: 0 0 1rem 0; - padding: 0.85em 1em; - -webkit-appearance: none; - border: 1px solid transparent; - border-radius: 0; - transition: background-color 0.25s ease-out, color 0.25s ease-out; - font-size: 0.9rem; - line-height: 1; - text-align: center; - cursor: pointer; - background-color: #1779ba; - color: #fefefe; -} -application-033…82025955.css:1 -a, h3 { - color: #26A69A; -} -application-033…82025955.css:1 -a { - line-height: inherit; - color: #1779ba; - text-decoration: none; - cursor: pointer; -} -application-033…82025955.css:1 -a { - background-color: transparent; - -webkit-text-decoration-skip: objects; -} -application-033…82025955.css:1 -a, h3 { - color: #26A69A; -} -application-033…82025955.css:1 -a { - line-height: inherit; - color: #1779ba; - text-decoration: none; - cursor: pointer; + display: inline-block; + vertical-align: middle; + margin: 0 0 1rem 0; + padding: 0.85em 1em; + border: 1px solid transparent; + border-radius: 0; + transition: background-color 0.25s ease-out, color 0.25s ease-out; + font-size: 0.9rem; + line-height: 1; + text-align: center; + cursor: pointer; + background-color: #1779ba; + color: #fefefe; + font-weight: normal; } -application-033…82025955.css:1 + +/* +Links +*/ + + a { - background-color: transparent; - -webkit-text-decoration-skip: objects; + line-height: inherit; + color: #1779ba; + text-decoration: none; + cursor: pointer; + background-color: transparent; + text-decoration: none; + cursor: pointer; + background-color: transparent; + cursor: auto; + font-weight: 900; } -application-033…82025955.css:1 -*, *::before, *::after { - box-sizing: inherit; -} -application-033…82025955.css:1 -*, *::before, *::after { - box-sizing: inherit; -} -user agent stylesheet -a:-webkit-any-link { - color: -webkit-link; - cursor: auto; - text-decoration: underline; + +a, h2 { + color: #26A69A; } -Inherited from body -application-033…82025955.css:1 + + + + + + +/* +Typography +*/ body, h1, h2, h3, h4, h5 { font-family: "Gudea", sans-serif; } -application-033…82025955.css:1 -body { - margin: 0; - padding: 0; - background: #fefefe; - font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; - font-weight: normal; - line-height: 1.5; - color: #0a0a0a; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; + +.article h1, +.sidebar p { + font-family: "Time New Roman"; } -application-033…82025955.css:1 -body, h1, h2, h3, h4, h5 { - font-family: "Gudea", sans-serif; + +.sidebar { + font-size: 10px; } -application-033…82025955.css:1 + +.article { + font-size: 20px; +} + +} + body { margin: 0; padding: 0; @@ -168,49 +138,28 @@ body { font-weight: normal; line-height: 1.5; color: #0a0a0a; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -Inherited from html.cye-disabled.cye-nm -application-033…82025955.css:1 -html { - box-sizing: border-box; - font-size: 100%; } -application-033…82025955.css:1 -html { - font-family: sans-serif; - line-height: 1.15; - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; -} -application-033…82025955.css:1 + html { box-sizing: border-box; font-size: 100%; -} -application-033…82025955.css:1 -html { font-family: sans-serif; line-height: 1.15; - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; -} -Pseudo ::before element -application-033…82025955.css:1 -*, *::before, *::after { - box-sizing: inherit; + } -application-033…82025955.css:1 -*, *::before, *::after { - box-sizing: inherit; + +/* Home Page */ +.top-ten h2 { + border-bottom: 2px solid; + border-bottom-color: #B2DFDB; } -Pseudo ::after element -application-033…82025955.css:1 -*, *::before, *::after { - box-sizing: inherit; + +.top-ten ul { + list-style-type: none; + margin: 0; + padding: 0; } -application-033…82025955.css:1 + *, *::before, *::after { box-sizing: inherit; } diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss deleted file mode 100644 index a0d94c17c1..0000000000 --- a/app/assets/stylesheets/main.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the main 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/votes_controller.rb b/app/controllers/votes_controller.rb index 9df2cfea56..37ac3c6d1a 100644 --- a/app/controllers/votes_controller.rb +++ b/app/controllers/votes_controller.rb @@ -21,9 +21,9 @@ class VotesController < ApplicationController # redirect_to works_path # end - private - - def vote_params - return params.permit(:work_id) - end + # private + # + # def vote_params + # return params.permit(:work_id) + # end end diff --git a/app/models/vote.rb b/app/models/vote.rb index ddba880fbf..e188f586e9 100644 --- a/app/models/vote.rb +++ b/app/models/vote.rb @@ -5,7 +5,7 @@ class Vote < ApplicationRecord validates :work_id, presence: true validates :user_id, presence: true, uniqueness: {scope: :work_id, message: "You've already voled for this work"} - # again not sure how to implement the @user_votes_arary method. see original comment in work.rb's custom methods + # again not sure how to implement the @user_votes_arary method. see original comment in work.rb's custom methods def self.user_votes_arary(user_id) Vote.where(user_id: user_id) @@ -13,11 +13,14 @@ def self.user_votes_arary(user_id) # create session through ip - def initialize(work_id, user_id) - @work_id = work_id - - @user_id = user_id - end + # def initialize(work_id: work_id, user_id: user_id) + # @work_id = work_id + # @user_id = user_id + # end + # + # def save + # self.save + # end end diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index 048dfbb4cc..c54bc69929 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -3,54 +3,66 @@ The code for Top media per category could be rolled into a partial. Do it later.-->

- <% if Work.all == [] %> + + + + + +

+
-

- Top Albums -

+

+ Top Albums +

-
    - <% Work.top_ten("album").each do |work| %> -
  • - <%= link_to(work.title, work_path(work.id)) %> by: <%= work.creator %> - <%= work.votes.count %> votes -
  • - <% end %> +
      + <% Work.top_ten("album").each do |work| %> +
    • + <%= link_to(work.title, work_path(work.id)) %> by: <%= work.creator %> +

      <%= work.votes.count %> votes

      +
    • + <% end %>
    +
+
-

- Top Books -

- -
    - <% Work.top_ten("book").each do |work| %> -
  • - <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> - <%= work.votes.count %> votes -
  • - <% end %> -
+

+ Top Books +

-

- Top Movies -

- -
    - <% Work.top_ten("movie").each do |work| %> -
  • - <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> - <%= work.votes.count %> votes -
  • - <% end %> -
+
    + <% Work.top_ten("book").each do |work| %> +
  • + <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> +

    <%= work.votes.count %> votes

    +
  • + <% end %> +
+
+ +
+ +

+ Top Movies +

+ +
    + <% Work.top_ten("movie").each do |work| %> +
  • + <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> +

    <%= work.votes.count %> votes

    +
  • + <% end %> +
+
diff --git a/app/views/works/_form.html.erb b/app/views/works/_form.html.erb index b8be6ea36e..9ccedd8d63 100644 --- a/app/views/works/_form.html.erb +++ b/app/views/works/_form.html.erb @@ -15,6 +15,6 @@ <%= f.label :description %> <%= f.text_field :description %> - <%= f.submit button_text %> + <%= f.submit button_text, class: "button" %> <% end %> diff --git a/test/models/vote_test.rb b/test/models/vote_test.rb index 916d82c494..68fa4cd05a 100644 --- a/test/models/vote_test.rb +++ b/test/models/vote_test.rb @@ -42,6 +42,39 @@ # tell user they cannot vote on the same work vote2.errors.messages.must_include :user_id + end + end + + describe "make new vote" do + it "Successfully make new vote" do + # need user id so make a user + user_id = User.create!(name: "angela").id + puts user_id + work_id = 1 + puts work_id + + start_count = Vote.all.count + puts "Start count: #{start_count}" + + vote = Vote.new( + work_id: work_id, + user_id: user_id + ) + + puts vote + after_count = Vote.all.count + puts after_count + + + vote.must_be_instance_of Vote + after_count.must_equal start_count + 1 + + + + + + + end end end From e20dd29f0b72d4deaf0a3745b65cea9681ba45e5 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Fri, 3 Nov 2017 13:16:39 -0700 Subject: [PATCH 48/56] working on styles for home page and work show page. --- app/assets/stylesheets/application.css | 79 +++++++++++++++++++++++++- app/controllers/main_controller.rb | 5 +- app/views/main/index.html.erb | 22 +++++-- app/views/works/show.html.erb | 9 +-- 4 files changed, 103 insertions(+), 12 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index dae6251b61..da48bd40e0 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -76,11 +76,15 @@ Button line-height: 1; text-align: center; cursor: pointer; - background-color: #1779ba; + color: #fefefe; font-weight: normal; } +.float-right { + float: right !important; +} + /* Links */ @@ -104,7 +108,54 @@ a, h2 { } +.spotlight { + padding: 0 2rem 2rem 2rem; +} + +.columns { + width: 100%; + float: left; + padding-right: 0.625rem; + padding-left: 0.625rem; +} +.small-12 { + width: 100%; +} + +article, aside, footer, header, nav, section { + display: block; +} + +a:hover { + color: #00796B; + } + +.button:hover { + background-color: #00796B; +} + +a, h3 { + color: #26A69A; +} + +.media-spotlight-header { + color: #424242; +} + +h1, h2, h3, h4, h5 { + font-weight: bold; +} + +.spotlight p { + margin-bottom: 0px; +} +p { + margin-bottom: 1rem; + font-size: inherit; + line-height: 1.6; + text-rendering: optimizeLegibility; +} @@ -163,3 +214,29 @@ html { *, *::before, *::after { box-sizing: inherit; } + + +/* work show page */ + +thead th, thead td, tfoot th, tfoot td { + padding: 0.5rem 0.625rem 0.625rem; + font-weight: bold; + text-align: left; +} + +td, th { + display: table-cell; + vertical-align: inherit; +} + + +.small-12 { + width: 100%; +} + +.columns { + width: 100%; + float: left; + padding-right: 0.625rem; + padding-left: 0.625rem; +} diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 25b21d72f2..c5e74c1354 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -1,5 +1,8 @@ class MainController < ApplicationController def index - + @spotlight = Work.spotlight + unless @spotlight + @new = "None" + end end end diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index c54bc69929..e25ed5751a 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -12,15 +12,29 @@ The code for Top media per category could be rolled into a partial. Do it later. <%= Work.spotlight.creator %> <%= Work.spotlight.votes.count %> votes <% end %> --> +
+
- + <% if @new %> +

+ Media Spotlight: No Media +

+ <% else %> +

+ Media Spotlight: <%= link_to @spotlight.title, work_path(@spotlight.id) %> by <%= @spotlight.creator %> +

+

<%= @spotlight.votes.count %> votes - <%= @spotlight.category %>

+ <% end %> + +
+
-
+

Top Albums @@ -35,7 +49,7 @@ The code for Top media per category could be rolled into a partial. Do it later. <% end %>

-
+

Top Books @@ -51,7 +65,7 @@ The code for Top media per category could be rolled into a partial. Do it later.

-
+

Top Movies diff --git a/app/views/works/show.html.erb b/app/views/works/show.html.erb index d0e547c591..4931f70496 100644 --- a/app/views/works/show.html.erb +++ b/app/views/works/show.html.erb @@ -1,9 +1,6 @@ -

Need to work on UpVote.



-

-<%= params %> -

+

-
+

<%= @work.title %>

@@ -20,11 +17,11 @@
+

<%= @work.votes.count %> Votes for this <%= @work.category.capitalize %>

-
From ce86cd65d52c1daccb349563626cba07b75b54a8 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 4 Nov 2017 08:26:23 -0700 Subject: [PATCH 49/56] add failing test to vote model. work on layout styles --- app/assets/stylesheets/application.css | 26 +- app/controllers/main_controller.rb | 3 - app/models/vote.rb | 8 +- app/models/work.rb | 2 +- app/views/layouts/application.html.erb | 2 +- app/views/main/index.html.erb | 115 ++++----- app/views/users/index.html.erb | 4 +- app/views/works/index.html.erb | 12 +- app/views/works/show.html.erb | 2 +- test/controllers/works_controller_test.rb | 290 +++++++++++----------- test/fixtures/votes.yml | 2 +- test/models/work_test.rb | 26 +- 12 files changed, 245 insertions(+), 247 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index da48bd40e0..9021aed968 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -112,15 +112,6 @@ a, h2 { padding: 0 2rem 2rem 2rem; } -.columns { - width: 100%; - float: left; - padding-right: 0.625rem; - padding-left: 0.625rem; -} -.small-12 { - width: 100%; -} article, aside, footer, header, nav, section { display: block; @@ -138,6 +129,10 @@ a, h3 { color: #26A69A; } +h3 a { + text-decoration: underline; +} + .media-spotlight-header { color: #424242; } @@ -227,16 +222,9 @@ thead th, thead td, tfoot th, tfoot td { td, th { display: table-cell; vertical-align: inherit; + text-align: left; } - -.small-12 { - width: 100%; -} - -.columns { - width: 100%; - float: left; - padding-right: 0.625rem; - padding-left: 0.625rem; +td:last-of-type { + text-align: right; } diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index c5e74c1354..e5caacec70 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -1,8 +1,5 @@ class MainController < ApplicationController def index @spotlight = Work.spotlight - unless @spotlight - @new = "None" - end end end diff --git a/app/models/vote.rb b/app/models/vote.rb index e188f586e9..ddf1af5eb1 100644 --- a/app/models/vote.rb +++ b/app/models/vote.rb @@ -6,10 +6,10 @@ class Vote < ApplicationRecord validates :user_id, presence: true, uniqueness: {scope: :work_id, message: "You've already voled for this work"} # again not sure how to implement the @user_votes_arary method. see original comment in work.rb's custom methods - def self.user_votes_arary(user_id) - Vote.where(user_id: user_id) - - end + # def self.user_votes_arary(user_id) + # Vote.where(user_id: user_id) + # + # end # create session through ip diff --git a/app/models/work.rb b/app/models/work.rb index 75637d48b0..99be53264a 100644 --- a/app/models/work.rb +++ b/app/models/work.rb @@ -13,7 +13,7 @@ class Work < ApplicationRecord def self.spotlight works = Work.all if works == [] - return "No media on website, please enter a media" + return nil else spotlight = works.max_by {|work| work.votes.count} diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 46f0aea34a..9d997af6fc 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -20,7 +20,7 @@ <%= link_to "Add New Work", new_work_path, class: "button" %> <%= link_to "View All Users", users_path, class: "button" %> -
+
<%= link_to "Login", login_path, class: "button" %>
diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index e25ed5751a..54714d4a25 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -2,81 +2,70 @@ The code for Top media per category could be rolled into a partial. Do it later.--> -

- -
- <% if @new %> -

- Media Spotlight: No Media -

- <% else %> -

- Media Spotlight: <%= link_to @spotlight.title, work_path(@spotlight.id) %> by <%= @spotlight.creator %> -

-

<%= @spotlight.votes.count %> votes - <%= @spotlight.category %>

+ <% unless @spotlight %> +

+ Media Spotlight: No Media +

+ <% else %> +

+ Media Spotlight: <%= link_to @spotlight.title, work_path(@spotlight.id) %> by <%= @spotlight.creator %> +

+

<%= @spotlight.votes.count %> votes - <%= @spotlight.category %>

<% end %> - - -
-

-
-

- Top Albums -

+
-
    - <% Work.top_ten("album").each do |work| %> -
  • - <%= link_to(work.title, work_path(work.id)) %> by: <%= work.creator %> -

    <%= work.votes.count %> votes

    -
  • - <% end %> -
-
-
+
-

- Top Books -

+

+ Top Albums +

-
    - <% Work.top_ten("book").each do |work| %> -
  • - <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> -

    <%= work.votes.count %> votes

    -
  • - <% end %> -
-
+
    + <% Work.top_ten("album").each do |work| %> +
  • + <%= link_to(work.title, work_path(work.id)) %> by: <%= work.creator %> +

    <%= work.votes.count %> votes

    +
  • + <% end %> +
+
+
-
+

+ Top Books +

-

- Top Movies -

+
    + <% Work.top_ten("book").each do |work| %> +
  • + <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> +

    <%= work.votes.count %> votes

    +
  • + <% end %> +
+
-
    - <% Work.top_ten("movie").each do |work| %> -
  • - <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> -

    <%= work.votes.count %> votes

    -
  • - <% end %> -
-
+
+ +

+ Top Movies +

+ +
    + <% Work.top_ten("movie").each do |work| %> +
  • + <%= link_to work.title, work_path(work.id)%> by: <%= work.creator %> +

    <%= work.votes.count %> votes

    +
  • + <% end %> +
+
+
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 4b96cb0674..43904b1bf6 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -8,8 +8,8 @@ <% @users.each do |user| %>
- - + + <% end %>
<%= link_to user.name, user_path(user.id) %><%= user.votes.count %><%= user.created_at %><%= user.votes.count %><%= user.created_at %>
diff --git a/app/views/works/index.html.erb b/app/views/works/index.html.erb index 40378e3940..76f7e63b74 100644 --- a/app/views/works/index.html.erb +++ b/app/views/works/index.html.erb @@ -1,16 +1,22 @@ -# Want to DRY up code and will think about it later. -

Albums

+ +

List of Works

+

Albums

+ - + + <% @works.each do |work| %> <% if work.category == "album" %> + + + <% end %> <% end %> diff --git a/app/views/works/show.html.erb b/app/views/works/show.html.erb index 4931f70496..e24156ccee 100644 --- a/app/views/works/show.html.erb +++ b/app/views/works/show.html.erb @@ -17,7 +17,7 @@ -
+

<%= @work.votes.count %> Votes for this <%= @work.category.capitalize %>

diff --git a/test/controllers/works_controller_test.rb b/test/controllers/works_controller_test.rb index 69a080d4fd..35e40b0e3b 100644 --- a/test/controllers/works_controller_test.rb +++ b/test/controllers/works_controller_test.rb @@ -1,145 +1,145 @@ -require "test_helper" - -describe WorksController do - # it "must be a real test" do - # flunk "Need real tests" - # end - - describe "index" do - it "returns a success status for all books" do - get works_path - must_respond_with :success - end - - it "returns a sucess status when there are no works" do - Work.destroy_all - get works_path - must_respond_with :success - end - - - # I am unsure if this applies. - it "returns a success status when given a valid user_id" do - get work_user_path(User.first) - must_respond_with :success - end - end # end describe - - describe "new" do - it "works successfully" do - get new_work_path - must_respond_with :success - end - end - - describe "create" do - it "saves new work to DB and redirect_to works_path" do - work_data = { - work: { - category: "movie", - title: "test movie" - } - } - - work = Work.new(work_data[:work]).must_be :valid? - - start_work_count = Work.count - - #act - post works_path, params: work_data - - #Assert - must_respond_with :redirect - must_redirect_to works_path - - Work.count.must_equal start_book_count + 1 - end - - it "renders to new page and responds with bad_request" do - invalid_work_data = { - work: { - #no catergory - title: "test work" - } - } - - #double check the data is invalid - - Book.new(invalid_work_data[:work]).wowont_be :valid? - - start_work_count = Work.count - - post works_path, params: invalid_work_data - - must_respond_with :bad_request - - Work.count.must_equal start_work_count - end - end #end create - - describe "show" do - it "returns success when given a valid work id" do - work_id = Work.first.id - - get work_path(work_id) - - must_respond_with :success - end - - it "returns not_found when given an invalid_work_id" do - invalid_work_id = Work.last.id + 1 - get work_path(invalid_work_id) - must_respond_with :not_found - end - end #end show - - describe "edit" do - it "returns success when given a valid work id" do - work_id = Work.first.id - - get work_path(work_id) - - must_respond_with :success - end - - it "returns not_found when given an invalid_work_id" do - invalid_work_id = Work.last.id + 1 - get work_path(invalid_work_id) - must_respond_with :not_found - end - end #end edit - - describe "update" do - it "successfully saves update to database and redirect_to work_path for updated work." do - work = Work.new(catergory: "album", title: "test") - - patch work_path(work) - - must_respond_with :success - must_redirect_to work_path() - end - end #end update - - describe "destroy" do - - end #end destroy -end - - - - - - - - - - - - - - - - - - -puts +# require "test_helper" +# +# describe WorksController do +# # it "must be a real test" do +# # flunk "Need real tests" +# # end +# +# describe "index" do +# it "returns a success status for all books" do +# get works_path +# must_respond_with :success +# end +# +# it "returns a sucess status when there are no works" do +# Work.destroy_all +# get works_path +# must_respond_with :success +# end +# +# +# # I am unsure if this applies. +# it "returns a success status when given a valid user_id" do +# get work_user_path(User.first) +# must_respond_with :success +# end +# end # end describe +# +# describe "new" do +# it "works successfully" do +# get new_work_path +# must_respond_with :success +# end +# end +# +# describe "create" do +# it "saves new work to DB and redirect_to works_path" do +# work_data = { +# work: { +# category: "movie", +# title: "test movie" +# } +# } +# +# work = Work.new(work_data[:work]).must_be :valid? +# +# start_work_count = Work.count +# +# #act +# post works_path, params: work_data +# +# #Assert +# must_respond_with :redirect +# must_redirect_to works_path +# +# Work.count.must_equal start_book_count + 1 +# end +# +# it "renders to new page and responds with bad_request" do +# invalid_work_data = { +# work: { +# #no catergory +# title: "test work" +# } +# } +# +# #double check the data is invalid +# +# Book.new(invalid_work_data[:work]).wowont_be :valid? +# +# start_work_count = Work.count +# +# post works_path, params: invalid_work_data +# +# must_respond_with :bad_request +# +# Work.count.must_equal start_work_count +# end +# end #end create +# +# describe "show" do +# it "returns success when given a valid work id" do +# work_id = Work.first.id +# +# get work_path(work_id) +# +# must_respond_with :success +# end +# +# it "returns not_found when given an invalid_work_id" do +# invalid_work_id = Work.last.id + 1 +# get work_path(invalid_work_id) +# must_respond_with :not_found +# end +# end #end show +# +# describe "edit" do +# it "returns success when given a valid work id" do +# work_id = Work.first.id +# +# get work_path(work_id) +# +# must_respond_with :success +# end +# +# it "returns not_found when given an invalid_work_id" do +# invalid_work_id = Work.last.id + 1 +# get work_path(invalid_work_id) +# must_respond_with :not_found +# end +# end #end edit +# +# describe "update" do +# it "successfully saves update to database and redirect_to work_path for updated work." do +# work = Work.new(catergory: "album", title: "test") +# +# patch work_path(work) +# +# must_respond_with :success +# must_redirect_to work_path() +# end +# end #end update +# +# describe "destroy" do +# +# end #end destroy +# end +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# puts diff --git a/test/fixtures/votes.yml b/test/fixtures/votes.yml index 6c7de1fa7b..01d3cb30ca 100644 --- a/test/fixtures/votes.yml +++ b/test/fixtures/votes.yml @@ -14,4 +14,4 @@ vote2: vote3: user: user2 - work: work3 + work: work2 diff --git a/test/models/work_test.rb b/test/models/work_test.rb index fd03d21070..a7b24082dc 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -50,10 +50,10 @@ it "spotlight returns 'no work' when no works are present" do Work.destroy_all - Work.spotlight.must_equal "No media on website, please enter a media" + Work.spotlight.must_equal nil end - it "top_ten returns top_ten works in each category" do + it "top_ten returns top_ten works for Album" do works = Work.top_ten("album") works.must_be_kind_of Array @@ -65,7 +65,16 @@ works.last.title.must_equal "test_record" works.length.must_be :<=, 10 + end + + it "if no albums in db returns []" do + Work.destroy_all + work = Work.top_ten("album") + work.must_equal [] + end + + it "top_ten returns top_ten works for movie" do #testing movie works = Work.top_ten("movie") @@ -74,11 +83,20 @@ works.first.must_be_instance_of Work works.last.must_be_instance_of Work - works.first.title.must_equal "indiana jones" works.last.title.must_equal "many" + works.first.title.must_equal "indiana jones" - works.must_be :<=, 10 + works.length.must_be :<=, 10 + end + + it "if no movies in db returns []" do + Work.destroy_all + + work = Work.top_ten("movie") + work.must_equal [] + end + it "top_ten returns top_ten works for book" do #testing book works = Work.top_ten("book") From aef536956f949b21ebe216a195a9d547ecd338cd Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 4 Nov 2017 11:49:59 -0700 Subject: [PATCH 50/56] refactor work_test.rb to DRY code and clarify negative tests --- test/models/vote_test.rb | 46 +++++++++++++++++++++++++++++----------- test/models/work_test.rb | 28 +++++++++++++++++++----- 2 files changed, 57 insertions(+), 17 deletions(-) diff --git a/test/models/vote_test.rb b/test/models/vote_test.rb index 68fa4cd05a..0dfc0bf28c 100644 --- a/test/models/vote_test.rb +++ b/test/models/vote_test.rb @@ -13,13 +13,20 @@ # work relation vote.must_respond_to :work + vote.work.must_be_kind_of Work # user relation vote.must_respond_to :user + vote.user.must_be_kind_of User end end describe "validations" do + let (:user1) { User.create!(name: 'angela') } + let (:user2) { User.create!(name: 'angela') } + let (:work1) { Work.create!(category: 'album', title: 'smells like teen spirit') } + let (:work2) { Work.create!(category: 'album', title: 'blah') } + it "work_id is present, vote is valid" do vote = votes(:vote1) vote.must_be :valid? @@ -32,6 +39,28 @@ vote.errors.messages.must_include :work_id end + it "user_id is NOT present, invalid vote" do + vote = Vote.new(work_id: 1 ) + + vote.valid?.must_equal false + vote.errors.messages.must_include :user_id + end + + it "allows user to vote for multiple works" do + vote1 = Vote.new(user: user1, work: work1) + vote1.save! + vote2 = Vote.new(user: user1, work: work2) + vote2.valid?.must_equal true + end + + it "allows multiple users to vote for a work" do + vote1 = Vote.new(user_id: user1.id, work_id: work1.id) + puts vote1 + vote1.save! + vote2 = Vote.new(user: user2, work: work2) + vote2.valid?.must_equal true + end + it "user cannot double vote on a work" do vote1 = votes(:vote1) @@ -50,30 +79,23 @@ # need user id so make a user user_id = User.create!(name: "angela").id puts user_id - work_id = 1 - puts work_id + work_id = Work.create!(category: "album", title: "test").id + start_count = Vote.all.count - puts "Start count: #{start_count}" - vote = Vote.new( + vote = Vote.create!( work_id: work_id, user_id: user_id ) - puts vote after_count = Vote.all.count - puts after_count - vote.must_be_instance_of Vote after_count.must_equal start_count + 1 + end - - - - - + it "invalid " do end end diff --git a/test/models/work_test.rb b/test/models/work_test.rb index a7b24082dc..40ad52dede 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -7,6 +7,9 @@ it "has many votes" do work = Work.new(title: "test") work.must_respond_to :votes + work.votes.each do |vote| + vote.must_be_kind_of Vote + end end end #end description @@ -58,8 +61,9 @@ works.must_be_kind_of Array - works.first.must_be_instance_of Work - works.last.must_be_instance_of Work + works.each do |work| + work.must_be_instance_of Work + end works.first.title.must_equal "test_record" works.last.title.must_equal "test_record" @@ -80,8 +84,9 @@ works.must_be_kind_of Array - works.first.must_be_instance_of Work - works.last.must_be_instance_of Work + works.each do |work| + work.must_be_instance_of Work + end works.last.title.must_equal "many" works.first.title.must_equal "indiana jones" @@ -100,8 +105,21 @@ #testing book works = Work.top_ten("book") - works.must_equal [] + works.must_be_kind_of Array + + works.each do |work| + work.must_be_instance_of Work + end + works.length.must_be :<=, 10 end + + it "if no books in db returns []" do + Work.destroy_all + + work = Work.top_ten("book") + work.must_equal [] + end + end end From ed37c92f686772fb7f78005b8fb3138b19ac9c22 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 4 Nov 2017 12:22:02 -0700 Subject: [PATCH 51/56] write user_test.rb tests for relations and validations --- app/models/user.rb | 4 +++- test/models/user_test.rb | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 9a97ca3cf4..730cf1b08d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,4 +1,6 @@ class User < ApplicationRecord has_many :votes - + + validates :name, presence: true + end diff --git a/test/models/user_test.rb b/test/models/user_test.rb index b507720193..d44f96b9eb 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -6,4 +6,22 @@ # it "must be valid" do # value(user).must_be :valid? # end + + describe "relations" do + it "has a list of votes" do + user = users(:user1) + user.must_respond_to :votes + user.votes.each do |vote| + vote.must_be_kind_of Vote + end + end + end + + describe "validations" do + it "requires a name" do + user = User.new + user.valid?.must_equal false + user.errors.messages.must_include :name + end + end end From 53d6006638299b026209d17adc72bcc715115a76 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 4 Nov 2017 15:46:58 -0700 Subject: [PATCH 52/56] add dropdown style to add work category --- app/views/users/index.html.erb | 2 +- app/views/works/_form.html.erb | 2 +- app/views/works/new.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 43904b1bf6..8e47b3ae22 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,4 +1,4 @@ -

List of Users

+

List of Users

Votes Title CreatorPublication YearPublishedUpVote
<%= work.votes.count %> <%= link_to work.title, work_path(work.id) %> <%= work.creator %> <%= work.publication_year %><%= link_to "UpVote", works_path, class: "button" %>
diff --git a/app/views/works/_form.html.erb b/app/views/works/_form.html.erb index 9ccedd8d63..1d249d5bbd 100644 --- a/app/views/works/_form.html.erb +++ b/app/views/works/_form.html.erb @@ -1,7 +1,7 @@
<%= form_for @work do |f| %> <%= f.label :category %> - <%= f.text_field :category %> + <%= f.select :category, [['album'], ['book'], ['movie']] %> <%= f.label :title %> <%= f.text_field :title %> diff --git a/app/views/works/new.html.erb b/app/views/works/new.html.erb index a0ea940794..b2212c786b 100644 --- a/app/views/works/new.html.erb +++ b/app/views/works/new.html.erb @@ -1,4 +1,4 @@ -

Add a media

+

Add a new work

<%= render partial: 'layouts/error_messages', locals:{ model: @work} %> From c66a359a6f6e2737db9615924df994cc70ce0d69 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 4 Nov 2017 17:04:31 -0700 Subject: [PATCH 53/56] Re: #top_ten, add more votes for albums and books to ensure the method works properly. --- test/fixtures/votes.yml | 28 +++++++++++++++++++++------ test/fixtures/works.yml | 21 ++++++++++++++++++++ test/models/work_test.rb | 41 ++++++++++++++++++++-------------------- 3 files changed, 63 insertions(+), 27 deletions(-) diff --git a/test/fixtures/votes.yml b/test/fixtures/votes.yml index 01d3cb30ca..cfab0f88b9 100644 --- a/test/fixtures/votes.yml +++ b/test/fixtures/votes.yml @@ -5,13 +5,29 @@ # below each fixture, per the syntax in the comments below # vote1: - user: user1 - work: work1 + user: user1 #angela + work: work1 #album test_record # vote2: - user: user2 - work: work1 + user: user2 #angela + work: work1 #album test_record vote3: - user: user2 - work: work2 + user: user2 #jordan + work: work2 #movie indiana jones + +vote4: + user: user1 #angela + work: work13 # movie stew + +vote5: + user: user1 #angela + work: work14 #book HP1 + +vote6: + user: user2 #jordan + work: work14 #book HP1 + +vote7: + user: user2 #jordan + work: work15 #book Love in the time diff --git a/test/fixtures/works.yml b/test/fixtures/works.yml index bcb6590555..173ac77174 100644 --- a/test/fixtures/works.yml +++ b/test/fixtures/works.yml @@ -88,3 +88,24 @@ work12: creator: speilberg description: action-adventure publication_year: 1987 + +work13: + category: album + title: stew + creator: speilberg + description: action-adventure + publication_year: 1987 + +work14: + category: book + title: HP1 + creator: speilberg + description: action-adventure + publication_year: 1987 + +work15: + category: book + title: Love in the time + creator: speilberg + description: action-adventure + publication_year: 1987 diff --git a/test/models/work_test.rb b/test/models/work_test.rb index 40ad52dede..af34d26aa9 100644 --- a/test/models/work_test.rb +++ b/test/models/work_test.rb @@ -50,10 +50,10 @@ Work.spotlight.title.must_equal "test_record" end - it "spotlight returns 'no work' when no works are present" do + it "spotlight returns 'nil' when no works are present" do Work.destroy_all - Work.spotlight.must_equal nil + Work.spotlight.must_be_nil end it "top_ten returns top_ten works for Album" do @@ -65,19 +65,13 @@ work.must_be_instance_of Work end + # test_record has 2 votes and stew has 1 vote works.first.title.must_equal "test_record" - works.last.title.must_equal "test_record" + works.last.title.must_equal "stew" works.length.must_be :<=, 10 end - it "if no albums in db returns []" do - Work.destroy_all - - work = Work.top_ten("album") - work.must_equal [] - end - it "top_ten returns top_ten works for movie" do #testing movie works = Work.top_ten("movie") @@ -88,17 +82,12 @@ work.must_be_instance_of Work end - works.last.title.must_equal "many" + #indiana jones has 1 vote and the rest of the movies have 0 votes works.first.title.must_equal "indiana jones" + works.last.title.must_equal "many" - works.length.must_be :<=, 10 - end - - it "if no movies in db returns []" do - Work.destroy_all - work = Work.top_ten("movie") - work.must_equal [] + works.length.must_be :<=, 10 end it "top_ten returns top_ten works for book" do @@ -111,14 +100,24 @@ work.must_be_instance_of Work end + # HP1 has 2 votes and Love in the time has 1 vote + works.first.title.must_equal "HP1" + works.last.title.must_equal "Love in the time" + works.length.must_be :<=, 10 end - it "if no books in db returns []" do + + it "if no media than returns an empty array for each category" do Work.destroy_all - work = Work.top_ten("book") - work.must_equal [] + categories = ["album", "movie", "book"] + + categories.each do |category| + work = Work.top_ten(category) + work.must_equal [] + end + end end From 1942d5e7e4acc041e19a81d71967cfab810cdc39 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sat, 4 Nov 2017 17:10:46 -0700 Subject: [PATCH 54/56] main#index page: add hr tag --- app/views/main/index.html.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index 54714d4a25..121d3bee90 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -19,6 +19,9 @@ The code for Top media per category could be rolled into a partial. Do it later.
+
+ +
From 935852e12ebaec605ed1b632d079b564f21f1989 Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 5 Nov 2017 16:57:06 -0800 Subject: [PATCH 55/56] add custom user method to make vote, tests pass --- app/models/user.rb | 16 ++++++++++++++++ test/models/user_test.rb | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index 730cf1b08d..b4974487fd 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,4 +3,20 @@ class User < ApplicationRecord validates :name, presence: true + def vote(work) + if work.id + vote = Vote.new(work_id: work.id, user_id: self.id) + vote.save + else + return "must have work id" + end + end + + + def valid + + if user_id > 0 && work_id > 0 + return true + end + end end diff --git a/test/models/user_test.rb b/test/models/user_test.rb index d44f96b9eb..644f004bf8 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -24,4 +24,22 @@ user.errors.messages.must_include :name end end + + describe "custom method" do + it "#vote creates a Vote" do + work = works(:work1) + user = users(:user1) + + user.vote(work).must_be_instance_of Vote + end + + it "#vote fails if work id is not present" do + work = Work.new + user = User.create(name: "name") + # puts user + + vote = user.vote(work) + vote.must_equal "must have work id" + end + end end From aa453c654244bc46162a67a3222b59c3267ccb8b Mon Sep 17 00:00:00 2001 From: Angela Wilson Date: Sun, 5 Nov 2017 16:58:16 -0800 Subject: [PATCH 56/56] delete user valid method that was un-needed. --- app/models/user.rb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index b4974487fd..3a6a6aa38d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -11,12 +11,4 @@ def vote(work) return "must have work id" end end - - - def valid - - if user_id > 0 && work_id > 0 - return true - end - end end
User Name