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

Feature/workout #17

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ $ ->


$('#workout_form').hide()
# $('#new_user_workout').hide()


$(document).on 'click', '.select_workout', ->

Expand All @@ -26,15 +24,9 @@ $ ->
console.log w._name()

image_tag_builder = '<' + '%= ' + 'image_tag ' + w._image_url() + ' %>'

$('#workout_grid').hide()
$('#workout_form').fadeIn( 500 )
#$('#new_user_workout').fadeIn( 500 )
$('#load_image').html( "<img src=\"" + w._image_url() + "\" width='90' height='90' />" ).addClass( "workout_image" )


$('#load_image').html( "<img src=\"" + w._image_url() + "\" width='100' height='100' />" ).addClass( "workout_image" )
rajgurung marked this conversation as resolved.
Show resolved Hide resolved

$(document).on 'click', '#search_id', ->

# $('#new_user_workout').hide()
$('#workout_form').hide()
13 changes: 12 additions & 1 deletion app/assets/stylesheets/user_workouts.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
.center_text { text-align: center}
rajgurung marked this conversation as resolved.
Show resolved Hide resolved

.txt_color_grey { color: grey }
rajgurung marked this conversation as resolved.
Show resolved Hide resolved

.display_design { margin-bottom: 15px }

.workout_image { float:left;display:block;background-color:grey;padding:4px }

.workout_name { float:left;margin-left:15px }

.grey-background { background-color: grey }
.grey-background { background-color: grey }

rajgurung marked this conversation as resolved.
Show resolved Hide resolved
.user_workout_input { font-family:'Roboto';font-weight:900;font-size:70px;line-height:75px;width:80%; }

rajgurung marked this conversation as resolved.
Show resolved Hide resolved
.user_workout_save { font-family:'Roboto';font-weight:900;font-size:45px;line-height:75px; }

input,
rajgurung marked this conversation as resolved.
Show resolved Hide resolved
input::-webkit-input-placeholder { font-size:30px;line-height:75px; }
3 changes: 3 additions & 0 deletions app/controllers/user_workouts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def edit
# POST /user_workouts
# POST /user_workouts.json
def create
raise user_workout_params.inspect
@user_workout = UserWorkout.new(user_workout_params)

respond_to do |format|
Expand Down Expand Up @@ -79,6 +80,8 @@ def user_workout_params
end

def _workout
foo = Hash.new

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use hash literal {} instead of Hash.new.

foo[1]
Workout
end
end
22 changes: 14 additions & 8 deletions app/views/user_workouts/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@
- @user_workout.errors.full_messages.each do |msg|
%li= msg

.row
.col-xs-4
.row.form-group
.col-xs-3{:style => "text-align:center;"}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use inline style attributes
Hash attribute should start with one space after the opening brace
Hash attribute should end with one space before the closing brace

%span#load_image
.col-xs-4
%b SETS
%h2 3
.col-xs-4
%b REPS
%h2 12
= f.hidden_field :workout_id, value: 1
.col-xs-2.center_text
-#%h2.user_workout_input 30

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment should have a space after the #

= f.number_field :weight, class: 'user_workout_input center_text', placeholder: 'wts'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [91/80]

.col-xs-2.center_text
-#%h2.user_workout_input 3

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment should have a space after the #

= f.number_field :set, class: 'user_workout_input center_text', placeholder: 'sets'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [89/80]

.col-xs-2.center_text
-#%h2.user_workout_input 12

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment should have a space after the #

= f.number_field :rep, class: 'user_workout_input center_text', placeholder: 'reps'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [89/80]

.col-xs-3{:style => "text-align:center;bottom:0"}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use inline style attributes
Hash attribute should start with one space after the opening brace
Hash attribute should end with one space before the closing brace

= f.submit 'save', class: 'user_workout_save txt_color_grey'

-#.form-group
-# = f.label :set, class: 'col-sm-2 control-label'
Expand Down