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

Add CS10 to the site. ❤️ #34

Open
wants to merge 1 commit 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
6 changes: 4 additions & 2 deletions app/controllers/lab_assistants_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class LabAssistantsController < ApplicationController

def create
@la = LabAssistant.new(la_params)
@la.password = 'password'
Expand All @@ -10,6 +10,8 @@ def create
@la.course_id = 2
when 'CS61C'
@la.course_id = 3
when 'CS10'
@la.course_id = 4
else
# potential other classes
end
Expand Down Expand Up @@ -37,7 +39,7 @@ def la_params
def update
if params['lt_ids']
current_user.preferred_lab_times = params['lt_ids'].map(&:to_i)
else
else
current_user.preferred_lab_times = []
end
current_user.save
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/lab_times_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def create
@lt.course_id = 2
when 'CS61C'
@lt.course_id = 3
when 'CS10'
@lt.course_id = 4
else
# potential other classes
end
Expand Down
4 changes: 3 additions & 1 deletion app/controllers/teaching_assistants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ def create
@ta.course_id = 2
when 'CS61C'
@ta.course_id = 3
when 'CS10'
@ta.course_id = 4
else
# potential other classes
end
if @ta.save
redirect_to root_path, flash: { success: "You will receive an email when you are accepted as a Teaching Assistant" }
redirect_to root_path, flash: { success: "You will receive an email when you are accepted as a Teaching Assistant" }
else
redirect_to root_path, flash: { error: @ta.errors.messages.to_s }
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/admins/dashboard/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<tbody>
<tr>
<td><%= f.submit :class => "btn btn-primary" %></td>
<td><%= f.select :course_id, options_for_select(%w[CS61A CS61B CS61C]), {}, { :class => "form-control" } %></td>
<td><%= f.select :course_id, options_for_select(%w[CS10 CS61A CS61B CS61C]), {}, { :class => "form-control" } %></td>
<td><%= f.select :day, ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], {}, { :class => "form-control" }%></td>
<td><%= f.time_select :open, {:ampm => true, :minute_step => 30}, { :class => "form-control form-time" } %></td>
<td><%= f.time_select :close, {:ampm => true, :minute_step => 30}, { :class => "form-control form-time" } %></td>
Expand Down
4 changes: 2 additions & 2 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
First name: <%= f.text_field :first_name, required: "" %><br />
Last name : <%= f.text_field :last_name, required: "" %><br />
Email : <%= f.email_field :email, required: "" %><br />
Class: <%= f.select :course_id, options_for_select(%w[CS61A CS61B CS61C]) %> <br />
Class: <%= f.select :course_id, options_for_select(%w[CS10 CS61A CS61B CS61C]) %> <br />
<%= f.submit %>
<% end %>
</div>
Expand All @@ -81,7 +81,7 @@
Last name : <%= f.text_field :last_name, required: "" %><br />
Email : <%= f.email_field :email, required: "" %><br />
SID : <%= f.text_field :SID, required: "" %><br />
Class: <%= f.select :course_id, options_for_select(%w[CS61A CS61B CS61C]) %> <br />
Class: <%= f.select :course_id, options_for_select(%w[CS10 CS61A CS61B CS61C]) %> <br />
<%= f.submit %>
<% end %>
</div>
Expand Down