This commit is contained in:
z9hang 2014-07-01 09:16:17 +08:00
commit 33c883146a
3 changed files with 5 additions and 4 deletions

View File

@ -94,7 +94,7 @@ class ApplicationController < ActionController::Base
Setting.check_cache
# Find the current user
User.current = find_current_user
logger.info(" Current user: " + (User.current.logged? ? "#{User.current.login} (id=#{User.current.id})" : "anonymous")) if logger
#logger.info(" Current user: " + (User.current.logged? ? "#{User.current.login} (id=#{User.current.id})" : "anonymous")) if logger
end
# Returns the current user or nil if no user is logged in
@ -300,7 +300,7 @@ class ApplicationController < ActionController::Base
render_404
end
#根据course_id找project
#<EFBFBD><EFBFBD><EFBFBD>course_id<EFBFBD><EFBFBD>project
def find_project_by_course_id
@bid = Bid.find params[:course_id]
@project = @bid.courses[0]
@ -354,7 +354,7 @@ class ApplicationController < ActionController::Base
end
#added by nwb
#获取课程
#<EFBFBD><EFBFBD>ȡ<EFBFBD>γ<EFBFBD>
def find_course
@course= Course.find(params[:id])
rescue ActiveRecord::RecordNotFound

View File

@ -179,6 +179,7 @@ class Attachment < ActiveRecord::Base
File.join(self.class.storage_path, disk_directory.to_s, disk_filename.to_s)
end
#标题
def title
title = filename.to_s
if description.present?

View File

@ -4,7 +4,7 @@ console.debug('课程修改成功:结束时间改为<%=Course.find_by_extra(@c
<% end %>
$('#content-title-top-div').html("<%= j(render partial: 'users/my_course_ex', :locals => {:memberships => @memberships,:user=>@user,
:memberships_doing=>@memberships_doing,:memberships_done=>@memberships_done} )%>")
//$('#finish_course_ <%=@course.id%>').replaceWith("<%= j(render partial: 'courses/set_course_time', :locals => {:course => @course} )%>")
$('#finish_course_<%=@course.id%>').replaceWith("<%= j(render partial: 'courses/set_course_time', :locals => {:course => @course} )%>")
<% else %>
alert('权限不足,设置失败,请在论坛提交问题,等待管理员处理。');
<% end %>