Merge branch 'Homework' into szzh

course_group
sw 11 years ago
commit 9d971069b5

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

@ -578,12 +578,13 @@ module ApplicationHelper
return ss return ss
end end
def time_tag(time) def time_tag(time, *args)
options = args.extract_options!
text = distance_of_time_in_words(Time.now, time) text = distance_of_time_in_words(Time.now, time)
if @project 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 else
content_tag('acronym', text, :title => format_time(time)) content_tag('acronym', text, options.reverse_merge(:title => format_time(time)))
end end
end end

@ -35,7 +35,7 @@
<li class="wscore"> <li class="wscore">
<%= is_student_batch_homework ? l(:label_my_score) : l(:label_student_score)%>: <%= is_student_batch_homework ? l(:label_my_score) : l(:label_student_score)%>:
<span class="c_red"> <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> </span>
</li> </li>
<% if is_teacher %> <% if is_teacher %>

@ -30,7 +30,7 @@
</span> </span>
<span class="font_lighter" style="float: right"> <span class="font_lighter" style="float: right">
<%= l(:label_bids_published) %>&nbsp; <%= 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) %> <%= l(:label_bids_published_ago) %>
</span> </span>
</div> </div>

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

@ -16,7 +16,7 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 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 baseurl = Redmine::Utils.relative_url_root

Loading…
Cancel
Save