Merge branch 'Homework' into szzh

This commit is contained in:
sw 2014-11-11 08:49:42 +08:00
commit 9d971069b5
6 changed files with 118 additions and 117 deletions

View File

@ -32,7 +32,7 @@ class ZipdownController < ApplicationController
send_file zipfile, :filename => obj.name+".zip", :type => detect_content_type(zipfile) if zipfile
rescue Exception => e
render file: 'public/no_file_found.html' , :layout => 'course_base'
render file: 'public/no_file_found.html'
end
#下载某一学生的作业的所有文件

View File

@ -578,12 +578,13 @@ module ApplicationHelper
return ss
end
def time_tag(time)
def time_tag(time, *args)
options = args.extract_options!
text = distance_of_time_in_words(Time.now, time)
if @project
link_to(text, {:controller => 'activities', :action => 'index', :id => @project, :from => User.current.time_to_date(time)}, :title => format_time(time))
link_to(text, {:controller => 'activities', :action => 'index', :id => @project, :from => User.current.time_to_date(time)},options.reverse_merge(:title => format_time(time)))
else
content_tag('acronym', text, :title => format_time(time))
content_tag('acronym', text, options.reverse_merge(:title => format_time(time)))
end
end

View File

@ -35,7 +35,7 @@
<li class="wscore">
<%= is_student_batch_homework ? l(:label_my_score) : l(:label_student_score)%>:
<span class="c_red">
<%= is_student_batch_homework ? (homework.m_score.nil? ? l(:label_without_score) : homework.m_score) : (homework.s_score.nil? ? l(:label_without_score) : homework.s_score)%>
<%= is_student_batch_homework ? (homework.m_score.nil? ? l(:label_without_score) : format("%.2f",homework.m_score)) : (homework.s_score.nil? ? l(:label_without_score) : format("%.2f",homework.s_score))%>
</span>
</li>
<% if is_teacher %>

View File

@ -30,7 +30,7 @@
</span>
<span class="font_lighter" style="float: right">
<%= l(:label_bids_published) %>&nbsp;
<%= time_tag(journal.created_on).html_safe %>&nbsp;
<%= time_tag(journal.created_on,:style => "float:initial").html_safe %>&nbsp;
<%= l(:label_bids_published_ago) %>
</span>
</div>

View File

@ -20,7 +20,7 @@
<%
is_target = false
if project and controller and project.module_enabled?(:code_review)
if project and project.is_a?(Project) and controller and project.module_enabled?(:code_review)
is_target = true
is_target = false unless User.current.allowed_to?({:controller => 'code_review', :action => 'update_diff_view'}, project)
setting = CodeReviewProjectSetting.find(:first, :conditions => ['project_id = ?', project.id])

View File

@ -16,7 +16,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%>
<% if @project and @project.module_enabled?('code_review') %>
<% if @project and @project.is_a?(Project) and @project.module_enabled?('code_review') %>
<%
baseurl = Redmine::Utils.relative_url_root