diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index a8a351eb1..145a73178 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -7,6 +7,7 @@ class BidsController < ApplicationController menu_item :project, :only => [:show_project,:show_results, :new_submit_homework] menu_item :homework_respond, :only => :homework_respond menu_item :homework_statistics, :only => :homework_statistics + menu_item :edit, :only => :edit before_filter :can_show_course,only: [] before_filter :can_show_contest,only: [] diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index ee1ca0230..5381e8757 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -8,7 +8,7 @@ class CoursesController < ApplicationController menu_item :overview menu_item :feedback, :only => :feedback menu_item :homework, :only => :homework - menu_item :new_homework + menu_item :new_homework, :only => :new_homework menu_item l(:label_sort_by_time), :only => :index menu_item l(:label_sort_by_active), :only => :index @@ -271,8 +271,7 @@ class CoursesController < ApplicationController @issue_custom_fields = IssueCustomField.sorted.all @trackers = Tracker.sorted.all - if User.current.user_extensions.identity == 0 - if @course.save + if @course.save #unless User.current.admin? r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first m = Member.new(:user => User.current, :roles => [r]) @@ -298,15 +297,13 @@ class CoursesController < ApplicationController } format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'courses', :action => 'show', :id => @course.id) } end - else + else #@course.destroy respond_to do |format| format.html { render :action => 'new', :layout => 'base' } #Added by young format.api { render_validation_errors(@course) } end - end - end - + end end def course diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 2cf2e7895..61760f462 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -106,7 +106,7 @@ class HomeworkAttachController < ApplicationController (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id}) AS m_score FROM homework_attaches INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id - WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY s_score DESC") + WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY m_score DESC") @cur_page = params[:page] || 1 @cur_type = 4 @homework_list = paginateHelper all_homework_list,10 diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index efa171d52..d7f9fa0ac 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -72,7 +72,7 @@ class ZipdownController < ApplicationController homeattach.attachments.each do |attach| homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1) end - zipping("#{Time.now.to_i.to_s}_#{homeattach.user.name}_#{homeattach.user.user_extensions.student_id}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) + zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{homeattach.user.user_extensions.student_id}_#{Time.now.to_i.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) end diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 298331c69..6d916f43e 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -97,7 +97,7 @@ module WatchersHelper return '' unless user && user.logged? # modify by nwb # 主讲教师不允许退出课程 - return '' if user.id == course.tea_id || course.is_public == 0 + return '' if user.id == course.tea_id joined = user.member_of_course?(course) text = joined ? l(:label_exit_course) : l(:label_new_join) url_t = join_path(:object_id => course.id) diff --git a/app/views/courses/_course_ad.html.erb b/app/views/courses/_course_ad.html.erb new file mode 100644 index 000000000..f8b4781f8 --- /dev/null +++ b/app/views/courses/_course_ad.html.erb @@ -0,0 +1,55 @@ + +
+ <%= l(:label_contact_us) %> + | +
<%= l(:label_course_ad_description) %> |
+ <%= l(:label_course_adcolick) %>黄井泉 + |
+
+ Tel:15388083362 + |
+
+ <%= l(:label_course_adcolick) %>王林春 + |
+
+ Tel:13467631747 + |
+
@@ -98,8 +99,6 @@