diff --git a/Gemfile.lock b/Gemfile.lock index 6677141c9..20107dba6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -130,6 +130,7 @@ GEM rspec (~> 2.11) hashie (3.3.1) hike (1.2.3) + hitimes (1.2.2) hitimes (1.2.2-x86-mingw32) htmlentities (4.3.2) i18n (0.6.1) @@ -176,6 +177,10 @@ GEM cocaine (~> 0.5.3) mime-types polyglot (0.3.5) + pry (0.9.12.6) + coderay (~> 1.0) + method_source (~> 0.8) + slop (~> 3.4) pry (0.9.12.6-x86-mingw32) coderay (~> 1.0) method_source (~> 0.8) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 161918094..e81b57ad7 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -8,6 +8,7 @@ class CoursesController < ApplicationController menu_item :overview menu_item :feedback, :only => :feedback menu_item :homework, :only => :homework + menu_item :new_homework, :only => :new_homework menu_item l(:label_sort_by_time), :only => :index @@ -675,8 +676,10 @@ class CoursesController < ApplicationController end def index - render_404 unless User.current.admin? - + if !User.current.admin? + render_404 + return + end @course_type = params[:course_type] @school_id = params[:school_id] per_page_option = 10 @@ -724,7 +727,7 @@ class CoursesController < ApplicationController respond_to do |format| format.html { - # render :layout => 'base' + render :layout => 'base' } format.atom { courses = Course.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all