From 7ebb1ff8f13a4789eeff8a684ef7b1bc9bd5d0ca Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 17:06:25 -0700 Subject: [PATCH 01/88] hides all the things --- .gitignore | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..7a1e904fe --- /dev/null +++ b/.gitignore @@ -0,0 +1,80 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +/.bundle + +# Ignore the default SQLite database. +/db/*.sqlite3 +/db/*.sqlite3-journal + +# Ignore all logfiles and tempfiles. +/log/* +!/log/.keep +/tmp + + +# Ignore this annoying MACOS file which is a caching file and keeps thumbnails +.DS_Store + +# Hide the .env because it's full of secrets! +/.env + +# Ignore the default SQLite database. +/db/*.sqlite3 +/db/*.sqlite3-journal +betsy_development +betsy_test + + +# Ignore this annoying MACOS file which is a caching file and keeps thumbnails +.DS_store + +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +#*.rbc +capybara-*.html +.rspec + +/public/system +/coverage/ +/spec/tmp +**.orig +rerun.txt +pickle-email-*.html + +# TODO Comment out this rule if you are OK with secrets being uploaded to the repo +config/initializers/secret_token.rb + +# Only include if you have production secrets in this file, which is no longer a Rails default +# config/secrets.yml + +# dotenv +# TODO Comment out this rule if environment variables can be committed + +# Hide the .env becuase of secrets +/.env +/*.env + +## Environment normalization: +/.bundle +/vendor/bundle + +# these should all be checked in to normalize the environment: +# Gemfile.lock, .ruby-version, .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc + +# if using bower-rails ignore default bower_components path bower.json files +/vendor/assets/bower_components +*.bowerrc +bower.json + +# Ignore pow environment settings +.powenv + +# Ignore Byebug command history file. +.byebug_history \ No newline at end of file From ea47c04a21a3850ca61986d517e4468f9a35b215 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 17:07:01 -0700 Subject: [PATCH 02/88] includes debugging gems, omniauth, and all that --- Gemfile | 73 +++++++++++++++++++++++ Gemfile.lock | 162 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 235 insertions(+) create mode 100644 Gemfile create mode 100644 Gemfile.lock diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..4cb14ebcf --- /dev/null +++ b/Gemfile @@ -0,0 +1,73 @@ +source 'https://rubygems.org' + + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '4.2.7' +# Use sqlite3 as the database for Active Record +# gem 'sqlite3' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0' +# Use CoffeeScript for .coffee assets and views +gem 'coffee-rails', '~> 4.1.0' +# See https://github.com/rails/execjs#readme for more supported runtimes +# gem 'therubyracer', platforms: :ruby + +# Use jquery as the JavaScript library +gem 'jquery-rails' +# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks +gem 'turbolinks' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.0' +# bundle exec rake doc:rails generates the API under doc/api. +gem 'sdoc', '~> 0.4.0', group: :doc + +#gem for authenticated user actions +#gem 'devise', '~> 4.2' + +#gem for oAuth github Authentication +gem 'omniauth' +gem 'omniauth-github' + +#make it easier to read +gem 'awesome_print' + + + +# Use ActiveModel has_secure_password +# gem 'bcrypt', '~> 3.1.7' + +# Use Unicorn as the app server +# gem 'unicorn' + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug' + gem 'sqlite3' + gem 'dotenv-rails' + gem 'pry' +end + +group :development do + # Access an IRB console on exception pages or by using <%= console %> in views + gem 'web-console', '~> 2.0' + + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'spring' + gem 'better_errors' +end + + +group :test do + gem 'minitest-reporters' + gem 'simplecov' +end + +gem 'pg', group: :production +gem 'rails_12factor', group: :production + +end \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..684fa5b41 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,162 @@ +GEM + remote: https://rubygems.org/ + specs: + actionmailer (4.2.7) + actionpack (= 4.2.7) + actionview (= 4.2.7) + activejob (= 4.2.7) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.7) + actionview (= 4.2.7) + activesupport (= 4.2.7) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.7) + activesupport (= 4.2.7) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.7) + activesupport (= 4.2.7) + globalid (>= 0.3.0) + activemodel (4.2.7) + activesupport (= 4.2.7) + builder (~> 3.1) + activerecord (4.2.7) + activemodel (= 4.2.7) + activesupport (= 4.2.7) + arel (~> 6.0) + activesupport (4.2.7) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + arel (6.0.3) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) + builder (3.2.2) + byebug (9.0.6) + coffee-rails (4.1.1) + coffee-script (>= 2.2.0) + railties (>= 4.0.0, < 5.1.x) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.10.0) + concurrent-ruby (1.0.2) + debug_inspector (0.0.2) + erubis (2.7.0) + execjs (2.7.0) + globalid (0.3.7) + activesupport (>= 4.1.0) + i18n (0.7.0) + jbuilder (2.6.0) + activesupport (>= 3.0.0, < 5.1) + multi_json (~> 1.2) + jquery-rails (4.2.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (1.8.3) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.4) + mime-types (>= 1.16, < 4) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_portile2 (2.1.0) + minitest (5.9.1) + multi_json (1.12.1) + nokogiri (1.6.8.1) + mini_portile2 (~> 2.1.0) + rack (1.6.4) + rack-test (0.6.3) + rack (>= 1.0) + rails (4.2.7) + actionmailer (= 4.2.7) + actionpack (= 4.2.7) + actionview (= 4.2.7) + activejob (= 4.2.7) + activemodel (= 4.2.7) + activerecord (= 4.2.7) + activesupport (= 4.2.7) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.7) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.7) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + railties (4.2.7) + actionpack (= 4.2.7) + activesupport (= 4.2.7) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (11.3.0) + rdoc (4.2.2) + json (~> 1.4) + sass (3.4.22) + 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) + sdoc (0.4.2) + json (~> 1.7, >= 1.7.7) + rdoc (~> 4.0) + spring (2.0.0) + activesupport (>= 4.2) + sprockets (3.7.0) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.0) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.12) + thor (0.19.1) + thread_safe (0.3.5) + tilt (2.0.5) + turbolinks (5.0.1) + turbolinks-source (~> 5) + turbolinks-source (5.0.0) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (3.0.3) + execjs (>= 0.3.0, < 3) + web-console (2.3.0) + activemodel (>= 4.0) + binding_of_caller (>= 0.7.2) + railties (>= 4.0) + sprockets-rails (>= 2.0, < 4.0) + +PLATFORMS + ruby + +DEPENDENCIES + byebug + coffee-rails (~> 4.1.0) + jbuilder (~> 2.0) + jquery-rails + rails (= 4.2.7) + sass-rails (~> 5.0) + sdoc (~> 0.4.0) + spring + sqlite3 + turbolinks + uglifier (>= 1.3.0) + web-console (~> 2.0) + +BUNDLED WITH + 1.13.5 From 7eee457ec5a807a5aca7622a39ce95ae75fa060c Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 17:07:10 -0700 Subject: [PATCH 03/88] first commit --- README.rdoc | 28 +++++++ Rakefile | 6 ++ app/assets/images/.keep | 0 app/assets/javascripts/application.js | 16 ++++ app/assets/stylesheets/application.css | 15 ++++ app/controllers/application_controller.rb | 5 ++ app/controllers/concerns/.keep | 0 app/helpers/application_helper.rb | 2 + app/mailers/.keep | 0 app/models/.keep | 0 app/models/concerns/.keep | 0 app/views/layouts/application.html.erb | 14 ++++ bin/bundle | 3 + bin/rails | 9 +++ bin/rake | 9 +++ bin/setup | 29 +++++++ bin/spring | 16 ++++ config.ru | 4 + config/application.rb | 26 ++++++ config/boot.rb | 3 + config/database.yml | 25 ++++++ config/environment.rb | 5 ++ config/environments/development.rb | 41 ++++++++++ config/environments/production.rb | 79 +++++++++++++++++++ config/environments/test.rb | 42 ++++++++++ config/initializers/assets.rb | 11 +++ config/initializers/backtrace_silencers.rb | 7 ++ config/initializers/cookies_serializer.rb | 3 + .../initializers/filter_parameter_logging.rb | 4 + config/initializers/inflections.rb | 16 ++++ config/initializers/mime_types.rb | 4 + config/initializers/session_store.rb | 3 + config/initializers/wrap_parameters.rb | 14 ++++ config/locales/en.yml | 23 ++++++ config/routes.rb | 56 +++++++++++++ config/secrets.yml | 22 ++++++ db/seeds.rb | 7 ++ lib/assets/.keep | 0 lib/tasks/.keep | 0 log/.keep | 0 public/404.html | 67 ++++++++++++++++ public/422.html | 67 ++++++++++++++++ public/500.html | 66 ++++++++++++++++ public/favicon.ico | 0 public/robots.txt | 5 ++ test/controllers/.keep | 0 test/fixtures/.keep | 0 test/helpers/.keep | 0 test/integration/.keep | 0 test/mailers/.keep | 0 test/models/.keep | 0 test/test_helper.rb | 10 +++ vendor/assets/javascripts/.keep | 0 vendor/assets/stylesheets/.keep | 0 54 files changed, 762 insertions(+) create mode 100644 README.rdoc create mode 100644 Rakefile create mode 100644 app/assets/images/.keep create mode 100644 app/assets/javascripts/application.js create mode 100644 app/assets/stylesheets/application.css 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/mailers/.keep create mode 100644 app/models/.keep create mode 100644 app/models/concerns/.keep create mode 100644 app/views/layouts/application.html.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 100644 config.ru create mode 100644 config/application.rb create mode 100644 config/boot.rb 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/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/session_store.rb create mode 100644 config/initializers/wrap_parameters.rb create mode 100644 config/locales/en.yml create mode 100644 config/routes.rb create mode 100644 config/secrets.yml 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 public/404.html create mode 100644 public/422.html create mode 100644 public/500.html create mode 100644 public/favicon.ico create mode 100644 public/robots.txt create mode 100644 test/controllers/.keep create mode 100644 test/fixtures/.keep 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/test_helper.rb create mode 100644 vendor/assets/javascripts/.keep create mode 100644 vendor/assets/stylesheets/.keep diff --git a/README.rdoc b/README.rdoc new file mode 100644 index 000000000..dd4e97e22 --- /dev/null +++ b/README.rdoc @@ -0,0 +1,28 @@ +== README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... + + +Please feel free to use a different markup language if you do not plan to run +rake doc:app. diff --git a/Rakefile b/Rakefile new file mode 100644 index 000000000..ba6b733dd --- /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 File.expand_path('../config/application', __FILE__) + +Rails.application.load_tasks diff --git a/app/assets/images/.keep b/app/assets/images/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 000000000..e07c5a830 --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,16 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or 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. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require jquery +//= require jquery_ujs +//= require turbolinks +//= require_tree . diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 000000000..f9cd5b348 --- /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, vendor/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 styles + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new + * file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 000000000..d83690e1b --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,5 @@ +class ApplicationController < ActionController::Base + # Prevent CSRF attacks by raising an exception. + # For APIs, you may want to use :null_session instead. + protect_from_forgery with: :exception +end diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 000000000..de6be7945 --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/app/mailers/.keep b/app/mailers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/app/models/.keep b/app/models/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 000000000..237dbba45 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + ApiMuncher + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> + <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> + <%= csrf_meta_tags %> + + + +<%= yield %> + + + diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 000000000..66e9889e8 --- /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 000000000..0138d79b7 --- /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', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake new file mode 100755 index 000000000..d87d5f578 --- /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 000000000..acdb2c138 --- /dev/null +++ b/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/bin/spring b/bin/spring new file mode 100755 index 000000000..9bc076b9e --- /dev/null +++ b/bin/spring @@ -0,0 +1,16 @@ +#!/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) + if spring = lockfile.specs.detect { |spec| spec.name == "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/config.ru b/config.ru new file mode 100644 index 000000000..bd83b2541 --- /dev/null +++ b/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 000000000..20568697a --- /dev/null +++ b/config/application.rb @@ -0,0 +1,26 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module ApiMuncher + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 000000000..6b750f00b --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 000000000..1c1a37ca8 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +# +default: &default + adapter: sqlite3 + pool: 5 + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# 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: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 000000000..ee8d90dc6 --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require File.expand_path('../application', __FILE__) + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 000000000..b55e2144b --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,41 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 000000000..5c1b32e48 --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,79 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like + # NGINX, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = 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 + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # 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 = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 000000000..1c19f08b2 --- /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 static file server for tests with Cache-Control for performance. + config.serve_static_files = true + config.static_cache_control = 'public, max-age=3600' + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Randomize the order test cases are executed. + config.active_support.test_order = :random + + # 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/assets.rb b/config/initializers/assets.rb new file mode 100644 index 000000000..01ef3e663 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# 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 + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb new file mode 100644 index 000000000..59385cdf3 --- /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 000000000..7f70458de --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +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 000000000..4a994e1e7 --- /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 000000000..ac033bf9d --- /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 000000000..dc1899682 --- /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/session_store.rb b/config/initializers/session_store.rb new file mode 100644 index 000000000..6cc0e03e4 --- /dev/null +++ b/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_api-muncher_session' diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb new file mode 100644 index 000000000..33725e95f --- /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] if respond_to?(:wrap_parameters) +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 000000000..065395716 --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,23 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 000000000..3f66539d5 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,56 @@ +Rails.application.routes.draw do + # The priority is based upon order of creation: first created -> highest priority. + # See how all your routes lay out with "rake routes". + + # You can have the root of your site routed with "root" + # root 'welcome#index' + + # Example of regular route: + # get 'products/:id' => 'catalog#view' + + # Example of named route that can be invoked with purchase_url(id: product.id) + # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase + + # Example resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Example resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Example resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Example resource route with more complex sub-resources: + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', on: :collection + # end + # end + + # Example resource route with concerns: + # concern :toggleable do + # post 'toggle' + # end + # resources :posts, concerns: :toggleable + # resources :photos, concerns: :toggleable + + # Example resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end +end diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 000000000..a6646551e --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: ba85a1497c3b4b724585bfe0a33ecadfad9ca1df6bb2930df54cb08153358f4f7b760525ff5e656858d4b548b3a36da7061ae24521decc93096408f820371eb9 + +test: + secret_key_base: e77f843b38ffcaa42f8466e372691a1c526740540402831ba99f5c616750e661e3bf75053d745acbb3c554025b639b7aebaf1765d82295840d7ee50692af89ce + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 000000000..4edb1e857 --- /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 rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) +# Mayor.create(name: 'Emanuel', city: cities.first) diff --git a/lib/assets/.keep b/lib/assets/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/lib/tasks/.keep b/lib/tasks/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/log/.keep b/log/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/public/404.html b/public/404.html new file mode 100644 index 000000000..b612547fc --- /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 000000000..a21f82b3b --- /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 000000000..061abc587 --- /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/favicon.ico b/public/favicon.ico new file mode 100644 index 000000000..e69de29bb diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 000000000..3c9c7c01f --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,5 @@ +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file +# +# To ban all spiders from the entire site uncomment the next two lines: +# User-agent: * +# Disallow: / diff --git a/test/controllers/.keep b/test/controllers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/fixtures/.keep b/test/fixtures/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/helpers/.keep b/test/helpers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/.keep b/test/integration/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/mailers/.keep b/test/mailers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/models/.keep b/test/models/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 000000000..92e39b2d7 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,10 @@ +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' + +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/vendor/assets/javascripts/.keep b/vendor/assets/javascripts/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/assets/stylesheets/.keep b/vendor/assets/stylesheets/.keep new file mode 100644 index 000000000..e69de29bb From 627828d7ac631aaf46332819448e3fad10a8a369 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 20:55:07 -0700 Subject: [PATCH 04/88] added httparty and foundation gems --- Gemfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Gemfile b/Gemfile index 4cb14ebcf..ca605f4b2 100644 --- a/Gemfile +++ b/Gemfile @@ -33,6 +33,12 @@ gem 'omniauth-github' #make it easier to read gem 'awesome_print' +# API GEMS +gem 'httparty' + + +# Helps make it pretty, CSS-related gem +gem 'foundation-rails' # Use ActiveModel has_secure_password From 2251a3c465be12a8ee47581193301ab45e63be97 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 20:55:59 -0700 Subject: [PATCH 05/88] search item class, start of --- lib/recipesearch.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/recipesearch.rb diff --git a/lib/recipesearch.rb b/lib/recipesearch.rb new file mode 100644 index 000000000..cf88dfce8 --- /dev/null +++ b/lib/recipesearch.rb @@ -0,0 +1,12 @@ +#recipesearch.rb + +class RecipeSearch + attr_reader :name, :id + + def initialize(name, id) + @name = name + @id = id + end + + +end From f694c89b6022a623d70609d19df75aff2ab4b297 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 20:56:11 -0700 Subject: [PATCH 06/88] api wrapper class, start of --- lib/recipesearchwrapper.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/recipesearchwrapper.rb diff --git a/lib/recipesearchwrapper.rb b/lib/recipesearchwrapper.rb new file mode 100644 index 000000000..493482cd1 --- /dev/null +++ b/lib/recipesearchwrapper.rb @@ -0,0 +1,12 @@ +#recipesearchwrapper.rb +require 'httparty' +require 'recipesearch' + +class RecipeSearchWrapper + + TOKEN = ENV[APP_ID] + SECRET = ENV[APP_KEY] + + BASE_URL = "https://api.edamam.com/search" + +end \ No newline at end of file From b5129541444a8aa053b9d54d2557e45c7915d76f Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 21:14:07 -0700 Subject: [PATCH 07/88] bundle installed --- Gemfile | 1 - Gemfile.lock | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index ca605f4b2..9b15ccfdb 100644 --- a/Gemfile +++ b/Gemfile @@ -76,4 +76,3 @@ end gem 'pg', group: :production gem 'rails_12factor', group: :production -end \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 684fa5b41..21c6c6106 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,11 +36,22 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) + ansi (1.5.0) arel (6.0.3) + awesome_print (1.7.0) + babel-source (5.8.35) + babel-transpiler (0.7.0) + babel-source (>= 4.0, < 6) + execjs (~> 2.0) + better_errors (2.1.1) + coderay (>= 1.0.0) + erubis (>= 2.6.6) + rack (>= 0.9.0) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) builder (3.2.2) byebug (9.0.6) + coderay (1.1.1) coffee-rails (4.1.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.1.x) @@ -50,10 +61,24 @@ GEM coffee-script-source (1.10.0) concurrent-ruby (1.0.2) debug_inspector (0.0.2) + docile (1.1.5) + dotenv (2.1.1) + dotenv-rails (2.1.1) + dotenv (= 2.1.1) + railties (>= 4.0, < 5.1) erubis (2.7.0) execjs (2.7.0) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + foundation-rails (6.2.4.0) + railties (>= 3.1.0) + sass (>= 3.3.0, < 3.5) + sprockets-es6 (>= 0.9.0) globalid (0.3.7) activesupport (>= 4.1.0) + hashie (3.4.6) + httparty (0.14.0) + multi_xml (>= 0.5.2) i18n (0.7.0) jbuilder (2.6.0) activesupport (>= 3.0.0, < 5.1) @@ -63,18 +88,47 @@ GEM railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (1.8.3) + jwt (1.5.6) loofah (2.0.3) nokogiri (>= 1.5.9) mail (2.6.4) mime-types (>= 1.16, < 4) + method_source (0.8.2) mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mini_portile2 (2.1.0) minitest (5.9.1) + minitest-reporters (1.1.12) + ansi + builder + minitest (>= 5.0) + ruby-progressbar multi_json (1.12.1) + multi_xml (0.5.5) + multipart-post (2.0.0) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) + oauth2 (1.2.0) + faraday (>= 0.8, < 0.10) + jwt (~> 1.0) + multi_json (~> 1.3) + multi_xml (~> 0.5) + rack (>= 1.2, < 3) + omniauth (1.3.1) + hashie (>= 1.2, < 4) + rack (>= 1.0, < 3) + omniauth-github (1.1.2) + omniauth (~> 1.0) + omniauth-oauth2 (~> 1.1) + omniauth-oauth2 (1.4.0) + oauth2 (~> 1.0) + omniauth (~> 1.2) + pg (0.19.0) + pry (0.10.4) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) @@ -97,6 +151,11 @@ GEM rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.3) loofah (~> 2.0) + rails_12factor (0.0.3) + rails_serve_static_assets + rails_stdout_logging + rails_serve_static_assets (0.0.5) + rails_stdout_logging (0.0.5) railties (4.2.7) actionpack (= 4.2.7) activesupport (= 4.2.7) @@ -105,6 +164,7 @@ GEM rake (11.3.0) rdoc (4.2.2) json (~> 1.4) + ruby-progressbar (1.8.1) sass (3.4.22) sass-rails (5.0.6) railties (>= 4.0.0, < 6) @@ -115,11 +175,21 @@ GEM sdoc (0.4.2) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) + simplecov (0.12.0) + docile (~> 1.1.0) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) + slop (3.6.0) spring (2.0.0) activesupport (>= 4.2) sprockets (3.7.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) + sprockets-es6 (0.9.2) + babel-source (>= 5.8.11) + babel-transpiler + sprockets (>= 3.0.0) sprockets-rails (3.2.0) actionpack (>= 4.0) activesupport (>= 4.0) @@ -145,13 +215,25 @@ PLATFORMS ruby DEPENDENCIES + awesome_print + better_errors byebug coffee-rails (~> 4.1.0) + dotenv-rails + foundation-rails + httparty jbuilder (~> 2.0) jquery-rails + minitest-reporters + omniauth + omniauth-github + pg + pry rails (= 4.2.7) + rails_12factor sass-rails (~> 5.0) sdoc (~> 0.4.0) + simplecov spring sqlite3 turbolinks @@ -159,4 +241,4 @@ DEPENDENCIES web-console (~> 2.0) BUNDLED WITH - 1.13.5 + 1.13.6 From 156aa750dfba3ae19e883a09c8adfe65c5ab26c7 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 21:14:41 -0700 Subject: [PATCH 08/88] require recipesearchwrapper lib file --- lib/recipesearch.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/recipesearch.rb b/lib/recipesearch.rb index cf88dfce8..98fce5869 100644 --- a/lib/recipesearch.rb +++ b/lib/recipesearch.rb @@ -1,5 +1,7 @@ #recipesearch.rb +require 'recipesearchwrapper' + class RecipeSearch attr_reader :name, :id From 79efefccd002e3ca8d1afaf7a48627e47266c939 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 21:15:51 -0700 Subject: [PATCH 09/88] added constants base_url and auth, renamed id and secret constants, started search class method --- lib/recipesearchwrapper.rb | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/recipesearchwrapper.rb b/lib/recipesearchwrapper.rb index 493482cd1..646f87b13 100644 --- a/lib/recipesearchwrapper.rb +++ b/lib/recipesearchwrapper.rb @@ -4,9 +4,35 @@ class RecipeSearchWrapper - TOKEN = ENV[APP_ID] - SECRET = ENV[APP_KEY] +#hide that information away! + APP_ID = ENV[APP_ID] + APP_KEY = ENV[APP_KEY] - BASE_URL = "https://api.edamam.com/search" +#this is where it all starts + BASE_URL = "https://api.edamam.com/" + +#because who wants to type all that? + AUTH = "&app_id=APP_ID&app_key=APP_KEY" + + +#helps users find recipes by an ingredient + self.search_recipes_by_one_keyword(keyword) + url = BASE_URL + "search?q=#{keyword}" + AUTH + + response = HTTParty.get(url) + + my_recipes = [] + + response["recipes"] + + response["recipes"].each do |recipe| + id = recipe["id"] + name = recipe["name"] + + my_recipes << RecipeSearch.new(name, id) + end + + return my_recipes + end end \ No newline at end of file From 01c4128acbb0f3439d1983b967ca1ba2471021a7 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 21:20:44 -0700 Subject: [PATCH 10/88] added sessions controller --- app/assets/javascripts/sessions.coffee | 3 +++ app/assets/stylesheets/sessions.scss | 3 +++ app/controllers/sessions_controller.rb | 10 ++++++++++ app/helpers/sessions_helper.rb | 2 ++ app/views/sessions/create.html.erb | 2 ++ app/views/sessions/destroy.html.erb | 2 ++ app/views/sessions/new.html.erb | 2 ++ test/controllers/sessions_controller_test.rb | 19 +++++++++++++++++++ 8 files changed, 43 insertions(+) create mode 100644 app/assets/javascripts/sessions.coffee create mode 100644 app/assets/stylesheets/sessions.scss create mode 100644 app/controllers/sessions_controller.rb create mode 100644 app/helpers/sessions_helper.rb create mode 100644 app/views/sessions/create.html.erb create mode 100644 app/views/sessions/destroy.html.erb create mode 100644 app/views/sessions/new.html.erb create mode 100644 test/controllers/sessions_controller_test.rb diff --git a/app/assets/javascripts/sessions.coffee b/app/assets/javascripts/sessions.coffee new file mode 100644 index 000000000..24f83d18b --- /dev/null +++ b/app/assets/javascripts/sessions.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/sessions.scss b/app/assets/stylesheets/sessions.scss new file mode 100644 index 000000000..7bef9cf82 --- /dev/null +++ b/app/assets/stylesheets/sessions.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the sessions 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/sessions_controller.rb b/app/controllers/sessions_controller.rb new file mode 100644 index 000000000..bd2333062 --- /dev/null +++ b/app/controllers/sessions_controller.rb @@ -0,0 +1,10 @@ +class SessionsController < ApplicationController + def new + end + + def create + end + + def destroy + end +end diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb new file mode 100644 index 000000000..309f8b2eb --- /dev/null +++ b/app/helpers/sessions_helper.rb @@ -0,0 +1,2 @@ +module SessionsHelper +end diff --git a/app/views/sessions/create.html.erb b/app/views/sessions/create.html.erb new file mode 100644 index 000000000..c251174fe --- /dev/null +++ b/app/views/sessions/create.html.erb @@ -0,0 +1,2 @@ +

Sessions#create

+

Find me in app/views/sessions/create.html.erb

diff --git a/app/views/sessions/destroy.html.erb b/app/views/sessions/destroy.html.erb new file mode 100644 index 000000000..d75237d98 --- /dev/null +++ b/app/views/sessions/destroy.html.erb @@ -0,0 +1,2 @@ +

Sessions#destroy

+

Find me in app/views/sessions/destroy.html.erb

diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb new file mode 100644 index 000000000..b39a3bc95 --- /dev/null +++ b/app/views/sessions/new.html.erb @@ -0,0 +1,2 @@ +

Sessions#new

+

Find me in app/views/sessions/new.html.erb

diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb new file mode 100644 index 000000000..7e1dbdee3 --- /dev/null +++ b/test/controllers/sessions_controller_test.rb @@ -0,0 +1,19 @@ +require 'test_helper' + +class SessionsControllerTest < ActionController::TestCase + test "should get new" do + get :new + assert_response :success + end + + test "should get create" do + get :create + assert_response :success + end + + test "should get destroy" do + get :destroy + assert_response :success + end + +end From e12da817e3f0a230f802606d11f3565ea83c89e3 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 21:21:47 -0700 Subject: [PATCH 11/88] added users controller --- app/assets/javascripts/users.coffee | 3 ++ app/assets/stylesheets/users.scss | 3 ++ app/controllers/users_controller.rb | 22 +++++++++++++ app/helpers/users_helper.rb | 2 ++ app/views/users/create.html.erb | 2 ++ app/views/users/destroy.html.erb | 2 ++ app/views/users/edit.html.erb | 2 ++ app/views/users/index.html.erb | 2 ++ app/views/users/new.html.erb | 2 ++ app/views/users/show.html.erb | 2 ++ app/views/users/update.html.erb | 2 ++ test/controllers/users_controller_test.rb | 39 +++++++++++++++++++++++ 12 files changed, 83 insertions(+) create mode 100644 app/assets/javascripts/users.coffee create mode 100644 app/assets/stylesheets/users.scss create mode 100644 app/controllers/users_controller.rb create mode 100644 app/helpers/users_helper.rb create mode 100644 app/views/users/create.html.erb create mode 100644 app/views/users/destroy.html.erb create mode 100644 app/views/users/edit.html.erb create mode 100644 app/views/users/index.html.erb create mode 100644 app/views/users/new.html.erb create mode 100644 app/views/users/show.html.erb create mode 100644 app/views/users/update.html.erb create mode 100644 test/controllers/users_controller_test.rb diff --git a/app/assets/javascripts/users.coffee b/app/assets/javascripts/users.coffee new file mode 100644 index 000000000..24f83d18b --- /dev/null +++ b/app/assets/javascripts/users.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss new file mode 100644 index 000000000..1efc835cc --- /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/controllers/users_controller.rb b/app/controllers/users_controller.rb new file mode 100644 index 000000000..4da2ddd9d --- /dev/null +++ b/app/controllers/users_controller.rb @@ -0,0 +1,22 @@ +class UsersController < ApplicationController + def index + end + + def show + end + + def new + end + + def create + end + + def edit + end + + def update + end + + def destroy + end +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb new file mode 100644 index 000000000..2310a240d --- /dev/null +++ b/app/helpers/users_helper.rb @@ -0,0 +1,2 @@ +module UsersHelper +end diff --git a/app/views/users/create.html.erb b/app/views/users/create.html.erb new file mode 100644 index 000000000..48ea02e60 --- /dev/null +++ b/app/views/users/create.html.erb @@ -0,0 +1,2 @@ +

Users#create

+

Find me in app/views/users/create.html.erb

diff --git a/app/views/users/destroy.html.erb b/app/views/users/destroy.html.erb new file mode 100644 index 000000000..de4bd2634 --- /dev/null +++ b/app/views/users/destroy.html.erb @@ -0,0 +1,2 @@ +

Users#destroy

+

Find me in app/views/users/destroy.html.erb

diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb new file mode 100644 index 000000000..1881fbdba --- /dev/null +++ b/app/views/users/edit.html.erb @@ -0,0 +1,2 @@ +

Users#edit

+

Find me in app/views/users/edit.html.erb

diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb new file mode 100644 index 000000000..51968c88d --- /dev/null +++ b/app/views/users/index.html.erb @@ -0,0 +1,2 @@ +

Users#index

+

Find me in app/views/users/index.html.erb

diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb new file mode 100644 index 000000000..c21a1adf1 --- /dev/null +++ b/app/views/users/new.html.erb @@ -0,0 +1,2 @@ +

Users#new

+

Find me in app/views/users/new.html.erb

diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb new file mode 100644 index 000000000..e5fa3adf1 --- /dev/null +++ b/app/views/users/show.html.erb @@ -0,0 +1,2 @@ +

Users#show

+

Find me in app/views/users/show.html.erb

diff --git a/app/views/users/update.html.erb b/app/views/users/update.html.erb new file mode 100644 index 000000000..cabbde176 --- /dev/null +++ b/app/views/users/update.html.erb @@ -0,0 +1,2 @@ +

Users#update

+

Find me in app/views/users/update.html.erb

diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb new file mode 100644 index 000000000..d84749b5f --- /dev/null +++ b/test/controllers/users_controller_test.rb @@ -0,0 +1,39 @@ +require 'test_helper' + +class UsersControllerTest < ActionController::TestCase + test "should get index" do + get :index + assert_response :success + end + + test "should get show" do + get :show + assert_response :success + end + + test "should get new" do + get :new + assert_response :success + end + + test "should get create" do + get :create + assert_response :success + end + + test "should get edit" do + get :edit + assert_response :success + end + + test "should get update" do + get :update + assert_response :success + end + + test "should get destroy" do + get :destroy + assert_response :success + end + +end From c9e7646521651761a8f7c20a598e75193ec7759d Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 21:22:14 -0700 Subject: [PATCH 12/88] sessions and users controllers routes --- config/routes.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/config/routes.rb b/config/routes.rb index 3f66539d5..102225abe 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,24 @@ Rails.application.routes.draw do + get 'users/index' + + get 'users/show' + + get 'users/new' + + get 'users/create' + + get 'users/edit' + + get 'users/update' + + get 'users/destroy' + + get 'sessions/new' + + get 'sessions/create' + + get 'sessions/destroy' + # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". From fc51127b963f9d8bd9d69ad5d9ddf645868ad5d6 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 21:22:24 -0700 Subject: [PATCH 13/88] user model --- app/models/user.rb | 2 ++ db/migrate/20161101041904_create_users.rb | 10 ++++++++++ db/schema.rb | 23 +++++++++++++++++++++++ test/fixtures/users.yml | 9 +++++++++ test/models/user_test.rb | 7 +++++++ 5 files changed, 51 insertions(+) create mode 100644 app/models/user.rb create mode 100644 db/migrate/20161101041904_create_users.rb create mode 100644 db/schema.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 000000000..4a57cf079 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,2 @@ +class User < ActiveRecord::Base +end diff --git a/db/migrate/20161101041904_create_users.rb b/db/migrate/20161101041904_create_users.rb new file mode 100644 index 000000000..03212bfaa --- /dev/null +++ b/db/migrate/20161101041904_create_users.rb @@ -0,0 +1,10 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.string :name + t.string :email + + t.timestamps null: false + end + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 000000000..534c1bcfb --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,23 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20161101041904) do + + create_table "users", force: :cascade do |t| + t.string "name" + t.string "email" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 000000000..5dc4ddf03 --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + email: MyString + +two: + name: MyString + email: MyString diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 000000000..82f61e010 --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UserTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From e905b4ebd613c3ba638b2dfc66d8f73ffff88121 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 31 Oct 2016 21:23:23 -0700 Subject: [PATCH 14/88] added omniauth for google --- Gemfile | 1 + Gemfile.lock | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Gemfile b/Gemfile index 9b15ccfdb..8ad602e31 100644 --- a/Gemfile +++ b/Gemfile @@ -29,6 +29,7 @@ gem 'sdoc', '~> 0.4.0', group: :doc #gem for oAuth github Authentication gem 'omniauth' gem 'omniauth-github' +gem "omniauth-google-oauth2" #make it easier to read gem 'awesome_print' diff --git a/Gemfile.lock b/Gemfile.lock index 21c6c6106..b4f60e087 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -121,6 +121,11 @@ GEM omniauth-github (1.1.2) omniauth (~> 1.0) omniauth-oauth2 (~> 1.1) + omniauth-google-oauth2 (0.4.1) + jwt (~> 1.5.2) + multi_json (~> 1.3) + omniauth (>= 1.1.1) + omniauth-oauth2 (>= 1.3.1) omniauth-oauth2 (1.4.0) oauth2 (~> 1.0) omniauth (~> 1.2) @@ -227,6 +232,7 @@ DEPENDENCIES minitest-reporters omniauth omniauth-github + omniauth-google-oauth2 pg pry rails (= 4.2.7) From 64c59c1d3833eee2221390700aa7a0f77041a34a Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Tue, 1 Nov 2016 11:21:37 -0700 Subject: [PATCH 15/88] ignores vcr cassettes --- .gitignore | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 7a1e904fe..06d146aaf 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,6 @@ # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' -# Ignore bundler config. -/.bundle # Ignore the default SQLite database. /db/*.sqlite3 @@ -22,16 +20,10 @@ # Hide the .env because it's full of secrets! /.env +/*.env -# Ignore the default SQLite database. -/db/*.sqlite3 -/db/*.sqlite3-journal -betsy_development -betsy_test - - -# Ignore this annoying MACOS file which is a caching file and keeps thumbnails -.DS_store +# Hide the cassets +/test/cassettes # See https://help.github.com/articles/ignoring-files for more about ignoring files. #*.rbc From 74eec9572c06fb9525cd4b35999dfba55daa0790 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Tue, 1 Nov 2016 11:21:55 -0700 Subject: [PATCH 16/88] added minitest-vcr and webmock --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index 8ad602e31..eac0e7695 100644 --- a/Gemfile +++ b/Gemfile @@ -66,6 +66,8 @@ group :development do # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'better_errors' + gem 'minitest-vcr' + gem 'webmock' end From 851b1ac0fde4fb6f5eb14e578ebefcff2c6f4585 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Tue, 1 Nov 2016 11:22:20 -0700 Subject: [PATCH 17/88] added recipe search class --- lib/recipesearch.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/recipesearch.rb b/lib/recipesearch.rb index 98fce5869..ebd6b6a20 100644 --- a/lib/recipesearch.rb +++ b/lib/recipesearch.rb @@ -3,11 +3,16 @@ require 'recipesearchwrapper' class RecipeSearch - attr_reader :name, :id + attr_reader :name, :id, :photo_url, :recipe_url - def initialize(name, id) + def initialize(name, id, image, url, ingredients, totalnutrients, totaldaily) @name = name @id = id + @image = image + @url = url + @ingredients = ingredients[] + @totalnutrients = totalnutrients + @totaldaily = totaldaily end From 4b17f968d617e9e99a5c5028390c703c816061e5 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Tue, 1 Nov 2016 11:43:06 -0700 Subject: [PATCH 18/88] adding omniauth for google and sessions methods --- app/controllers/application_controller.rb | 29 +++++++++ app/controllers/sessions_controller.rb | 75 ++++++++++++++++++++++- config/initializers/omniauth.rb | 8 +++ config/routes.rb | 23 ++++--- 4 files changed, 124 insertions(+), 11 deletions(-) create mode 100644 config/initializers/omniauth.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d83690e1b..177de6b17 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,4 +2,33 @@ class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception + + helper_method :current_user, :signed_in? + +private + # def current_user + # @current_user = User.find_by(id: session[:user_id] ) + # end + + def current_user + @current_user = Identity.find_by(id: session[:user_id] ) + end + + # def require_login + # if current_user.nil? + # flash[:error] = "You must be logged in to view this section" + # redirect_to session_path + # end + # end + + # def signed_in? + # !!current_user + # end + + + # def current_user=(user) + # @current_user = user + # session[:user_id] = user.nil? ? nil : user.id + # end + end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index bd2333062..f1092f469 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,10 +1,83 @@ class SessionsController < ApplicationController + # skip_before_action :require_login, only: :create + # skip_before_filter :verify_authenticity_token, only: :create + + def new end def create + auth_hash = request.env['omniauth.auth'] + #below is us saying we don't know them (unless they have a uid) + return redirect to login_failure_path unless auth_hash['uid'] + + @identity = Identity.find_by(uid: auth_hash[:uid]) + #github knows them, but do we? if not, let's make them an account + if @identity.nil? + # identity doesn't match anything in the DB. + # Attempt to create a new identity. + @identity = Identity.build_from_github_or_google(auth_hash) + flash[:notice] = "Unable to Save the Identity" +#using method below to save time + return redirect_to root_path unless @identity.save + # render :creation_failure unless @identity.save + end + + # Save the user ID in the session + session[:user_id] = @identity.id + + + # redirect_to sessions_path +#doing this other thing to save time + flash[:notice] = "Successfully Logged in!" + redirect_to index_path + end +# def destroy +# session[:user_id] = nil +# redirect_to root_path +# end + + + # def create + # auth = request.env['omniauth.auth'] + # # Find an identity here + # @identity = Identity.find_with_omniauth(auth) + + # if @identity.nil? + # # If no identity was found, create a brand new one here + # @identity = Identity.create_with_omniauth(auth) + # end + + # if signed_in? + # if @identity.user == current_user + # # User is signed in so they are trying to link an identity with their + # # account. But we found the identity and the user associated with it + # # is the current user. So the identity is already associated with + # # this user. So let's display an error message. + # redirect_to root_url, notice: "Already linked that account!" + # else + # # The identity is not associated with the current_user so lets + # # associate the identity + # @identity.user = current_user + # @identity.save + # redirect_to root_url, notice: "Successfully linked that account!" + # end + # else + # if @identity.user.present? + # # The identity we found had a user associated with it so let's + # # just log them in here + # self.current_user = @identity.user + # redirect_to root_url, notice: "Signed in!" + # else + # # No user associated with the identity so we need to create a new one + # redirect_to new_user_url, notice: "Please finish registering" + # end + # end + def destroy - end + self.current_user = nil + redirect_to root_url, notice: "Signed out!" + end end diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb new file mode 100644 index 000000000..05c9ef6ac --- /dev/null +++ b/config/initializers/omniauth.rb @@ -0,0 +1,8 @@ +#omniauth.rb + +Rails.application.config.middleware.use OmniAuth::Builder do + # binding.pry + provider :github, ENV["GITHUB_CLIENT_ID"], ENV["GITHUB_CLIENT_SECRET"], scope: "user:email" + + provider :google_oauth2, ENV["GOOGLE_CLIENT_ID"], ENV["GOOGLE_CLIENT_SECRET"] +end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 102225abe..d74e219c2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,23 +1,26 @@ Rails.application.routes.draw do - get 'users/index' + get 'users/index' => 'users#index' - get 'users/show' + get 'users/show' => 'users#show' - get 'users/new' + get 'users/new' => 'users#new' - get 'users/create' + post 'users/create' => 'users#create' - get 'users/edit' + get 'users/edit' => 'users#edit' - get 'users/update' + put 'users/update' => 'users#update' - get 'users/destroy' + delete 'users/destroy' => 'users#destroy' - get 'sessions/new' +#SESSIONS ROUTES - get 'sessions/create' + resources :sessions - get 'sessions/destroy' + + get "/auth/:provider/callback" => 'sessions#create' + + get 'logout' => 'sessions#destroy' # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". From e7f72adc7bca499368f27fbb89da97ac3ff9e8c3 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Tue, 1 Nov 2016 12:05:50 -0700 Subject: [PATCH 19/88] added recipe search controller for optional features later --- Gemfile.lock | 18 +++++++++ app/assets/javascripts/recipe_searches.coffee | 3 ++ app/assets/stylesheets/recipe_searches.scss | 3 ++ app/controllers/recipe_searches_controller.rb | 23 +++++++++++ app/helpers/recipe_searches_helper.rb | 2 + app/views/recipe_searches/create.html.erb | 2 + app/views/recipe_searches/destroy.html.erb | 2 + app/views/recipe_searches/edit.html.erb | 2 + app/views/recipe_searches/index.html.erb | 2 + app/views/recipe_searches/new.html.erb | 2 + app/views/recipe_searches/show.html.erb | 2 + app/views/recipe_searches/update.html.erb | 2 + config/routes.rb | 26 +++++++++++++ .../recipe_searches_controller_test.rb | 39 +++++++++++++++++++ 14 files changed, 128 insertions(+) create mode 100644 app/assets/javascripts/recipe_searches.coffee create mode 100644 app/assets/stylesheets/recipe_searches.scss create mode 100644 app/controllers/recipe_searches_controller.rb create mode 100644 app/helpers/recipe_searches_helper.rb create mode 100644 app/views/recipe_searches/create.html.erb create mode 100644 app/views/recipe_searches/destroy.html.erb create mode 100644 app/views/recipe_searches/edit.html.erb create mode 100644 app/views/recipe_searches/index.html.erb create mode 100644 app/views/recipe_searches/new.html.erb create mode 100644 app/views/recipe_searches/show.html.erb create mode 100644 app/views/recipe_searches/update.html.erb create mode 100644 test/controllers/recipe_searches_controller_test.rb diff --git a/Gemfile.lock b/Gemfile.lock index b4f60e087..05ca3626b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,6 +36,7 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) + addressable (2.4.0) ansi (1.5.0) arel (6.0.3) awesome_print (1.7.0) @@ -60,6 +61,8 @@ GEM execjs coffee-script-source (1.10.0) concurrent-ruby (1.0.2) + crack (0.4.3) + safe_yaml (~> 1.0.0) debug_inspector (0.0.2) docile (1.1.5) dotenv (2.1.1) @@ -76,6 +79,7 @@ GEM sprockets-es6 (>= 0.9.0) globalid (0.3.7) activesupport (>= 4.1.0) + hashdiff (0.3.0) hashie (3.4.6) httparty (0.14.0) multi_xml (>= 0.5.2) @@ -98,12 +102,18 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mini_portile2 (2.1.0) + minispec-metadata (2.0.0) + minitest minitest (5.9.1) minitest-reporters (1.1.12) ansi builder minitest (>= 5.0) ruby-progressbar + minitest-vcr (1.4.0) + minispec-metadata (~> 2.0) + minitest (>= 4.7.5) + vcr (>= 2.9) multi_json (1.12.1) multi_xml (0.5.5) multipart-post (2.0.0) @@ -170,6 +180,7 @@ GEM rdoc (4.2.2) json (~> 1.4) ruby-progressbar (1.8.1) + safe_yaml (1.0.4) sass (3.4.22) sass-rails (5.0.6) railties (>= 4.0.0, < 6) @@ -210,11 +221,16 @@ GEM thread_safe (~> 0.1) uglifier (3.0.3) execjs (>= 0.3.0, < 3) + vcr (3.0.3) web-console (2.3.0) activemodel (>= 4.0) binding_of_caller (>= 0.7.2) railties (>= 4.0) sprockets-rails (>= 2.0, < 4.0) + webmock (2.1.0) + addressable (>= 2.3.6) + crack (>= 0.3.2) + hashdiff PLATFORMS ruby @@ -230,6 +246,7 @@ DEPENDENCIES jbuilder (~> 2.0) jquery-rails minitest-reporters + minitest-vcr omniauth omniauth-github omniauth-google-oauth2 @@ -245,6 +262,7 @@ DEPENDENCIES turbolinks uglifier (>= 1.3.0) web-console (~> 2.0) + webmock BUNDLED WITH 1.13.6 diff --git a/app/assets/javascripts/recipe_searches.coffee b/app/assets/javascripts/recipe_searches.coffee new file mode 100644 index 000000000..24f83d18b --- /dev/null +++ b/app/assets/javascripts/recipe_searches.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/recipe_searches.scss b/app/assets/stylesheets/recipe_searches.scss new file mode 100644 index 000000000..6c3c2df87 --- /dev/null +++ b/app/assets/stylesheets/recipe_searches.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the recipe_searches 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/recipe_searches_controller.rb b/app/controllers/recipe_searches_controller.rb new file mode 100644 index 000000000..1aceff8c4 --- /dev/null +++ b/app/controllers/recipe_searches_controller.rb @@ -0,0 +1,23 @@ +class RecipeSearchesController < ApplicationController + def index + end + + def show + end + + def new + + end + + def create + end + + def edit + end + + def update + end + + def destroy + end +end diff --git a/app/helpers/recipe_searches_helper.rb b/app/helpers/recipe_searches_helper.rb new file mode 100644 index 000000000..911239af1 --- /dev/null +++ b/app/helpers/recipe_searches_helper.rb @@ -0,0 +1,2 @@ +module RecipeSearchesHelper +end diff --git a/app/views/recipe_searches/create.html.erb b/app/views/recipe_searches/create.html.erb new file mode 100644 index 000000000..f9d578ed6 --- /dev/null +++ b/app/views/recipe_searches/create.html.erb @@ -0,0 +1,2 @@ +

RecipeSearches#create

+

Find me in app/views/recipe_searches/create.html.erb

diff --git a/app/views/recipe_searches/destroy.html.erb b/app/views/recipe_searches/destroy.html.erb new file mode 100644 index 000000000..67696627b --- /dev/null +++ b/app/views/recipe_searches/destroy.html.erb @@ -0,0 +1,2 @@ +

RecipeSearches#destroy

+

Find me in app/views/recipe_searches/destroy.html.erb

diff --git a/app/views/recipe_searches/edit.html.erb b/app/views/recipe_searches/edit.html.erb new file mode 100644 index 000000000..2fdcb7852 --- /dev/null +++ b/app/views/recipe_searches/edit.html.erb @@ -0,0 +1,2 @@ +

RecipeSearches#edit

+

Find me in app/views/recipe_searches/edit.html.erb

diff --git a/app/views/recipe_searches/index.html.erb b/app/views/recipe_searches/index.html.erb new file mode 100644 index 000000000..7849e2902 --- /dev/null +++ b/app/views/recipe_searches/index.html.erb @@ -0,0 +1,2 @@ +

RecipeSearches#index

+

Find me in app/views/recipe_searches/index.html.erb

diff --git a/app/views/recipe_searches/new.html.erb b/app/views/recipe_searches/new.html.erb new file mode 100644 index 000000000..3de012e71 --- /dev/null +++ b/app/views/recipe_searches/new.html.erb @@ -0,0 +1,2 @@ +

RecipeSearches#new

+

Find me in app/views/recipe_searches/new.html.erb

diff --git a/app/views/recipe_searches/show.html.erb b/app/views/recipe_searches/show.html.erb new file mode 100644 index 000000000..44a67e248 --- /dev/null +++ b/app/views/recipe_searches/show.html.erb @@ -0,0 +1,2 @@ +

RecipeSearches#show

+

Find me in app/views/recipe_searches/show.html.erb

diff --git a/app/views/recipe_searches/update.html.erb b/app/views/recipe_searches/update.html.erb new file mode 100644 index 000000000..e4ad068fc --- /dev/null +++ b/app/views/recipe_searches/update.html.erb @@ -0,0 +1,2 @@ +

RecipeSearches#update

+

Find me in app/views/recipe_searches/update.html.erb

