Skip to content

Commit

Permalink
Make tweaks to splash CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
avvazana committed Nov 15, 2018
1 parent c85b0c3 commit db064ef
Show file tree
Hide file tree
Showing 29 changed files with 169 additions and 21 deletions.
3 changes: 3 additions & 0 deletions app/assets/javascripts/playlists.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/song_playlists.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/songs.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/
4 changes: 4 additions & 0 deletions app/assets/stylesheets/components/browse.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
Expand Down
10 changes: 5 additions & 5 deletions app/assets/stylesheets/components/splash.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,7 +30,7 @@
height: 40px;
color: white;
margin-left: 110px;
margin-top: 18px;
margin-top: 24px;
}

.splash-page .logo img {
Expand All @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/playlists.scss
Original file line number Diff line number Diff line change
@@ -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/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/song_playlists.scss
Original file line number Diff line number Diff line change
@@ -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/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/songs.scss
Original file line number Diff line number Diff line change
@@ -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/
5 changes: 5 additions & 0 deletions app/controllers/playlists_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class PlaylistsController < ApplicationController



end
3 changes: 3 additions & 0 deletions app/controllers/song_playlists_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class SongPlaylistsController < ApplicationController

end
3 changes: 3 additions & 0 deletions app/controllers/songs_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class SongsController < ApplicationController

end
2 changes: 2 additions & 0 deletions app/helpers/playlists_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module PlaylistsHelper
end
2 changes: 2 additions & 0 deletions app/helpers/song_playlists_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module SongPlaylistsHelper
end
2 changes: 2 additions & 0 deletions app/helpers/songs_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module SongsHelper
end
7 changes: 7 additions & 0 deletions app/models/playlist.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Playlist < ApplicationRecord
validates :author_id, presence: true

belongs_to :author,
foreign_key: :author_id,
class_name: :User
end
8 changes: 8 additions & 0 deletions app/models/song.rb
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions app/models/song_playlist.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Song_playlist < ApplicationRecord
belongs_to :song
belongs_to :playlist
end
11 changes: 11 additions & 0 deletions db/migrate/20181115144937_create_songs.rb
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions db/migrate/20181115144945_create_playlists.rb
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions db/migrate/20181115145102_create_song_playlists.rb
Original file line number Diff line number Diff line change
@@ -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
47 changes: 46 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions frontend/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div>

<Switch>
<AuthRoute exact path="/login" component={LoginFormContainer} />
<AuthRoute exact path="/signup" component={SignupFormContainer} />
<ProtectedRoute exact path="/browse" component={Browse}/>
<ProtectedRoute exact path="/browse" component={BrowseContainer}/>
<Route path="/" component={SplashContainer}/>
</Switch>
</div>
Expand Down
1 change: 1 addition & 0 deletions frontend/components/browse/browse.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Browse extends React.Component {
return (
<div className="main-container">
<nav className="nav-bar">
<button onClick={()=>this.props.logout()}>Logout</button>
</nav>
</div>
);
Expand Down
14 changes: 4 additions & 10 deletions frontend/components/browse/browse_container.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import { connect } from 'react-redux';
import React from 'react';
import { Link } from 'react-router-dom';
import { login } from '../../actions/session_actions';
import SessionForm from './session_form';

const mapStateToProps = (state) => {
return {

};
};
import { logout } from '../../actions/session_actions';
import Browse from './browse'

const mapDispatchToProps = dispatch => {
return {

logout: () => dispatch(logout())
};
};

export default connect(mapStateToProps, mapDispatchToProps)(SessionForm);
export default connect(null, mapDispatchToProps)(Browse);
1 change: 1 addition & 0 deletions frontend/components/splash/splash.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const sessionLinks = () => (
<div className="login-signup">
<Link className='splash-session-link' to="/signup">Sign up</Link>
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
<Link className='splash-session-link' to="/login">Log in</Link>
</div>
</nav>
Expand Down
3 changes: 1 addition & 2 deletions frontend/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import configureStore from './store/store';
import Root from './components/root';
import {fetchUser, logout} from './actions/session_actions';
import {logout} from './actions/session_actions';

document.addEventListener('DOMContentLoaded', () => {
let store;
Expand All @@ -18,5 +18,4 @@ document.addEventListener('DOMContentLoaded', () => {
window.getState = store.getState;
window.dispatch = store.dispatch;
window.logout = logout;
window.fetchUser = fetchUser;
});
7 changes: 7 additions & 0 deletions test/controllers/playlists_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class PlaylistsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
7 changes: 7 additions & 0 deletions test/controllers/song_playlists_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class SongPlaylistsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
7 changes: 7 additions & 0 deletions test/controllers/songs_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class SongsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end

0 comments on commit db064ef

Please sign in to comment.