Skip to content

Commit

Permalink
patch disabled, toggle chord voicings in song
Browse files Browse the repository at this point in the history
  • Loading branch information
davebenjoya committed Sep 26, 2020
1 parent c0ca595 commit 61a390d
Show file tree
Hide file tree
Showing 16 changed files with 672 additions and 601 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ gem 'jbuilder', '~> 2.7'
gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'jquery-rails'

gem 'cloudinary', '~> 1.12.0'
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'master'
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ GEM
concurrent-ruby (~> 1.0)
jbuilder (2.10.0)
activesupport (>= 5.0.0)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
Expand Down Expand Up @@ -277,6 +281,7 @@ DEPENDENCIES
faker!
font-awesome-sass
jbuilder (~> 2.7)
jquery-rails
listen (~> 3.2)
pg (>= 0.18, < 2.0)
pry-byebug
Expand Down
18 changes: 14 additions & 4 deletions app/assets/stylesheets/components/_dnd.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
--voicings-width: 100px;
}


.update-chord {
display: hidden !important;
overflow: hidden;
width: 0px;
height: 0px;
}

.hidden_bg {
background-color:rgba(60, 140, 160, 0.0) !important;
Expand Down Expand Up @@ -32,7 +37,9 @@
.voicings-header {
font-size:24px;
clear: both;
position: absolute;
position: relative;
// z-index: 1;
margin-right: 16px;
// width:auto;
// padding-right: 32px;
// transform: rotate(-90deg);
Expand All @@ -46,7 +53,7 @@
width: 100%;
z-index: 100;
padding: 80px;
background-color: rgba(156,156,56,.4);
background-color: rgba(36,46,86,.4);
margin: 0;
// opacity: .5;
};
Expand Down Expand Up @@ -171,6 +178,7 @@ margin: 0;
text-align: left;
// margin-right: 8px;
padding: 0px;
// pointer-events: none;
}

.chord-type {
Expand All @@ -181,6 +189,7 @@ margin: 0;
position: relative;
display: inline;
width: 30px;
pointer-events: none;

}

Expand All @@ -196,6 +205,7 @@ margin: 0;
text-align: left;
vertical-align: top;
// display: inline;
pointer-events: none;
}

.modifier {
Expand Down Expand Up @@ -260,7 +270,7 @@ margin: 0;
position: relative;
pointer-events: none;
text-align: center;

pointer-events: none;
}

.barre {
Expand Down
26 changes: 23 additions & 3 deletions app/controllers/chords_controller.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
class ChordsController < ApplicationController

def index
@chords = Chord.all
authorize @chords
redirect_to new_song_path
end

def show
end

def update
@chord = Chord.find_by_id params[:id]
@chord.update chord_params
@chord.save
respond_to do |format|
format.js

authorize @chord
@chord.save!
# respond_to do |format|
# format.js
# end

if @chord.save
# raise
# redirect_to new_song_path
else
puts "Not saved"
end

end

private
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/songs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def new
end

def create
raise
# raise
@song = Song.new(song_params)
authorize @song
@song.user = current_user
Expand Down
Loading

0 comments on commit 61a390d

Please sign in to comment.