diff --git a/config/routes.rb b/config/routes.rb index d74e219c2..31ab98cff 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,30 @@ Rails.application.routes.draw do + get 'recipe_searches/index' + + get 'recipe_searches/show' + + get 'recipe_searches/new' + + get 'recipe_searches/create' + + get 'recipe_searches/edit' + + get 'recipe_searches/update' + + get 'recipe_searches/destroy' + + get 'recipe_searches/index' + + get 'recipe_searches/show' + + get 'recipe_searches/new' + + get 'recipe_searches/edit' + + get 'recipe_searches/update' + + get 'recipe_searches/destroy' + get 'users/index' => 'users#index' get 'users/show' => 'users#show' diff --git a/test/controllers/recipe_searches_controller_test.rb b/test/controllers/recipe_searches_controller_test.rb new file mode 100644 index 000000000..0d1119561 --- /dev/null +++ b/test/controllers/recipe_searches_controller_test.rb @@ -0,0 +1,39 @@ +require 'test_helper' + +class RecipeSearchesControllerTest < ActionController::TestCase + test "should get index" do + get :index + assert_response :success + end + + test "should get show" do + get :show + assert_response :success + end + + test "should get new" do + get :new + assert_response :success + end + + test "should get create" do + get :create + assert_response :success + end + + test "should get edit" do + get :edit + assert_response :success + end + + test "should get update" do + get :update + assert_response :success + end + + test "should get destroy" do + get :destroy + assert_response :success + end + +end From 2080a48f48652b3916ec82e67401c7a58ad5f5ed Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Tue, 1 Nov 2016 12:06:12 -0700 Subject: [PATCH 20/88] created test files for lib files --- test/lib/recipesearch_test.rb | 6 ++++++ test/lib/recipesearchwrapper_test.rb | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 test/lib/recipesearch_test.rb create mode 100644 test/lib/recipesearchwrapper_test.rb diff --git a/test/lib/recipesearch_test.rb b/test/lib/recipesearch_test.rb new file mode 100644 index 000000000..a4e7293b3 --- /dev/null +++ b/test/lib/recipesearch_test.rb @@ -0,0 +1,6 @@ +require 'testhelper' +require 'recipesearch' + +class RecipeSearchTest < ActionController::TestCase + +end \ No newline at end of file diff --git a/test/lib/recipesearchwrapper_test.rb b/test/lib/recipesearchwrapper_test.rb new file mode 100644 index 000000000..d4f1238d7 --- /dev/null +++ b/test/lib/recipesearchwrapper_test.rb @@ -0,0 +1,6 @@ +require 'testhelper' +require 'recipesearchwrapper' + +class RecipeSearchWrapperTest < ActionController::TestCase + +end \ No newline at end of file From 0a1d0f9a50eea1ae4e0de84d58c9d2e6a14fba73 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 10:20:15 -0700 Subject: [PATCH 21/88] simplified initalize --- lib/recipesearch.rb | 48 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/lib/recipesearch.rb b/lib/recipesearch.rb index ebd6b6a20..71d58c230 100644 --- a/lib/recipesearch.rb +++ b/lib/recipesearch.rb @@ -1,19 +1,47 @@ #recipesearch.rb +#NOTE dietlabels, health labels, cautions, ingredientlines, ingredients, totalNutrients, totalDaily show up as arrays (ingredients is an array of hashes) + require 'recipesearchwrapper' class RecipeSearch - attr_reader :name, :id, :photo_url, :recipe_url - - def initialize(name, id, image, url, ingredients, totalnutrients, totaldaily) - @name = name - @id = id - @image = image - @url = url - @ingredients = ingredients[] - @totalnutrients = totalnutrients - @totaldaily = totaldaily + attr_reader :label, :id, :photo_url, :recipe_url + + def initialize(uri, label, params = {}) + if uri == nil || uri == "" || label == nil || label == "" + raise ArguementError + end + + @uri = uri #aka id + @label = label + @image = params["image"] + @shareas = params["shareas"] #link to the recipe on edamam website, as opposed to the source website + end end + + + + + + + # @uri = uri #aka id + # @label = label + # @image = params["image"] + # # @source = recipe["source"] + # # @sourceicon = recipe["sourceicon"] # + # # @url = recipe["url"] #link to recipe on source website + # @shareas = params["shareas"] #link to the recipe on edamam website, as opposed to the source website + # # @recipe_yield = recipe["recipe_yield"] + # # @dietabels = recipe["dietLabels"] + # # @healthabels = recipe["healthlabels"] + # # @cautions = recipe["cautions"] + # # @ingredientines = recipe["ingredientlines"] + # # @ingredients = recipe["ingredients"] + # # @calories = recipe["calories"] + # # @totalweight = recipe["totalweight"] + # # @totalnutrients = recipe["totalnutrients"] + # # @totaldaily = recipe["totaldaily"] + # end \ No newline at end of file From cff3d3e9a29c3a60a6b6d2e89da65fd5724fde3e Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 10:21:04 -0700 Subject: [PATCH 22/88] create initialize method, refine search --- lib/recipesearchwrapper.rb | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/lib/recipesearchwrapper.rb b/lib/recipesearchwrapper.rb index 646f87b13..9747210af 100644 --- a/lib/recipesearchwrapper.rb +++ b/lib/recipesearchwrapper.rb @@ -4,6 +4,7 @@ class RecipeSearchWrapper +#CONSTANTS #hide that information away! APP_ID = ENV[APP_ID] APP_KEY = ENV[APP_KEY] @@ -13,26 +14,45 @@ class RecipeSearchWrapper #because who wants to type all that? AUTH = "&app_id=APP_ID&app_key=APP_KEY" +# /CONSTANTS + + +#CREATE A WRAPPER + def initialize(uri, label, params = {}) + @uri = uri #aka id + @label = label + @image = params["image"] + @shareas = params["shareas"] #link to the recipe on edamam website, as opposed to the source website + end #helps users find recipes by an ingredient - self.search_recipes_by_one_keyword(keyword) + self.search_by_one_keyword(keyword, app_id = nil, app_key = nil) + app_id =|| APP_ID + app_key =|| APP_KEY + url = BASE_URL + "search?q=#{keyword}" + AUTH - response = HTTParty.get(url) +#THIS IS WHERE THE MAGIC HAPPENS + data = HTTParty.get(url) my_recipes = [] - response["recipes"] + data["recipes"] - response["recipes"].each do |recipe| - id = recipe["id"] - name = recipe["name"] + if data["recipes"] + data["recipes"].each do |recipe| + wrapper = RecipeSearch.new (recipe["uri"], recipe["label"], image: recipe["image"], shareas: recipe["shareas"] + my_recipes << wrapper + end + + return my_recipes + + else - my_recipes << RecipeSearch.new(name, id) + return nil + end - - return my_recipes end end \ No newline at end of file From 800f498ff9992e344df2ca69c6ed45030f2b32ef Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 10:21:25 -0700 Subject: [PATCH 23/88] add test the truth --- test/lib/recipesearch_test.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/lib/recipesearch_test.rb b/test/lib/recipesearch_test.rb index a4e7293b3..7dcd611a4 100644 --- a/test/lib/recipesearch_test.rb +++ b/test/lib/recipesearch_test.rb @@ -2,5 +2,9 @@ require 'recipesearch' class RecipeSearchTest < ActionController::TestCase +#make sure rake is picking up the test + test "the truth" do + assert true + end end \ No newline at end of file From c56328bfaf436f0fafb006cb259f0d60da83b5e5 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 10:22:10 -0700 Subject: [PATCH 24/88] add tests --- test/lib/recipesearchwrapper_test.rb | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/test/lib/recipesearchwrapper_test.rb b/test/lib/recipesearchwrapper_test.rb index d4f1238d7..2e4ec959e 100644 --- a/test/lib/recipesearchwrapper_test.rb +++ b/test/lib/recipesearchwrapper_test.rb @@ -3,4 +3,54 @@ class RecipeSearchWrapperTest < ActionController::TestCase +#make sure rake is picking up the test + test "the truth" do + assert true + end + + test "Can Retrieve a List of Recipes" do + VCR.use_cassette("recipe list") do + + recipes = RecipeSearchWrapper.search_by_one_keyword("carrot") + + assert recipes.length > 0 + assert recipes.is_a? Array + assert_not recipes.is_empty? + + recipes.each do |recipe| + +end + + test "Searches without a Keyword Fail" do + VCR.use_cassette("no-keyword") do + recipes = RecipeSearchWrapper.search_by_one_keyword("") + + assert recipes == nil + end + end + + + test "Retrieves Nil When the App ID is Wrong" do + VCR.use_cassette("bad-token") do + recipes = RecipeSearchWrapper.search_by_one_keyword("carrot", "bad-token") + + assert recipes == Error 500 + end + end + + test "Retrieves Nil When the App Key is Wrong" do + VCR.use_cassette("bad-key") do + recipes = RecipeSearchWrapper.search_by_one_keyword("carrot", "bad-token") + + assert recipes == nil + end + end + + test "Retrieves Nil When the Keyword is not an Option" do + VCR.use_cassette("bad-keyword") do + recipes = RecipeSearchWrapper.search_by_one_keyword("grok") + + assert recipes == nil + end + end end \ No newline at end of file From 86003acab1ccafec2fd84171e79677bdb434862f Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 10:38:54 -0700 Subject: [PATCH 25/88] fixed typos - thank you Charles --- lib/recipesearchwrapper.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/recipesearchwrapper.rb b/lib/recipesearchwrapper.rb index 9747210af..d82bd6da2 100644 --- a/lib/recipesearchwrapper.rb +++ b/lib/recipesearchwrapper.rb @@ -6,8 +6,8 @@ class RecipeSearchWrapper #CONSTANTS #hide that information away! - APP_ID = ENV[APP_ID] - APP_KEY = ENV[APP_KEY] + APP_ID = ENV["APP_ID"] + APP_KEY = ENV["APP_KEY"] #this is where it all starts BASE_URL = "https://api.edamam.com/" @@ -27,9 +27,9 @@ def initialize(uri, label, params = {}) #helps users find recipes by an ingredient - self.search_by_one_keyword(keyword, app_id = nil, app_key = nil) - app_id =|| APP_ID - app_key =|| APP_KEY + def self.search_by_one_keyword(keyword, app_id = nil, app_key = nil) + app_id ||= APP_ID + app_key ||= APP_KEY url = BASE_URL + "search?q=#{keyword}" + AUTH @@ -42,7 +42,7 @@ def initialize(uri, label, params = {}) if data["recipes"] data["recipes"].each do |recipe| - wrapper = RecipeSearch.new (recipe["uri"], recipe["label"], image: recipe["image"], shareas: recipe["shareas"] + wrapper = RecipeSearch.new(recipe["uri"], recipe["label"], image: recipe["image"], shareas: recipe["shareas"]) my_recipes << wrapper end From 9dc841df09efd26c55a81ac505261027bceb4e70 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 10:39:20 -0700 Subject: [PATCH 26/88] typo - added underscore --- test/lib/recipesearch_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib/recipesearch_test.rb b/test/lib/recipesearch_test.rb index 7dcd611a4..70f80a3da 100644 --- a/test/lib/recipesearch_test.rb +++ b/test/lib/recipesearch_test.rb @@ -1,4 +1,4 @@ -require 'testhelper' +require 'test_helper' require 'recipesearch' class RecipeSearchTest < ActionController::TestCase From 1626a29b4c6cacdfac60b591891f027fca16a4d5 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 10:40:03 -0700 Subject: [PATCH 27/88] commented out unwieldy tests --- test/lib/recipesearchwrapper_test.rb | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/test/lib/recipesearchwrapper_test.rb b/test/lib/recipesearchwrapper_test.rb index 2e4ec959e..158bca167 100644 --- a/test/lib/recipesearchwrapper_test.rb +++ b/test/lib/recipesearchwrapper_test.rb @@ -1,4 +1,4 @@ -require 'testhelper' +require 'test_helper' require 'recipesearchwrapper' class RecipeSearchWrapperTest < ActionController::TestCase @@ -9,6 +9,7 @@ class RecipeSearchWrapperTest < ActionController::TestCase end test "Can Retrieve a List of Recipes" do + VCR.use_cassette("recipe list") do recipes = RecipeSearchWrapper.search_by_one_keyword("carrot") @@ -16,10 +17,10 @@ class RecipeSearchWrapperTest < ActionController::TestCase assert recipes.length > 0 assert recipes.is_a? Array assert_not recipes.is_empty? + end + - recipes.each do |recipe| - -end + end test "Searches without a Keyword Fail" do VCR.use_cassette("no-keyword") do @@ -30,13 +31,13 @@ class RecipeSearchWrapperTest < ActionController::TestCase end - test "Retrieves Nil When the App ID is Wrong" do - VCR.use_cassette("bad-token") do - recipes = RecipeSearchWrapper.search_by_one_keyword("carrot", "bad-token") + # test "Retrieves Nil When the App ID is Wrong" do + # VCR.use_cassette("bad-token") do + # recipes = RecipeSearchWrapper.search_by_one_keyword("carrot", "bad-token") - assert recipes == Error 500 - end - end + # assert recipes == Error 500 + # end + # end test "Retrieves Nil When the App Key is Wrong" do VCR.use_cassette("bad-key") do From 417ec1c1079d93f452cb8a2fd5d70d0eff35604f Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 10:41:05 -0700 Subject: [PATCH 28/88] added vcr, webmock, minitest-reporter functionality --- test/test_helper.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/test_helper.rb b/test/test_helper.rb index 92e39b2d7..7b8b209e7 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,10 +1,28 @@ ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) + require 'rails/test_help' +require 'vcr' +require 'webmock/minitest' + +require "minitest/reporters" + 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... + + + Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new + + VCR.configure do |config| + config.cassette_library_dir = 'test/cassettes' # folder where casettes will be located + config.hook_into :webmock # tie into this other tool called webmock + config.default_cassette_options = { + :record => :new_episodes # record new data when we don't have it yet + } + end + end From deaba24d5057c023ff9e2c8a6bef6f97b1cb4bc3 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 10:41:46 -0700 Subject: [PATCH 29/88] what the api returns per postman --- sample-recipe-result.rb | 641 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 641 insertions(+) create mode 100644 sample-recipe-result.rb diff --git a/sample-recipe-result.rb b/sample-recipe-result.rb new file mode 100644 index 000000000..aaa076cac --- /dev/null +++ b/sample-recipe-result.rb @@ -0,0 +1,641 @@ +{ + "q": "carrot", + "from": 0, + "to": 10, + "params": { + "sane": [], + "q": [ + "carrot" + ], + "app_id": [ + "d24a2641" + ], + "app_key": [ + "178d4d3e2f7d0a953b4b0b40f2243762" + ] + }, + "more": true, + "count": 1000, + "hits": [ + { + "recipe": { + "uri": "http://www.edamam.com/ontologies/edamam.owl#recipe_be5a134c776c528ff22c664552ccb69a", + "label": "Carrots Braised in Beer and Carrot Juice", + "image": "https://www.edamam.com/web-img/6d7/6d7c318d7a0e0b11413bbf5c4cc91583.jpg", + "source": "Food & Wine", + "sourceIcon": "http://www.foodandwine.com/favicon.ico", + "url": "http://www.foodandwine.com/recipes/carrots-braised-in-beer-and-carrot-juice", + "shareAs": "http://www.edamam.com/recipe/carrots-braised-in-beer-and-carrot-juice-be5a134c776c528ff22c664552ccb69a/carrot", + "yield": 4, + "dietLabels": [ + "Low-Sodium" + ], + "healthLabels": [ + "Vegetarian", + "Egg-Free", + "Peanut-Free", + "Tree-Nut-Free", + "Soy-Free", + "Fish-Free", + "Shellfish-Free" + ], + "cautions": [], + "ingredientLines": [ + "8 medium carrots", + "1 cup fresh carrot juice", + "1/2 cup hoppy beer, such as a pilsner", + "1 teaspoon sugar", + "1 tablespoon unsalted butter", + "Salt" + ], + "ingredients": [ + { + "text": "8 medium carrots", + "quantity": 8, + "measure": "medium", + "food": "carrots", + "weight": 488 + }, + { + "text": "1 cup fresh carrot juice", + "quantity": 1, + "measure": "cup", + "food": "carrot juice", + "weight": 236 + }, + { + "text": "1/2 cup hoppy beer, such as a pilsner", + "quantity": 0.5, + "measure": "cup", + "food": "beer", + "weight": 94.93002 + }, + { + "text": "1 teaspoon sugar", + "quantity": 1, + "measure": "tsp", + "food": "sugar", + "weight": 4.2 + }, + { + "text": "1 tablespoon unsalted butter", + "quantity": 1, + "measure": "tbsp", + "food": "unsalted butter", + "weight": 14.2 + }, + { + "text": "Salt", + "quantity": 0, + "measure": "medium", + "food": "salt", + "weight": 0.029010605938335318 + } + ], + "calories": 453.36790859999996, + "totalWeight": 837.3590306059384, + "totalNutrients": { + "ENERC_KCAL": { + "label": "Energy", + "quantity": 453.36790859999996, + "unit": "kcal" + }, + "FAT": { + "label": "Fat", + "quantity": 13.042819999999999, + "unit": "g" + }, + "FASAT": { + "label": "Saturated", + "quantity": 7.486719999999999, + "unit": "g" + }, + "FATRN": { + "label": "Trans", + "quantity": 0.46434, + "unit": "g" + }, + "FAMS": { + "label": "Monounsaturated", + "quantity": 3.0501599999999995, + "unit": "g" + }, + "FAPU": { + "label": "Polyunsaturated", + "quantity": 1.13368, + "unit": "g" + }, + "CHOCDF": { + "label": "Carbs", + "quantity": 76.22889571, + "unit": "g" + }, + "FIBTG": { + "label": "Fiber", + "quantity": 15.552, + "unit": "g" + }, + "SUGAR": { + "label": "Sugars", + "quantity": 36.55892, + "unit": "g" + }, + "PROCNT": { + "label": "Protein", + "quantity": 7.337778092000001, + "unit": "g" + }, + "CHOLE": { + "label": "Cholesterol", + "quantity": 30.529999999999998, + "unit": "mg" + }, + "NA": { + "label": "Sodium", + "quantity": 509.12513144957995, + "unit": "mg" + }, + "CA": { + "label": "Calcium", + "quantity": 224.93416334542522, + "unit": "mg" + }, + "MG": { + "label": "Magnesium", + "quantity": 97.58009130605939, + "unit": "mg" + }, + "K": { + "label": "Potassium", + "quantity": 2279.8454262484743, + "unit": "mg" + }, + "FE": { + "label": "Iron", + "quantity": 2.5736217389995963, + "unit": "mg" + }, + "ZN": { + "label": "Zinc", + "quantity": 1.6187220126059385, + "unit": "mg" + }, + "P": { + "label": "Phosphorus", + "quantity": 286.61820279999995, + "unit": "mg" + }, + "VITA_RAE": { + "label": "Vitamin A", + "quantity": 6428.087999999999, + "unit": "µg_RAE" + }, + "VITC": { + "label": "Vitamin C", + "quantity": 48.852000000000004, + "unit": "mg" + }, + "THIA": { + "label": "Thiamin (B1)", + "quantity": 0.5106565009999999, + "unit": "mg" + }, + "RIBF": { + "label": "Riboflavin (B2)", + "quantity": 0.38566600399999995, + "unit": "mg" + }, + "NIA": { + "label": "Niacin (B3)", + "quantity": 6.169023102, + "unit": "mg" + }, + "VITB6A": { + "label": "Vitamin B6", + "quantity": 1.168398008, + "unit": "mg" + }, + "FOL": { + "label": "Folic Acid (B9)", + "quantity": 108.2818012, + "unit": "µg" + }, + "VITB12": { + "label": "Vitamin B12", + "quantity": 0.043126003999999996, + "unit": "µg" + }, + "VITD": { + "label": "Vitamin D", + "quantity": 0.21299999999999997, + "unit": "µg" + }, + "TOCPHA": { + "label": "Vitamin E", + "quantity": 6.287839999999999, + "unit": "mg" + }, + "VITK1": { + "label": "Vitamin K", + "quantity": 101.99, + "unit": "µg" + } + }, + "totalDaily": { + "ENERC_KCAL": { + "label": "Energy", + "quantity": 22.668395429999997, + "unit": "%" + }, + "FAT": { + "label": "Fat", + "quantity": 20.06587692307692, + "unit": "%" + }, + "FASAT": { + "label": "Saturated", + "quantity": 37.4336, + "unit": "%" + }, + "CHOCDF": { + "label": "Carbs", + "quantity": 25.409631903333334, + "unit": "%" + }, + "FIBTG": { + "label": "Fiber", + "quantity": 62.208, + "unit": "%" + }, + "PROCNT": { + "label": "Protein", + "quantity": 14.675556184000001, + "unit": "%" + }, + "CHOLE": { + "label": "Cholesterol", + "quantity": 10.176666666666666, + "unit": "%" + }, + "NA": { + "label": "Sodium", + "quantity": 21.213547143732498, + "unit": "%" + }, + "CA": { + "label": "Calcium", + "quantity": 22.493416334542523, + "unit": "%" + }, + "MG": { + "label": "Magnesium", + "quantity": 24.395022826514847, + "unit": "%" + }, + "K": { + "label": "Potassium", + "quantity": 65.13844074995642, + "unit": "%" + }, + "FE": { + "label": "Iron", + "quantity": 14.29789854999776, + "unit": "%" + }, + "ZN": { + "label": "Zinc", + "quantity": 10.79148008403959, + "unit": "%" + }, + "P": { + "label": "Phosphorus", + "quantity": 40.945457542857135, + "unit": "%" + }, + "VITA_RAE": { + "label": "Vitamin A", + "quantity": 714.232, + "unit": "%" + }, + "VITC": { + "label": "Vitamin C", + "quantity": 81.42000000000002, + "unit": "%" + }, + "THIA": { + "label": "Thiamin (B1)", + "quantity": 34.04376673333333, + "unit": "%" + }, + "RIBF": { + "label": "Riboflavin (B2)", + "quantity": 22.686235529411764, + "unit": "%" + }, + "NIA": { + "label": "Niacin (B3)", + "quantity": 30.84511551, + "unit": "%" + }, + "VITB6A": { + "label": "Vitamin B6", + "quantity": 58.4199004, + "unit": "%" + }, + "FOL": { + "label": "Folic Acid (B9)", + "quantity": 27.0704503, + "unit": "%" + }, + "VITB12": { + "label": "Vitamin B12", + "quantity": 0.7187667333333332, + "unit": "%" + }, + "VITD": { + "label": "Vitamin D", + "quantity": 0.05324999999999999, + "unit": "%" + }, + "TOCPHA": { + "label": "Vitamin E", + "quantity": 31.439199999999992, + "unit": "%" + }, + "VITK1": { + "label": "Vitamin K", + "quantity": 127.4875, + "unit": "%" + } + }, + "digest": [ + { + "label": "Fat", + "tag": "FAT", + "schemaOrgTag": "fatContent", + "total": 13.042819999999999, + "hasRDI": true, + "daily": 20.06587692307692, + "unit": "g", + "sub": [ + { + "label": "Saturated", + "tag": "FASAT", + "schemaOrgTag": "saturatedFatContent", + "total": 7.486719999999999, + "hasRDI": true, + "daily": 37.4336, + "unit": "g" + }, + { + "label": "Trans", + "tag": "FATRN", + "schemaOrgTag": "transFatContent", + "total": 0.46434, + "hasRDI": false, + "daily": 0, + "unit": "g" + }, + { + "label": "Monounsaturated", + "tag": "FAMS", + "schemaOrgTag": null, + "total": 3.0501599999999995, + "hasRDI": false, + "daily": 0, + "unit": "g" + }, + { + "label": "Polyunsaturated", + "tag": "FAPU", + "schemaOrgTag": null, + "total": 1.13368, + "hasRDI": false, + "daily": 0, + "unit": "g" + } + ] + }, + { + "label": "Carbs", + "tag": "CHOCDF", + "schemaOrgTag": "carbohydrateContent", + "total": 76.22889571, + "hasRDI": true, + "daily": 25.409631903333334, + "unit": "g", + "sub": [ + { + "label": "Carbs (net)", + "tag": "CHOCDF.net", + "schemaOrgTag": null, + "total": 60.676895710000004, + "hasRDI": false, + "daily": 0, + "unit": "g" + }, + { + "label": "Fiber", + "tag": "FIBTG", + "schemaOrgTag": "fiberContent", + "total": 15.552, + "hasRDI": true, + "daily": 62.208, + "unit": "g" + }, + { + "label": "Sugars", + "tag": "SUGAR", + "schemaOrgTag": "sugarContent", + "total": 36.55892, + "hasRDI": false, + "daily": 0, + "unit": "g" + } + ] + }, + { + "label": "Protein", + "tag": "PROCNT", + "schemaOrgTag": "proteinContent", + "total": 7.337778092000001, + "hasRDI": true, + "daily": 14.675556184000001, + "unit": "g" + }, + { + "label": "Cholesterol", + "tag": "CHOLE", + "schemaOrgTag": "cholesterolContent", + "total": 30.529999999999998, + "hasRDI": true, + "daily": 10.176666666666666, + "unit": "mg" + }, + { + "label": "Sodium", + "tag": "NA", + "schemaOrgTag": "sodiumContent", + "total": 509.12513144957995, + "hasRDI": true, + "daily": 21.213547143732498, + "unit": "mg" + }, + { + "label": "Calcium", + "tag": "CA", + "schemaOrgTag": null, + "total": 224.93416334542522, + "hasRDI": true, + "daily": 22.493416334542523, + "unit": "mg" + }, + { + "label": "Magnesium", + "tag": "MG", + "schemaOrgTag": null, + "total": 97.58009130605939, + "hasRDI": true, + "daily": 24.395022826514847, + "unit": "mg" + }, + { + "label": "Potassium", + "tag": "K", + "schemaOrgTag": null, + "total": 2279.8454262484743, + "hasRDI": true, + "daily": 65.13844074995642, + "unit": "mg" + }, + { + "label": "Iron", + "tag": "FE", + "schemaOrgTag": null, + "total": 2.5736217389995963, + "hasRDI": true, + "daily": 14.29789854999776, + "unit": "mg" + }, + { + "label": "Zinc", + "tag": "ZN", + "schemaOrgTag": null, + "total": 1.6187220126059385, + "hasRDI": true, + "daily": 10.79148008403959, + "unit": "mg" + }, + { + "label": "Phosphorus", + "tag": "P", + "schemaOrgTag": null, + "total": 286.61820279999995, + "hasRDI": true, + "daily": 40.945457542857135, + "unit": "mg" + }, + { + "label": "Vitamin A", + "tag": "VITA_RAE", + "schemaOrgTag": null, + "total": 6428.087999999999, + "hasRDI": true, + "daily": 714.232, + "unit": "µg" + }, + { + "label": "Vitamin C", + "tag": "VITC", + "schemaOrgTag": null, + "total": 48.852000000000004, + "hasRDI": true, + "daily": 81.42000000000002, + "unit": "mg" + }, + { + "label": "Thiamin (B1)", + "tag": "THIA", + "schemaOrgTag": null, + "total": 0.5106565009999999, + "hasRDI": true, + "daily": 34.04376673333333, + "unit": "mg" + }, + { + "label": "Riboflavin (B2)", + "tag": "RIBF", + "schemaOrgTag": null, + "total": 0.38566600399999995, + "hasRDI": true, + "daily": 22.686235529411764, + "unit": "mg" + }, + { + "label": "Niacin (B3)", + "tag": "NIA", + "schemaOrgTag": null, + "total": 6.169023102, + "hasRDI": true, + "daily": 30.84511551, + "unit": "mg" + }, + { + "label": "Vitamin B6", + "tag": "VITB6A", + "schemaOrgTag": null, + "total": 1.168398008, + "hasRDI": true, + "daily": 58.4199004, + "unit": "mg" + }, + { + "label": "Folic Acid (B9)", + "tag": "FOL", + "schemaOrgTag": null, + "total": 108.2818012, + "hasRDI": true, + "daily": 27.0704503, + "unit": "µg" + }, + { + "label": "Vitamin B12", + "tag": "VITB12", + "schemaOrgTag": null, + "total": 0.043126003999999996, + "hasRDI": true, + "daily": 0.7187667333333332, + "unit": "µg" + }, + { + "label": "Vitamin D", + "tag": "VITD", + "schemaOrgTag": null, + "total": 0.21299999999999997, + "hasRDI": true, + "daily": 0.05324999999999999, + "unit": "µg" + }, + { + "label": "Vitamin E", + "tag": "TOCPHA", + "schemaOrgTag": null, + "total": 6.287839999999999, + "hasRDI": true, + "daily": 31.439199999999992, + "unit": "mg" + }, + { + "label": "Vitamin K", + "tag": "VITK1", + "schemaOrgTag": null, + "total": 101.99, + "hasRDI": true, + "daily": 127.4875, + "unit": "µg" + } + ] + }, + "bookmarked": false, + "bought": false + }, \ No newline at end of file From f48b075ef8f04c6fb777613dfd5cc35b17d2f730 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 10:49:38 -0700 Subject: [PATCH 30/88] renamed class (recipesearch -> reciperesult), changed file names for readability --- lib/{recipesearch.rb => recipe_result.rb} | 6 +++--- lib/{recipesearchwrapper.rb => recipe_search_wrapper.rb} | 6 +++--- test/lib/{recipesearch_test.rb => recipe_result_test.rb} | 4 ++-- ...esearchwrapper_test.rb => recipe_search_wrapper_test.rb} | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) rename lib/{recipesearch.rb => recipe_result.rb} (94%) rename lib/{recipesearchwrapper.rb => recipe_search_wrapper.rb} (90%) rename test/lib/{recipesearch_test.rb => recipe_result_test.rb} (58%) rename test/lib/{recipesearchwrapper_test.rb => recipe_search_wrapper_test.rb} (97%) diff --git a/lib/recipesearch.rb b/lib/recipe_result.rb similarity index 94% rename from lib/recipesearch.rb rename to lib/recipe_result.rb index 71d58c230..52e11d408 100644 --- a/lib/recipesearch.rb +++ b/lib/recipe_result.rb @@ -1,10 +1,10 @@ -#recipesearch.rb +#recipe_result.rb #NOTE dietlabels, health labels, cautions, ingredientlines, ingredients, totalNutrients, totalDaily show up as arrays (ingredients is an array of hashes) -require 'recipesearchwrapper' +require 'recipe_search_wrapper' -class RecipeSearch +class RecipeResult attr_reader :label, :id, :photo_url, :recipe_url def initialize(uri, label, params = {}) diff --git a/lib/recipesearchwrapper.rb b/lib/recipe_search_wrapper.rb similarity index 90% rename from lib/recipesearchwrapper.rb rename to lib/recipe_search_wrapper.rb index d82bd6da2..74b627d73 100644 --- a/lib/recipesearchwrapper.rb +++ b/lib/recipe_search_wrapper.rb @@ -1,6 +1,6 @@ -#recipesearchwrapper.rb +#recipe_search_wrapper.rb require 'httparty' -require 'recipesearch' +require 'recipe_result' class RecipeSearchWrapper @@ -42,7 +42,7 @@ def self.search_by_one_keyword(keyword, app_id = nil, app_key = nil) if data["recipes"] data["recipes"].each do |recipe| - wrapper = RecipeSearch.new(recipe["uri"], recipe["label"], image: recipe["image"], shareas: recipe["shareas"]) + wrapper = RecipeResult.new(recipe["uri"], recipe["label"], image: recipe["image"], shareas: recipe["shareas"]) my_recipes << wrapper end diff --git a/test/lib/recipesearch_test.rb b/test/lib/recipe_result_test.rb similarity index 58% rename from test/lib/recipesearch_test.rb rename to test/lib/recipe_result_test.rb index 70f80a3da..86c668f4e 100644 --- a/test/lib/recipesearch_test.rb +++ b/test/lib/recipe_result_test.rb @@ -1,7 +1,7 @@ require 'test_helper' -require 'recipesearch' +require 'recipe_result' -class RecipeSearchTest < ActionController::TestCase +class RecipeResultTest < ActionController::TestCase #make sure rake is picking up the test test "the truth" do assert true diff --git a/test/lib/recipesearchwrapper_test.rb b/test/lib/recipe_search_wrapper_test.rb similarity index 97% rename from test/lib/recipesearchwrapper_test.rb rename to test/lib/recipe_search_wrapper_test.rb index 158bca167..60ef20314 100644 --- a/test/lib/recipesearchwrapper_test.rb +++ b/test/lib/recipe_search_wrapper_test.rb @@ -1,5 +1,5 @@ require 'test_helper' -require 'recipesearchwrapper' +require 'recipe_search_wrapper' class RecipeSearchWrapperTest < ActionController::TestCase From 44f9c76b4c0811a34c64209c401d91cd20eb7d1d Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 16:59:35 -0700 Subject: [PATCH 31/88] fixed typos, updated attr_reader --- lib/recipe_result.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/recipe_result.rb b/lib/recipe_result.rb index 52e11d408..d671e26d0 100644 --- a/lib/recipe_result.rb +++ b/lib/recipe_result.rb @@ -5,11 +5,11 @@ require 'recipe_search_wrapper' class RecipeResult - attr_reader :label, :id, :photo_url, :recipe_url + attr_reader :label, :uri, :image, :shareas def initialize(uri, label, params = {}) if uri == nil || uri == "" || label == nil || label == "" - raise ArguementError + raise ArgumentError end @uri = uri #aka id From fed1d2c9ec7567928c9c66be1d1494f341f5e1b1 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 17:00:35 -0700 Subject: [PATCH 32/88] added attr_reader, deleted AUTH idea, updated search --- lib/recipe_search_wrapper.rb | 38 ++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/lib/recipe_search_wrapper.rb b/lib/recipe_search_wrapper.rb index 74b627d73..225919828 100644 --- a/lib/recipe_search_wrapper.rb +++ b/lib/recipe_search_wrapper.rb @@ -3,20 +3,22 @@ require 'recipe_result' class RecipeSearchWrapper + attr_reader :label, :uri, :image, :shareas + + #CONSTANTS #hide that information away! APP_ID = ENV["APP_ID"] APP_KEY = ENV["APP_KEY"] -#this is where it all starts - BASE_URL = "https://api.edamam.com/" + BASE_URL = "https://api.edamam.com/search?" -#because who wants to type all that? - AUTH = "&app_id=APP_ID&app_key=APP_KEY" # /CONSTANTS + + #CREATE A WRAPPER def initialize(uri, label, params = {}) @uri = uri #aka id @@ -26,27 +28,28 @@ def initialize(uri, label, params = {}) end + #helps users find recipes by an ingredient - def self.search_by_one_keyword(keyword, app_id = nil, app_key = nil) - app_id ||= APP_ID - app_key ||= APP_KEY + def self.search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil) + my_app_id ||= APP_ID + my_app_key ||= APP_KEY - url = BASE_URL + "search?q=#{keyword}" + AUTH + url = BASE_URL + "q=#{keyword}" + "&app_id=#{my_app_id}" + "&app_key=#{my_app_key}" #THIS IS WHERE THE MAGIC HAPPENS data = HTTParty.get(url) - my_recipes = [] + recipes = [] - data["recipes"] - if data["recipes"] - data["recipes"].each do |recipe| + if data["hits"] + my_recipes = data["hits"] + my_recipes.each do |recipe| wrapper = RecipeResult.new(recipe["uri"], recipe["label"], image: recipe["image"], shareas: recipe["shareas"]) - my_recipes << wrapper + recipes << wrapper end - return my_recipes + return recipes else @@ -55,4 +58,9 @@ def self.search_by_one_keyword(keyword, app_id = nil, app_key = nil) end end -end \ No newline at end of file +end + + + + + From 8c60bfcef3225685d7b747ae6b68b8aea767f104 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 17:00:59 -0700 Subject: [PATCH 33/88] commented out everything for now --- .../recipe_searches_controller_test.rb | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/test/controllers/recipe_searches_controller_test.rb b/test/controllers/recipe_searches_controller_test.rb index 0d1119561..32940a32a 100644 --- a/test/controllers/recipe_searches_controller_test.rb +++ b/test/controllers/recipe_searches_controller_test.rb @@ -1,39 +1,39 @@ require 'test_helper' class RecipeSearchesControllerTest < ActionController::TestCase - test "should get index" do - get :index - assert_response :success - end - - test "should get show" do - get :show - assert_response :success - end - - test "should get new" do - get :new - assert_response :success - end - - test "should get create" do - get :create - assert_response :success - end - - test "should get edit" do - get :edit - assert_response :success - end - - test "should get update" do - get :update - assert_response :success - end - - test "should get destroy" do - get :destroy - assert_response :success - end + # test "should get index" do + # get :index + # assert_response :success + # end + + # test "should get show" do + # get :show + # assert_response :success + # end + + # test "should get new" do + # get :new + # assert_response :success + # end + + # test "should get create" do + # get :create + # assert_response :success + # end + + # test "should get edit" do + # get :edit + # assert_response :success + # end + + # test "should get update" do + # get :update + # assert_response :success + # end + + # test "should get destroy" do + # get :destroy + # assert_response :success + # end end From a37551a42821249e969dcfbf23f8304914db9242 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 17:01:22 -0700 Subject: [PATCH 34/88] commented out everything for now --- test/controllers/sessions_controller_test.rb | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb index 7e1dbdee3..3f3cbf1bb 100644 --- a/test/controllers/sessions_controller_test.rb +++ b/test/controllers/sessions_controller_test.rb @@ -1,19 +1,19 @@ require 'test_helper' class SessionsControllerTest < ActionController::TestCase - test "should get new" do - get :new - assert_response :success - end + # test "should get new" do + # get :new + # assert_response :success + # end - test "should get create" do - get :create - assert_response :success - end + # test "should get create" do + # get :create + # assert_response :success + # end - test "should get destroy" do - get :destroy - assert_response :success - end + # test "should get destroy" do + # get :destroy + # assert_response :success + # end end From 77f79cf1ed1dfe04e891ed663799bbc163a0637d Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 17:01:37 -0700 Subject: [PATCH 35/88] commented out everything for now --- test/controllers/users_controller_test.rb | 68 +++++++++++------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb index d84749b5f..36378fec0 100644 --- a/test/controllers/users_controller_test.rb +++ b/test/controllers/users_controller_test.rb @@ -1,39 +1,39 @@ require 'test_helper' class UsersControllerTest < ActionController::TestCase - test "should get index" do - get :index - assert_response :success - end - - test "should get show" do - get :show - assert_response :success - end - - test "should get new" do - get :new - assert_response :success - end - - test "should get create" do - get :create - assert_response :success - end - - test "should get edit" do - get :edit - assert_response :success - end - - test "should get update" do - get :update - assert_response :success - end - - test "should get destroy" do - get :destroy - assert_response :success - end + # test "should get index" do + # get :index + # assert_response :success + # end + + # test "should get show" do + # get :show + # assert_response :success + # end + + # test "should get new" do + # get :new + # assert_response :success + # end + + # test "should get create" do + # get :create + # assert_response :success + # end + + # test "should get edit" do + # get :edit + # assert_response :success + # end + + # test "should get update" do + # get :update + # assert_response :success + # end + + # test "should get destroy" do + # get :destroy + # assert_response :success + # end end From 59942a4c1dcb68ef43c51da12b090e781bb27faf Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 17:02:17 -0700 Subject: [PATCH 36/88] added tests --- test/lib/recipe_result_test.rb | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test/lib/recipe_result_test.rb b/test/lib/recipe_result_test.rb index 86c668f4e..19245741e 100644 --- a/test/lib/recipe_result_test.rb +++ b/test/lib/recipe_result_test.rb @@ -7,4 +7,41 @@ class RecipeResultTest < ActionController::TestCase assert true end + test 'Must Provide a URI and a Label for a Recipe Result' do + + assert_raises ArgumentError do + RecipeResult.new nil, nil + end + + assert_raises ArgumentError do + RecipeResult.new "", "" + end + + assert_raises ArgumentError do + RecipeResult.new "", "SomeLabel" + end + + assert_raises ArgumentError do + RecipeResult.new "SomeURI", "" + end + + assert_raises ArgumentError do + RecipeResult.new "SomeURI", nil + end + + assert_raises ArgumentError do + RecipeResult.new nil, "SomeLabel" + end + end + + test "Name Attribute is Set Correctly" do + test_me = RecipeResult.new "SomeURI", "SomeLabel" + assert test_me.label == "SomeLabel" + end + + test "ID Attribute is Set Correctly" do + test_me = RecipeResult.new "SomeURI", "SomeLabel" + assert test_me.uri == "SomeURI" + end + end \ No newline at end of file From c01146c0be04c775515ddd02b216cb3fd91a3246 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Wed, 2 Nov 2016 17:02:53 -0700 Subject: [PATCH 37/88] changed name of cassette --- test/lib/recipe_search_wrapper_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib/recipe_search_wrapper_test.rb b/test/lib/recipe_search_wrapper_test.rb index 60ef20314..6d37dcafd 100644 --- a/test/lib/recipe_search_wrapper_test.rb +++ b/test/lib/recipe_search_wrapper_test.rb @@ -10,7 +10,7 @@ class RecipeSearchWrapperTest < ActionController::TestCase test "Can Retrieve a List of Recipes" do - VCR.use_cassette("recipe list") do + VCR.use_cassette("recipe-list") do recipes = RecipeSearchWrapper.search_by_one_keyword("carrot") From 08871be9c474eb23a9ffe63fd02e743befc5f9ac Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 13:22:14 -0700 Subject: [PATCH 38/88] tweaked initialize recipe --- lib/recipe_result.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/recipe_result.rb b/lib/recipe_result.rb index d671e26d0..a06c3255a 100644 --- a/lib/recipe_result.rb +++ b/lib/recipe_result.rb @@ -2,20 +2,20 @@ #NOTE dietlabels, health labels, cautions, ingredientlines, ingredients, totalNutrients, totalDaily show up as arrays (ingredients is an array of hashes) -require 'recipe_search_wrapper' +# require_relative 'recipe_search_wrapper' class RecipeResult - attr_reader :label, :uri, :image, :shareas + attr_reader :uri, :label, :image, :shareas - def initialize(uri, label, params = {}) + def initialize(uri, label, image, shareas) if uri == nil || uri == "" || label == nil || label == "" raise ArgumentError end @uri = uri #aka id @label = label - @image = params["image"] - @shareas = params["shareas"] #link to the recipe on edamam website, as opposed to the source website + @image = image + @shareas = shareas #link to the recipe on edamam website, as opposed to the source website end From c88536972c34f493b6a9f850564406b0b93fb010 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 13:23:19 -0700 Subject: [PATCH 39/88] tweaked initialize, loaded dotenv, made search sample method, made working api method --- lib/recipe_search_wrapper.rb | 70 +++++++++++++++++++++++++++++++----- 1 file changed, 61 insertions(+), 9 deletions(-) diff --git a/lib/recipe_search_wrapper.rb b/lib/recipe_search_wrapper.rb index 225919828..489c82d0b 100644 --- a/lib/recipe_search_wrapper.rb +++ b/lib/recipe_search_wrapper.rb @@ -1,9 +1,13 @@ #recipe_search_wrapper.rb + +require 'dotenv' +Dotenv.load! require 'httparty' -require 'recipe_result' +require_relative 'recipe_result' +require_relative 'sample-recipe-result' class RecipeSearchWrapper - attr_reader :label, :uri, :image, :shareas + attr_reader :uri, :label, :image, :shareas @@ -20,11 +24,11 @@ class RecipeSearchWrapper #CREATE A WRAPPER - def initialize(uri, label, params = {}) + def initialize(uri, label, image, shareas) @uri = uri #aka id @label = label - @image = params["image"] - @shareas = params["shareas"] #link to the recipe on edamam website, as opposed to the source website + @image = image + @shareas = shareas #link to the recipe on edamam website, as opposed to the source website end @@ -36,16 +40,18 @@ def self.search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil) url = BASE_URL + "q=#{keyword}" + "&app_id=#{my_app_id}" + "&app_key=#{my_app_key}" -#THIS IS WHERE THE MAGIC HAPPENS +#THIS IS WHERE THE MAGIC HAPPENS, MY JSON HASH data = HTTParty.get(url) recipes = [] if data["hits"] - my_recipes = data["hits"] - my_recipes.each do |recipe| - wrapper = RecipeResult.new(recipe["uri"], recipe["label"], image: recipe["image"], shareas: recipe["shareas"]) + + results_array = data["hits"] + + results_array.each do |result| + wrapper = RecipeResult.new(result["recipe"]["uri"], result["recipe"]["label"], result["recipe"]["image"], result["recipe"]["shareas"]) recipes << wrapper end @@ -58,9 +64,55 @@ def self.search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil) end end +# end + + + def self.search_sample + + + recipe_results_hash = Sample::SAMPLE_RECIPE + + results_array = recipe_results_hash[:hits] + + + if results_array + recipes = [] + + results_array.each do |result| + uri = result[:recipe][:uri] + label = result[:recipe][:label] + + + wrapper = RecipeResult.new(uri, label) + # x = uri + # y = label + # x = uri.class + # y = label.class + recipes << wrapper + # recipes << x + # recipes << y + end + + return recipes + + else + + return nil + + end + end end +# test = RecipeSearchWrapper.search_sample + +test = RecipeSearchWrapper.search_by_one_keyword("carrots") +puts test +puts test.class +test.each do |recipe| + puts recipe.uri + puts recipe.label +end From d3e9ffffdb021d4c759a5030a31956f7f9f33f69 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 13:23:33 -0700 Subject: [PATCH 40/88] sample data to play with --- lib/sample-recipe-result.rb | 1268 +++++++++++++++++++++++++++++++++++ sample-recipe-result.rb | 641 ------------------ 2 files changed, 1268 insertions(+), 641 deletions(-) create mode 100644 lib/sample-recipe-result.rb delete mode 100644 sample-recipe-result.rb diff --git a/lib/sample-recipe-result.rb b/lib/sample-recipe-result.rb new file mode 100644 index 000000000..5e81fa870 --- /dev/null +++ b/lib/sample-recipe-result.rb @@ -0,0 +1,1268 @@ +class Sample + SAMPLE_RECIPE = { + "q": "carrot", + "from": 0, + "to": 10, + "params": { + "sane": [], + "q": [ + "carrot" + ], + "app_id": [ + "d24a2641" + ], + "app_key": [ + "178d4d3e2f7d0a953b4b0b40f2243762" + ] + }, + "more": true, + "count": 1000, + "hits": [ + { + "recipe": { + "uri": "http://www.edamam.com/ontologies/edamam.owl#recipe_be5a134c776c528ff22c664552ccb69a", + "label": "Carrots Braised in Beer and Carrot Juice", + "image": "https://www.edamam.com/web-img/6d7/6d7c318d7a0e0b11413bbf5c4cc91583.jpg", + "source": "Food & Wine", + "sourceIcon": "http://www.foodandwine.com/favicon.ico", + "url": "http://www.foodandwine.com/recipes/carrots-braised-in-beer-and-carrot-juice", + "shareAs": "http://www.edamam.com/recipe/carrots-braised-in-beer-and-carrot-juice-be5a134c776c528ff22c664552ccb69a/carrot", + "yield": 4, + "dietLabels": [ + "Low-Sodium" + ], + "healthLabels": [ + "Vegetarian", + "Egg-Free", + "Peanut-Free", + "Tree-Nut-Free", + "Soy-Free", + "Fish-Free", + "Shellfish-Free" + ], + "cautions": [], + "ingredientLines": [ + "8 medium carrots", + "1 cup fresh carrot juice", + "1/2 cup hoppy beer, such as a pilsner", + "1 teaspoon sugar", + "1 tablespoon unsalted butter", + "Salt" + ], + "ingredients": [ + { + "text": "8 medium carrots", + "quantity": 8, + "measure": "medium", + "food": "carrots", + "weight": 488 + }, + { + "text": "1 cup fresh carrot juice", + "quantity": 1, + "measure": "cup", + "food": "carrot juice", + "weight": 236 + }, + { + "text": "1/2 cup hoppy beer, such as a pilsner", + "quantity": 0.5, + "measure": "cup", + "food": "beer", + "weight": 94.93002 + }, + { + "text": "1 teaspoon sugar", + "quantity": 1, + "measure": "tsp", + "food": "sugar", + "weight": 4.2 + }, + { + "text": "1 tablespoon unsalted butter", + "quantity": 1, + "measure": "tbsp", + "food": "unsalted butter", + "weight": 14.2 + }, + { + "text": "Salt", + "quantity": 0, + "measure": "medium", + "food": "salt", + "weight": 0.029010605938335318 + } + ], + "calories": 453.36790859999996, + "totalWeight": 837.3590306059384, + "totalNutrients": { + "ENERC_KCAL": { + "label": "Energy", + "quantity": 453.36790859999996, + "unit": "kcal" + }, + "FAT": { + "label": "Fat", + "quantity": 13.042819999999999, + "unit": "g" + }, + "FASAT": { + "label": "Saturated", + "quantity": 7.486719999999999, + "unit": "g" + }, + "FATRN": { + "label": "Trans", + "quantity": 0.46434, + "unit": "g" + }, + "FAMS": { + "label": "Monounsaturated", + "quantity": 3.0501599999999995, + "unit": "g" + }, + "FAPU": { + "label": "Polyunsaturated", + "quantity": 1.13368, + "unit": "g" + }, + "CHOCDF": { + "label": "Carbs", + "quantity": 76.22889571, + "unit": "g" + }, + "FIBTG": { + "label": "Fiber", + "quantity": 15.552, + "unit": "g" + }, + "SUGAR": { + "label": "Sugars", + "quantity": 36.55892, + "unit": "g" + }, + "PROCNT": { + "label": "Protein", + "quantity": 7.337778092000001, + "unit": "g" + }, + "CHOLE": { + "label": "Cholesterol", + "quantity": 30.529999999999998, + "unit": "mg" + }, + "NA": { + "label": "Sodium", + "quantity": 509.12513144957995, + "unit": "mg" + }, + "CA": { + "label": "Calcium", + "quantity": 224.93416334542522, + "unit": "mg" + }, + "MG": { + "label": "Magnesium", + "quantity": 97.58009130605939, + "unit": "mg" + }, + "K": { + "label": "Potassium", + "quantity": 2279.8454262484743, + "unit": "mg" + }, + "FE": { + "label": "Iron", + "quantity": 2.5736217389995963, + "unit": "mg" + }, + "ZN": { + "label": "Zinc", + "quantity": 1.6187220126059385, + "unit": "mg" + }, + "P": { + "label": "Phosphorus", + "quantity": 286.61820279999995, + "unit": "mg" + }, + "VITA_RAE": { + "label": "Vitamin A", + "quantity": 6428.087999999999, + "unit": "µg_RAE" + }, + "VITC": { + "label": "Vitamin C", + "quantity": 48.852000000000004, + "unit": "mg" + }, + "THIA": { + "label": "Thiamin (B1)", + "quantity": 0.5106565009999999, + "unit": "mg" + }, + "RIBF": { + "label": "Riboflavin (B2)", + "quantity": 0.38566600399999995, + "unit": "mg" + }, + "NIA": { + "label": "Niacin (B3)", + "quantity": 6.169023102, + "unit": "mg" + }, + "VITB6A": { + "label": "Vitamin B6", + "quantity": 1.168398008, + "unit": "mg" + }, + "FOL": { + "label": "Folic Acid (B9)", + "quantity": 108.2818012, + "unit": "µg" + }, + "VITB12": { + "label": "Vitamin B12", + "quantity": 0.043126003999999996, + "unit": "µg" + }, + "VITD": { + "label": "Vitamin D", + "quantity": 0.21299999999999997, + "unit": "µg" + }, + "TOCPHA": { + "label": "Vitamin E", + "quantity": 6.287839999999999, + "unit": "mg" + }, + "VITK1": { + "label": "Vitamin K", + "quantity": 101.99, + "unit": "µg" + } + }, + "totalDaily": { + "ENERC_KCAL": { + "label": "Energy", + "quantity": 22.668395429999997, + "unit": "%" + }, + "FAT": { + "label": "Fat", + "quantity": 20.06587692307692, + "unit": "%" + }, + "FASAT": { + "label": "Saturated", + "quantity": 37.4336, + "unit": "%" + }, + "CHOCDF": { + "label": "Carbs", + "quantity": 25.409631903333334, + "unit": "%" + }, + "FIBTG": { + "label": "Fiber", + "quantity": 62.208, + "unit": "%" + }, + "PROCNT": { + "label": "Protein", + "quantity": 14.675556184000001, + "unit": "%" + }, + "CHOLE": { + "label": "Cholesterol", + "quantity": 10.176666666666666, + "unit": "%" + }, + "NA": { + "label": "Sodium", + "quantity": 21.213547143732498, + "unit": "%" + }, + "CA": { + "label": "Calcium", + "quantity": 22.493416334542523, + "unit": "%" + }, + "MG": { + "label": "Magnesium", + "quantity": 24.395022826514847, + "unit": "%" + }, + "K": { + "label": "Potassium", + "quantity": 65.13844074995642, + "unit": "%" + }, + "FE": { + "label": "Iron", + "quantity": 14.29789854999776, + "unit": "%" + }, + "ZN": { + "label": "Zinc", + "quantity": 10.79148008403959, + "unit": "%" + }, + "P": { + "label": "Phosphorus", + "quantity": 40.945457542857135, + "unit": "%" + }, + "VITA_RAE": { + "label": "Vitamin A", + "quantity": 714.232, + "unit": "%" + }, + "VITC": { + "label": "Vitamin C", + "quantity": 81.42000000000002, + "unit": "%" + }, + "THIA": { + "label": "Thiamin (B1)", + "quantity": 34.04376673333333, + "unit": "%" + }, + "RIBF": { + "label": "Riboflavin (B2)", + "quantity": 22.686235529411764, + "unit": "%" + }, + "NIA": { + "label": "Niacin (B3)", + "quantity": 30.84511551, + "unit": "%" + }, + "VITB6A": { + "label": "Vitamin B6", + "quantity": 58.4199004, + "unit": "%" + }, + "FOL": { + "label": "Folic Acid (B9)", + "quantity": 27.0704503, + "unit": "%" + }, + "VITB12": { + "label": "Vitamin B12", + "quantity": 0.7187667333333332, + "unit": "%" + }, + "VITD": { + "label": "Vitamin D", + "quantity": 0.05324999999999999, + "unit": "%" + }, + "TOCPHA": { + "label": "Vitamin E", + "quantity": 31.439199999999992, + "unit": "%" + }, + "VITK1": { + "label": "Vitamin K", + "quantity": 127.4875, + "unit": "%" + } + }, + "digest": [ + { + "label": "Fat", + "tag": "FAT", + "schemaOrgTag": "fatContent", + "total": 13.042819999999999, + "hasRDI": true, + "daily": 20.06587692307692, + "unit": "g", + "sub": [ + { + "label": "Saturated", + "tag": "FASAT", + "schemaOrgTag": "saturatedFatContent", + "total": 7.486719999999999, + "hasRDI": true, + "daily": 37.4336, + "unit": "g" + }, + { + "label": "Trans", + "tag": "FATRN", + "schemaOrgTag": "transFatContent", + "total": 0.46434, + "hasRDI": false, + "daily": 0, + "unit": "g" + }, + { + "label": "Monounsaturated", + "tag": "FAMS", + "schemaOrgTag": nil, + "total": 3.0501599999999995, + "hasRDI": false, + "daily": 0, + "unit": "g" + }, + { + "label": "Polyunsaturated", + "tag": "FAPU", + "schemaOrgTag": nil, + "total": 1.13368, + "hasRDI": false, + "daily": 0, + "unit": "g" + } + ] + }, + { + "label": "Carbs", + "tag": "CHOCDF", + "schemaOrgTag": "carbohydrateContent", + "total": 76.22889571, + "hasRDI": true, + "daily": 25.409631903333334, + "unit": "g", + "sub": [ + { + "label": "Carbs (net)", + "tag": "CHOCDF.net", + "schemaOrgTag": nil, + "total": 60.676895710000004, + "hasRDI": false, + "daily": 0, + "unit": "g" + }, + { + "label": "Fiber", + "tag": "FIBTG", + "schemaOrgTag": "fiberContent", + "total": 15.552, + "hasRDI": true, + "daily": 62.208, + "unit": "g" + }, + { + "label": "Sugars", + "tag": "SUGAR", + "schemaOrgTag": "sugarContent", + "total": 36.55892, + "hasRDI": false, + "daily": 0, + "unit": "g" + } + ] + }, + { + "label": "Protein", + "tag": "PROCNT", + "schemaOrgTag": "proteinContent", + "total": 7.337778092000001, + "hasRDI": true, + "daily": 14.675556184000001, + "unit": "g" + }, + { + "label": "Cholesterol", + "tag": "CHOLE", + "schemaOrgTag": "cholesterolContent", + "total": 30.529999999999998, + "hasRDI": true, + "daily": 10.176666666666666, + "unit": "mg" + }, + { + "label": "Sodium", + "tag": "NA", + "schemaOrgTag": "sodiumContent", + "total": 509.12513144957995, + "hasRDI": true, + "daily": 21.213547143732498, + "unit": "mg" + }, + { + "label": "Calcium", + "tag": "CA", + "schemaOrgTag": nil, + "total": 224.93416334542522, + "hasRDI": true, + "daily": 22.493416334542523, + "unit": "mg" + }, + { + "label": "Magnesium", + "tag": "MG", + "schemaOrgTag": nil, + "total": 97.58009130605939, + "hasRDI": true, + "daily": 24.395022826514847, + "unit": "mg" + }, + { + "label": "Potassium", + "tag": "K", + "schemaOrgTag": nil, + "total": 2279.8454262484743, + "hasRDI": true, + "daily": 65.13844074995642, + "unit": "mg" + }, + { + "label": "Iron", + "tag": "FE", + "schemaOrgTag": nil, + "total": 2.5736217389995963, + "hasRDI": true, + "daily": 14.29789854999776, + "unit": "mg" + }, + { + "label": "Zinc", + "tag": "ZN", + "schemaOrgTag": nil, + "total": 1.6187220126059385, + "hasRDI": true, + "daily": 10.79148008403959, + "unit": "mg" + }, + { + "label": "Phosphorus", + "tag": "P", + "schemaOrgTag": nil, + "total": 286.61820279999995, + "hasRDI": true, + "daily": 40.945457542857135, + "unit": "mg" + }, + { + "label": "Vitamin A", + "tag": "VITA_RAE", + "schemaOrgTag": nil, + "total": 6428.087999999999, + "hasRDI": true, + "daily": 714.232, + "unit": "µg" + }, + { + "label": "Vitamin C", + "tag": "VITC", + "schemaOrgTag": nil, + "total": 48.852000000000004, + "hasRDI": true, + "daily": 81.42000000000002, + "unit": "mg" + }, + { + "label": "Thiamin (B1)", + "tag": "THIA", + "schemaOrgTag": nil, + "total": 0.5106565009999999, + "hasRDI": true, + "daily": 34.04376673333333, + "unit": "mg" + }, + { + "label": "Riboflavin (B2)", + "tag": "RIBF", + "schemaOrgTag": nil, + "total": 0.38566600399999995, + "hasRDI": true, + "daily": 22.686235529411764, + "unit": "mg" + }, + { + "label": "Niacin (B3)", + "tag": "NIA", + "schemaOrgTag": nil, + "total": 6.169023102, + "hasRDI": true, + "daily": 30.84511551, + "unit": "mg" + }, + { + "label": "Vitamin B6", + "tag": "VITB6A", + "schemaOrgTag": nil, + "total": 1.168398008, + "hasRDI": true, + "daily": 58.4199004, + "unit": "mg" + }, + { + "label": "Folic Acid (B9)", + "tag": "FOL", + "schemaOrgTag": nil, + "total": 108.2818012, + "hasRDI": true, + "daily": 27.0704503, + "unit": "µg" + }, + { + "label": "Vitamin B12", + "tag": "VITB12", + "schemaOrgTag": nil, + "total": 0.043126003999999996, + "hasRDI": true, + "daily": 0.7187667333333332, + "unit": "µg" + }, + { + "label": "Vitamin D", + "tag": "VITD", + "schemaOrgTag": nil, + "total": 0.21299999999999997, + "hasRDI": true, + "daily": 0.05324999999999999, + "unit": "µg" + }, + { + "label": "Vitamin E", + "tag": "TOCPHA", + "schemaOrgTag": nil, + "total": 6.287839999999999, + "hasRDI": true, + "daily": 31.439199999999992, + "unit": "mg" + }, + { + "label": "Vitamin K", + "tag": "VITK1", + "schemaOrgTag": nil, + "total": 101.99, + "hasRDI": true, + "daily": 127.4875, + "unit": "µg" + } + ] + }, + "bookmarked": false, + "bought": false + }, + { + "recipe": { + "uri": "http://www.edamam.com/ontologies/edamam.owl#recipe_be5a134c776c528ff22c664552ccb69a", + "label": "Carrots Braised in Beer and Carrot Juice", + "image": "https://www.edamam.com/web-img/6d7/6d7c318d7a0e0b11413bbf5c4cc91583.jpg", + "source": "Food & Wine", + "sourceIcon": "http://www.foodandwine.com/favicon.ico", + "url": "http://www.foodandwine.com/recipes/carrots-braised-in-beer-and-carrot-juice", + "shareAs": "http://www.edamam.com/recipe/carrots-braised-in-beer-and-carrot-juice-be5a134c776c528ff22c664552ccb69a/carrot", + "yield": 4, + "dietLabels": [ + "Low-Sodium" + ], + "healthLabels": [ + "Vegetarian", + "Egg-Free", + "Peanut-Free", + "Tree-Nut-Free", + "Soy-Free", + "Fish-Free", + "Shellfish-Free" + ], + "cautions": [], + "ingredientLines": [ + "8 medium carrots", + "1 cup fresh carrot juice", + "1/2 cup hoppy beer, such as a pilsner", + "1 teaspoon sugar", + "1 tablespoon unsalted butter", + "Salt" + ], + "ingredients": [ + { + "text": "8 medium carrots", + "quantity": 8, + "measure": "medium", + "food": "carrots", + "weight": 488 + }, + { + "text": "1 cup fresh carrot juice", + "quantity": 1, + "measure": "cup", + "food": "carrot juice", + "weight": 236 + }, + { + "text": "1/2 cup hoppy beer, such as a pilsner", + "quantity": 0.5, + "measure": "cup", + "food": "beer", + "weight": 94.93002 + }, + { + "text": "1 teaspoon sugar", + "quantity": 1, + "measure": "tsp", + "food": "sugar", + "weight": 4.2 + }, + { + "text": "1 tablespoon unsalted butter", + "quantity": 1, + "measure": "tbsp", + "food": "unsalted butter", + "weight": 14.2 + }, + { + "text": "Salt", + "quantity": 0, + "measure": "medium", + "food": "salt", + "weight": 0.029010605938335318 + } + ], + "calories": 453.36790859999996, + "totalWeight": 837.3590306059384, + "totalNutrients": { + "ENERC_KCAL": { + "label": "Energy", + "quantity": 453.36790859999996, + "unit": "kcal" + }, + "FAT": { + "label": "Fat", + "quantity": 13.042819999999999, + "unit": "g" + }, + "FASAT": { + "label": "Saturated", + "quantity": 7.486719999999999, + "unit": "g" + }, + "FATRN": { + "label": "Trans", + "quantity": 0.46434, + "unit": "g" + }, + "FAMS": { + "label": "Monounsaturated", + "quantity": 3.0501599999999995, + "unit": "g" + }, + "FAPU": { + "label": "Polyunsaturated", + "quantity": 1.13368, + "unit": "g" + }, + "CHOCDF": { + "label": "Carbs", + "quantity": 76.22889571, + "unit": "g" + }, + "FIBTG": { + "label": "Fiber", + "quantity": 15.552, + "unit": "g" + }, + "SUGAR": { + "label": "Sugars", + "quantity": 36.55892, + "unit": "g" + }, + "PROCNT": { + "label": "Protein", + "quantity": 7.337778092000001, + "unit": "g" + }, + "CHOLE": { + "label": "Cholesterol", + "quantity": 30.529999999999998, + "unit": "mg" + }, + "NA": { + "label": "Sodium", + "quantity": 509.12513144957995, + "unit": "mg" + }, + "CA": { + "label": "Calcium", + "quantity": 224.93416334542522, + "unit": "mg" + }, + "MG": { + "label": "Magnesium", + "quantity": 97.58009130605939, + "unit": "mg" + }, + "K": { + "label": "Potassium", + "quantity": 2279.8454262484743, + "unit": "mg" + }, + "FE": { + "label": "Iron", + "quantity": 2.5736217389995963, + "unit": "mg" + }, + "ZN": { + "label": "Zinc", + "quantity": 1.6187220126059385, + "unit": "mg" + }, + "P": { + "label": "Phosphorus", + "quantity": 286.61820279999995, + "unit": "mg" + }, + "VITA_RAE": { + "label": "Vitamin A", + "quantity": 6428.087999999999, + "unit": "µg_RAE" + }, + "VITC": { + "label": "Vitamin C", + "quantity": 48.852000000000004, + "unit": "mg" + }, + "THIA": { + "label": "Thiamin (B1)", + "quantity": 0.5106565009999999, + "unit": "mg" + }, + "RIBF": { + "label": "Riboflavin (B2)", + "quantity": 0.38566600399999995, + "unit": "mg" + }, + "NIA": { + "label": "Niacin (B3)", + "quantity": 6.169023102, + "unit": "mg" + }, + "VITB6A": { + "label": "Vitamin B6", + "quantity": 1.168398008, + "unit": "mg" + }, + "FOL": { + "label": "Folic Acid (B9)", + "quantity": 108.2818012, + "unit": "µg" + }, + "VITB12": { + "label": "Vitamin B12", + "quantity": 0.043126003999999996, + "unit": "µg" + }, + "VITD": { + "label": "Vitamin D", + "quantity": 0.21299999999999997, + "unit": "µg" + }, + "TOCPHA": { + "label": "Vitamin E", + "quantity": 6.287839999999999, + "unit": "mg" + }, + "VITK1": { + "label": "Vitamin K", + "quantity": 101.99, + "unit": "µg" + } + }, + "totalDaily": { + "ENERC_KCAL": { + "label": "Energy", + "quantity": 22.668395429999997, + "unit": "%" + }, + "FAT": { + "label": "Fat", + "quantity": 20.06587692307692, + "unit": "%" + }, + "FASAT": { + "label": "Saturated", + "quantity": 37.4336, + "unit": "%" + }, + "CHOCDF": { + "label": "Carbs", + "quantity": 25.409631903333334, + "unit": "%" + }, + "FIBTG": { + "label": "Fiber", + "quantity": 62.208, + "unit": "%" + }, + "PROCNT": { + "label": "Protein", + "quantity": 14.675556184000001, + "unit": "%" + }, + "CHOLE": { + "label": "Cholesterol", + "quantity": 10.176666666666666, + "unit": "%" + }, + "NA": { + "label": "Sodium", + "quantity": 21.213547143732498, + "unit": "%" + }, + "CA": { + "label": "Calcium", + "quantity": 22.493416334542523, + "unit": "%" + }, + "MG": { + "label": "Magnesium", + "quantity": 24.395022826514847, + "unit": "%" + }, + "K": { + "label": "Potassium", + "quantity": 65.13844074995642, + "unit": "%" + }, + "FE": { + "label": "Iron", + "quantity": 14.29789854999776, + "unit": "%" + }, + "ZN": { + "label": "Zinc", + "quantity": 10.79148008403959, + "unit": "%" + }, + "P": { + "label": "Phosphorus", + "quantity": 40.945457542857135, + "unit": "%" + }, + "VITA_RAE": { + "label": "Vitamin A", + "quantity": 714.232, + "unit": "%" + }, + "VITC": { + "label": "Vitamin C", + "quantity": 81.42000000000002, + "unit": "%" + }, + "THIA": { + "label": "Thiamin (B1)", + "quantity": 34.04376673333333, + "unit": "%" + }, + "RIBF": { + "label": "Riboflavin (B2)", + "quantity": 22.686235529411764, + "unit": "%" + }, + "NIA": { + "label": "Niacin (B3)", + "quantity": 30.84511551, + "unit": "%" + }, + "VITB6A": { + "label": "Vitamin B6", + "quantity": 58.4199004, + "unit": "%" + }, + "FOL": { + "label": "Folic Acid (B9)", + "quantity": 27.0704503, + "unit": "%" + }, + "VITB12": { + "label": "Vitamin B12", + "quantity": 0.7187667333333332, + "unit": "%" + }, + "VITD": { + "label": "Vitamin D", + "quantity": 0.05324999999999999, + "unit": "%" + }, + "TOCPHA": { + "label": "Vitamin E", + "quantity": 31.439199999999992, + "unit": "%" + }, + "VITK1": { + "label": "Vitamin K", + "quantity": 127.4875, + "unit": "%" + } + }, + "digest": [ + { + "label": "Fat", + "tag": "FAT", + "schemaOrgTag": "fatContent", + "total": 13.042819999999999, + "hasRDI": true, + "daily": 20.06587692307692, + "unit": "g", + "sub": [ + { + "label": "Saturated", + "tag": "FASAT", + "schemaOrgTag": "saturatedFatContent", + "total": 7.486719999999999, + "hasRDI": true, + "daily": 37.4336, + "unit": "g" + }, + { + "label": "Trans", + "tag": "FATRN", + "schemaOrgTag": "transFatContent", + "total": 0.46434, + "hasRDI": false, + "daily": 0, + "unit": "g" + }, + { + "label": "Monounsaturated", + "tag": "FAMS", + "schemaOrgTag": nil, + "total": 3.0501599999999995, + "hasRDI": false, + "daily": 0, + "unit": "g" + }, + { + "label": "Polyunsaturated", + "tag": "FAPU", + "schemaOrgTag": nil, + "total": 1.13368, + "hasRDI": false, + "daily": 0, + "unit": "g" + } + ] + }, + { + "label": "Carbs", + "tag": "CHOCDF", + "schemaOrgTag": "carbohydrateContent", + "total": 76.22889571, + "hasRDI": true, + "daily": 25.409631903333334, + "unit": "g", + "sub": [ + { + "label": "Carbs (net)", + "tag": "CHOCDF.net", + "schemaOrgTag": nil, + "total": 60.676895710000004, + "hasRDI": false, + "daily": 0, + "unit": "g" + }, + { + "label": "Fiber", + "tag": "FIBTG", + "schemaOrgTag": "fiberContent", + "total": 15.552, + "hasRDI": true, + "daily": 62.208, + "unit": "g" + }, + { + "label": "Sugars", + "tag": "SUGAR", + "schemaOrgTag": "sugarContent", + "total": 36.55892, + "hasRDI": false, + "daily": 0, + "unit": "g" + } + ] + }, + { + "label": "Protein", + "tag": "PROCNT", + "schemaOrgTag": "proteinContent", + "total": 7.337778092000001, + "hasRDI": true, + "daily": 14.675556184000001, + "unit": "g" + }, + { + "label": "Cholesterol", + "tag": "CHOLE", + "schemaOrgTag": "cholesterolContent", + "total": 30.529999999999998, + "hasRDI": true, + "daily": 10.176666666666666, + "unit": "mg" + }, + { + "label": "Sodium", + "tag": "NA", + "schemaOrgTag": "sodiumContent", + "total": 509.12513144957995, + "hasRDI": true, + "daily": 21.213547143732498, + "unit": "mg" + }, + { + "label": "Calcium", + "tag": "CA", + "schemaOrgTag": nil, + "total": 224.93416334542522, + "hasRDI": true, + "daily": 22.493416334542523, + "unit": "mg" + }, + { + "label": "Magnesium", + "tag": "MG", + "schemaOrgTag": nil, + "total": 97.58009130605939, + "hasRDI": true, + "daily": 24.395022826514847, + "unit": "mg" + }, + { + "label": "Potassium", + "tag": "K", + "schemaOrgTag": nil, + "total": 2279.8454262484743, + "hasRDI": true, + "daily": 65.13844074995642, + "unit": "mg" + }, + { + "label": "Iron", + "tag": "FE", + "schemaOrgTag": nil, + "total": 2.5736217389995963, + "hasRDI": true, + "daily": 14.29789854999776, + "unit": "mg" + }, + { + "label": "Zinc", + "tag": "ZN", + "schemaOrgTag": nil, + "total": 1.6187220126059385, + "hasRDI": true, + "daily": 10.79148008403959, + "unit": "mg" + }, + { + "label": "Phosphorus", + "tag": "P", + "schemaOrgTag": nil, + "total": 286.61820279999995, + "hasRDI": true, + "daily": 40.945457542857135, + "unit": "mg" + }, + { + "label": "Vitamin A", + "tag": "VITA_RAE", + "schemaOrgTag": nil, + "total": 6428.087999999999, + "hasRDI": true, + "daily": 714.232, + "unit": "µg" + }, + { + "label": "Vitamin C", + "tag": "VITC", + "schemaOrgTag": nil, + "total": 48.852000000000004, + "hasRDI": true, + "daily": 81.42000000000002, + "unit": "mg" + }, + { + "label": "Thiamin (B1)", + "tag": "THIA", + "schemaOrgTag": nil, + "total": 0.5106565009999999, + "hasRDI": true, + "daily": 34.04376673333333, + "unit": "mg" + }, + { + "label": "Riboflavin (B2)", + "tag": "RIBF", + "schemaOrgTag": nil, + "total": 0.38566600399999995, + "hasRDI": true, + "daily": 22.686235529411764, + "unit": "mg" + }, + { + "label": "Niacin (B3)", + "tag": "NIA", + "schemaOrgTag": nil, + "total": 6.169023102, + "hasRDI": true, + "daily": 30.84511551, + "unit": "mg" + }, + { + "label": "Vitamin B6", + "tag": "VITB6A", + "schemaOrgTag": nil, + "total": 1.168398008, + "hasRDI": true, + "daily": 58.4199004, + "unit": "mg" + }, + { + "label": "Folic Acid (B9)", + "tag": "FOL", + "schemaOrgTag": nil, + "total": 108.2818012, + "hasRDI": true, + "daily": 27.0704503, + "unit": "µg" + }, + { + "label": "Vitamin B12", + "tag": "VITB12", + "schemaOrgTag": nil, + "total": 0.043126003999999996, + "hasRDI": true, + "daily": 0.7187667333333332, + "unit": "µg" + }, + { + "label": "Vitamin D", + "tag": "VITD", + "schemaOrgTag": nil, + "total": 0.21299999999999997, + "hasRDI": true, + "daily": 0.05324999999999999, + "unit": "µg" + }, + { + "label": "Vitamin E", + "tag": "TOCPHA", + "schemaOrgTag": nil, + "total": 6.287839999999999, + "hasRDI": true, + "daily": 31.439199999999992, + "unit": "mg" + }, + { + "label": "Vitamin K", + "tag": "VITK1", + "schemaOrgTag": nil, + "total": 101.99, + "hasRDI": true, + "daily": 127.4875, + "unit": "µg" + } + ] + }, + "bookmarked": false, + "bought": false + } + ] + } +end + \ No newline at end of file diff --git a/sample-recipe-result.rb b/sample-recipe-result.rb deleted file mode 100644 index aaa076cac..000000000 --- a/sample-recipe-result.rb +++ /dev/null @@ -1,641 +0,0 @@ -{ - "q": "carrot", - "from": 0, - "to": 10, - "params": { - "sane": [], - "q": [ - "carrot" - ], - "app_id": [ - "d24a2641" - ], - "app_key": [ - "178d4d3e2f7d0a953b4b0b40f2243762" - ] - }, - "more": true, - "count": 1000, - "hits": [ - { - "recipe": { - "uri": "http://www.edamam.com/ontologies/edamam.owl#recipe_be5a134c776c528ff22c664552ccb69a", - "label": "Carrots Braised in Beer and Carrot Juice", - "image": "https://www.edamam.com/web-img/6d7/6d7c318d7a0e0b11413bbf5c4cc91583.jpg", - "source": "Food & Wine", - "sourceIcon": "http://www.foodandwine.com/favicon.ico", - "url": "http://www.foodandwine.com/recipes/carrots-braised-in-beer-and-carrot-juice", - "shareAs": "http://www.edamam.com/recipe/carrots-braised-in-beer-and-carrot-juice-be5a134c776c528ff22c664552ccb69a/carrot", - "yield": 4, - "dietLabels": [ - "Low-Sodium" - ], - "healthLabels": [ - "Vegetarian", - "Egg-Free", - "Peanut-Free", - "Tree-Nut-Free", - "Soy-Free", - "Fish-Free", - "Shellfish-Free" - ], - "cautions": [], - "ingredientLines": [ - "8 medium carrots", - "1 cup fresh carrot juice", - "1/2 cup hoppy beer, such as a pilsner", - "1 teaspoon sugar", - "1 tablespoon unsalted butter", - "Salt" - ], - "ingredients": [ - { - "text": "8 medium carrots", - "quantity": 8, - "measure": "medium", - "food": "carrots", - "weight": 488 - }, - { - "text": "1 cup fresh carrot juice", - "quantity": 1, - "measure": "cup", - "food": "carrot juice", - "weight": 236 - }, - { - "text": "1/2 cup hoppy beer, such as a pilsner", - "quantity": 0.5, - "measure": "cup", - "food": "beer", - "weight": 94.93002 - }, - { - "text": "1 teaspoon sugar", - "quantity": 1, - "measure": "tsp", - "food": "sugar", - "weight": 4.2 - }, - { - "text": "1 tablespoon unsalted butter", - "quantity": 1, - "measure": "tbsp", - "food": "unsalted butter", - "weight": 14.2 - }, - { - "text": "Salt", - "quantity": 0, - "measure": "medium", - "food": "salt", - "weight": 0.029010605938335318 - } - ], - "calories": 453.36790859999996, - "totalWeight": 837.3590306059384, - "totalNutrients": { - "ENERC_KCAL": { - "label": "Energy", - "quantity": 453.36790859999996, - "unit": "kcal" - }, - "FAT": { - "label": "Fat", - "quantity": 13.042819999999999, - "unit": "g" - }, - "FASAT": { - "label": "Saturated", - "quantity": 7.486719999999999, - "unit": "g" - }, - "FATRN": { - "label": "Trans", - "quantity": 0.46434, - "unit": "g" - }, - "FAMS": { - "label": "Monounsaturated", - "quantity": 3.0501599999999995, - "unit": "g" - }, - "FAPU": { - "label": "Polyunsaturated", - "quantity": 1.13368, - "unit": "g" - }, - "CHOCDF": { - "label": "Carbs", - "quantity": 76.22889571, - "unit": "g" - }, - "FIBTG": { - "label": "Fiber", - "quantity": 15.552, - "unit": "g" - }, - "SUGAR": { - "label": "Sugars", - "quantity": 36.55892, - "unit": "g" - }, - "PROCNT": { - "label": "Protein", - "quantity": 7.337778092000001, - "unit": "g" - }, - "CHOLE": { - "label": "Cholesterol", - "quantity": 30.529999999999998, - "unit": "mg" - }, - "NA": { - "label": "Sodium", - "quantity": 509.12513144957995, - "unit": "mg" - }, - "CA": { - "label": "Calcium", - "quantity": 224.93416334542522, - "unit": "mg" - }, - "MG": { - "label": "Magnesium", - "quantity": 97.58009130605939, - "unit": "mg" - }, - "K": { - "label": "Potassium", - "quantity": 2279.8454262484743, - "unit": "mg" - }, - "FE": { - "label": "Iron", - "quantity": 2.5736217389995963, - "unit": "mg" - }, - "ZN": { - "label": "Zinc", - "quantity": 1.6187220126059385, - "unit": "mg" - }, - "P": { - "label": "Phosphorus", - "quantity": 286.61820279999995, - "unit": "mg" - }, - "VITA_RAE": { - "label": "Vitamin A", - "quantity": 6428.087999999999, - "unit": "µg_RAE" - }, - "VITC": { - "label": "Vitamin C", - "quantity": 48.852000000000004, - "unit": "mg" - }, - "THIA": { - "label": "Thiamin (B1)", - "quantity": 0.5106565009999999, - "unit": "mg" - }, - "RIBF": { - "label": "Riboflavin (B2)", - "quantity": 0.38566600399999995, - "unit": "mg" - }, - "NIA": { - "label": "Niacin (B3)", - "quantity": 6.169023102, - "unit": "mg" - }, - "VITB6A": { - "label": "Vitamin B6", - "quantity": 1.168398008, - "unit": "mg" - }, - "FOL": { - "label": "Folic Acid (B9)", - "quantity": 108.2818012, - "unit": "µg" - }, - "VITB12": { - "label": "Vitamin B12", - "quantity": 0.043126003999999996, - "unit": "µg" - }, - "VITD": { - "label": "Vitamin D", - "quantity": 0.21299999999999997, - "unit": "µg" - }, - "TOCPHA": { - "label": "Vitamin E", - "quantity": 6.287839999999999, - "unit": "mg" - }, - "VITK1": { - "label": "Vitamin K", - "quantity": 101.99, - "unit": "µg" - } - }, - "totalDaily": { - "ENERC_KCAL": { - "label": "Energy", - "quantity": 22.668395429999997, - "unit": "%" - }, - "FAT": { - "label": "Fat", - "quantity": 20.06587692307692, - "unit": "%" - }, - "FASAT": { - "label": "Saturated", - "quantity": 37.4336, - "unit": "%" - }, - "CHOCDF": { - "label": "Carbs", - "quantity": 25.409631903333334, - "unit": "%" - }, - "FIBTG": { - "label": "Fiber", - "quantity": 62.208, - "unit": "%" - }, - "PROCNT": { - "label": "Protein", - "quantity": 14.675556184000001, - "unit": "%" - }, - "CHOLE": { - "label": "Cholesterol", - "quantity": 10.176666666666666, - "unit": "%" - }, - "NA": { - "label": "Sodium", - "quantity": 21.213547143732498, - "unit": "%" - }, - "CA": { - "label": "Calcium", - "quantity": 22.493416334542523, - "unit": "%" - }, - "MG": { - "label": "Magnesium", - "quantity": 24.395022826514847, - "unit": "%" - }, - "K": { - "label": "Potassium", - "quantity": 65.13844074995642, - "unit": "%" - }, - "FE": { - "label": "Iron", - "quantity": 14.29789854999776, - "unit": "%" - }, - "ZN": { - "label": "Zinc", - "quantity": 10.79148008403959, - "unit": "%" - }, - "P": { - "label": "Phosphorus", - "quantity": 40.945457542857135, - "unit": "%" - }, - "VITA_RAE": { - "label": "Vitamin A", - "quantity": 714.232, - "unit": "%" - }, - "VITC": { - "label": "Vitamin C", - "quantity": 81.42000000000002, - "unit": "%" - }, - "THIA": { - "label": "Thiamin (B1)", - "quantity": 34.04376673333333, - "unit": "%" - }, - "RIBF": { - "label": "Riboflavin (B2)", - "quantity": 22.686235529411764, - "unit": "%" - }, - "NIA": { - "label": "Niacin (B3)", - "quantity": 30.84511551, - "unit": "%" - }, - "VITB6A": { - "label": "Vitamin B6", - "quantity": 58.4199004, - "unit": "%" - }, - "FOL": { - "label": "Folic Acid (B9)", - "quantity": 27.0704503, - "unit": "%" - }, - "VITB12": { - "label": "Vitamin B12", - "quantity": 0.7187667333333332, - "unit": "%" - }, - "VITD": { - "label": "Vitamin D", - "quantity": 0.05324999999999999, - "unit": "%" - }, - "TOCPHA": { - "label": "Vitamin E", - "quantity": 31.439199999999992, - "unit": "%" - }, - "VITK1": { - "label": "Vitamin K", - "quantity": 127.4875, - "unit": "%" - } - }, - "digest": [ - { - "label": "Fat", - "tag": "FAT", - "schemaOrgTag": "fatContent", - "total": 13.042819999999999, - "hasRDI": true, - "daily": 20.06587692307692, - "unit": "g", - "sub": [ - { - "label": "Saturated", - "tag": "FASAT", - "schemaOrgTag": "saturatedFatContent", - "total": 7.486719999999999, - "hasRDI": true, - "daily": 37.4336, - "unit": "g" - }, - { - "label": "Trans", - "tag": "FATRN", - "schemaOrgTag": "transFatContent", - "total": 0.46434, - "hasRDI": false, - "daily": 0, - "unit": "g" - }, - { - "label": "Monounsaturated", - "tag": "FAMS", - "schemaOrgTag": null, - "total": 3.0501599999999995, - "hasRDI": false, - "daily": 0, - "unit": "g" - }, - { - "label": "Polyunsaturated", - "tag": "FAPU", - "schemaOrgTag": null, - "total": 1.13368, - "hasRDI": false, - "daily": 0, - "unit": "g" - } - ] - }, - { - "label": "Carbs", - "tag": "CHOCDF", - "schemaOrgTag": "carbohydrateContent", - "total": 76.22889571, - "hasRDI": true, - "daily": 25.409631903333334, - "unit": "g", - "sub": [ - { - "label": "Carbs (net)", - "tag": "CHOCDF.net", - "schemaOrgTag": null, - "total": 60.676895710000004, - "hasRDI": false, - "daily": 0, - "unit": "g" - }, - { - "label": "Fiber", - "tag": "FIBTG", - "schemaOrgTag": "fiberContent", - "total": 15.552, - "hasRDI": true, - "daily": 62.208, - "unit": "g" - }, - { - "label": "Sugars", - "tag": "SUGAR", - "schemaOrgTag": "sugarContent", - "total": 36.55892, - "hasRDI": false, - "daily": 0, - "unit": "g" - } - ] - }, - { - "label": "Protein", - "tag": "PROCNT", - "schemaOrgTag": "proteinContent", - "total": 7.337778092000001, - "hasRDI": true, - "daily": 14.675556184000001, - "unit": "g" - }, - { - "label": "Cholesterol", - "tag": "CHOLE", - "schemaOrgTag": "cholesterolContent", - "total": 30.529999999999998, - "hasRDI": true, - "daily": 10.176666666666666, - "unit": "mg" - }, - { - "label": "Sodium", - "tag": "NA", - "schemaOrgTag": "sodiumContent", - "total": 509.12513144957995, - "hasRDI": true, - "daily": 21.213547143732498, - "unit": "mg" - }, - { - "label": "Calcium", - "tag": "CA", - "schemaOrgTag": null, - "total": 224.93416334542522, - "hasRDI": true, - "daily": 22.493416334542523, - "unit": "mg" - }, - { - "label": "Magnesium", - "tag": "MG", - "schemaOrgTag": null, - "total": 97.58009130605939, - "hasRDI": true, - "daily": 24.395022826514847, - "unit": "mg" - }, - { - "label": "Potassium", - "tag": "K", - "schemaOrgTag": null, - "total": 2279.8454262484743, - "hasRDI": true, - "daily": 65.13844074995642, - "unit": "mg" - }, - { - "label": "Iron", - "tag": "FE", - "schemaOrgTag": null, - "total": 2.5736217389995963, - "hasRDI": true, - "daily": 14.29789854999776, - "unit": "mg" - }, - { - "label": "Zinc", - "tag": "ZN", - "schemaOrgTag": null, - "total": 1.6187220126059385, - "hasRDI": true, - "daily": 10.79148008403959, - "unit": "mg" - }, - { - "label": "Phosphorus", - "tag": "P", - "schemaOrgTag": null, - "total": 286.61820279999995, - "hasRDI": true, - "daily": 40.945457542857135, - "unit": "mg" - }, - { - "label": "Vitamin A", - "tag": "VITA_RAE", - "schemaOrgTag": null, - "total": 6428.087999999999, - "hasRDI": true, - "daily": 714.232, - "unit": "µg" - }, - { - "label": "Vitamin C", - "tag": "VITC", - "schemaOrgTag": null, - "total": 48.852000000000004, - "hasRDI": true, - "daily": 81.42000000000002, - "unit": "mg" - }, - { - "label": "Thiamin (B1)", - "tag": "THIA", - "schemaOrgTag": null, - "total": 0.5106565009999999, - "hasRDI": true, - "daily": 34.04376673333333, - "unit": "mg" - }, - { - "label": "Riboflavin (B2)", - "tag": "RIBF", - "schemaOrgTag": null, - "total": 0.38566600399999995, - "hasRDI": true, - "daily": 22.686235529411764, - "unit": "mg" - }, - { - "label": "Niacin (B3)", - "tag": "NIA", - "schemaOrgTag": null, - "total": 6.169023102, - "hasRDI": true, - "daily": 30.84511551, - "unit": "mg" - }, - { - "label": "Vitamin B6", - "tag": "VITB6A", - "schemaOrgTag": null, - "total": 1.168398008, - "hasRDI": true, - "daily": 58.4199004, - "unit": "mg" - }, - { - "label": "Folic Acid (B9)", - "tag": "FOL", - "schemaOrgTag": null, - "total": 108.2818012, - "hasRDI": true, - "daily": 27.0704503, - "unit": "µg" - }, - { - "label": "Vitamin B12", - "tag": "VITB12", - "schemaOrgTag": null, - "total": 0.043126003999999996, - "hasRDI": true, - "daily": 0.7187667333333332, - "unit": "µg" - }, - { - "label": "Vitamin D", - "tag": "VITD", - "schemaOrgTag": null, - "total": 0.21299999999999997, - "hasRDI": true, - "daily": 0.05324999999999999, - "unit": "µg" - }, - { - "label": "Vitamin E", - "tag": "TOCPHA", - "schemaOrgTag": null, - "total": 6.287839999999999, - "hasRDI": true, - "daily": 31.439199999999992, - "unit": "mg" - }, - { - "label": "Vitamin K", - "tag": "VITK1", - "schemaOrgTag": null, - "total": 101.99, - "hasRDI": true, - "daily": 127.4875, - "unit": "µg" - } - ] - }, - "bookmarked": false, - "bought": false - }, \ No newline at end of file From 81b7e0e17839fe3780494c72fbfbdeadb0a911c8 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 14:14:39 -0700 Subject: [PATCH 41/88] added search to show method --- app/controllers/recipe_searches_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/recipe_searches_controller.rb b/app/controllers/recipe_searches_controller.rb index 1aceff8c4..29a3ed8df 100644 --- a/app/controllers/recipe_searches_controller.rb +++ b/app/controllers/recipe_searches_controller.rb @@ -2,11 +2,13 @@ class RecipeSearchesController < ApplicationController def index end - def show + def show(keyword, my_app_id = nil, my_app_key = nil, list_start = 0, list_end = 10) + @search = RecipeSearchWrapper.search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil) + return @search end def new - + @search = RecipeSearchWrapper.new end def create From 143f0fa70c774e6452b95a36dcb35393aa355673 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 14:15:07 -0700 Subject: [PATCH 42/88] added rudimentary form, incomplete --- app/views/recipe_searches/index.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/recipe_searches/index.html.erb b/app/views/recipe_searches/index.html.erb index 7849e2902..c80e9855d 100644 --- a/app/views/recipe_searches/index.html.erb +++ b/app/views/recipe_searches/index.html.erb @@ -1,2 +1,6 @@ -

