Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tunes Takeout #8

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3c1c56f
Boiler plate and Shaved yaks
dri19tcc May 17, 2016
0770a58
started using omniauth to sign a user in through spotify
dri19tcc May 17, 2016
6f7d0d6
added new gems to the Gemfile, and added a new user.
dri19tcc May 18, 2016
6ec4119
added a picture from spotify. Made it so that you can't view other p…
dri19tcc May 18, 2016
7f65672
Lots of stuff
dri19tcc May 19, 2016
3bb164b
suggestions view
dri19tcc May 19, 2016
7f54bc2
trying to add top suggestions to home page
dri19tcc May 19, 2016
ced8d4c
working with bootstrap and top suggestions
dri19tcc May 19, 2016
d6ca12d
Added pictures for suggestions and top favorites
dri19tcc May 19, 2016
8a02e3c
added images for music, can click on all images to take you to yelp …
dri19tcc May 19, 2016
21d7ba0
When clicking user image or hi, you go to spotify overview page
dri19tcc May 19, 2016
6e35261
added favorites for a particular user to charles' api
dri19tcc May 20, 2016
0bfa37b
cleaned up, redirected when you add, added a flash, saved to API
dri19tcc May 20, 2016
9eb41cb
got delete favorite function to work. Added gem so that you can conf…
dri19tcc May 20, 2016
6268e7a
Added if statements to favorites button if there is no user
dri19tcc May 20, 2016
7c7e634
Adding partial form for all files
dri19tcc May 20, 2016
ab725c3
Added partial views
dri19tcc May 20, 2016
ed5bd30
Added partials to all index views
dri19tcc May 20, 2016
338a047
Delete button shows for favorites, Add button shows on suggestions an…
dri19tcc May 20, 2016
a9e088a
Adding a new method to show the artist logo for sign in
dri19tcc May 20, 2016
57abd87
adding spotify image logo if not signed in
dri19tcc May 20, 2016
a4e8b5b
Added phone number as well as formatted it
dri19tcc May 20, 2016
21cbf55
Added spotify.type requirement
dri19tcc May 20, 2016
fd5c032
added an embedded software player that has album image or is just bla…
dri19tcc May 20, 2016
55e0af2
trying to add user logo if no one signed in
dri19tcc May 20, 2016
c351bdc
cleaned up files from unneccessary data, made spotify image work when…
dri19tcc May 21, 2016
655ca3f
Added a flash error for creating and deleting favorites
dri19tcc May 21, 2016
71aa2b6
Added a bootstrap navbar
dri19tcc May 22, 2016
bc4dc55
Adding bootstrap stylings
dri19tcc May 22, 2016
0a70684
Added bootstrap styling
dri19tcc May 22, 2016
d13ce48
Added more styling in
dri19tcc May 22, 2016
00d968e
bootstrap
dri19tcc May 22, 2016
3912b43
Added user test
dri19tcc May 22, 2016
0f0fb30
One passing users test
dri19tcc May 22, 2016
7a6dcec
Added food model testing
dri19tcc May 23, 2016
3a6a31a
testing
dri19tcc May 23, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ build-iPhoneSimulator/

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

/.env
31 changes: 29 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ruby '2.3.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# Use postgresql as the database for Active Record
gem 'pg', '~> 0.15'
# gem 'pg', '~> 0.15'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
Expand All @@ -13,9 +13,22 @@ gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'httparty'

gem 'yelp'

# Use jquery as the JavaScript library
gem 'jquery-rails'

gem 'rspotify'

gem 'omniauth'
gem 'omniauth-spotify'

gem 'omniauth-oauth2', '~> 1.3.1'

gem 'pg', '~> 0.15'

# Use jquery as the JavaScript library
# 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.
Expand All @@ -33,13 +46,27 @@ gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'simplecov', '~> 0.11.2'
gem 'dotenv-rails'
gem 'pry-rails'
gem 'minitest-vcr'
gem 'minitest-reporters'
gem 'webmock'
gem 'vcr'
end

group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# gem "pry-rails"
gem "better_errors"
gem "binding_of_caller"
gem 'rails-erd'

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end

group :production do
gem 'rails_12factor'
end
116 changes: 115 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,19 @@ 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)
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 (8.2.5)
choice (0.2.0)
coderay (1.1.1)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x)
Expand All @@ -49,11 +57,27 @@ 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)
dotenv-rails (2.1.1)
dotenv (= 2.1.1)
railties (>= 4.0, < 5.1)
erubis (2.7.0)
execjs (2.6.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.10.0)
faraday (>= 0.7.4, < 0.10)
globalid (0.3.6)
activesupport (>= 4.1.0)
hashdiff (0.3.0)
hashie (3.4.4)
httparty (0.13.7)
json (~> 1.8)
multi_xml (>= 0.5.2)
i18n (0.7.0)
jbuilder (2.4.1)
activesupport (>= 3.0.0, < 5.1)
Expand All @@ -63,19 +87,55 @@ GEM
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
jwt (1.5.1)
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.0)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0221)
mini_portile2 (2.0.0)
minispec-metadata (2.0.0)
minitest
minitest (5.8.4)
minitest-reporters (1.1.9)
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.0)
multi_xml (0.5.5)
multipart-post (2.0.0)
netrc (0.7.9)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
oauth2 (1.1.0)
faraday (>= 0.8, < 0.10)
jwt (~> 1.0, < 1.5.2)
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-oauth2 (1.3.1)
oauth2 (~> 1.0)
omniauth (~> 1.2)
omniauth-spotify (0.0.9)
omniauth-oauth2 (~> 1.1)
pg (0.18.4)
pry (0.10.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry-rails (0.3.4)
pry (>= 0.9.10)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
Expand All @@ -96,8 +156,18 @@ GEM
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-erd (1.4.7)
activerecord (>= 3.2)
activesupport (>= 3.2)
choice (~> 0.2.0)
ruby-graphviz (~> 1.2)
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.6)
actionpack (= 4.2.6)
activesupport (= 4.2.6)
Expand All @@ -106,6 +176,14 @@ GEM
rake (11.1.2)
rdoc (4.2.2)
json (~> 1.4)
rest_client (1.8.3)
netrc (~> 0.7.7)
rspotify (1.10.0)
omniauth-oauth2 (~> 1.1)
rest_client (~> 1.8)
ruby-graphviz (1.2.2)
ruby-progressbar (1.8.1)
safe_yaml (1.0.4)
sass (3.4.22)
sass-rails (5.0.4)
railties (>= 4.0.0, < 5.0)
Expand All @@ -116,6 +194,13 @@ GEM
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
simple_oauth (0.3.1)
simplecov (0.11.2)
docile (~> 1.1.0)
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
slop (3.6.0)
spring (1.7.1)
sprockets (3.6.0)
concurrent-ruby (~> 1.0)
Expand All @@ -131,27 +216,56 @@ GEM
thread_safe (~> 0.1)
uglifier (3.0.0)
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.0.3)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
yelp (2.1.2)
faraday (~> 0.8, >= 0.8.0)
faraday_middleware (~> 0.8, >= 0.8.0)
simple_oauth (~> 0.3.1)

PLATFORMS
ruby

DEPENDENCIES
better_errors
binding_of_caller
byebug
coffee-rails (~> 4.1.0)
dotenv-rails
httparty
jbuilder (~> 2.0)
jquery-rails
minitest-reporters
minitest-vcr
omniauth
omniauth-oauth2 (~> 1.3.1)
omniauth-spotify
pg (~> 0.15)
pry-rails
rails (= 4.2.6)
rails-erd
rails_12factor
rspotify
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
simplecov (~> 0.11.2)
spring
uglifier (>= 1.3.0)
vcr
web-console (~> 2.0)
webmock
yelp

RUBY VERSION
ruby 2.3.1p112

BUNDLED WITH
1.12.3
1.12.4
Binary file added app/assets/images/spotify-user-logo.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/javascripts/home.coffee
Original file line number Diff line number Diff line change
@@ -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/
3 changes: 3 additions & 0 deletions app/assets/javascripts/sessions.coffee
Original file line number Diff line number Diff line change
@@ -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/
3 changes: 3 additions & 0 deletions app/assets/javascripts/suggestions.coffee
Original file line number Diff line number Diff line change
@@ -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/
3 changes: 3 additions & 0 deletions app/assets/javascripts/users.coffee
Original file line number Diff line number Diff line change
@@ -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/
35 changes: 20 additions & 15 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
/*
* 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
*/
.jumbo-fix {
margin-top: 110px;
}

h1, h2, h3, h4, h5, h6 {
text-align: center;
}

.card-h {
height: 65rem;
/*padding: 2rem 0rem;*/
}

body {
background-color: #ccc;
}

.card-p {
padding: 3rem 0rem;
}
3 changes: 3 additions & 0 deletions app/assets/stylesheets/home.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the home controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/sessions.scss
Original file line number Diff line number Diff line change
@@ -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/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/suggestions.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the suggestions controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/users.scss
Original file line number Diff line number Diff line change
@@ -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/
15 changes: 15 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,19 @@ 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

before_action :require_login

def current_user
@user ||= User.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 root_path
end
end
end
Loading