Skip to content

Commit

Permalink
work on instructor acceptance
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Bolton committed May 14, 2012
1 parent 23ab868 commit 75cbf5a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
4 changes: 3 additions & 1 deletion app/controllers/courses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def accept
link = InstructorsCourses.where(course_id: course.id, user_id: current_user.id).first
if link && link.uuid == params[:uuid]
link.update_attribute(:status, 'accepted')
render inline: 'Accepted!'
else
render nothing: true
end
render nothing: true
end

def download
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/manage_course.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
.tabbable
%ul.nav.nav-tabs{:'data-tabs' => 'tabs'}
%li#info-link= link_to 'Info', '#info', :'data-toggle' => 'tab'
%li#schedule-link= link_to 'Schedule', '#schedule', id: 'schedule-link', :'data-toggle' => 'tab'
%li#staffing-link= link_to 'Staffing', '#staffing', id: 'staffing-link', :'data-toggle' => 'tab'
%li#schedule-link= link_to 'Schedule', '#schedule', :'data-toggle' => 'tab'
%li#staffing-link= link_to 'Staffing', '#staffing', :'data-toggle' => 'tab'
.tab-content
#info.tab-pane
- if flash[:notice] == :success
Expand Down
22 changes: 18 additions & 4 deletions app/views/site/catalog.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
= content_for :title, organization.catalogDisplayName

- if params[:tab]
:javascript
var tab = '#{params[:tab]}'
- else
:javascript
var tab = 'all'

:javascript
$(document).ready(function(){
$('#' + tab + '-link').addClass('active')
$('#' + tab).addClass('active')
})

#google-modal.hide

#calendar-modal.modal.hide.fade
Expand Down Expand Up @@ -49,14 +63,14 @@
Show Past Courses
.tabbable
%ul.nav.nav-tabs
%li.active= link_to 'All Courses', '#all', :'data-toggle' => 'tab'
%li#all-link= link_to 'All Courses', '#all', :'data-toggle' => 'tab'
- if current_user
%li= link_to 'My Enrollments', '#enrollments', :'data-toggle' => 'tab'
%li#enrollments-link= link_to 'My Enrollments', '#enrollments', :'data-toggle' => 'tab'
- if current_user.instructing.first
%li= link_to 'My Shifts', '#shifts', :'data-toggle' => 'tab'
%li#shifts-link= link_to 'My Shifts', '#shifts', :'data-toggle' => 'tab'

.tab-content#courses
#all.tab-pane.active= render partial: 'site/course_table', locals: { courses: @courses }
#all.tab-pane= render partial: 'site/course_table', locals: { courses: @courses }
- if current_user
#enrollments.tab-pane
- if current_user.courses.mirai.first
Expand Down

0 comments on commit 75cbf5a

Please sign in to comment.