RecipeSearches#index

-

Find me in app/views/recipe_searches/index.html.erb

+

Recipe Searches

+ +<%= form, url: 'show_path' |f| %> +<%= f.label, "Recipe Keyword" %> +<%= f.string %> +<%= f.submit, "Search" %> From 0e23b88f30284df046563fd2c1e6fe8e4157629d Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 14:15:28 -0700 Subject: [PATCH 43/88] call partial --- app/views/recipe_searches/show.html.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/recipe_searches/show.html.erb b/app/views/recipe_searches/show.html.erb index 44a67e248..f39474256 100644 --- a/app/views/recipe_searches/show.html.erb +++ b/app/views/recipe_searches/show.html.erb @@ -1,2 +1,4 @@ -

RecipeSearches#show

-

Find me in app/views/recipe_searches/show.html.erb

+

Recipe Searches

+ +<%= render partial 'search' %> + From 487bf4af67447d5e1e4901ac1b7a904611799814 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 14:15:45 -0700 Subject: [PATCH 44/88] added routes --- config/routes.rb | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 31ab98cff..9cf6f3e3c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,29 +1,19 @@ Rails.application.routes.draw do - get 'recipe_searches/index' + root: 'recipe_searches#index' + get 'recipe_searches/index' => 'recipe_searches#index' - get 'recipe_searches/show' + get 'recipe_searches/show' => 'recipe_searches#show', as: 'show' - get 'recipe_searches/new' + get 'recipe_searches/new' => 'recipe_searches#new' - get 'recipe_searches/create' + get 'recipe_searches/create' => 'recipe_searches#create' - get 'recipe_searches/edit' + get 'recipe_searches/edit' => 'recipe_searches#edit' - get 'recipe_searches/update' + get 'recipe_searches/update' => 'recipe_searches#update' get 'recipe_searches/destroy' - get 'recipe_searches/index' - - get 'recipe_searches/show' - - get 'recipe_searches/new' - - get 'recipe_searches/edit' - - get 'recipe_searches/update' - - get 'recipe_searches/destroy' get 'users/index' => 'users#index' From bfc15b88aec05120db4062ca22c2ab2a4db2d44f Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 14:16:16 -0700 Subject: [PATCH 45/88] updated initialize information to include ingredients, calories etc --- lib/recipe_result.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/recipe_result.rb b/lib/recipe_result.rb index a06c3255a..b3f9b7b3f 100644 --- a/lib/recipe_result.rb +++ b/lib/recipe_result.rb @@ -5,9 +5,8 @@ # require_relative 'recipe_search_wrapper' class RecipeResult - attr_reader :uri, :label, :image, :shareas - - def initialize(uri, label, image, shareas) + attr_reader :uri, :label, :image, :shareas, :ingredientsLines + def initialize(uri, label, image, url, shareas, ingredientsLines, calories, totalNutrients) if uri == nil || uri == "" || label == nil || label == "" raise ArgumentError end @@ -15,8 +14,11 @@ def initialize(uri, label, image, shareas) @uri = uri #aka id @label = label @image = image + @url = url @shareas = shareas #link to the recipe on edamam website, as opposed to the source website - + @ingredientsLines = ingredientsLines + @calories = calories + @totalNutrients = totalNutrients end From f93914cdc46c9699640cfe5068862ef60a24defa Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 14:16:49 -0700 Subject: [PATCH 46/88] added pagination possibilities, added ingredients, calories etc to results --- lib/recipe_search_wrapper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/recipe_search_wrapper.rb b/lib/recipe_search_wrapper.rb index 489c82d0b..a715c5ed0 100644 --- a/lib/recipe_search_wrapper.rb +++ b/lib/recipe_search_wrapper.rb @@ -34,11 +34,11 @@ def initialize(uri, label, image, shareas) #helps users find recipes by an ingredient - def self.search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil) + def search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil, list_start = 0, list_end = 10) my_app_id ||= APP_ID my_app_key ||= APP_KEY - url = BASE_URL + "q=#{keyword}" + "&app_id=#{my_app_id}" + "&app_key=#{my_app_key}" + url = BASE_URL + "q=#{keyword}" + "&app_id=#{my_app_id}" + "&app_key=#{my_app_key}" + "&from=#{list_start}" + "&to=#{list_end}" #THIS IS WHERE THE MAGIC HAPPENS, MY JSON HASH data = HTTParty.get(url) @@ -51,7 +51,7 @@ def self.search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil) results_array = data["hits"] results_array.each do |result| - wrapper = RecipeResult.new(result["recipe"]["uri"], result["recipe"]["label"], result["recipe"]["image"], result["recipe"]["shareas"]) + wrapper = RecipeResult.new(result["recipe"]["uri"], result["recipe"]["label"], result["recipe"]["image"], result["recipe"]["result"], ["recipe"]["shareas"], result["recipe"]["ingredientsLines"], result["recipe"]["calories"], result["recipe"]["totalNutrients"]) recipes << wrapper end From 1a30a6fa359e5b9e79e55d60242b521df7af17f1 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 14:17:02 -0700 Subject: [PATCH 47/88] added search partial --- app/views/recipe_searches/_search.html.erb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/views/recipe_searches/_search.html.erb diff --git a/app/views/recipe_searches/_search.html.erb b/app/views/recipe_searches/_search.html.erb new file mode 100644 index 000000000..7722aa9c8 --- /dev/null +++ b/app/views/recipe_searches/_search.html.erb @@ -0,0 +1,14 @@ +<%= @search.each do |recipe| %> +
+
    +
  • recipe.label
  • +
  • recipe.ingredientsLines
  • + <% recipe.totalNutrients.each do |nutrient| %> +
  • nutrient.label
  • +
  • nutrient.quantity nutrient.unit
  • + <% end %> +
