Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
872357cdf4
|
@ -59,6 +59,8 @@ class AttachmentsController < ApplicationController
|
||||||
:type => detect_content_type(@attachment),
|
:type => detect_content_type(@attachment),
|
||||||
:disposition => (@attachment.image? ? 'inline' : 'attachment')
|
:disposition => (@attachment.image? ? 'inline' : 'attachment')
|
||||||
end
|
end
|
||||||
|
rescue => e
|
||||||
|
redirect_to "http://forge.trustie.net/file_not_found.html"
|
||||||
end
|
end
|
||||||
|
|
||||||
#更新资源文件类型
|
#更新资源文件类型
|
||||||
|
|
|
@ -801,6 +801,11 @@ class UsersController < ApplicationController
|
||||||
else
|
else
|
||||||
@user = User.find(params[:id])
|
@user = User.find(params[:id])
|
||||||
end
|
end
|
||||||
|
if @user.user_score.nil?
|
||||||
|
us = UserScore.new
|
||||||
|
us.user_id = @user.id
|
||||||
|
us.save
|
||||||
|
end
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
render_404
|
render_404
|
||||||
end
|
end
|
||||||
|
|
|
@ -27,7 +27,7 @@ class ZipdownController < ApplicationController
|
||||||
else
|
else
|
||||||
logger.error "[ZipDown#assort] ===> #{obj.class.to_s.to_sym} unKown !!"
|
logger.error "[ZipDown#assort] ===> #{obj.class.to_s.to_sym} unKown !!"
|
||||||
end
|
end
|
||||||
send_file zipfile, :filename => obj.name, :type => detect_content_type(zipfile) if zipfile
|
send_file zipfile, :filename => obj.name+".zip", :type => detect_content_type(zipfile) if zipfile
|
||||||
|
|
||||||
#rescue NameError, ActiveRecord::RecordNotFound => e
|
#rescue NameError, ActiveRecord::RecordNotFound => e
|
||||||
#logger.error "[ZipDown] ===> #{e}"
|
#logger.error "[ZipDown] ===> #{e}"
|
||||||
|
@ -39,7 +39,7 @@ class ZipdownController < ApplicationController
|
||||||
homework = HomeworkAttach.find params[:homework]
|
homework = HomeworkAttach.find params[:homework]
|
||||||
if homework != nil && (User.current.admin? || User.current.member_of?(homework.bid.courses.first))
|
if homework != nil && (User.current.admin? || User.current.member_of?(homework.bid.courses.first))
|
||||||
zipfile = zip_homework_by_user homework
|
zipfile = zip_homework_by_user homework
|
||||||
send_file zipfile, :filename => homework.name, :type => detect_content_type(zipfile) if zipfile
|
send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if zipfile
|
||||||
else
|
else
|
||||||
render_403 :message => :notice_not_authorized
|
render_403 :message => :notice_not_authorized
|
||||||
end
|
end
|
||||||
|
@ -88,7 +88,7 @@ class ZipdownController < ApplicationController
|
||||||
#length = attach.storage_path.length
|
#length = attach.storage_path.length
|
||||||
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
|
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
|
||||||
end
|
end
|
||||||
zipping "#{homeattach.user.name.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true
|
zipping "#{homeattach.user.name.to_s}_#{Time.now.to_i}.zip", homeworks_attach_path, OUTPUT_FOLDER, true
|
||||||
#user_attaches_paths
|
#user_attaches_paths
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
(Member.where('user_id = ? and project_id = ?', User.current.id,
|
(Member.where('user_id = ? and project_id = ?', User.current.id,
|
||||||
@bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) && cur_user_homework_for_bid(@bid).count == 0 %>
|
@bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) && cur_user_homework_for_bid(@bid).count == 0 %>
|
||||||
<div class='icon icon-add'>
|
<div class='icon icon-add'>
|
||||||
<!-- <%= link_to l(:label_commit_homework), new_submit_homework_path, :onclick => "$('#put-bid-form').slideToggle(); this.blur(); return false;" %> -->
|
<%#= link_to l(:label_commit_homework), new_submit_homework_path, :onclick => "$('#put-bid-form').slideToggle(); this.blur(); return false;" %>
|
||||||
<%= link_to l(:label_course_new_homework),new_homework_attach_path %>
|
<%= link_to l(:label_course_new_homework),new_homework_attach_path %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<table width="100%" valign="center">
|
<table width="100%" valign="center">
|
||||||
<tr>
|
<tr>
|
||||||
<td ><span style="margin-left:0px"><%= l(:label_task_plural)%>(<%= @homework_list.count%>)</span>
|
<td ><span style="margin-left:0px"><%= l(:label_task_plural)%>(<%= @homework_list.count%>)</span>
|
||||||
<%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), remote: false, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(
|
<%#= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), remote: false, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(
|
||||||
User.current.admin? ||
|
User.current.admin? ||
|
||||||
!(User.current.roles_for_project(@bid.courses.first).map(&:id) & ([7,9])).empty? ) ||
|
!(User.current.roles_for_project(@bid.courses.first).map(&:id) & ([7,9])).empty? ) ||
|
||||||
(Rails.env.development?) %>
|
(Rails.env.development?) %>
|
||||||
|
|
|
@ -73,7 +73,8 @@
|
||||||
<td>
|
<td>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="info-course"><%= @project.name %></td>
|
<!-- modified by zjc 课程名称添加超链接 -->
|
||||||
|
<td class="info-course"><%= link_to @project.name,project_path(@project) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
|
@ -180,7 +181,8 @@
|
||||||
<% unless @course.teacher.user_extensions.nil? %>
|
<% unless @course.teacher.user_extensions.nil? %>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td>
|
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td>
|
||||||
<td class="font_lighter_sidebar"><%= @course.teacher.user_extensions.school %></td>
|
<!-- modified by zjc 教师单位添加超链接 -->
|
||||||
|
<td class="font_lighter_sidebar"><%= link_to @course.teacher.user_extensions.school,options={:controller => 'welcome',:action => 'course',:school_id => @course.teacher.user_extensions.school.id}, html_options={:method => 'get'} %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% else %>
|
<% else %>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
<td>
|
<td>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="info_font" style=" word-wrap: break-word; word-break: break-all"><%= h @contest.name %></td>
|
<td class="info_font" style=" word-wrap: break-word; word-break: break-all"><%= link_to @contest.name, show_contest_contest_path(@contest) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% if User.current.login? %>
|
<% if User.current.login? %>
|
||||||
<tr colspan='3'>
|
<tr colspan='3'>
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
<td><%= image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
|
<td><%= image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
|
||||||
<td>
|
<td>
|
||||||
<div class="info-course">
|
<div class="info-course">
|
||||||
<%= @project.name %>
|
<%= link_to @project.name, project_path(@project)%>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<!-- added by bai 增加项目得分 -->
|
<!-- added by bai 增加项目得分 -->
|
||||||
|
|
|
@ -56,7 +56,9 @@
|
||||||
<td>
|
<td>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><%= h (@user.name) %> <!-- added by bai -->
|
<!-- added by bai -->
|
||||||
|
<!-- modified by zjc 姓名添加超链接 -->
|
||||||
|
<td class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><%= link_to h (@user.name) %>
|
||||||
<%= image_tag(gender_avatar_uri(@user), weight:"25px", height:"25px") if (@user.user_extensions && (@user.user_extensions.identity != 2) )%></td>
|
<%= image_tag(gender_avatar_uri(@user), weight:"25px", height:"25px") if (@user.user_extensions && (@user.user_extensions.identity != 2) )%></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -93,6 +95,7 @@
|
||||||
<% finall_influence_score = news_score + wiki_contents_score + comments_score %>
|
<% finall_influence_score = news_score + wiki_contents_score + comments_score %>
|
||||||
<% finall_user_score = finall_messages_score + finall_user_project_score + finall_activity_score + finall_influence_score %>
|
<% finall_user_score = finall_messages_score + finall_user_project_score + finall_activity_score + finall_influence_score %>
|
||||||
|
|
||||||
|
<!-- modified by zjc 新得分显示 -->
|
||||||
<tr><td class="score">
|
<tr><td class="score">
|
||||||
<%= l(:label_user_grade)%>:
|
<%= l(:label_user_grade)%>:
|
||||||
<%= link_to(format("%.2f" , @user.user_score.total_score).to_f, {:controller => 'users',
|
<%= link_to(format("%.2f" , @user.user_score.total_score).to_f, {:controller => 'users',
|
||||||
|
@ -102,6 +105,7 @@
|
||||||
}, :style => 'color :#E8770D;') %>
|
}, :style => 'color :#E8770D;') %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<!-- end -->
|
||||||
<tr><td class="score">
|
<tr><td class="score">
|
||||||
<%= l(:label_user_grade)%>:
|
<%= l(:label_user_grade)%>:
|
||||||
<%= link_to(format("%.2f" , finall_user_score).to_f, {:controller => 'users',
|
<%= link_to(format("%.2f" , finall_user_score).to_f, {:controller => 'users',
|
||||||
|
@ -174,12 +178,13 @@
|
||||||
-->
|
-->
|
||||||
<!-- added by bai 在个人主页里显示“工作单位”“地区”"教师的职称"-->
|
<!-- added by bai 在个人主页里显示“工作单位”“地区”"教师的职称"-->
|
||||||
<!-- modified by linchun 在个人主页里显示“加入时间”,“最后登录”,“邮件地址”后面添加冒号-->
|
<!-- modified by linchun 在个人主页里显示“加入时间”,“最后登录”,“邮件地址”后面添加冒号-->
|
||||||
|
<!-- modified by zjc 高校添加超链接 -->
|
||||||
<% unless @user.user_extensions.nil? %>
|
<% unless @user.user_extensions.nil? %>
|
||||||
<% unless @user.user_extensions.identity == 2 %>
|
<% unless @user.user_extensions.identity == 2 %>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding-left: 5px" width="70px"><%= l(:field_occupation) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
|
<td style="padding-left: 5px" width="70px"><%= l(:field_occupation) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
|
||||||
<% unless @user.user_extensions.school.nil? %>
|
<% unless @user.user_extensions.school.nil? %>
|
||||||
<%= @user.user_extensions.school.name %>
|
<%= link_to @user.user_extensions.school.name, options={:controller => 'welcome',:action => 'course',:school_id => @user.user_extensions.school.id}, html_options={:method => 'get'} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -18,7 +18,11 @@
|
||||||
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
|
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
|
||||||
<!-- <%= @admin.first.user.user_extensions.occupation %> -->
|
<!-- <%= @admin.first.user.user_extensions.occupation %> -->
|
||||||
<%# unless @project.course_extra.school.nil? %>
|
<%# unless @project.course_extra.school.nil? %>
|
||||||
<%= @project.course_extra.teacher.user_extensions.school.try(:name) %>
|
<!-- modified by zjc 单位名称添加超链接 -->
|
||||||
|
<% unless @project.course_extra.teacher.user_extensions.school.nil? %>
|
||||||
|
<%= link_to @project.course_extra.teacher.user_extensions.school.try(:name),options={:controller => 'welcome',:action => 'course',:school_id => @project.course_extra.teacher.user_extensions.school.id}, html_options={:method => 'get'}%>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%# end %>
|
<%# end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<html>
|
||||||
|
<title>文件未找到</title>
|
||||||
|
<style>
|
||||||
|
body{
|
||||||
|
font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
|
||||||
|
color:#303030;
|
||||||
|
margin:10px;
|
||||||
|
}
|
||||||
|
h1{
|
||||||
|
font-size:1.5em;
|
||||||
|
}
|
||||||
|
p{
|
||||||
|
font-size:0.8em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<body>
|
||||||
|
<h1>文件已经损坏</h1>
|
||||||
|
<p>抱歉,因文件已经损坏,请重新上传此文件.</p>
|
||||||
|
<p><a href="javascript:history.back()">Back</a></p>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue