diff --git a/app/assets/javascripts/playlists.coffee b/app/assets/javascripts/playlists.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/playlists.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/song_playlists.coffee b/app/assets/javascripts/song_playlists.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/song_playlists.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/songs.coffee b/app/assets/javascripts/songs.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/songs.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/components/browse.scss b/app/assets/stylesheets/components/browse.scss index c49f3ef..6564e0c 100644 --- a/app/assets/stylesheets/components/browse.scss +++ b/app/assets/stylesheets/components/browse.scss @@ -4,6 +4,10 @@ background-image: linear-gradient(orange, red, black); } +.nav-bar button { + color:white; +} + // .main-container { // /* Set rules to fill background */ // min-height: 100%; diff --git a/app/assets/stylesheets/components/splash.scss b/app/assets/stylesheets/components/splash.scss index f488577..e3c2398 100644 --- a/app/assets/stylesheets/components/splash.scss +++ b/app/assets/stylesheets/components/splash.scss @@ -10,7 +10,7 @@ .splash-nav { background-color: rgba(0,0,0,0.5); - height: 80px; + height: 89px; display: flex; justify-content: space-between; font-size: 16px; @@ -30,7 +30,7 @@ height: 40px; color: white; margin-left: 110px; - margin-top: 18px; + margin-top: 24px; } .splash-page .logo img { @@ -39,16 +39,16 @@ .splash-page .logo h1 { padding-top: 4px; - letter-spacing: -1px; + letter-spacing: 0px; margin-left: 9px; } .login-signup{ color: white; - margin-top: 28px; + margin-top: 36px; margin-right: 110px; justify-content: space-between; - font-size: 14px; + font-size: 18px; } .splash-session-link:hover { diff --git a/app/assets/stylesheets/playlists.scss b/app/assets/stylesheets/playlists.scss new file mode 100644 index 0000000..07d1945 --- /dev/null +++ b/app/assets/stylesheets/playlists.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the playlists controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/song_playlists.scss b/app/assets/stylesheets/song_playlists.scss new file mode 100644 index 0000000..6b3a30b --- /dev/null +++ b/app/assets/stylesheets/song_playlists.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the song_playlists controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/songs.scss b/app/assets/stylesheets/songs.scss new file mode 100644 index 0000000..c94dc29 --- /dev/null +++ b/app/assets/stylesheets/songs.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the songs 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/playlists_controller.rb b/app/controllers/playlists_controller.rb new file mode 100644 index 0000000..78fd2d9 --- /dev/null +++ b/app/controllers/playlists_controller.rb @@ -0,0 +1,5 @@ +class PlaylistsController < ApplicationController + + + +end diff --git a/app/controllers/song_playlists_controller.rb b/app/controllers/song_playlists_controller.rb new file mode 100644 index 0000000..ae52da8 --- /dev/null +++ b/app/controllers/song_playlists_controller.rb @@ -0,0 +1,3 @@ +class SongPlaylistsController < ApplicationController + +end diff --git a/app/controllers/songs_controller.rb b/app/controllers/songs_controller.rb new file mode 100644 index 0000000..962cc94 --- /dev/null +++ b/app/controllers/songs_controller.rb @@ -0,0 +1,3 @@ +class SongsController < ApplicationController + +end diff --git a/app/helpers/playlists_helper.rb b/app/helpers/playlists_helper.rb new file mode 100644 index 0000000..5c69b75 --- /dev/null +++ b/app/helpers/playlists_helper.rb @@ -0,0 +1,2 @@ +module PlaylistsHelper +end diff --git a/app/helpers/song_playlists_helper.rb b/app/helpers/song_playlists_helper.rb new file mode 100644 index 0000000..6762ca8 --- /dev/null +++ b/app/helpers/song_playlists_helper.rb @@ -0,0 +1,2 @@ +module SongPlaylistsHelper +end diff --git a/app/helpers/songs_helper.rb b/app/helpers/songs_helper.rb new file mode 100644 index 0000000..75baad2 --- /dev/null +++ b/app/helpers/songs_helper.rb @@ -0,0 +1,2 @@ +module SongsHelper +end diff --git a/app/models/playlist.rb b/app/models/playlist.rb new file mode 100644 index 0000000..57b2ae7 --- /dev/null +++ b/app/models/playlist.rb @@ -0,0 +1,7 @@ +class Playlist < ApplicationRecord + validates :author_id, presence: true + + belongs_to :author, + foreign_key: :author_id, + class_name: :User +end diff --git a/app/models/song.rb b/app/models/song.rb new file mode 100644 index 0000000..1fc2d58 --- /dev/null +++ b/app/models/song.rb @@ -0,0 +1,8 @@ +class Song < ApplicationRecord + validates :playlist_id, presence: true + + belongs_to :album + has_one_attached :song + has_many :song_playlists + # has_many :artists +end diff --git a/app/models/song_playlist.rb b/app/models/song_playlist.rb new file mode 100644 index 0000000..204cf2e --- /dev/null +++ b/app/models/song_playlist.rb @@ -0,0 +1,4 @@ +class Song_playlist < ApplicationRecord + belongs_to :song + belongs_to :playlist +end diff --git a/db/migrate/20181115144937_create_songs.rb b/db/migrate/20181115144937_create_songs.rb new file mode 100644 index 0000000..31c07b2 --- /dev/null +++ b/db/migrate/20181115144937_create_songs.rb @@ -0,0 +1,11 @@ +class CreateSongs < ActiveRecord::Migration[5.2] + def change + create_table :songs do |t| + t.integer :album_id, null: false + t.string :title, null: false + t.index [:album_id], unique: true + t.index [:title], unique: true + t.timestamps + end + end +end diff --git a/db/migrate/20181115144945_create_playlists.rb b/db/migrate/20181115144945_create_playlists.rb new file mode 100644 index 0000000..efedfb2 --- /dev/null +++ b/db/migrate/20181115144945_create_playlists.rb @@ -0,0 +1,10 @@ +class CreatePlaylists < ActiveRecord::Migration[5.2] + def change + create_table :playlists do |t| + t.integer :author_id + t.string :title, null: false + t.index [:title] + t.timestamps + end + end +end diff --git a/db/migrate/20181115145102_create_song_playlists.rb b/db/migrate/20181115145102_create_song_playlists.rb new file mode 100644 index 0000000..d8670e2 --- /dev/null +++ b/db/migrate/20181115145102_create_song_playlists.rb @@ -0,0 +1,9 @@ +class CreateSongPlaylists < ActiveRecord::Migration[5.2] + def change + create_table :song_playlists do |t| + t.integer :song_id + t.integer :playlist_id + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index eee0952..e6046b8 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,11 +10,56 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2018_11_13_164249) do +ActiveRecord::Schema.define(version: 2018_11_15_145102) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" + create_table "active_storage_attachments", force: :cascade do |t| + t.string "name", null: false + t.string "record_type", null: false + t.bigint "record_id", null: false + t.bigint "blob_id", null: false + t.datetime "created_at", null: false + t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" + t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true + end + + create_table "active_storage_blobs", force: :cascade do |t| + t.string "key", null: false + t.string "filename", null: false + t.string "content_type" + t.text "metadata" + t.bigint "byte_size", null: false + t.string "checksum", null: false + t.datetime "created_at", null: false + t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true + end + + create_table "playlists", force: :cascade do |t| + t.integer "author_id" + t.string "title", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["title"], name: "index_playlists_on_title" + end + + create_table "song_playlists", force: :cascade do |t| + t.integer "song_id" + t.integer "playlist_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "songs", force: :cascade do |t| + t.integer "album_id", null: false + t.string "title", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["album_id"], name: "index_songs_on_album_id", unique: true + t.index ["title"], name: "index_songs_on_title", unique: true + end + create_table "users", force: :cascade do |t| t.string "username", null: false t.string "email", null: false diff --git a/frontend/components/App.jsx b/frontend/components/App.jsx index bae7d40..c571521 100644 --- a/frontend/components/App.jsx +++ b/frontend/components/App.jsx @@ -4,16 +4,15 @@ import { Route, Switch } from 'react-router-dom'; import LoginFormContainer from './session/login_form_container'; import SignupFormContainer from './session/signup_form_container'; import SplashContainer from './splash/splash_container'; -import Browse from './browse/browse'; +import BrowseContainer from './browse/browse_container'; const App = () => { return (