+
+<% end %> + + \ No newline at end of file From 56c629d82bb79dcf68f2abb6d5ce5e862f0b9b22 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 15:27:08 -0700 Subject: [PATCH 48/88] swapped out recipe_searches controller for recipes controller --- ...{recipe_searches.coffee => recipes.coffee} | 0 .../{recipe_searches.scss => recipes.scss} | 2 +- app/controllers/recipe_searches_controller.rb | 25 ----------- app/controllers/recipes_controller.rb | 25 +++++++++++ app/helpers/recipe_searches_helper.rb | 2 - app/helpers/recipes_helper.rb | 2 + app/views/recipe_searches/_search.html.erb | 14 ------ app/views/recipe_searches/create.html.erb | 2 - app/views/recipe_searches/destroy.html.erb | 2 - app/views/recipe_searches/edit.html.erb | 2 - app/views/recipe_searches/index.html.erb | 6 --- app/views/recipe_searches/new.html.erb | 2 - app/views/recipe_searches/show.html.erb | 4 -- app/views/recipe_searches/update.html.erb | 2 - app/views/recipes/create.html.erb | 2 + app/views/recipes/destroy.html.erb | 2 + app/views/recipes/edit.html.erb | 2 + app/views/recipes/index.html.erb | 2 + app/views/recipes/new.html.erb | 2 + app/views/recipes/search.html.erb | 2 + app/views/recipes/show.html.erb | 2 + app/views/recipes/update.html.erb | 2 + config/routes.rb | 18 +++++++- .../recipe_searches_controller_test.rb | 39 ---------------- test/controllers/recipes_controller_test.rb | 44 +++++++++++++++++++ 25 files changed, 105 insertions(+), 102 deletions(-) rename app/assets/javascripts/{recipe_searches.coffee => recipes.coffee} (100%) rename app/assets/stylesheets/{recipe_searches.scss => recipes.scss} (61%) delete mode 100644 app/controllers/recipe_searches_controller.rb create mode 100644 app/controllers/recipes_controller.rb delete mode 100644 app/helpers/recipe_searches_helper.rb create mode 100644 app/helpers/recipes_helper.rb delete mode 100644 app/views/recipe_searches/_search.html.erb delete mode 100644 app/views/recipe_searches/create.html.erb delete mode 100644 app/views/recipe_searches/destroy.html.erb delete mode 100644 app/views/recipe_searches/edit.html.erb delete mode 100644 app/views/recipe_searches/index.html.erb delete mode 100644 app/views/recipe_searches/new.html.erb delete mode 100644 app/views/recipe_searches/show.html.erb delete mode 100644 app/views/recipe_searches/update.html.erb create mode 100644 app/views/recipes/create.html.erb create mode 100644 app/views/recipes/destroy.html.erb create mode 100644 app/views/recipes/edit.html.erb create mode 100644 app/views/recipes/index.html.erb create mode 100644 app/views/recipes/new.html.erb create mode 100644 app/views/recipes/search.html.erb create mode 100644 app/views/recipes/show.html.erb create mode 100644 app/views/recipes/update.html.erb delete mode 100644 test/controllers/recipe_searches_controller_test.rb create mode 100644 test/controllers/recipes_controller_test.rb diff --git a/app/assets/javascripts/recipe_searches.coffee b/app/assets/javascripts/recipes.coffee similarity index 100% rename from app/assets/javascripts/recipe_searches.coffee rename to app/assets/javascripts/recipes.coffee diff --git a/app/assets/stylesheets/recipe_searches.scss b/app/assets/stylesheets/recipes.scss similarity index 61% rename from app/assets/stylesheets/recipe_searches.scss rename to app/assets/stylesheets/recipes.scss index 6c3c2df87..1e10ffa50 100644 --- a/app/assets/stylesheets/recipe_searches.scss +++ b/app/assets/stylesheets/recipes.scss @@ -1,3 +1,3 @@ -// Place all the styles related to the recipe_searches controller here. +// Place all the styles related to the recipes 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/recipe_searches_controller.rb b/app/controllers/recipe_searches_controller.rb deleted file mode 100644 index 29a3ed8df..000000000 --- a/app/controllers/recipe_searches_controller.rb +++ /dev/null @@ -1,25 +0,0 @@ -class RecipeSearchesController < ApplicationController - def index - end - - def show(keyword, my_app_id = nil, my_app_key = nil, list_start = 0, list_end = 10) - @search = RecipeSearchWrapper.search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil) - return @search - end - - def new - @search = RecipeSearchWrapper.new - end - - def create - end - - def edit - end - - def update - end - - def destroy - end -end diff --git a/app/controllers/recipes_controller.rb b/app/controllers/recipes_controller.rb new file mode 100644 index 000000000..a4c2b0858 --- /dev/null +++ b/app/controllers/recipes_controller.rb @@ -0,0 +1,25 @@ +class RecipesController < ApplicationController + def search + end + + def index + end + + def show + end + + def new + end + + def create + end + + def edit + end + + def update + end + + def destroy + end +end diff --git a/app/helpers/recipe_searches_helper.rb b/app/helpers/recipe_searches_helper.rb deleted file mode 100644 index 911239af1..000000000 --- a/app/helpers/recipe_searches_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module RecipeSearchesHelper -end diff --git a/app/helpers/recipes_helper.rb b/app/helpers/recipes_helper.rb new file mode 100644 index 000000000..f526316e2 --- /dev/null +++ b/app/helpers/recipes_helper.rb @@ -0,0 +1,2 @@ +module RecipesHelper +end diff --git a/app/views/recipe_searches/_search.html.erb b/app/views/recipe_searches/_search.html.erb deleted file mode 100644 index 7722aa9c8..000000000 --- a/app/views/recipe_searches/_search.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<%= @search.each do |recipe| %> -
-
    -
  • recipe.label
  • -
  • recipe.ingredientsLines
  • - <% recipe.totalNutrients.each do |nutrient| %> -
  • nutrient.label
  • -
  • nutrient.quantity nutrient.unit
  • - <% end %> -
-
-<% end %> - - \ No newline at end of file diff --git a/app/views/recipe_searches/create.html.erb b/app/views/recipe_searches/create.html.erb deleted file mode 100644 index f9d578ed6..000000000 --- a/app/views/recipe_searches/create.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -

RecipeSearches#create

-

Find me in app/views/recipe_searches/create.html.erb

diff --git a/app/views/recipe_searches/destroy.html.erb b/app/views/recipe_searches/destroy.html.erb deleted file mode 100644 index 67696627b..000000000 --- a/app/views/recipe_searches/destroy.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -

RecipeSearches#destroy

-

Find me in app/views/recipe_searches/destroy.html.erb

diff --git a/app/views/recipe_searches/edit.html.erb b/app/views/recipe_searches/edit.html.erb deleted file mode 100644 index 2fdcb7852..000000000 --- a/app/views/recipe_searches/edit.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -

RecipeSearches#edit

-

Find me in app/views/recipe_searches/edit.html.erb

diff --git a/app/views/recipe_searches/index.html.erb b/app/views/recipe_searches/index.html.erb deleted file mode 100644 index c80e9855d..000000000 --- a/app/views/recipe_searches/index.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -

Recipe Searches

- -<%= form, url: 'show_path' |f| %> -<%= f.label, "Recipe Keyword" %> -<%= f.string %> -<%= f.submit, "Search" %> diff --git a/app/views/recipe_searches/new.html.erb b/app/views/recipe_searches/new.html.erb deleted file mode 100644 index 3de012e71..000000000 --- a/app/views/recipe_searches/new.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -

RecipeSearches#new

-

Find me in app/views/recipe_searches/new.html.erb

diff --git a/app/views/recipe_searches/show.html.erb b/app/views/recipe_searches/show.html.erb deleted file mode 100644 index f39474256..000000000 --- a/app/views/recipe_searches/show.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -

Recipe Searches

- -<%= render partial 'search' %> - diff --git a/app/views/recipe_searches/update.html.erb b/app/views/recipe_searches/update.html.erb deleted file mode 100644 index e4ad068fc..000000000 --- a/app/views/recipe_searches/update.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -

RecipeSearches#update

-

Find me in app/views/recipe_searches/update.html.erb

diff --git a/app/views/recipes/create.html.erb b/app/views/recipes/create.html.erb new file mode 100644 index 000000000..c3982a70a --- /dev/null +++ b/app/views/recipes/create.html.erb @@ -0,0 +1,2 @@ +

Recipes#create

+

Find me in app/views/recipes/create.html.erb

diff --git a/app/views/recipes/destroy.html.erb b/app/views/recipes/destroy.html.erb new file mode 100644 index 000000000..a4e89b3a0 --- /dev/null +++ b/app/views/recipes/destroy.html.erb @@ -0,0 +1,2 @@ +

Recipes#destroy

+

Find me in app/views/recipes/destroy.html.erb

diff --git a/app/views/recipes/edit.html.erb b/app/views/recipes/edit.html.erb new file mode 100644 index 000000000..101388455 --- /dev/null +++ b/app/views/recipes/edit.html.erb @@ -0,0 +1,2 @@ +

Recipes#edit

+

Find me in app/views/recipes/edit.html.erb

diff --git a/app/views/recipes/index.html.erb b/app/views/recipes/index.html.erb new file mode 100644 index 000000000..a55bf9993 --- /dev/null +++ b/app/views/recipes/index.html.erb @@ -0,0 +1,2 @@ +

Recipes#index

+

Find me in app/views/recipes/index.html.erb

diff --git a/app/views/recipes/new.html.erb b/app/views/recipes/new.html.erb new file mode 100644 index 000000000..4590c48fc --- /dev/null +++ b/app/views/recipes/new.html.erb @@ -0,0 +1,2 @@ +

Recipes#new

+

Find me in app/views/recipes/new.html.erb

diff --git a/app/views/recipes/search.html.erb b/app/views/recipes/search.html.erb new file mode 100644 index 000000000..9b00299d8 --- /dev/null +++ b/app/views/recipes/search.html.erb @@ -0,0 +1,2 @@ +

Recipes#search

+

Find me in app/views/recipes/search.html.erb

diff --git a/app/views/recipes/show.html.erb b/app/views/recipes/show.html.erb new file mode 100644 index 000000000..3c5ef29cd --- /dev/null +++ b/app/views/recipes/show.html.erb @@ -0,0 +1,2 @@ +

Recipes#show

+

Find me in app/views/recipes/show.html.erb

diff --git a/app/views/recipes/update.html.erb b/app/views/recipes/update.html.erb new file mode 100644 index 000000000..6243b5d1b --- /dev/null +++ b/app/views/recipes/update.html.erb @@ -0,0 +1,2 @@ +

Recipes#update

+

Find me in app/views/recipes/update.html.erb

diff --git a/config/routes.rb b/config/routes.rb index 9cf6f3e3c..f8dfadfb3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,21 @@ Rails.application.routes.draw do - root: 'recipe_searches#index' + get 'recipes/search' + + get 'recipes/index' + + get 'recipes/show' + + get 'recipes/new' + + get 'recipes/create' + + get 'recipes/edit' + + get 'recipes/update' + + get 'recipes/destroy' + + root 'recipe_searches#index' get 'recipe_searches/index' => 'recipe_searches#index' get 'recipe_searches/show' => 'recipe_searches#show', as: 'show' diff --git a/test/controllers/recipe_searches_controller_test.rb b/test/controllers/recipe_searches_controller_test.rb deleted file mode 100644 index 32940a32a..000000000 --- a/test/controllers/recipe_searches_controller_test.rb +++ /dev/null @@ -1,39 +0,0 @@ -require 'test_helper' - -class RecipeSearchesControllerTest < ActionController::TestCase - # test "should get index" do - # get :index - # assert_response :success - # end - - # test "should get show" do - # get :show - # assert_response :success - # end - - # test "should get new" do - # get :new - # assert_response :success - # end - - # test "should get create" do - # get :create - # assert_response :success - # end - - # test "should get edit" do - # get :edit - # assert_response :success - # end - - # test "should get update" do - # get :update - # assert_response :success - # end - - # test "should get destroy" do - # get :destroy - # assert_response :success - # end - -end diff --git a/test/controllers/recipes_controller_test.rb b/test/controllers/recipes_controller_test.rb new file mode 100644 index 000000000..590b06c39 --- /dev/null +++ b/test/controllers/recipes_controller_test.rb @@ -0,0 +1,44 @@ +require 'test_helper' + +class RecipesControllerTest < ActionController::TestCase + test "should get search" do + get :search + assert_response :success + end + + test "should get index" do + get :index + assert_response :success + end + + test "should get show" do + get :show + assert_response :success + end + + test "should get new" do + get :new + assert_response :success + end + + test "should get create" do + get :create + assert_response :success + end + + test "should get edit" do + get :edit + assert_response :success + end + + test "should get update" do + get :update + assert_response :success + end + + test "should get destroy" do + get :destroy + assert_response :success + end + +end From e4c916aea53d67db1c630e4f4209db5777a3a4df Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 15:35:07 -0700 Subject: [PATCH 49/88] added search method --- app/controllers/recipes_controller.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/controllers/recipes_controller.rb b/app/controllers/recipes_controller.rb index a4c2b0858..b09c9e302 100644 --- a/app/controllers/recipes_controller.rb +++ b/app/controllers/recipes_controller.rb @@ -1,8 +1,23 @@ class RecipesController < ApplicationController def search + + def search + @search = RecipeSearchWrapper.search_by_one_keyword(params[:query], list_start = 0, list_end = 10) + redirect_to root_path and return @search + end + # def self.search(keyword, my_app_id = nil, my_app_key = nil, list_start = 0, list_end = 10) + # @search = RecipeSearchWrapper.search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil) + # redirect_to root_path and return @search + # end + + # @products = Product.search(params[:query]) +# # if product query matches a product(s) +# # render those image(s), if any match. +# render :index end def index + end def show From c6ab9448f926ff7a9faf498acb4ff393efd47c9f Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 15:35:31 -0700 Subject: [PATCH 50/88] added index view --- app/views/recipes/index.html.erb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/app/views/recipes/index.html.erb b/app/views/recipes/index.html.erb index a55bf9993..a378a7dd2 100644 --- a/app/views/recipes/index.html.erb +++ b/app/views/recipes/index.html.erb @@ -1,2 +1,18 @@ -

Recipes#index

-

Find me in app/views/recipes/index.html.erb

+<% unless @search == nil %> + <%= @search.each do |recipe| %> +
+
    +
  • recipe.label
  • +
  • recipe.ingredientsLines
  • + + <% recipe.totalNutrients.each do |nutrient| %> +
  • nutrient.label
  • +
  • nutrient.quantity nutrient.unit
  • + <% end %> + +
+
+ <% end %> +<% end %> + +<%= render partial: 'search' %> \ No newline at end of file From 6976a7356030cc44d6a184b0ad37adb4e15e8bcc Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 15:36:01 -0700 Subject: [PATCH 51/88] added search --- app/views/recipes/search.html.erb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/views/recipes/search.html.erb b/app/views/recipes/search.html.erb index 9b00299d8..5341771da 100644 --- a/app/views/recipes/search.html.erb +++ b/app/views/recipes/search.html.erb @@ -1,2 +1,11 @@ -

Recipes#search

-

Find me in app/views/recipes/search.html.erb

+

Recipe Search

+ + +
+

Find a Recipe

+ <%= form_tag(search_path(), :method => "get") do %> + <%= search_field_tag("query", nil, :placeholder => "Recipe Keyword")%> + <%= submit_tag "Search", :name => nil, class: 'button' %> + <% end %> +
+ From 7f2c0ec72db1edea1e50a99bae39d718a1a98049 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 15:36:23 -0700 Subject: [PATCH 52/88] added recipes routes, deleted recipe_searches routes --- config/routes.rb | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index f8dfadfb3..f8a600721 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,9 +1,14 @@ Rails.application.routes.draw do - get 'recipes/search' - get 'recipes/index' +root 'recipes#index' - get 'recipes/show' + #******** RECIPES ROUTES ********* + + get 'recipes/search' => 'recipes#search', as: 'search' + + get 'recipes' => 'recipes#index', as: 'index' + + get 'recipes/show' => 'recipes#show', as: 'show' get 'recipes/new' @@ -15,20 +20,7 @@ get 'recipes/destroy' - root 'recipe_searches#index' - get 'recipe_searches/index' => 'recipe_searches#index' - - get 'recipe_searches/show' => 'recipe_searches#show', as: 'show' - - get 'recipe_searches/new' => 'recipe_searches#new' - - get 'recipe_searches/create' => 'recipe_searches#create' - - get 'recipe_searches/edit' => 'recipe_searches#edit' - - get 'recipe_searches/update' => 'recipe_searches#update' - - get 'recipe_searches/destroy' + #******** USERS ROUTES ********* get 'users/index' => 'users#index' From 8a1dcdee0a3c4aff69387c1fbda57a4e121b69c2 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Thu, 3 Nov 2016 15:36:35 -0700 Subject: [PATCH 53/88] added search partial --- app/views/recipes/_search.html.erb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/views/recipes/_search.html.erb diff --git a/app/views/recipes/_search.html.erb b/app/views/recipes/_search.html.erb new file mode 100644 index 000000000..b6eed216d --- /dev/null +++ b/app/views/recipes/_search.html.erb @@ -0,0 +1,18 @@ +

Recipe Searches

+ + +
+

Find a Recipe

+ <%= form_tag(search_path(), :method => "get") do %> + <%= search_field_tag("query", nil, :placeholder => "Recipe Keyword")%> + <%= submit_tag "Search", :name => nil, class: 'button' %> + <% end %> +
+ + + \ No newline at end of file From c44479f349ff3d045ec0949997fe5fe0813fb4d0 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 08:52:07 -0700 Subject: [PATCH 54/88] tweaked search method, wrote notes about show method --- app/controllers/recipes_controller.rb | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/app/controllers/recipes_controller.rb b/app/controllers/recipes_controller.rb index b09c9e302..87b59552e 100644 --- a/app/controllers/recipes_controller.rb +++ b/app/controllers/recipes_controller.rb @@ -1,9 +1,11 @@ + class RecipesController < ApplicationController - def search + def search - @search = RecipeSearchWrapper.search_by_one_keyword(params[:query], list_start = 0, list_end = 10) - redirect_to root_path and return @search + @results = RecipeSearchWrapper.search_by_one_keyword(params[:query]) + # binding.pry + return render :index end # def self.search(keyword, my_app_id = nil, my_app_key = nil, list_start = 0, list_end = 10) # @search = RecipeSearchWrapper.search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil) @@ -14,13 +16,27 @@ def search # # if product query matches a product(s) # # render those image(s), if any match. # render :index - end + # end def index end + def flip_page + + end + def show + #paginate with @hit in the list_start local? + @result = RecipeSearchWrapper.search_by_one_keyword(params["search_term"], params["hit_num"].to_i, params["hit_num"].to_i) + @uri = params["uri"] #aka id + @label = params["label"] + @image = params["image"] + @url = params["url"] + @shareas = params["shareas"] #link to the recipe on edamam website, as opposed to the source website + @ingredientsLines = params["ingredientsLines"] + @calories = params["calories"] + @totalNutrients = params["totalNutrients"] end def new From d82e3a685d659c6eae73264a253234f4bb1ce1ac Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 08:52:52 -0700 Subject: [PATCH 55/88] tweaked view --- app/views/recipes/_search.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/recipes/_search.html.erb b/app/views/recipes/_search.html.erb index b6eed216d..9313f2ff9 100644 --- a/app/views/recipes/_search.html.erb +++ b/app/views/recipes/_search.html.erb @@ -10,9 +10,9 @@ - \ No newline at end of file +<% end %> \ No newline at end of file From d3a2a30512d42d0478b6fb43b8f851b6f915ec0b Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 08:53:11 -0700 Subject: [PATCH 56/88] rudimentary show view --- app/views/recipes/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/recipes/show.html.erb b/app/views/recipes/show.html.erb index 3c5ef29cd..b06cea291 100644 --- a/app/views/recipes/show.html.erb +++ b/app/views/recipes/show.html.erb @@ -1,2 +1,2 @@ -

Recipes#show

-

Find me in app/views/recipes/show.html.erb

+

meep<%= @result %>

+ From a2c8551c4c8e9884a5803cfd8bf3478969d5b535 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 08:53:32 -0700 Subject: [PATCH 57/88] added autoload lib --- config/application.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/application.rb b/config/application.rb index 20568697a..4ecc7a04a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,5 +22,6 @@ class Application < Rails::Application # Do not swallow errors in after_commit/after_rollback callbacks. config.active_record.raise_in_transactional_callbacks = true + config.autoload_paths << Rails.root.join('lib') end end From 0604d7db1bdff16afd9c029ff7e5d2da210537cf Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 08:54:22 -0700 Subject: [PATCH 58/88] added additional json info for wrapper --- lib/recipe_search_wrapper.rb | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/lib/recipe_search_wrapper.rb b/lib/recipe_search_wrapper.rb index a715c5ed0..32285e515 100644 --- a/lib/recipe_search_wrapper.rb +++ b/lib/recipe_search_wrapper.rb @@ -24,21 +24,27 @@ class RecipeSearchWrapper #CREATE A WRAPPER - def initialize(uri, label, image, shareas) + def initialize(uri, label, image, url, shareas, ingredientLines, calories, totalNutrients, hit_num, search_term) @uri = uri #aka id @label = label @image = image @shareas = shareas #link to the recipe on edamam website, as opposed to the source website + @ingredientLines = ingredientLines + @calories = calories + @totalNutrients = totalNutrients + @hit_num = hit_num + @search_term = search_term end #helps users find recipes by an ingredient - def search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil, list_start = 0, list_end = 10) + def self.search_by_one_keyword(keyword, list_start = 0, list_end = 10, my_app_id = nil, my_app_key = nil) my_app_id ||= APP_ID my_app_key ||= APP_KEY - url = BASE_URL + "q=#{keyword}" + "&app_id=#{my_app_id}" + "&app_key=#{my_app_key}" + "&from=#{list_start}" + "&to=#{list_end}" + url = BASE_URL + "q=#{keyword}" + "&app_id=#{my_app_id}" + "&app_key=#{my_app_key}" + "&from=#{list_start}" + + "&to=#{list_end}" #THIS IS WHERE THE MAGIC HAPPENS, MY JSON HASH data = HTTParty.get(url) @@ -50,9 +56,15 @@ def search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil, list_start results_array = data["hits"] + hit_num = 1 + results_array.each do |result| - wrapper = RecipeResult.new(result["recipe"]["uri"], result["recipe"]["label"], result["recipe"]["image"], result["recipe"]["result"], ["recipe"]["shareas"], result["recipe"]["ingredientsLines"], result["recipe"]["calories"], result["recipe"]["totalNutrients"]) + #@hit? use a counter to give hit numbers? and then when showing, pass the hit number as the list_start argument? + + wrapper = RecipeResult.new(result["recipe"]["uri"], result["recipe"]["label"], result["recipe"]["image"], result["recipe"]["url"], result["recipe"]["shareas"], result["recipe"]["ingredientLines"], result["recipe"]["calories"], result["recipe"]["totalNutrients"], hit_num, keyword) + # wrapper = RecipeResult.new(result["recipe"]["uri"], result["recipe"]["label"], result["recipe"]["image"], result["recipe"]["url"]) recipes << wrapper + hit_num += 1 end return recipes @@ -64,7 +76,10 @@ def search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil, list_start end end -# end +def self.show_just_one_recipe + + +end def self.search_sample @@ -105,7 +120,7 @@ def self.search_sample # test = RecipeSearchWrapper.search_sample -test = RecipeSearchWrapper.search_by_one_keyword("carrots") +test = RecipeSearchWrapper.search_by_one_keyword("carrots", 3, 3) puts test puts test.class From 8bde1fdc78cc0578d1a8335396089087821a8739 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 08:54:51 -0700 Subject: [PATCH 59/88] added additional attributes, fixed typo --- lib/recipe_result.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/recipe_result.rb b/lib/recipe_result.rb index b3f9b7b3f..57b9e941c 100644 --- a/lib/recipe_result.rb +++ b/lib/recipe_result.rb @@ -5,8 +5,10 @@ # require_relative 'recipe_search_wrapper' class RecipeResult - attr_reader :uri, :label, :image, :shareas, :ingredientsLines - def initialize(uri, label, image, url, shareas, ingredientsLines, calories, totalNutrients) + attr_reader :uri, :label, :image, :url, :shareas, :ingredientLines, :calories, :totalNutrients, :hit_num, :search_term + # def initialize(uri, label, image, url) + def initialize(uri, label, image, url, shareas, ingredientLines, calories, totalNutrients, hit_num, search_term) + if uri == nil || uri == "" || label == nil || label == "" raise ArgumentError end @@ -16,9 +18,11 @@ def initialize(uri, label, image, url, shareas, ingredientsLines, calories, tota @image = image @url = url @shareas = shareas #link to the recipe on edamam website, as opposed to the source website - @ingredientsLines = ingredientsLines + @ingredientLines = ingredientLines @calories = calories @totalNutrients = totalNutrients + @hit_num = hit_num + @search_term = search_term end From 99b0fea01e01f58750293f90fe745cee8ad30f40 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 08:55:51 -0700 Subject: [PATCH 60/88] fixed typo, added search box code instead of partial, removed details from view --- app/views/recipes/index.html.erb | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/app/views/recipes/index.html.erb b/app/views/recipes/index.html.erb index a378a7dd2..978d6e057 100644 --- a/app/views/recipes/index.html.erb +++ b/app/views/recipes/index.html.erb @@ -1,18 +1,22 @@ -<% unless @search == nil %> - <%= @search.each do |recipe| %> +<% unless @results == nil %> + <% @results.each do |recipe| %>
    -
  • recipe.label
  • -
  • recipe.ingredientsLines
  • - - <% recipe.totalNutrients.each do |nutrient| %> -
  • nutrient.label
  • -
  • nutrient.quantity nutrient.unit
  • - <% end %> - +
  • <%= link_to recipe.label, recipe.url, target: "_blank" %>
  • +
  • show <%= link_to recipe.label, show_path(recipe.search_term, recipe.hit_num, recipe.hit_num), target: "_blank" %>
<% end %> <% end %> -<%= render partial: 'search' %> \ No newline at end of file +

Recipe Search

+ + +
+

Find a Recipe

+ <%= form_tag(search_path(), :method => "get") do %> + <%= search_field_tag("query", nil, :placeholder => "Recipe Keyword")%> + <%= submit_tag "Search", :name => nil, class: 'button' %> + <% end %> +
+ From 41426fb9286532180410eae027da5fef980a175f Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 10:32:35 -0700 Subject: [PATCH 61/88] added code to keep VCR from recording my app_key --- test/test_helper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_helper.rb b/test/test_helper.rb index 7b8b209e7..f89485dc4 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -23,6 +23,14 @@ class ActiveSupport::TestCase config.default_cassette_options = { :record => :new_episodes # record new data when we don't have it yet } + + config.filter_sensitive_data("") do + ENV['API_ID'] + end + + config.filter_sensitive_data("") do + ENV['API_KEY'] + end end end From c342167751869ddb9be926ce4f82a00d247eaa8a Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 12:54:12 -0700 Subject: [PATCH 62/88] working show method --- app/controllers/recipes_controller.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/controllers/recipes_controller.rb b/app/controllers/recipes_controller.rb index 87b59552e..d7026eb59 100644 --- a/app/controllers/recipes_controller.rb +++ b/app/controllers/recipes_controller.rb @@ -28,15 +28,8 @@ def flip_page def show #paginate with @hit in the list_start local? - @result = RecipeSearchWrapper.search_by_one_keyword(params["search_term"], params["hit_num"].to_i, params["hit_num"].to_i) - @uri = params["uri"] #aka id - @label = params["label"] - @image = params["image"] - @url = params["url"] - @shareas = params["shareas"] #link to the recipe on edamam website, as opposed to the source website - @ingredientsLines = params["ingredientsLines"] - @calories = params["calories"] - @totalNutrients = params["totalNutrients"] + @result = RecipeSearchWrapper.show_just_one_recipe(params[:id]) + end def new @@ -54,3 +47,4 @@ def update def destroy end end + From a04b1a5036f8f3724b8c4fac3c1ded53662e3bdd Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 12:54:58 -0700 Subject: [PATCH 63/88] renamed paths, working link to show --- app/views/recipes/index.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/recipes/index.html.erb b/app/views/recipes/index.html.erb index 978d6e057..068fc3ae6 100644 --- a/app/views/recipes/index.html.erb +++ b/app/views/recipes/index.html.erb @@ -2,8 +2,8 @@ <% @results.each do |recipe| %>
    -
  • <%= link_to recipe.label, recipe.url, target: "_blank" %>
  • -
  • show <%= link_to recipe.label, show_path(recipe.search_term, recipe.hit_num, recipe.hit_num), target: "_blank" %>
  • +
  • <%= link_to recipe.label, recipes_show_path(recipe.uri), target: "_blank" %>
  • +
<% end %> @@ -14,7 +14,7 @@

Find a Recipe

- <%= form_tag(search_path(), :method => "get") do %> + <%= form_tag(recipes_search_path(), :method => "get") do %> <%= search_field_tag("query", nil, :placeholder => "Recipe Keyword")%> <%= submit_tag "Search", :name => nil, class: 'button' %> <% end %> From 7b782ce95c7256cba36afa7d7ee93ca3f7e6e381 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 12:55:20 -0700 Subject: [PATCH 64/88] working show view --- app/views/recipes/show.html.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/recipes/show.html.erb b/app/views/recipes/show.html.erb index b06cea291..33abdc328 100644 --- a/app/views/recipes/show.html.erb +++ b/app/views/recipes/show.html.erb @@ -1,2 +1,8 @@ -

meep<%= @result %>

+

<%= @result.label %>

+
    + <% @result.ingredients.each do |ingredient| %> +
  • <%= ingredient['text'] %> + <% end %> +
+ <%= button_to "Back", root_path, method: :get, class: 'button' %> \ No newline at end of file From 8a16ba091c135d2f52428f930c2c341361d73b55 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 12:56:05 -0700 Subject: [PATCH 65/88] streamlined initialize, cleaned up attr, cleaned up uri for search functionality --- lib/recipe_result.rb | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/lib/recipe_result.rb b/lib/recipe_result.rb index 57b9e941c..8617bc055 100644 --- a/lib/recipe_result.rb +++ b/lib/recipe_result.rb @@ -5,24 +5,36 @@ # require_relative 'recipe_search_wrapper' class RecipeResult - attr_reader :uri, :label, :image, :url, :shareas, :ingredientLines, :calories, :totalNutrients, :hit_num, :search_term + attr_reader :uri, :label, :image, :url, :shareas, :ingredients, :calories, :totalNutrients # def initialize(uri, label, image, url) - def initialize(uri, label, image, url, shareas, ingredientLines, calories, totalNutrients, hit_num, search_term) + def initialize(recipe_details) - if uri == nil || uri == "" || label == nil || label == "" + @label = recipe_details['label'] + + + @uri = "" + real_uri = false + + recipe_details['uri'].each_char do |character| + if character == "_" + real_uri = true + end + + if real_uri + @uri << character + end + end + + if @uri == nil || @uri == "" || @label == nil || @label == "" raise ArgumentError end - @uri = uri #aka id - @label = label - @image = image - @url = url - @shareas = shareas #link to the recipe on edamam website, as opposed to the source website - @ingredientLines = ingredientLines - @calories = calories - @totalNutrients = totalNutrients - @hit_num = hit_num - @search_term = search_term + @image = recipe_details['image'] + @url = recipe_details['url'] + @shareas = recipe_details['shareas'] #link to the recipe on edamam website, as opposed to the source website + @ingredients = recipe_details['ingredients'] + @calories = recipe_details['calories'] + @totalNutrients = recipe_details['totalNutrients'] end From ae8684f5cb6b95930a7886c05c0de9fbacf15da8 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 12:57:44 -0700 Subject: [PATCH 66/88] cleaned up URL, streamlined RecipeResult creation, show method based on uri --- lib/recipe_search_wrapper.rb | 101 +++++++++++++++++------------------ 1 file changed, 50 insertions(+), 51 deletions(-) diff --git a/lib/recipe_search_wrapper.rb b/lib/recipe_search_wrapper.rb index 32285e515..2e21d1b4b 100644 --- a/lib/recipe_search_wrapper.rb +++ b/lib/recipe_search_wrapper.rb @@ -7,7 +7,7 @@ require_relative 'sample-recipe-result' class RecipeSearchWrapper - attr_reader :uri, :label, :image, :shareas + attr_reader :uri, :label, :image, :shareas, :url, :ingredients, :calories, :totalNutrients @@ -24,47 +24,35 @@ class RecipeSearchWrapper #CREATE A WRAPPER - def initialize(uri, label, image, url, shareas, ingredientLines, calories, totalNutrients, hit_num, search_term) + def initialize(uri) @uri = uri #aka id - @label = label - @image = image - @shareas = shareas #link to the recipe on edamam website, as opposed to the source website - @ingredientLines = ingredientLines - @calories = calories - @totalNutrients = totalNutrients - @hit_num = hit_num - @search_term = search_term end #helps users find recipes by an ingredient - def self.search_by_one_keyword(keyword, list_start = 0, list_end = 10, my_app_id = nil, my_app_key = nil) + def self.search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil) my_app_id ||= APP_ID my_app_key ||= APP_KEY - url = BASE_URL + "q=#{keyword}" + "&app_id=#{my_app_id}" + "&app_key=#{my_app_key}" + "&from=#{list_start}" - + "&to=#{list_end}" + url = BASE_URL + "q=#{keyword}" + "&app_id=#{my_app_id}" + "&app_key=#{my_app_key}" #THIS IS WHERE THE MAGIC HAPPENS, MY JSON HASH data = HTTParty.get(url) recipes = [] - if data["hits"] results_array = data["hits"] - hit_num = 1 - results_array.each do |result| - #@hit? use a counter to give hit numbers? and then when showing, pass the hit number as the list_start argument? - wrapper = RecipeResult.new(result["recipe"]["uri"], result["recipe"]["label"], result["recipe"]["image"], result["recipe"]["url"], result["recipe"]["shareas"], result["recipe"]["ingredientLines"], result["recipe"]["calories"], result["recipe"]["totalNutrients"], hit_num, keyword) - # wrapper = RecipeResult.new(result["recipe"]["uri"], result["recipe"]["label"], result["recipe"]["image"], result["recipe"]["url"]) + wrapper = RecipeResult.new(result["recipe"]) + recipes << wrapper - hit_num += 1 + + # binding.pry end return recipes @@ -76,58 +64,69 @@ def self.search_by_one_keyword(keyword, list_start = 0, list_end = 10, my_app_i end end -def self.show_just_one_recipe +def self.show_just_one_recipe(recipe_uri) + my_app_id ||= APP_ID + my_app_key ||= APP_KEY + + url = BASE_URL + "r=http://www.edamam.com/ontologies/edamam.owl%23recipe#{recipe_uri}" + "&app_id=#{my_app_id}" + "&app_key=#{my_app_key}" + #THIS IS WHERE THE MAGIC HAPPENS, MY JSON HASH + data = HTTParty.get(url) + + + recipe = RecipeResult.new(data.first) + + return recipe end - def self.search_sample + # def self.search_sample - recipe_results_hash = Sample::SAMPLE_RECIPE + # recipe_results_hash = Sample::SAMPLE_RECIPE - results_array = recipe_results_hash[:hits] + # results_array = recipe_results_hash[:hits] - if results_array - recipes = [] + # if results_array + # recipes = [] - results_array.each do |result| - uri = result[:recipe][:uri] - label = result[:recipe][:label] + # results_array.each do |result| + # uri = result[:recipe][:uri] + # label = result[:recipe][:label] - wrapper = RecipeResult.new(uri, label) - # x = uri - # y = label - # x = uri.class - # y = label.class - recipes << wrapper - # recipes << x - # recipes << y - end + # wrapper = RecipeResult.new(uri, label) + # # x = uri + # # y = label + # # x = uri.class + # # y = label.class + # recipes << wrapper + # # recipes << x + # # recipes << y + # end - return recipes + # return recipes - else + # else - return nil + # return nil - end - end + # end + # end end # test = RecipeSearchWrapper.search_sample -test = RecipeSearchWrapper.search_by_one_keyword("carrots", 3, 3) +# test = RecipeSearchWrapper.search_by_one_keyword("chocolate", 3, 4) -puts test -puts test.class - -test.each do |recipe| - puts recipe.uri - puts recipe.label -end +# puts test +# puts test.class +# test.each do |recipe| +# puts recipe.uri +# puts recipe.label +# end +# result = RecipeSearchWrapper.show_just_one_recipe("chocolate", 3, 4) From 63da273a133c60883aa2fcbdbcd96d1c3051db7b Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 12:58:06 -0700 Subject: [PATCH 67/88] renamed routes --- config/routes.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index f8a600721..7e1eaff72 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,11 +4,11 @@ #******** RECIPES ROUTES ********* - get 'recipes/search' => 'recipes#search', as: 'search' + get 'recipes/search' => 'recipes#search', as: 'recipes_search' - get 'recipes' => 'recipes#index', as: 'index' + get 'recipes' => 'recipes#index', as: 'recipes_index' - get 'recipes/show' => 'recipes#show', as: 'show' + get 'recipes/show/:id' => 'recipes#show', as: 'recipes_show' get 'recipes/new' From 92ff56f4c121021486d641ec085a868bcf03247e Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 13:01:43 -0700 Subject: [PATCH 68/88] added image to show page --- app/views/recipes/show.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/recipes/show.html.erb b/app/views/recipes/show.html.erb index 33abdc328..aeabd8ade 100644 --- a/app/views/recipes/show.html.erb +++ b/app/views/recipes/show.html.erb @@ -1,5 +1,6 @@

<%= @result.label %>

    +
  • <%= image_tag @result.image %>
  • <% @result.ingredients.each do |ingredient| %>
  • <%= ingredient['text'] %> <% end %> From e2f8bf6da6f380da62db2e1637e2cafc776e3a07 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 14:00:34 -0700 Subject: [PATCH 69/88] adds rounding helper that rounds floats without breaking things --- app/helpers/recipes_helper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/helpers/recipes_helper.rb b/app/helpers/recipes_helper.rb index f526316e2..e5bd02187 100644 --- a/app/helpers/recipes_helper.rb +++ b/app/helpers/recipes_helper.rb @@ -1,2 +1,10 @@ module RecipesHelper + def round_to(value, precision) + if value.is_a? Float + value.round(precision) + else + return value + end + end + end From b1ce92ce30472a66474cba90e288064e2e5eae0c Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 14:01:09 -0700 Subject: [PATCH 70/88] links to outside url, shows ingredients properly --- app/views/recipes/show.html.erb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/recipes/show.html.erb b/app/views/recipes/show.html.erb index aeabd8ade..317de6ecb 100644 --- a/app/views/recipes/show.html.erb +++ b/app/views/recipes/show.html.erb @@ -1,8 +1,15 @@ -

    <%= @result.label %>

    +

    <%= link_to @result.label, @result.url %>

    • <%= image_tag @result.image %>
    • <% @result.ingredients.each do |ingredient| %> -
    • <%= ingredient['text'] %> +
    • <%= round_to(ingredient['quantity'], 0) %> <%= ingredient['measure'].titleize %> <%= ingredient['food'].titleize %> + <% end %> + + <% @result.totalDaily.each do |key, value| %> +
    • + <% value.each do |k, v| %> + <%= round_to(v, 2) %> + <% end %>
    • <% end %>
    From db9d346f8bb53ef9c7ea94a1e6444cad58ed72c5 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 14:01:31 -0700 Subject: [PATCH 71/88] adds total daily nutrition info --- lib/recipe_result.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/recipe_result.rb b/lib/recipe_result.rb index 8617bc055..bd6da4068 100644 --- a/lib/recipe_result.rb +++ b/lib/recipe_result.rb @@ -5,7 +5,7 @@ # require_relative 'recipe_search_wrapper' class RecipeResult - attr_reader :uri, :label, :image, :url, :shareas, :ingredients, :calories, :totalNutrients + attr_reader :uri, :label, :image, :url, :shareas, :ingredients, :calories, :totalNutrients, :totalDaily # def initialize(uri, label, image, url) def initialize(recipe_details) @@ -35,6 +35,7 @@ def initialize(recipe_details) @ingredients = recipe_details['ingredients'] @calories = recipe_details['calories'] @totalNutrients = recipe_details['totalNutrients'] + @totalDaily = recipe_details['totalDaily'] end From 43425523247982b90380cbcee85a502d006c85b2 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 15:13:20 -0700 Subject: [PATCH 72/88] added ability to paginate without gems - yay - thx Chris --- app/controllers/recipes_controller.rb | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/app/controllers/recipes_controller.rb b/app/controllers/recipes_controller.rb index d7026eb59..fd76ebf6d 100644 --- a/app/controllers/recipes_controller.rb +++ b/app/controllers/recipes_controller.rb @@ -3,20 +3,14 @@ class RecipesController < ApplicationController def search - @results = RecipeSearchWrapper.search_by_one_keyword(params[:query]) - # binding.pry - return render :index - end - # def self.search(keyword, my_app_id = nil, my_app_key = nil, list_start = 0, list_end = 10) - # @search = RecipeSearchWrapper.search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil) - # redirect_to root_path and return @search - # end - # @products = Product.search(params[:query]) -# # if product query matches a product(s) -# # render those image(s), if any match. -# render :index - # end + @keyword = params[:query] + @from = params[:from] + @to = "#{params[:from].to_i + 10}" + @results = RecipeSearchWrapper.search_by_one_keyword(@keyword, @from, @to) + render :index + + end def index @@ -27,9 +21,7 @@ def flip_page end def show - #paginate with @hit in the list_start local? @result = RecipeSearchWrapper.show_just_one_recipe(params[:id]) - end def new From bd00c2c9d724e01977585ea889b5486b7028dad9 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 15:13:57 -0700 Subject: [PATCH 73/88] working on partial, now matches index search box --- app/views/recipes/_search.html.erb | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/app/views/recipes/_search.html.erb b/app/views/recipes/_search.html.erb index 9313f2ff9..3686467db 100644 --- a/app/views/recipes/_search.html.erb +++ b/app/views/recipes/_search.html.erb @@ -1,18 +1,8 @@ -

    Recipe Searches

    - -

    Find a Recipe

    - <%= form_tag(search_path(), :method => "get") do %> - <%= search_field_tag("query", nil, :placeholder => "Recipe Keyword")%> - <%= submit_tag "Search", :name => nil, class: 'button' %> + <%= form_tag(recipes_search_path(), method: :get) do %> + <%= search_field_tag("query", nil, placeholder: "Recipe Keyword")%> + <%= hidden_field_tag("from", "0") %> + <%= submit_tag "Search", name: nil, class: 'button' %> <% end %>
    - - -

    Recipe Searches

    - -<%= form_tag('root_path', :method => "get") do %> -<%= text_field_tag :search, params[:search], placeholder: "Recipe Keyword" %> -<%= submit_tag "Search" %> -<% end %> \ No newline at end of file From 5c685ada533badade1071e660cbaef9e893c02c6 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 15:14:23 -0700 Subject: [PATCH 74/88] updated name of search path --- app/views/recipes/search.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/recipes/search.html.erb b/app/views/recipes/search.html.erb index 5341771da..258141665 100644 --- a/app/views/recipes/search.html.erb +++ b/app/views/recipes/search.html.erb @@ -3,7 +3,7 @@

    Find a Recipe

    - <%= form_tag(search_path(), :method => "get") do %> + <%= form_tag(recipes_search_path(), :method => "get") do %> <%= search_field_tag("query", nil, :placeholder => "Recipe Keyword")%> <%= submit_tag "Search", :name => nil, class: 'button' %> <% end %> From 35d27c9a351f8d7a333adec23637cdc1ef42f9c2 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 15:15:48 -0700 Subject: [PATCH 75/88] added pagination to search by one keyword, deleted sample test method --- lib/recipe_search_wrapper.rb | 57 +++--------------------------------- 1 file changed, 4 insertions(+), 53 deletions(-) diff --git a/lib/recipe_search_wrapper.rb b/lib/recipe_search_wrapper.rb index 2e21d1b4b..93c0c50dd 100644 --- a/lib/recipe_search_wrapper.rb +++ b/lib/recipe_search_wrapper.rb @@ -31,11 +31,11 @@ def initialize(uri) #helps users find recipes by an ingredient - def self.search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil) + def self.search_by_one_keyword(keyword, list_start = 0, list_end = 10, my_app_id = nil, my_app_key = nil ) my_app_id ||= APP_ID my_app_key ||= APP_KEY - url = BASE_URL + "q=#{keyword}" + "&app_id=#{my_app_id}" + "&app_key=#{my_app_key}" + url = BASE_URL + "q=#{keyword}" + "&app_id=#{my_app_id}" + "&app_key=#{my_app_key}" + "&from=#{list_start}" + "&to=#{list_end}" #THIS IS WHERE THE MAGIC HAPPENS, MY JSON HASH data = HTTParty.get(url) @@ -64,7 +64,7 @@ def self.search_by_one_keyword(keyword, my_app_id = nil, my_app_key = nil) end end -def self.show_just_one_recipe(recipe_uri) + def self.show_just_one_recipe(recipe_uri) my_app_id ||= APP_ID my_app_key ||= APP_KEY @@ -78,55 +78,6 @@ def self.show_just_one_recipe(recipe_uri) return recipe + end end - - # def self.search_sample - - - # recipe_results_hash = Sample::SAMPLE_RECIPE - - # results_array = recipe_results_hash[:hits] - - - # if results_array - # recipes = [] - - # results_array.each do |result| - # uri = result[:recipe][:uri] - # label = result[:recipe][:label] - - - # wrapper = RecipeResult.new(uri, label) - # # x = uri - # # y = label - # # x = uri.class - # # y = label.class - # recipes << wrapper - # # recipes << x - # # recipes << y - # end - - # return recipes - - # else - - # return nil - - # end - # end -end - -# test = RecipeSearchWrapper.search_sample - -# test = RecipeSearchWrapper.search_by_one_keyword("chocolate", 3, 4) - -# puts test -# puts test.class - -# test.each do |recipe| -# puts recipe.uri -# puts recipe.label -# end - -# result = RecipeSearchWrapper.show_just_one_recipe("chocolate", 3, 4) From d952c0c6d8b368559d0a9b4fff2608f5bdf320d7 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 15:16:13 -0700 Subject: [PATCH 76/88] added back button to proper list of recipes --- app/views/recipes/show.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/recipes/show.html.erb b/app/views/recipes/show.html.erb index 317de6ecb..c2b9c9a7e 100644 --- a/app/views/recipes/show.html.erb +++ b/app/views/recipes/show.html.erb @@ -13,4 +13,5 @@ <% end %>
- <%= button_to "Back", root_path, method: :get, class: 'button' %> \ No newline at end of file +<%= link_to "Back", :back %> + From 3c5b781bb36d95e471619491c7b9441c1b6badf1 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Fri, 4 Nov 2016 15:16:48 -0700 Subject: [PATCH 77/88] added next and back buttons and logic, tweaked search box --- app/views/recipes/index.html.erb | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/app/views/recipes/index.html.erb b/app/views/recipes/index.html.erb index 068fc3ae6..22889ee5b 100644 --- a/app/views/recipes/index.html.erb +++ b/app/views/recipes/index.html.erb @@ -7,15 +7,34 @@ <% end %> -<% end %> + + <% if params[:from].to_i >= 10 %> +
+ <%= form_tag(recipes_search_path(), :method => "get") do %> + <%= hidden_field_tag("query", "#{params[:query]}")%> + <%= hidden_field_tag("from", "#{params[:from].to_i - 10}") %> + <%= submit_tag "Back", :name => nil, class: 'button' %> + <% end %> +
+ <% end %> + +
+ <%= form_tag(recipes_search_path(), :method => "get") do %> + <%= hidden_field_tag("query", "#{params[:query]}")%> + <%= hidden_field_tag("from", "#{params[:from].to_i + 10}") %> + <%= submit_tag "Next", :name => nil, class: 'button' %> + <% end %> +
+<% end %>

Recipe Search

Find a Recipe

- <%= form_tag(recipes_search_path(), :method => "get") do %> - <%= search_field_tag("query", nil, :placeholder => "Recipe Keyword")%> + <%= form_tag(recipes_search_path(), method: :get) do %> + <%= search_field_tag("query", nil, placeholder: "Recipe Keyword")%> + <%= hidden_field_tag("from", "0") %> <%= submit_tag "Search", :name => nil, class: 'button' %> <% end %>
From aeb20b0c3fec168bda075dc2b0cc8274bdc3fd73 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 7 Nov 2016 09:16:35 -0800 Subject: [PATCH 78/88] added will_paginate gem for a page bar --- Gemfile | 1 + Gemfile.lock | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Gemfile b/Gemfile index eac0e7695..950715792 100644 --- a/Gemfile +++ b/Gemfile @@ -37,6 +37,7 @@ gem 'awesome_print' # API GEMS gem 'httparty' +gem 'will_paginate', '~> 3.1' # Helps make it pretty, CSS-related gem gem 'foundation-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 05ca3626b..721769957 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -231,6 +231,7 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff + will_paginate (3.1.5) PLATFORMS ruby @@ -263,6 +264,7 @@ DEPENDENCIES uglifier (>= 1.3.0) web-console (~> 2.0) webmock + will_paginate (~> 3.1) BUNDLED WITH 1.13.6 From 37ce3fa38d0d774e89604fdedfe97aec11cc93b9 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 7 Nov 2016 09:16:58 -0800 Subject: [PATCH 79/88] added a topbar --- app/views/layouts/application.html.erb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 237dbba45..8cbdfc337 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -7,6 +7,24 @@ <%= csrf_meta_tags %> +
+ +
+
+
+ +

Choose Your Own (Dining!?!) Adventure

+
+ +
+ +
+ +
+ <%= render partial: 'search' %> +
+
+
<%= yield %> From 395db55bac5c5814dc4d15bf83551ea2ff41619a Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 7 Nov 2016 09:17:49 -0800 Subject: [PATCH 80/88] removed older instance variables for pages, added logic for will_paginate --- app/controllers/recipes_controller.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controllers/recipes_controller.rb b/app/controllers/recipes_controller.rb index fd76ebf6d..8b2fbb5e2 100644 --- a/app/controllers/recipes_controller.rb +++ b/app/controllers/recipes_controller.rb @@ -5,9 +5,12 @@ class RecipesController < ApplicationController def search @keyword = params[:query] - @from = params[:from] - @to = "#{params[:from].to_i + 10}" - @results = RecipeSearchWrapper.search_by_one_keyword(@keyword, @from, @to) + @results = RecipeSearchWrapper.search_by_one_keyword(@keyword) + + unless @results == nil + @results = @results.paginate(:page => params[:page], :per_page => 10) + end + render :index end From e55587b936a1426f4f0e563da5709a03b599bc9e Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 7 Nov 2016 09:18:20 -0800 Subject: [PATCH 81/88] added new way of viewing ingredients and nutritional info --- app/views/recipes/show.html.erb | 46 +++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/app/views/recipes/show.html.erb b/app/views/recipes/show.html.erb index c2b9c9a7e..832935787 100644 --- a/app/views/recipes/show.html.erb +++ b/app/views/recipes/show.html.erb @@ -1,17 +1,35 @@ -

<%= link_to @result.label, @result.url %>

-
    -
  • <%= image_tag @result.image %>
  • - <% @result.ingredients.each do |ingredient| %> -
  • <%= round_to(ingredient['quantity'], 0) %> <%= ingredient['measure'].titleize %> <%= ingredient['food'].titleize %> - <% end %> +
    +
    +
    +
    + <%= link_to(image_tag(@result.image, class: 'recipe-image'), image_path(@result.url)) %> +
    - <% @result.totalDaily.each do |key, value| %> -
  • - <% value.each do |k, v| %> - <%= round_to(v, 2) %> - <% end %>
  • - <% end %> -
+
-<%= link_to "Back", :back %> +

<%= link_to @result.label, @result.url %>

+ +

Ingredients

+
    + <% @result.ingredients.each do |ingredient| %> +
  • <%= round_to(ingredient['quantity'], 0) %> <%= ingredient['measure'] %> <%= ingredient['food'].titleize %>
  • + <% end %> +
+
+
+
+

Nutritional Information

+
    + <% @result.totalDaily.each do |key, value| %> +
  • + <% value.each do |k, v| %> + <%= round_to(v, 0) %> + <% end %>
  • + <% end %> +
+ <%= link_to "Back", :back, class: 'button' %> +
+
+
+ \ No newline at end of file From 8b436211395362924b0f7422b8099d2fe9ea90a7 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 7 Nov 2016 09:18:40 -0800 Subject: [PATCH 82/88] requires foundation and app css files --- app/assets/stylesheets/application.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index f9cd5b348..c5b6d171a 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -12,4 +12,5 @@ * *= require_tree . *= require_self - */ + *= require app + *= require foundation */ From 10b80528f9b693beaf674afcd0e8f3632f2b4815 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 7 Nov 2016 09:19:12 -0800 Subject: [PATCH 83/88] cleaner search partial, older page variables removed --- app/views/recipes/_search.html.erb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/views/recipes/_search.html.erb b/app/views/recipes/_search.html.erb index 3686467db..d91f04952 100644 --- a/app/views/recipes/_search.html.erb +++ b/app/views/recipes/_search.html.erb @@ -1,8 +1,12 @@ -
-

Find a Recipe

- <%= form_tag(recipes_search_path(), method: :get) do %> - <%= search_field_tag("query", nil, placeholder: "Recipe Keyword")%> - <%= hidden_field_tag("from", "0") %> - <%= submit_tag "Search", name: nil, class: 'button' %> - <% end %> -
+ + + + + From a4226e2effb739bf2ade7a2e55548493bdfc203c Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 7 Nov 2016 09:19:39 -0800 Subject: [PATCH 84/88] added pagination, logic, formatting --- app/views/recipes/index.html.erb | 59 ++++++++++++++------------------ 1 file changed, 25 insertions(+), 34 deletions(-) diff --git a/app/views/recipes/index.html.erb b/app/views/recipes/index.html.erb index 22889ee5b..85190f3a2 100644 --- a/app/views/recipes/index.html.erb +++ b/app/views/recipes/index.html.erb @@ -1,41 +1,32 @@ -<% unless @results == nil %> - <% @results.each do |recipe| %> -
-
    -
  • <%= link_to recipe.label, recipes_show_path(recipe.uri), target: "_blank" %>
  • +
    +
    +
    +
    -
-
- <% end %> + <% unless @results == nil %> +

Recipe Results for '<%= params[:query].titleize %>'

+
+ <% @results.each do |recipe| %> + +
+
    +
  • <%= link_to(image_tag(recipe.image), image_path(recipes_show_path(recipe.uri)), target: "_blank") %>
  • +
  • <%= link_to recipe.label, recipes_show_path(recipe.uri), target: "_blank" %>
  • +
+
- <% if params[:from].to_i >= 10 %> -
- <%= form_tag(recipes_search_path(), :method => "get") do %> - <%= hidden_field_tag("query", "#{params[:query]}")%> - <%= hidden_field_tag("from", "#{params[:from].to_i - 10}") %> - <%= submit_tag "Back", :name => nil, class: 'button' %> - <% end %> -
- <% end %> + + <% end %> +
-
- <%= form_tag(recipes_search_path(), :method => "get") do %> - <%= hidden_field_tag("query", "#{params[:query]}")%> - <%= hidden_field_tag("from", "#{params[:from].to_i + 10}") %> - <%= submit_tag "Next", :name => nil, class: 'button' %> - <% end %> -
-<% end %> -

Recipe Search

+ + <% else %> +

There are no recipes containing the term(s) <%= params[:query] %>

+ <% end %> + -
-

Find a Recipe

- <%= form_tag(recipes_search_path(), method: :get) do %> - <%= search_field_tag("query", nil, placeholder: "Recipe Keyword")%> - <%= hidden_field_tag("from", "0") %> - <%= submit_tag "Search", :name => nil, class: 'button' %> - <% end %> +
- + From 29a0796ab793f6b57a6c29582614cf3aaa406e51 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 7 Nov 2016 09:20:21 -0800 Subject: [PATCH 85/88] changed list_end variable for some reason --- lib/recipe_search_wrapper.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/recipe_search_wrapper.rb b/lib/recipe_search_wrapper.rb index 93c0c50dd..41a113c94 100644 --- a/lib/recipe_search_wrapper.rb +++ b/lib/recipe_search_wrapper.rb @@ -31,7 +31,9 @@ def initialize(uri) #helps users find recipes by an ingredient - def self.search_by_one_keyword(keyword, list_start = 0, list_end = 10, my_app_id = nil, my_app_key = nil ) + +#changed to 100 for will_paginate + def self.search_by_one_keyword(keyword, list_start = 0, list_end = 100, my_app_id = nil, my_app_key = nil ) my_app_id ||= APP_ID my_app_key ||= APP_KEY @@ -52,7 +54,6 @@ def self.search_by_one_keyword(keyword, list_start = 0, list_end = 10, my_app_id recipes << wrapper - # binding.pry end return recipes From 25b858e527cced70c6044660d019c6efebefe0b3 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 7 Nov 2016 09:20:40 -0800 Subject: [PATCH 86/88] initializes will_paginate gem --- config/initializers/will_paginate.rb | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 config/initializers/will_paginate.rb diff --git a/config/initializers/will_paginate.rb b/config/initializers/will_paginate.rb new file mode 100644 index 000000000..04dbff8b3 --- /dev/null +++ b/config/initializers/will_paginate.rb @@ -0,0 +1,3 @@ +#will_paginate.rb + +require 'will_paginate/array' \ No newline at end of file From 36e2a6bdd9e0d1c0a44a9497bc5c74bb5c31af2f Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 7 Nov 2016 09:20:59 -0800 Subject: [PATCH 87/88] makes it foundation-pretty, or offers the possibility, anyhow --- app/assets/stylesheets/app.css | 35 + app/assets/stylesheets/foundation.css | 4226 +++++++++++++++++++++++++ 2 files changed, 4261 insertions(+) create mode 100644 app/assets/stylesheets/app.css create mode 100644 app/assets/stylesheets/foundation.css diff --git a/app/assets/stylesheets/app.css b/app/assets/stylesheets/app.css new file mode 100644 index 000000000..c4529026e --- /dev/null +++ b/app/assets/stylesheets/app.css @@ -0,0 +1,35 @@ +/***********GENERAL***********/ +.wrapper { + width: 90%; + margin: 0 auto; + +} + +.search { + +} +/***********HERO***********/ +.pagination a { + display: inline-block !important ; + +} + +.button { + display: inline-block; +} + +/***********MAIN***********/ +.card { + display: inline-block; +} + +ul.recipe { + list-style: none; + +} + +.recipe-image { + border: solid black; +} + +/***********FOOTER***********/ \ No newline at end of file diff --git a/app/assets/stylesheets/foundation.css b/app/assets/stylesheets/foundation.css new file mode 100644 index 000000000..c59eaf55b --- /dev/null +++ b/app/assets/stylesheets/foundation.css @@ -0,0 +1,4226 @@ +@charset "UTF-8"; +/** + * Foundation for Sites by ZURB + * Version 6.2.4 + * foundation.zurb.com + * Licensed under MIT Open Source + */ +/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS and IE text size adjust after device orientation change, + * without disabling user zoom. + */ +html { + font-family: sans-serif; + /* 1 */ + -ms-text-size-adjust: 100%; + /* 2 */ + -webkit-text-size-adjust: 100%; + /* 2 */ } + +/** + * Remove default margin. + */ +body { + margin: 0; } + +/* HTML5 display definitions + ========================================================================== */ +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 + * and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; } + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ +audio, +canvas, +progress, +video { + display: inline-block; + /* 1 */ + vertical-align: baseline; + /* 2 */ } + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ +audio:not([controls]) { + display: none; + height: 0; } + +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22. + */ +[hidden], +template { + display: none; } + +/* Links + ========================================================================== */ +/** + * Remove the gray background color from active links in IE 10. + */ +a { + background-color: transparent; } + +/** + * Improve readability of focused elements when they are also in an + * active/hover state. + */ +a:active, +a:hover { + outline: 0; } + +/* Text-level semantics + ========================================================================== */ +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ +abbr[title] { + border-bottom: 1px dotted; } + +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ +b, +strong { + font-weight: bold; } + +/** + * Address styling not present in Safari and Chrome. + */ +dfn { + font-style: italic; } + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ +h1 { + font-size: 2em; + margin: 0.67em 0; } + +/** + * Address styling not present in IE 8/9. + */ +mark { + background: #ff0; + color: #000; } + +/** + * Address inconsistent and variable font size in all browsers. + */ +small { + font-size: 80%; } + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; } + +sup { + top: -0.5em; } + +sub { + bottom: -0.25em; } + +/* Embedded content + ========================================================================== */ +/** + * Remove border when inside `a` element in IE 8/9/10. + */ +img { + border: 0; } + +/** + * Correct overflow not hidden in IE 9/10/11. + */ +svg:not(:root) { + overflow: hidden; } + +/* Grouping content + ========================================================================== */ +/** + * Address margin not present in IE 8/9 and Safari. + */ +figure { + margin: 1em 40px; } + +/** + * Address differences between Firefox and other browsers. + */ +hr { + box-sizing: content-box; + height: 0; } + +/** + * Contain overflow in all browsers. + */ +pre { + overflow: auto; } + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; } + +/* Forms + ========================================================================== */ +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + */ +button, +input, +optgroup, +select, +textarea { + color: inherit; + /* 1 */ + font: inherit; + /* 2 */ + margin: 0; + /* 3 */ } + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ +button { + overflow: visible; } + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ +button, +select { + text-transform: none; } + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + /* 2 */ + cursor: pointer; + /* 3 */ } + +/** + * Re-set default cursor for disabled elements. + */ +button[disabled], +html input[disabled] { + cursor: not-allowed; } + +/** + * Remove inner padding and border in Firefox 4+. + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; } + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ +input { + line-height: normal; } + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ } + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; } + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome. + */ +input[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + box-sizing: content-box; + /* 2 */ } + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; } + +/** + * Define consistent border, margin, and padding. + * [NOTE] We don't enable this ruleset in Foundation, because we want the
element to have plain styling. + */ +/* fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; + } */ +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ +legend { + border: 0; + /* 1 */ + padding: 0; + /* 2 */ } + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ +textarea { + overflow: auto; } + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ +optgroup { + font-weight: bold; } + +/* Tables + ========================================================================== */ +/** + * Remove most spacing between table cells. + */ +table { + border-collapse: collapse; + border-spacing: 0; } + +td, +th { + padding: 0; } + +.foundation-mq { + font-family: "small=0em&medium=40em&large=64em&xlarge=75em&xxlarge=90em"; } + +html { + font-size: 100%; + box-sizing: border-box; } + +*, +*::before, +*::after { + box-sizing: inherit; } + +body { + padding: 0; + margin: 0; + font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; + font-weight: normal; + line-height: 1.5; + color: #0a0a0a; + background: #fefefe; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } + +img { + max-width: 100%; + height: auto; + -ms-interpolation-mode: bicubic; + display: inline-block; + vertical-align: middle; } + +textarea { + height: auto; + min-height: 50px; + border-radius: 0; } + +select { + width: 100%; + border-radius: 0; } + +#map_canvas img, +#map_canvas embed, +#map_canvas object, +.map_canvas img, +.map_canvas embed, +.map_canvas object, +.mqa-display img, +.mqa-display embed, +.mqa-display object { + max-width: none !important; } + +button { + -webkit-appearance: none; + -moz-appearance: none; + background: transparent; + padding: 0; + border: 0; + border-radius: 0; + line-height: 1; } + [data-whatinput='mouse'] button { + outline: 0; } + +.is-visible { + display: block !important; } + +.is-hidden { + display: none !important; } + +.row { + max-width: 75rem; + margin-left: auto; + margin-right: auto; } + .row::before, .row::after { + content: ' '; + display: table; } + .row::after { + clear: both; } + .row.collapse > .column, .row.collapse > .columns { + padding-left: 0; + padding-right: 0; } + .row .row { + margin-left: -0.625rem; + margin-right: -0.625rem; } + @media screen and (min-width: 40em) { + .row .row { + margin-left: -0.9375rem; + margin-right: -0.9375rem; } } + .row .row.collapse { + margin-left: 0; + margin-right: 0; } + .row.expanded { + max-width: none; } + .row.expanded .row { + margin-left: auto; + margin-right: auto; } + +.column, .columns { + width: 100%; + float: left; + padding-left: 0.625rem; + padding-right: 0.625rem; } + @media screen and (min-width: 40em) { + .column, .columns { + padding-left: 0.9375rem; + padding-right: 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 { + padding-left: 0; + padding-right: 0; + margin-left: 0; + margin-right: 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 { + width: 100%; + float: left; } + .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 { + width: 50%; + float: left; } + .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 { + width: 33.33333%; + float: left; } + .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 { + width: 25%; + float: left; } + .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 { + width: 20%; + float: left; } + .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 { + width: 16.66667%; + float: left; } + .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 { + width: 14.28571%; + float: left; } + .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 { + width: 12.5%; + float: left; } + .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-left: 0; + padding-right: 0; } + +.small-collapse .row { + margin-left: 0; + margin-right: 0; } + +.expanded.row .small-collapse.row { + margin-left: 0; + margin-right: 0; } + +.small-uncollapse > .column, .small-uncollapse > .columns { + padding-left: 0.625rem; + padding-right: 0.625rem; } + +.small-centered { + margin-left: auto; + margin-right: auto; } + .small-centered, .small-centered:last-child:not(:first-child) { + float: none; + clear: both; } + +.small-uncentered, +.small-push-0, +.small-pull-0 { + position: static; + margin-left: 0; + margin-right: 0; + float: left; } + +@media 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 { + width: 100%; + float: left; } + .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 { + width: 50%; + float: left; } + .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 { + width: 33.33333%; + float: left; } + .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 { + width: 25%; + float: left; } + .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 { + width: 20%; + float: left; } + .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 { + width: 16.66667%; + float: left; } + .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 { + width: 14.28571%; + float: left; } + .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 { + width: 12.5%; + float: left; } + .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-left: 0; + padding-right: 0; } + .medium-collapse .row { + margin-left: 0; + margin-right: 0; } + .expanded.row .medium-collapse.row { + margin-left: 0; + margin-right: 0; } + .medium-uncollapse > .column, .medium-uncollapse > .columns { + padding-left: 0.9375rem; + padding-right: 0.9375rem; } + .medium-centered { + margin-left: auto; + margin-right: auto; } + .medium-centered, .medium-centered:last-child:not(:first-child) { + float: none; + clear: both; } + .medium-uncentered, + .medium-push-0, + .medium-pull-0 { + position: static; + margin-left: 0; + margin-right: 0; + float: left; } } + +@media 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 { + width: 100%; + float: left; } + .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 { + width: 50%; + float: left; } + .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 { + width: 33.33333%; + float: left; } + .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 { + width: 25%; + float: left; } + .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 { + width: 20%; + float: left; } + .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 { + width: 16.66667%; + float: left; } + .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 { + width: 14.28571%; + float: left; } + .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 { + width: 12.5%; + float: left; } + .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-left: 0; + padding-right: 0; } + .large-collapse .row { + margin-left: 0; + margin-right: 0; } + .expanded.row .large-collapse.row { + margin-left: 0; + margin-right: 0; } + .large-uncollapse > .column, .large-uncollapse > .columns { + padding-left: 0.9375rem; + padding-right: 0.9375rem; } + .large-centered { + margin-left: auto; + margin-right: auto; } + .large-centered, .large-centered:last-child:not(:first-child) { + float: none; + clear: both; } + .large-uncentered, + .large-push-0, + .large-pull-0 { + position: static; + margin-left: 0; + margin-right: 0; + float: left; } } + +div, +dl, +dt, +dd, +ul, +ol, +li, +h1, +h2, +h3, +h4, +h5, +h6, +pre, +form, +p, +blockquote, +th, +td { + margin: 0; + padding: 0; } + +p { + font-size: inherit; + line-height: 1.6; + margin-bottom: 1rem; + 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-weight: normal; + font-style: normal; + color: inherit; + text-rendering: optimizeLegibility; + margin-top: 0; + margin-bottom: 0.5rem; + line-height: 1.4; } + h1 small, + h2 small, + h3 small, + h4 small, + h5 small, + h6 small { + color: #cacaca; + line-height: 0; } + +h1 { + font-size: 1.5rem; } + +h2 { + font-size: 1.25rem; } + +h3 { + font-size: 1.1875rem; } + +h4 { + font-size: 1.125rem; } + +h5 { + font-size: 1.0625rem; } + +h6 { + font-size: 1rem; } + +@media 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 { + color: #2199e8; + text-decoration: none; + line-height: inherit; + cursor: pointer; } + a:hover, a:focus { + color: #1585cf; } + a img { + border: 0; } + +hr { + max-width: 75rem; + height: 0; + border-right: 0; + border-top: 0; + border-bottom: 1px solid #cacaca; + border-left: 0; + margin: 1.25rem auto; + clear: both; } + +ul, +ol, +dl { + line-height: 1.6; + margin-bottom: 1rem; + list-style-position: outside; } + +li { + font-size: inherit; } + +ul { + list-style-type: disc; + margin-left: 1.25rem; } + +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: '\2014 \0020'; } + +abbr { + color: #0a0a0a; + cursor: help; + border-bottom: 1px dotted #0a0a0a; } + +code { + font-family: Consolas, "Liberation Mono", Courier, monospace; + font-weight: normal; + color: #0a0a0a; + background-color: #e6e6e6; + border: 1px solid #cacaca; + padding: 0.125rem 0.3125rem 0.0625rem; } + +kbd { + padding: 0.125rem 0.25rem 0; + margin: 0; + background-color: #e6e6e6; + color: #0a0a0a; + font-family: Consolas, "Liberation Mono", Courier, monospace; } + +.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 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 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; + color: black !important; + box-shadow: none !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; } } + +.button { + display: inline-block; + text-align: center; + line-height: 1; + cursor: pointer; + -webkit-appearance: none; + transition: background-color 0.25s ease-out, color 0.25s ease-out; + vertical-align: middle; + border: 1px solid transparent; + border-radius: 0; + padding: 0.85em 1em; + margin: 0 0 1rem 0; + font-size: 0.9rem; + background-color: #2199e8; + color: #fefefe; } + [data-whatinput='mouse'] .button { + outline: 0; } + .button:hover, .button:focus { + background-color: #1583cc; + 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-left: 0; + margin-right: 0; } + .button.primary { + background-color: #2199e8; + color: #fefefe; } + .button.primary:hover, .button.primary:focus { + background-color: #147cc0; + color: #fefefe; } + .button.secondary { + background-color: #777; + color: #fefefe; } + .button.secondary:hover, .button.secondary:focus { + background-color: #5f5f5f; + color: #fefefe; } + .button.success { + background-color: #3adb76; + color: #fefefe; } + .button.success:hover, .button.success:focus { + background-color: #22bb5b; + color: #fefefe; } + .button.warning { + background-color: #ffae00; + color: #fefefe; } + .button.warning:hover, .button.warning:focus { + background-color: #cc8b00; + color: #fefefe; } + .button.alert { + background-color: #ec5840; + color: #fefefe; } + .button.alert:hover, .button.alert:focus { + background-color: #da3116; + color: #fefefe; } + .button.hollow { + border: 1px solid #2199e8; + color: #2199e8; } + .button.hollow, .button.hollow:hover, .button.hollow:focus { + background-color: transparent; } + .button.hollow:hover, .button.hollow:focus { + border-color: #0c4d78; + color: #0c4d78; } + .button.hollow.primary { + border: 1px solid #2199e8; + color: #2199e8; } + .button.hollow.primary:hover, .button.hollow.primary:focus { + border-color: #0c4d78; + color: #0c4d78; } + .button.hollow.secondary { + border: 1px solid #777; + color: #777; } + .button.hollow.secondary:hover, .button.hollow.secondary:focus { + border-color: #3c3c3c; + color: #3c3c3c; } + .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 #ec5840; + color: #ec5840; } + .button.hollow.alert:hover, .button.hollow.alert:focus { + border-color: #881f0e; + color: #881f0e; } + .button.disabled, .button[disabled] { + opacity: 0.25; + cursor: not-allowed; } + .button.disabled:hover, .button.disabled:focus, .button[disabled]:hover, .button[disabled]:focus { + background-color: #2199e8; + color: #fefefe; } + .button.disabled.primary, .button[disabled].primary { + opacity: 0.25; + cursor: not-allowed; } + .button.disabled.primary:hover, .button.disabled.primary:focus, .button[disabled].primary:hover, .button[disabled].primary:focus { + background-color: #2199e8; + color: #fefefe; } + .button.disabled.secondary, .button[disabled].secondary { + opacity: 0.25; + cursor: not-allowed; } + .button.disabled.secondary:hover, .button.disabled.secondary:focus, .button[disabled].secondary:hover, .button[disabled].secondary:focus { + background-color: #777; + color: #fefefe; } + .button.disabled.success, .button[disabled].success { + opacity: 0.25; + cursor: not-allowed; } + .button.disabled.success:hover, .button.disabled.success:focus, .button[disabled].success:hover, .button[disabled].success:focus { + background-color: #3adb76; + color: #fefefe; } + .button.disabled.warning, .button[disabled].warning { + opacity: 0.25; + cursor: not-allowed; } + .button.disabled.warning:hover, .button.disabled.warning:focus, .button[disabled].warning:hover, .button[disabled].warning:focus { + background-color: #ffae00; + color: #fefefe; } + .button.disabled.alert, .button[disabled].alert { + opacity: 0.25; + cursor: not-allowed; } + .button.disabled.alert:hover, .button.disabled.alert:focus, .button[disabled].alert:hover, .button[disabled].alert:focus { + background-color: #ec5840; + color: #fefefe; } + .button.dropdown::after { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 0.4em; + border-color: #fefefe transparent transparent; + border-top-style: solid; + border-bottom-width: 0; + position: relative; + top: 0.4em; + float: right; + margin-left: 1em; + display: inline-block; } + .button.arrow-only::after { + margin-left: 0; + float: none; + top: -0.1em; } + +[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; + box-sizing: border-box; + width: 100%; + height: 2.4375rem; + padding: 0.5rem; + border: 1px solid #cacaca; + margin: 0 0 1rem; + font-family: inherit; + font-size: 1rem; + color: #0a0a0a; + background-color: #fefefe; + box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1); + border-radius: 0; + transition: box-shadow 0.5s, border-color 0.25s ease-in-out; + -webkit-appearance: none; + -moz-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 { + border: 1px solid #8a8a8a; + background-color: #fefefe; + outline: none; + box-shadow: 0 0 5px #cacaca; + transition: box-shadow 0.5s, border-color 0.25s ease-in-out; } + +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'] { + border-radius: 0; + -webkit-appearance: none; + -moz-appearance: none; } + +input[type='search'] { + box-sizing: border-box; } + +[type='file'], +[type='checkbox'], +[type='radio'] { + margin: 0 0 1rem; } + +[type='checkbox'] + label, +[type='radio'] + label { + display: inline-block; + margin-left: 0.5rem; + margin-right: 1rem; + margin-bottom: 0; + vertical-align: baseline; } + [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 { + margin: 0; + white-space: nowrap; + display: table-cell; + vertical-align: middle; } + +.input-group-label { + text-align: center; + padding: 0 1rem; + background: #e6e6e6; + color: #0a0a0a; + border: 1px solid #cacaca; + 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; + height: 100%; + width: 1%; } + .input-group-button a, + .input-group-button input, + .input-group-button button { + margin: 0; } + +.input-group .input-group-button { + display: table-cell; } + +fieldset { + border: 0; + padding: 0; + margin: 0; } + +legend { + margin-bottom: 0.5rem; + max-width: 100%; } + +.fieldset { + border: 1px solid #cacaca; + padding: 1.25rem; + margin: 1.125rem 0; } + .fieldset legend { + background: #fefefe; + padding: 0 0.1875rem; + margin: 0; + margin-left: -0.1875rem; } + +select { + height: 2.4375rem; + padding: 0.5rem; + border: 1px solid #cacaca; + margin: 0 0 1rem; + font-size: 1rem; + font-family: inherit; + line-height: normal; + color: #0a0a0a; + background-color: #fefefe; + border-radius: 0; + -webkit-appearance: none; + -moz-appearance: none; + background-image: url("data:image/svg+xml;utf8,"); + background-size: 9px 6px; + background-position: right -1rem center; + background-origin: content-box; + background-repeat: no-repeat; + padding-right: 1.5rem; } + @media screen and (min-width: 0\0) { + select { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAYCAYAAACbU/80AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIpJREFUeNrEkckNgDAMBBfRkEt0ObRBBdsGXUDgmQfK4XhH2m8czQAAy27R3tsw4Qfe2x8uOO6oYLb6GlOor3GF+swURAOmUJ+RwtEJs9WvTGEYxBXqI1MQAZhCfUQKRzDMVj+TwrAIV6jvSUEkYAr1LSkcyTBb/V+KYfX7xAeusq3sLDtGH3kEGACPWIflNZfhRQAAAABJRU5ErkJggg=="); } } + 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) { + background-color: rgba(236, 88, 64, 0.1); + border-color: #ec5840; } + +.is-invalid-label { + color: #ec5840; } + +.form-error { + display: none; + margin-top: -0.5rem; + margin-bottom: 1rem; + font-size: 0.75rem; + font-weight: bold; + color: #ec5840; } + .form-error.is-visible { + display: block; } + +.accordion { + list-style-type: none; + background: #fefefe; + margin-left: 0; } + +.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 { + display: block; + padding: 1.25rem 1rem; + line-height: 1; + font-size: 0.75rem; + color: #2199e8; + position: relative; + border: 1px solid #e6e6e6; + border-bottom: 0; } + :last-child:not(.is-active) > .accordion-title { + border-radius: 0 0 0 0; + border-bottom: 1px solid #e6e6e6; } + .accordion-title:hover, .accordion-title:focus { + background-color: #e6e6e6; } + .accordion-title::before { + content: '+'; + position: absolute; + right: 1rem; + top: 50%; + margin-top: -0.5rem; } + .is-active > .accordion-title::before { + content: '–'; } + +.accordion-content { + padding: 1rem; + display: none; + 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 { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 6px; + border-color: #2199e8 transparent transparent; + border-top-style: solid; + border-bottom-width: 0; + position: absolute; + top: 50%; + margin-top: -4px; + right: 1rem; } + +.is-accordion-submenu-parent[aria-expanded='true'] > a::after { + -webkit-transform-origin: 50% 50%; + -ms-transform-origin: 50% 50%; + transform-origin: 50% 50%; + -webkit-transform: scaleY(-1); + -ms-transform: scaleY(-1); + transform: scaleY(-1); } + +.badge { + display: inline-block; + padding: 0.3em; + min-width: 2.1em; + font-size: 0.6rem; + text-align: center; + border-radius: 50%; + background: #2199e8; + color: #fefefe; } + .badge.secondary { + background: #777; + color: #fefefe; } + .badge.success { + background: #3adb76; + color: #fefefe; } + .badge.warning { + background: #ffae00; + color: #fefefe; } + .badge.alert { + background: #ec5840; + color: #fefefe; } + +.breadcrumbs { + list-style: none; + margin: 0 0 1rem 0; } + .breadcrumbs::before, .breadcrumbs::after { + content: ' '; + display: table; } + .breadcrumbs::after { + clear: both; } + .breadcrumbs li { + float: left; + color: #0a0a0a; + font-size: 0.6875rem; + cursor: default; + text-transform: uppercase; } + .breadcrumbs li:not(:last-child)::after { + color: #cacaca; + content: "/"; + margin: 0 0.75rem; + position: relative; + top: 1px; + opacity: 1; } + .breadcrumbs a { + color: #2199e8; } + .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 { + content: ' '; + display: table; } + .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: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: #2199e8; + color: #fefefe; } + .button-group.primary .button:hover, .button-group.primary .button:focus { + background-color: #147cc0; + color: #fefefe; } + .button-group.secondary .button { + background-color: #777; + color: #fefefe; } + .button-group.secondary .button:hover, .button-group.secondary .button:focus { + background-color: #5f5f5f; + color: #fefefe; } + .button-group.success .button { + background-color: #3adb76; + color: #fefefe; } + .button-group.success .button:hover, .button-group.success .button:focus { + background-color: #22bb5b; + color: #fefefe; } + .button-group.warning .button { + background-color: #ffae00; + color: #fefefe; } + .button-group.warning .button:hover, .button-group.warning .button:focus { + background-color: #cc8b00; + color: #fefefe; } + .button-group.alert .button { + background-color: #ec5840; + color: #fefefe; } + .button-group.alert .button:hover, .button-group.alert .button:focus { + background-color: #da3116; + 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 screen and (min-width: 40em) { + .button-group.stacked-for-small .button { + width: auto; + margin-bottom: 0; } } + @media 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 { + margin: 0 0 1rem 0; + padding: 1rem; + border: 1px solid rgba(10, 10, 10, 0.25); + border-radius: 0; + position: relative; + color: #0a0a0a; + background-color: white; } + .callout > :first-child { + margin-top: 0; } + .callout > :last-child { + margin-bottom: 0; } + .callout.primary { + background-color: #def0fc; } + .callout.secondary { + background-color: #ebebeb; } + .callout.success { + background-color: #e1faea; } + .callout.warning { + background-color: #fff3d9; } + .callout.alert { + background-color: #fce6e2; } + .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; } + +.close-button { + position: absolute; + color: #8a8a8a; + right: 1rem; + top: 0.5rem; + font-size: 2em; + line-height: 1; + cursor: pointer; } + [data-whatinput='mouse'] .close-button { + outline: 0; } + .close-button:hover, .close-button:focus { + color: #0a0a0a; } + +.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 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 { + display: table-cell; } + .menu.vertical > li { + display: block; } + @media screen and (min-width: 40em) { + .menu.medium-horizontal > li { + display: table-cell; } + .menu.medium-vertical > li { + display: block; } } + @media screen and (min-width: 64em) { + .menu.large-horizontal > li { + display: table-cell; } + .menu.large-vertical > li { + display: block; } } + .menu.simple li { + line-height: 1; + display: inline-block; + margin-right: 1rem; } + .menu.simple a { + padding: 0; } + .menu.align-right::before, .menu.align-right::after { + content: ' '; + display: table; } + .menu.align-right::after { + clear: both; } + .menu.align-right > li { + float: right; } + .menu.expanded { + width: 100%; + display: table; + table-layout: fixed; } + .menu.expanded > li:first-child:last-child { + width: 100%; } + .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.nested { + margin-left: 1rem; } + .menu .active > a { + color: #fefefe; + background: #2199e8; } + +.menu-text { + font-weight: bold; + color: inherit; + line-height: 1; + padding-top: 0; + padding-bottom: 0; + padding: 0.7rem 1rem; } + +.menu-centered { + text-align: center; } + .menu-centered > .menu { + display: inline-block; } + +.no-js [data-responsive-menu] ul { + display: none; } + +.menu-icon { + position: relative; + display: inline-block; + vertical-align: middle; + cursor: pointer; + width: 20px; + height: 16px; } + .menu-icon::after { + content: ''; + position: absolute; + display: block; + width: 100%; + height: 2px; + background: #fefefe; + top: 0; + left: 0; + box-shadow: 0 7px 0 #fefefe, 0 14px 0 #fefefe; } + .menu-icon:hover::after { + background: #cacaca; + box-shadow: 0 7px 0 #cacaca, 0 14px 0 #cacaca; } + +.menu-icon.dark { + position: relative; + display: inline-block; + vertical-align: middle; + cursor: pointer; + width: 20px; + height: 16px; } + .menu-icon.dark::after { + content: ''; + position: absolute; + display: block; + width: 100%; + height: 2px; + background: #0a0a0a; + top: 0; + left: 0; + box-shadow: 0 7px 0 #0a0a0a, 0 14px 0 #0a0a0a; } + .menu-icon.dark:hover::after { + background: #8a8a8a; + box-shadow: 0 7px 0 #8a8a8a, 0 14px 0 #8a8a8a; } + +.is-drilldown { + position: relative; + overflow: hidden; } + .is-drilldown li { + display: block !important; } + +.is-drilldown-submenu { + position: absolute; + top: 0; + left: 100%; + z-index: -1; + width: 100%; + background: #fefefe; + transition: -webkit-transform 0.15s linear; + transition: 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%); } + +.is-drilldown-submenu-parent > a { + position: relative; } + .is-drilldown-submenu-parent > a::after { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 6px; + border-color: transparent transparent transparent #2199e8; + border-left-style: solid; + border-right-width: 0; + position: absolute; + top: 50%; + margin-top: -6px; + right: 1rem; } + +.js-drilldown-back > a::before { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 6px; + border-color: transparent #2199e8 transparent transparent; + border-right-style: solid; + border-left-width: 0; + border-left-width: 0; + display: inline-block; + vertical-align: middle; + margin-right: 0.75rem; } + +.dropdown-pane { + background-color: #fefefe; + border: 1px solid #cacaca; + border-radius: 0; + display: block; + font-size: 1rem; + padding: 1rem; + position: absolute; + visibility: hidden; + width: 300px; + z-index: 10; } + .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 { + left: auto; + right: 0; + top: 100%; } + +.dropdown.menu > li.opens-right > .is-dropdown-submenu { + right: auto; + left: 0; + top: 100%; } + +.dropdown.menu > li.is-dropdown-submenu-parent > a { + padding-right: 1.5rem; + position: relative; } + +.dropdown.menu > li.is-dropdown-submenu-parent > a::after { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 5px; + border-color: #2199e8 transparent transparent; + border-top-style: solid; + border-bottom-width: 0; + right: 5px; + margin-top: -2px; } + +[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 { + left: auto; + right: 100%; } + +.dropdown.menu.vertical > li.opens-right > .is-dropdown-submenu { + right: auto; + left: 100%; } + +.dropdown.menu.vertical > li > a::after { + right: 14px; + margin-top: -3px; } + +.dropdown.menu.vertical > li.opens-left > a::after { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 5px; + border-color: transparent #2199e8 transparent transparent; + border-right-style: solid; + border-left-width: 0; } + +.dropdown.menu.vertical > li.opens-right > a::after { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 5px; + border-color: transparent transparent transparent #2199e8; + border-left-style: solid; + border-right-width: 0; } + +@media screen and (min-width: 40em) { + .dropdown.menu.medium-horizontal > li.opens-left > .is-dropdown-submenu { + left: auto; + right: 0; + top: 100%; } + .dropdown.menu.medium-horizontal > li.opens-right > .is-dropdown-submenu { + right: auto; + left: 0; + top: 100%; } + .dropdown.menu.medium-horizontal > li.is-dropdown-submenu-parent > a { + padding-right: 1.5rem; + position: relative; } + .dropdown.menu.medium-horizontal > li.is-dropdown-submenu-parent > a::after { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 5px; + border-color: #2199e8 transparent transparent; + border-top-style: solid; + border-bottom-width: 0; + right: 5px; + margin-top: -2px; } + .dropdown.menu.medium-vertical > li .is-dropdown-submenu { + top: 0; } + .dropdown.menu.medium-vertical > li.opens-left > .is-dropdown-submenu { + left: auto; + right: 100%; } + .dropdown.menu.medium-vertical > li.opens-right > .is-dropdown-submenu { + right: auto; + left: 100%; } + .dropdown.menu.medium-vertical > li > a::after { + right: 14px; + margin-top: -3px; } + .dropdown.menu.medium-vertical > li.opens-left > a::after { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 5px; + border-color: transparent #2199e8 transparent transparent; + border-right-style: solid; + border-left-width: 0; } + .dropdown.menu.medium-vertical > li.opens-right > a::after { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 5px; + border-color: transparent transparent transparent #2199e8; + border-left-style: solid; + border-right-width: 0; } } + +@media screen and (min-width: 64em) { + .dropdown.menu.large-horizontal > li.opens-left > .is-dropdown-submenu { + left: auto; + right: 0; + top: 100%; } + .dropdown.menu.large-horizontal > li.opens-right > .is-dropdown-submenu { + right: auto; + left: 0; + top: 100%; } + .dropdown.menu.large-horizontal > li.is-dropdown-submenu-parent > a { + padding-right: 1.5rem; + position: relative; } + .dropdown.menu.large-horizontal > li.is-dropdown-submenu-parent > a::after { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 5px; + border-color: #2199e8 transparent transparent; + border-top-style: solid; + border-bottom-width: 0; + right: 5px; + margin-top: -2px; } + .dropdown.menu.large-vertical > li .is-dropdown-submenu { + top: 0; } + .dropdown.menu.large-vertical > li.opens-left > .is-dropdown-submenu { + left: auto; + right: 100%; } + .dropdown.menu.large-vertical > li.opens-right > .is-dropdown-submenu { + right: auto; + left: 100%; } + .dropdown.menu.large-vertical > li > a::after { + right: 14px; + margin-top: -3px; } + .dropdown.menu.large-vertical > li.opens-left > a::after { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 5px; + border-color: transparent #2199e8 transparent transparent; + border-right-style: solid; + border-left-width: 0; } + .dropdown.menu.large-vertical > li.opens-right > a::after { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 5px; + border-color: transparent transparent transparent #2199e8; + border-left-style: solid; + border-right-width: 0; } } + +.dropdown.menu.align-right .is-dropdown-submenu.first-sub { + top: 100%; + left: auto; + right: 0; } + +.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: -2px; } + .is-dropdown-submenu-parent.opens-inner > .is-dropdown-submenu { + top: 100%; + left: auto; } + .is-dropdown-submenu-parent.opens-left > .is-dropdown-submenu { + left: auto; + right: 100%; } + .is-dropdown-submenu-parent.opens-right > .is-dropdown-submenu { + right: auto; + left: 100%; } + +.is-dropdown-submenu { + display: none; + position: absolute; + top: 0; + left: 100%; + min-width: 200px; + z-index: 1; + background: #fefefe; + border: 1px solid #cacaca; } + .is-dropdown-submenu .is-dropdown-submenu-parent > a::after { + right: 14px; + margin-top: -3px; } + .is-dropdown-submenu .is-dropdown-submenu-parent.opens-left > a::after { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 5px; + border-color: transparent #2199e8 transparent transparent; + border-right-style: solid; + border-left-width: 0; } + .is-dropdown-submenu .is-dropdown-submenu-parent.opens-right > a::after { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 5px; + border-color: transparent transparent transparent #2199e8; + border-left-style: solid; + border-right-width: 0; } + .is-dropdown-submenu .is-dropdown-submenu { + margin-top: -1px; } + .is-dropdown-submenu > li { + width: 100%; } + .is-dropdown-submenu.js-dropdown-active { + display: block; } + +.flex-video { + position: relative; + height: 0; + padding-bottom: 75%; + margin-bottom: 1rem; + overflow: hidden; } + .flex-video iframe, + .flex-video object, + .flex-video embed, + .flex-video video { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; } + .flex-video.widescreen { + padding-bottom: 56.25%; } + .flex-video.vimeo { + padding-top: 0; } + +.label { + display: inline-block; + padding: 0.33333rem 0.5rem; + font-size: 0.8rem; + line-height: 1; + white-space: nowrap; + cursor: default; + border-radius: 0; + background: #2199e8; + color: #fefefe; } + .label.secondary { + background: #777; + color: #fefefe; } + .label.success { + background: #3adb76; + color: #fefefe; } + .label.warning { + background: #ffae00; + color: #fefefe; } + .label.alert { + background: #ec5840; + color: #fefefe; } + +.media-object { + margin-bottom: 1rem; + display: block; } + .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; } + +html, +body { + height: 100%; } + +.off-canvas-wrapper { + width: 100%; + overflow-x: hidden; + position: relative; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-overflow-scrolling: auto; } + +.off-canvas-wrapper-inner { + position: relative; + width: 100%; + min-height: 100%; + transition: -webkit-transform 0.5s ease; + transition: transform 0.5s ease; } + .off-canvas-wrapper-inner::before, .off-canvas-wrapper-inner::after { + content: ' '; + display: table; } + .off-canvas-wrapper-inner::after { + clear: both; } + +.off-canvas-content, +.off-canvas-content { + min-height: 100%; + background: #fefefe; + transition: -webkit-transform 0.5s ease; + transition: transform 0.5s ease; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + z-index: 1; + padding-bottom: 0.1px; + box-shadow: 0 0 10px rgba(10, 10, 10, 0.5); } + +.js-off-canvas-exit { + display: none; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(254, 254, 254, 0.25); + cursor: pointer; + transition: background 0.5s ease; } + +.off-canvas { + position: absolute; + background: #e6e6e6; + z-index: -1; + max-height: 100%; + overflow-y: auto; + -webkit-transform: translateX(0); + -ms-transform: translateX(0); + transform: translateX(0); } + [data-whatinput='mouse'] .off-canvas { + outline: 0; } + .off-canvas.position-left { + left: -250px; + top: 0; + width: 250px; } + .is-open-left { + -webkit-transform: translateX(250px); + -ms-transform: translateX(250px); + transform: translateX(250px); } + .off-canvas.position-right { + right: -250px; + top: 0; + width: 250px; } + .is-open-right { + -webkit-transform: translateX(-250px); + -ms-transform: translateX(-250px); + transform: translateX(-250px); } + +@media screen and (min-width: 40em) { + .position-left.reveal-for-medium { + left: 0; + z-index: auto; + position: fixed; } + .position-left.reveal-for-medium ~ .off-canvas-content { + margin-left: 250px; } + .position-right.reveal-for-medium { + right: 0; + z-index: auto; + position: fixed; } + .position-right.reveal-for-medium ~ .off-canvas-content { + margin-right: 250px; } } + +@media screen and (min-width: 64em) { + .position-left.reveal-for-large { + left: 0; + z-index: auto; + position: fixed; } + .position-left.reveal-for-large ~ .off-canvas-content { + margin-left: 250px; } + .position-right.reveal-for-large { + right: 0; + z-index: auto; + position: fixed; } + .position-right.reveal-for-large ~ .off-canvas-content { + margin-right: 250px; } } + +.orbit { + position: relative; } + +.orbit-container { + position: relative; + margin: 0; + overflow: hidden; + list-style: none; } + +.orbit-slide { + width: 100%; + max-height: 100%; } + .orbit-slide.no-motionui.is-active { + top: 0; + left: 0; } + +.orbit-figure { + margin: 0; } + +.orbit-image { + margin: 0; + width: 100%; + max-width: 100%; } + +.orbit-caption { + position: absolute; + bottom: 0; + width: 100%; + padding: 1rem; + margin-bottom: 0; + color: #fefefe; + background-color: rgba(10, 10, 10, 0.5); } + +.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; + background-color: #cacaca; + border-radius: 50%; } + .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 { + content: ' '; + display: table; } + .pagination::after { + clear: both; } + .pagination li { + font-size: 0.875rem; + margin-right: 0.0625rem; + border-radius: 0; + display: none; } + .pagination li:last-child, .pagination li:first-child { + display: inline-block; } + @media screen and (min-width: 40em) { + .pagination li { + display: inline-block; } } + .pagination a, + .pagination button { + color: #0a0a0a; + display: block; + padding: 0.1875rem 0.625rem; + border-radius: 0; } + .pagination a:hover, + .pagination button:hover { + background: #e6e6e6; } + .pagination .current { + padding: 0.1875rem 0.625rem; + background: #2199e8; + color: #fefefe; + cursor: default; } + .pagination .disabled { + padding: 0.1875rem 0.625rem; + color: #cacaca; + cursor: not-allowed; } + .pagination .disabled:hover { + background: transparent; } + .pagination .ellipsis::after { + content: '\2026'; + padding: 0.1875rem 0.625rem; + color: #0a0a0a; } + +.pagination-previous a::before, +.pagination-previous.disabled::before { + content: '\00ab'; + display: inline-block; + margin-right: 0.5rem; } + +.pagination-next a::after, +.pagination-next.disabled::after { + content: '\00bb'; + display: inline-block; + margin-left: 0.5rem; } + +.progress { + background-color: #cacaca; + height: 1rem; + margin-bottom: 1rem; + border-radius: 0; } + .progress.primary .progress-meter { + background-color: #2199e8; } + .progress.secondary .progress-meter { + background-color: #777; } + .progress.success .progress-meter { + background-color: #3adb76; } + .progress.warning .progress-meter { + background-color: #ffae00; } + .progress.alert .progress-meter { + background-color: #ec5840; } + +.progress-meter { + position: relative; + display: block; + width: 0%; + height: 100%; + background-color: #2199e8; } + +.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; } + +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 { + display: none; + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + z-index: 1005; + background-color: rgba(10, 10, 10, 0.45); + overflow-y: scroll; } + +.reveal { + display: none; + z-index: 1006; + padding: 1rem; + border: 1px solid #cacaca; + background-color: #fefefe; + border-radius: 0; + position: relative; + top: 100px; + margin-left: auto; + margin-right: auto; + overflow-y: auto; } + [data-whatinput='mouse'] .reveal { + outline: 0; } + @media 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 screen and (min-width: 40em) { + .reveal { + width: 600px; + max-width: 75rem; } } + @media screen and (min-width: 40em) { + .reveal .reveal { + left: auto; + right: auto; + margin: 0 auto; } } + .reveal.collapse { + padding: 0; } + @media screen and (min-width: 40em) { + .reveal.tiny { + width: 30%; + max-width: 75rem; } } + @media screen and (min-width: 40em) { + .reveal.small { + width: 50%; + max-width: 75rem; } } + @media screen and (min-width: 40em) { + .reveal.large { + width: 90%; + max-width: 75rem; } } + .reveal.full { + top: 0; + left: 0; + width: 100%; + height: 100%; + height: 100vh; + min-height: 100vh; + max-width: none; + margin-left: 0; + border: 0; + border-radius: 0; } + @media screen and (max-width: 39.9375em) { + .reveal { + top: 0; + left: 0; + width: 100%; + height: 100%; + height: 100vh; + min-height: 100vh; + max-width: none; + margin-left: 0; + border: 0; + border-radius: 0; } } + .reveal.without-overlay { + position: fixed; } + +.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; + transition: all 0.2s ease-in-out; } + .slider-fill.is-dragging { + 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; + background-color: #2199e8; + transition: all 0.2s ease-in-out; + -ms-touch-action: manipulation; + touch-action: manipulation; + border-radius: 0; } + [data-whatinput='mouse'] .slider-handle { + outline: 0; } + .slider-handle:hover { + background-color: #1583cc; } + .slider-handle.is-dragging { + 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: absolute; + 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: absolute; + left: auto; + right: auto; } + .sticky.is-anchored.is-at-bottom { + bottom: 0; } + +.switch { + height: 2rem; + margin-bottom: 1rem; + outline: 0; + position: relative; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + color: #fefefe; + font-weight: bold; + font-size: 0.875rem; } + +.switch-input { + opacity: 0; + position: absolute; + margin-bottom: 0; } + +.switch-paddle { + background: #cacaca; + cursor: pointer; + display: block; + position: relative; + width: 4rem; + height: 2rem; + transition: all 0.25s ease-out; + border-radius: 0; + color: inherit; + font-weight: inherit; } + input + .switch-paddle { + margin: 0; } + .switch-paddle::after { + background: #fefefe; + content: ''; + display: block; + position: absolute; + height: 1.5rem; + left: 0.25rem; + top: 0.25rem; + width: 1.5rem; + transition: all 0.25s ease-out; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + border-radius: 0; } + input:checked ~ .switch-paddle { + background: #2199e8; } + 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 { + 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 { + 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 { + 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 { + font-weight: bold; + padding: 0.5rem 0.625rem 0.625rem; } + 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 tr:nth-child(even) { + background-color: #f1f1f1; } + table tbody th, + table tbody td { + padding: 0.5rem 0.625rem 0.625rem; } + +@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 tbody tr:nth-of-type(even):hover { + background-color: #ececec; } + +.table-scroll { + overflow-x: auto; } + .table-scroll table { + width: auto; } + +.tabs { + margin: 0; + list-style-type: none; + background: #fefefe; + border: 1px solid #e6e6e6; } + .tabs::before, .tabs::after { + content: ' '; + display: table; } + .tabs::after { + clear: both; } + +.tabs.vertical > li { + width: auto; + float: none; + display: block; } + +.tabs.simple > li > a { + padding: 0; } + .tabs.simple > li > a:hover { + background: transparent; } + +.tabs.primary { + background: #2199e8; } + .tabs.primary > li > a { + color: #fefefe; } + .tabs.primary > li > a:hover, .tabs.primary > li > a:focus { + background: #1893e4; } + +.tabs-title { + float: left; } + .tabs-title > a { + display: block; + padding: 1.25rem 1.5rem; + line-height: 1; + font-size: 0.75rem; } + .tabs-title > a:hover { + background: #fefefe; } + .tabs-title > a:focus, .tabs-title > a[aria-selected='true'] { + background: #e6e6e6; } + +.tabs-content { + background: #fefefe; + transition: all 0.5s ease; + border: 1px solid #e6e6e6; + border-top: 0; } + +.tabs-content.vertical { + border: 1px solid #e6e6e6; + border-left: 0; } + +.tabs-panel { + display: none; + padding: 1rem; } + .tabs-panel.is-active { + display: block; } + +.thumbnail { + border: solid 4px #fefefe; + box-shadow: 0 0 0 1px rgba(10, 10, 10, 0.2); + display: inline-block; + line-height: 0; + max-width: 100%; + transition: box-shadow 200ms ease-out; + border-radius: 0; + margin-bottom: 1rem; } + .thumbnail:hover, .thumbnail:focus { + box-shadow: 0 0 6px 1px rgba(33, 153, 232, 0.5); } + +.title-bar { + background: #0a0a0a; + color: #fefefe; + padding: 0.5rem; } + .title-bar::before, .title-bar::after { + content: ' '; + display: table; } + .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 { + font-weight: bold; + vertical-align: middle; + display: inline-block; } + +.has-tip { + border-bottom: dotted 1px #8a8a8a; + font-weight: bold; + position: relative; + display: inline-block; + cursor: help; } + +.tooltip { + background-color: #0a0a0a; + color: #fefefe; + font-size: 80%; + padding: 0.75rem; + position: absolute; + z-index: 10; + top: calc(100% + 0.6495rem); + max-width: 10rem !important; + border-radius: 0; } + .tooltip::before { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 0.75rem; + border-color: transparent transparent #0a0a0a; + border-bottom-style: solid; + border-top-width: 0; + bottom: 100%; + position: absolute; + left: 50%; + -webkit-transform: translateX(-50%); + -ms-transform: translateX(-50%); + transform: translateX(-50%); } + .tooltip.top::before { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 0.75rem; + border-color: #0a0a0a transparent transparent; + border-top-style: solid; + border-bottom-width: 0; + top: 100%; + bottom: auto; } + .tooltip.left::before { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 0.75rem; + border-color: transparent transparent transparent #0a0a0a; + border-left-style: solid; + border-right-width: 0; + bottom: auto; + left: 100%; + top: 50%; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); } + .tooltip.right::before { + content: ''; + display: block; + width: 0; + height: 0; + border: inset 0.75rem; + border-color: transparent #0a0a0a transparent transparent; + border-right-style: solid; + border-left-width: 0; + bottom: auto; + left: auto; + right: 100%; + top: 50%; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); } + +.top-bar { + padding: 0.5rem; } + .top-bar::before, .top-bar::after { + content: ' '; + display: table; } + .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 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 { + float: left; + margin-right: 1rem; } + +.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 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 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; + height: auto; + width: 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-left: auto; + margin-right: auto; } + +.clearfix::before, .clearfix::after { + content: ' '; + display: table; } + +.clearfix::after { + clear: both; } + +.slide-in-down.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: translateY(-100%); + -ms-transform: translateY(-100%); + transform: translateY(-100%); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } + +.slide-in-down.mui-enter.mui-enter-active { + -webkit-transform: translateY(0); + -ms-transform: translateY(0); + transform: translateY(0); } + +.slide-in-left.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: translateX(-100%); + -ms-transform: translateX(-100%); + transform: translateX(-100%); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } + +.slide-in-left.mui-enter.mui-enter-active { + -webkit-transform: translateX(0); + -ms-transform: translateX(0); + transform: translateX(0); } + +.slide-in-up.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: translateY(100%); + -ms-transform: translateY(100%); + transform: translateY(100%); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } + +.slide-in-up.mui-enter.mui-enter-active { + -webkit-transform: translateY(0); + -ms-transform: translateY(0); + transform: translateY(0); } + +.slide-in-right.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: translateX(100%); + -ms-transform: translateX(100%); + transform: translateX(100%); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } + +.slide-in-right.mui-enter.mui-enter-active { + -webkit-transform: translateX(0); + -ms-transform: translateX(0); + transform: translateX(0); } + +.slide-out-down.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: translateY(0); + -ms-transform: translateY(0); + transform: translateY(0); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } + +.slide-out-down.mui-leave.mui-leave-active { + -webkit-transform: translateY(100%); + -ms-transform: translateY(100%); + transform: translateY(100%); } + +.slide-out-right.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: translateX(0); + -ms-transform: translateX(0); + transform: translateX(0); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } + +.slide-out-right.mui-leave.mui-leave-active { + -webkit-transform: translateX(100%); + -ms-transform: translateX(100%); + transform: translateX(100%); } + +.slide-out-up.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: translateY(0); + -ms-transform: translateY(0); + transform: translateY(0); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } + +.slide-out-up.mui-leave.mui-leave-active { + -webkit-transform: translateY(-100%); + -ms-transform: translateY(-100%); + transform: translateY(-100%); } + +.slide-out-left.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: translateX(0); + -ms-transform: translateX(0); + transform: translateX(0); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; } + +.slide-out-left.mui-leave.mui-leave-active { + -webkit-transform: translateX(-100%); + -ms-transform: translateX(-100%); + transform: translateX(-100%); } + +.fade-in.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + opacity: 0; + transition-property: opacity; } + +.fade-in.mui-enter.mui-enter-active { + opacity: 1; } + +.fade-out.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + opacity: 1; + transition-property: opacity; } + +.fade-out.mui-leave.mui-leave-active { + opacity: 0; } + +.hinge-in-from-top.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: perspective(2000px) rotateX(-90deg); + transform: perspective(2000px) rotateX(-90deg); + -webkit-transform-origin: top; + -ms-transform-origin: top; + transform-origin: top; + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 0; } + +.hinge-in-from-top.mui-enter.mui-enter-active { + -webkit-transform: perspective(2000px) rotate(0deg); + transform: perspective(2000px) rotate(0deg); + opacity: 1; } + +.hinge-in-from-right.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: perspective(2000px) rotateY(-90deg); + transform: perspective(2000px) rotateY(-90deg); + -webkit-transform-origin: right; + -ms-transform-origin: right; + transform-origin: right; + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 0; } + +.hinge-in-from-right.mui-enter.mui-enter-active { + -webkit-transform: perspective(2000px) rotate(0deg); + transform: perspective(2000px) rotate(0deg); + opacity: 1; } + +.hinge-in-from-bottom.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: perspective(2000px) rotateX(90deg); + transform: perspective(2000px) rotateX(90deg); + -webkit-transform-origin: bottom; + -ms-transform-origin: bottom; + transform-origin: bottom; + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 0; } + +.hinge-in-from-bottom.mui-enter.mui-enter-active { + -webkit-transform: perspective(2000px) rotate(0deg); + transform: perspective(2000px) rotate(0deg); + opacity: 1; } + +.hinge-in-from-left.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: perspective(2000px) rotateY(90deg); + transform: perspective(2000px) rotateY(90deg); + -webkit-transform-origin: left; + -ms-transform-origin: left; + transform-origin: left; + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 0; } + +.hinge-in-from-left.mui-enter.mui-enter-active { + -webkit-transform: perspective(2000px) rotate(0deg); + transform: perspective(2000px) rotate(0deg); + opacity: 1; } + +.hinge-in-from-middle-x.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: perspective(2000px) rotateX(-90deg); + transform: perspective(2000px) rotateX(-90deg); + -webkit-transform-origin: center; + -ms-transform-origin: center; + transform-origin: center; + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 0; } + +.hinge-in-from-middle-x.mui-enter.mui-enter-active { + -webkit-transform: perspective(2000px) rotate(0deg); + transform: perspective(2000px) rotate(0deg); + opacity: 1; } + +.hinge-in-from-middle-y.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: perspective(2000px) rotateY(-90deg); + transform: perspective(2000px) rotateY(-90deg); + -webkit-transform-origin: center; + -ms-transform-origin: center; + transform-origin: center; + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 0; } + +.hinge-in-from-middle-y.mui-enter.mui-enter-active { + -webkit-transform: perspective(2000px) rotate(0deg); + transform: perspective(2000px) rotate(0deg); + opacity: 1; } + +.hinge-out-from-top.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: perspective(2000px) rotate(0deg); + transform: perspective(2000px) rotate(0deg); + -webkit-transform-origin: top; + -ms-transform-origin: top; + transform-origin: top; + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 1; } + +.hinge-out-from-top.mui-leave.mui-leave-active { + -webkit-transform: perspective(2000px) rotateX(-90deg); + transform: perspective(2000px) rotateX(-90deg); + opacity: 0; } + +.hinge-out-from-right.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: perspective(2000px) rotate(0deg); + transform: perspective(2000px) rotate(0deg); + -webkit-transform-origin: right; + -ms-transform-origin: right; + transform-origin: right; + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 1; } + +.hinge-out-from-right.mui-leave.mui-leave-active { + -webkit-transform: perspective(2000px) rotateY(-90deg); + transform: perspective(2000px) rotateY(-90deg); + opacity: 0; } + +.hinge-out-from-bottom.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: perspective(2000px) rotate(0deg); + transform: perspective(2000px) rotate(0deg); + -webkit-transform-origin: bottom; + -ms-transform-origin: bottom; + transform-origin: bottom; + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 1; } + +.hinge-out-from-bottom.mui-leave.mui-leave-active { + -webkit-transform: perspective(2000px) rotateX(90deg); + transform: perspective(2000px) rotateX(90deg); + opacity: 0; } + +.hinge-out-from-left.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: perspective(2000px) rotate(0deg); + transform: perspective(2000px) rotate(0deg); + -webkit-transform-origin: left; + -ms-transform-origin: left; + transform-origin: left; + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 1; } + +.hinge-out-from-left.mui-leave.mui-leave-active { + -webkit-transform: perspective(2000px) rotateY(90deg); + transform: perspective(2000px) rotateY(90deg); + opacity: 0; } + +.hinge-out-from-middle-x.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: perspective(2000px) rotate(0deg); + transform: perspective(2000px) rotate(0deg); + -webkit-transform-origin: center; + -ms-transform-origin: center; + transform-origin: center; + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 1; } + +.hinge-out-from-middle-x.mui-leave.mui-leave-active { + -webkit-transform: perspective(2000px) rotateX(-90deg); + transform: perspective(2000px) rotateX(-90deg); + opacity: 0; } + +.hinge-out-from-middle-y.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: perspective(2000px) rotate(0deg); + transform: perspective(2000px) rotate(0deg); + -webkit-transform-origin: center; + -ms-transform-origin: center; + transform-origin: center; + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 1; } + +.hinge-out-from-middle-y.mui-leave.mui-leave-active { + -webkit-transform: perspective(2000px) rotateY(-90deg); + transform: perspective(2000px) rotateY(-90deg); + opacity: 0; } + +.scale-in-up.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: scale(0.5); + -ms-transform: scale(0.5); + transform: scale(0.5); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 0; } + +.scale-in-up.mui-enter.mui-enter-active { + -webkit-transform: scale(1); + -ms-transform: scale(1); + transform: scale(1); + opacity: 1; } + +.scale-in-down.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: scale(1.5); + -ms-transform: scale(1.5); + transform: scale(1.5); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 0; } + +.scale-in-down.mui-enter.mui-enter-active { + -webkit-transform: scale(1); + -ms-transform: scale(1); + transform: scale(1); + opacity: 1; } + +.scale-out-up.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: scale(1); + -ms-transform: scale(1); + transform: scale(1); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 1; } + +.scale-out-up.mui-leave.mui-leave-active { + -webkit-transform: scale(1.5); + -ms-transform: scale(1.5); + transform: scale(1.5); + opacity: 0; } + +.scale-out-down.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: scale(1); + -ms-transform: scale(1); + transform: scale(1); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 1; } + +.scale-out-down.mui-leave.mui-leave-active { + -webkit-transform: scale(0.5); + -ms-transform: scale(0.5); + transform: scale(0.5); + opacity: 0; } + +.spin-in.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: rotate(-0.75turn); + -ms-transform: rotate(-0.75turn); + transform: rotate(-0.75turn); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 0; } + +.spin-in.mui-enter.mui-enter-active { + -webkit-transform: rotate(0); + -ms-transform: rotate(0); + transform: rotate(0); + opacity: 1; } + +.spin-out.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: rotate(0); + -ms-transform: rotate(0); + transform: rotate(0); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 1; } + +.spin-out.mui-leave.mui-leave-active { + -webkit-transform: rotate(0.75turn); + -ms-transform: rotate(0.75turn); + transform: rotate(0.75turn); + opacity: 0; } + +.spin-in-ccw.mui-enter { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: rotate(0.75turn); + -ms-transform: rotate(0.75turn); + transform: rotate(0.75turn); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 0; } + +.spin-in-ccw.mui-enter.mui-enter-active { + -webkit-transform: rotate(0); + -ms-transform: rotate(0); + transform: rotate(0); + opacity: 1; } + +.spin-out-ccw.mui-leave { + transition-duration: 500ms; + transition-timing-function: linear; + -webkit-transform: rotate(0); + -ms-transform: rotate(0); + transform: rotate(0); + transition-property: -webkit-transform, opacity; + transition-property: transform, opacity; + opacity: 1; } + +.spin-out-ccw.mui-leave.mui-leave-active { + -webkit-transform: rotate(-0.75turn); + -ms-transform: rotate(-0.75turn); + transform: rotate(-0.75turn); + opacity: 0; } + +.slow { + transition-duration: 750ms !important; } + +.fast { + transition-duration: 250ms !important; } + +.linear { + transition-timing-function: linear !important; } + +.ease { + transition-timing-function: ease !important; } + +.ease-in { + transition-timing-function: ease-in !important; } + +.ease-out { + transition-timing-function: ease-out !important; } + +.ease-in-out { + transition-timing-function: ease-in-out !important; } + +.bounce-in { + transition-timing-function: cubic-bezier(0.485, 0.155, 0.24, 1.245) !important; } + +.bounce-out { + transition-timing-function: cubic-bezier(0.485, 0.155, 0.515, 0.845) !important; } + +.bounce-in-out { + transition-timing-function: cubic-bezier(0.76, -0.245, 0.24, 1.245) !important; } + +.short-delay { + transition-delay: 300ms !important; } + +.long-delay { + transition-delay: 700ms !important; } + +.shake { + -webkit-animation-name: shake-7; + animation-name: shake-7; } + +@-webkit-keyframes shake-7 { + 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90% { + -webkit-transform: translateX(7%); + transform: translateX(7%); } + 5%, 15%, 25%, 35%, 45%, 55%, 65%, 75%, 85%, 95% { + -webkit-transform: translateX(-7%); + transform: translateX(-7%); } } + +@keyframes shake-7 { + 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90% { + -webkit-transform: translateX(7%); + transform: translateX(7%); } + 5%, 15%, 25%, 35%, 45%, 55%, 65%, 75%, 85%, 95% { + -webkit-transform: translateX(-7%); + transform: translateX(-7%); } } + +.spin-cw { + -webkit-animation-name: spin-cw-1turn; + animation-name: spin-cw-1turn; } + +@-webkit-keyframes spin-cw-1turn { + 0% { + -webkit-transform: rotate(-1turn); + transform: rotate(-1turn); } + 100% { + -webkit-transform: rotate(0); + transform: rotate(0); } } + +@keyframes spin-cw-1turn { + 0% { + -webkit-transform: rotate(-1turn); + transform: rotate(-1turn); } + 100% { + -webkit-transform: rotate(0); + transform: rotate(0); } } + +.spin-ccw { + -webkit-animation-name: spin-cw-1turn; + animation-name: spin-cw-1turn; } + +@keyframes spin-cw-1turn { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); } + 100% { + -webkit-transform: rotate(1turn); + transform: rotate(1turn); } } + +.wiggle { + -webkit-animation-name: wiggle-7deg; + animation-name: wiggle-7deg; } + +@-webkit-keyframes wiggle-7deg { + 40%, 50%, 60% { + -webkit-transform: rotate(7deg); + transform: rotate(7deg); } + 35%, 45%, 55%, 65% { + -webkit-transform: rotate(-7deg); + transform: rotate(-7deg); } + 0%, 30%, 70%, 100% { + -webkit-transform: rotate(0); + transform: rotate(0); } } + +@keyframes wiggle-7deg { + 40%, 50%, 60% { + -webkit-transform: rotate(7deg); + transform: rotate(7deg); } + 35%, 45%, 55%, 65% { + -webkit-transform: rotate(-7deg); + transform: rotate(-7deg); } + 0%, 30%, 70%, 100% { + -webkit-transform: rotate(0); + transform: rotate(0); } } + +.shake, +.spin-cw, +.spin-ccw, +.wiggle { + -webkit-animation-duration: 500ms; + animation-duration: 500ms; } + +.infinite { + -webkit-animation-iteration-count: infinite; + animation-iteration-count: infinite; } + +.slow { + -webkit-animation-duration: 750ms !important; + animation-duration: 750ms !important; } + +.fast { + -webkit-animation-duration: 250ms !important; + animation-duration: 250ms !important; } + +.linear { + -webkit-animation-timing-function: linear !important; + animation-timing-function: linear !important; } + +.ease { + -webkit-animation-timing-function: ease !important; + animation-timing-function: ease !important; } + +.ease-in { + -webkit-animation-timing-function: ease-in !important; + animation-timing-function: ease-in !important; } + +.ease-out { + -webkit-animation-timing-function: ease-out !important; + animation-timing-function: ease-out !important; } + +.ease-in-out { + -webkit-animation-timing-function: ease-in-out !important; + animation-timing-function: ease-in-out !important; } + +.bounce-in { + -webkit-animation-timing-function: cubic-bezier(0.485, 0.155, 0.24, 1.245) !important; + animation-timing-function: cubic-bezier(0.485, 0.155, 0.24, 1.245) !important; } + +.bounce-out { + -webkit-animation-timing-function: cubic-bezier(0.485, 0.155, 0.515, 0.845) !important; + animation-timing-function: cubic-bezier(0.485, 0.155, 0.515, 0.845) !important; } + +.bounce-in-out { + -webkit-animation-timing-function: cubic-bezier(0.76, -0.245, 0.24, 1.245) !important; + animation-timing-function: cubic-bezier(0.76, -0.245, 0.24, 1.245) !important; } + +.short-delay { + -webkit-animation-delay: 300ms !important; + animation-delay: 300ms !important; } + +.long-delay { + -webkit-animation-delay: 700ms !important; + animation-delay: 700ms !important; } From 12f310df725de496f435ceb4aec1127a9d8159a5 Mon Sep 17 00:00:00 2001 From: RedSquirrelious Date: Mon, 7 Nov 2016 09:26:18 -0800 Subject: [PATCH 88/88] some thoughts on the project --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index afd643dd4..dc6c1f2f9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,15 @@ + + + # Recipe API Consumer +## REFLECTION +I can set up an app that pulls from an API. I can navigate through the API's docs. While I was just starting to wrap my head around working with APIs, I practiced with Google Books. I figured that since the recipe search API throttles us after so many pulls, it'd be best to dink around with other APIs so I don't use up my quota. + +I want more practice with CSS. I didn't get done what I'd wanted to get done and my site is pretty darn ugly. + +My chair pair did a fabulous job styling. + ## Learning Goals: - Configure an API for consumption - Create authenticated API requests using HTTParty