-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
work week updating is sorta functional
- Loading branch information
Showing
14 changed files
with
100 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ontrollers/staff_plan/users_controller.rb → ...ntrollers/staff_plans/users_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class StaffPlans::WorkWeeksController < ApplicationController | ||
def create | ||
@work_week = assignment.work_weeks.create(create_work_week_params) | ||
end | ||
|
||
def update | ||
@work_week = assignment.work_weeks.find(params[:id]) | ||
@work_week.update(create_work_week_params) | ||
end | ||
|
||
private | ||
|
||
def create_work_week_params | ||
params.require(:work_week).permit(:estimated_hours, :actual_hours, :cweek, :year, :beginning_of_week) | ||
end | ||
|
||
def edit_work_week_params | ||
params.require(:work_week).permit(:estimated_hours, :actual_hours, :cweek, :year, :beginning_of_week) | ||
end | ||
|
||
def assignment | ||
current_user.assignments.find(params[:assignment_id]) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module StaffPlan::WorkWeeksHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<% # currently assuming happy path. Need to handle/render validation errors. %> | ||
<%= turbo_stream.update( | ||
@work_week.turbo_frame_id, | ||
render(WorkWeekComponent.new( | ||
work_week: @work_week, | ||
assignment: @work_week.assignment, | ||
work_week_beginning_of_week: @work_week.beginning_of_week, | ||
beginning_of_week: @work_week.beginning_of_week, | ||
render_td: false | ||
)) | ||
) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<% # currently assuming happy path. Need to handle/render validation errors. %> | ||
<%= turbo_stream.update( | ||
@work_week.turbo_frame_id, | ||
render(WorkWeekComponent.new( | ||
work_week: @work_week, | ||
assignment: @work_week.assignment, | ||
work_week_beginning_of_week: @work_week.beginning_of_week, | ||
beginning_of_week: @work_week.beginning_of_week, | ||
render_td: false | ||
)) | ||
) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters