Merge branch 'cxt_course' into szzh

This commit is contained in:
cxt 2016-01-08 18:06:18 +08:00
commit 6d97673181
46 changed files with 2269 additions and 2015 deletions

View File

@ -1,3 +1,4 @@
#encoding: utf-8
class CoursesController < ApplicationController
# layout 'base_courses'
include CoursesHelper
@ -436,6 +437,73 @@ class CoursesController < ApplicationController
def create
cs = CoursesService.new
@course = cs.create_course(params,User.current)[:course]
if params[:copy_course]
copy_course = Course.find params[:copy_course].to_i
@course.update_attributes(:open_student => copy_course.open_student, :publish_resource => copy_course.publish_resource)
if params[:checkAll]
attachments = copy_course.attachments
attachments.each do |attachment|
attach_copied_obj = attachment.copy
attach_copied_obj.tag_list.add(attachment.tag_list) # tag关联
attach_copied_obj.container = @course
attach_copied_obj.created_on = Time.now
attach_copied_obj.author_id = User.current.id
attach_copied_obj.copy_from = attachment.copy_from.nil? ? attachment.id : attachment.copy_from
if attach_copied_obj.attachtype == nil
attach_copied_obj.attachtype = 4
end
attach_copied_obj.save
update_quotes attach_copied_obj
end
elsif params[:course_attachment_type]
copy_attachments = []
params[:course_attachment_type].each do |type|
case type
when "1"
tag_name = l(:label_courseware)
when "2"
tag_name = l(:label_software)
when "3"
tag_name = l(:label_media)
when "4"
tag_name = l(:label_code)
when "6"
tag_name = "论文"
else
tag_name = ""
end
if tag_name == ""
tag_attachments = copy_course.attachments.select{|attachment|
!attachment.tag_list.include?('课件') &&
!attachment.tag_list.include?('软件') &&
!attachment.tag_list.include?('媒体') &&
!attachment.tag_list.include?('代码') &&
!attachment.tag_list.include?('论文') }
else
tag_attachments = copy_course.attachments.select{|attachment| attachment.tag_list.include?(tag_name)}
end
tag_attachments.each do |attach|
next if copy_attachments.include?(attach)
copy_attachments << attach
end
end
unless copy_attachments.blank?
copy_attachments.each do |c_attach|
attach_copied_obj = c_attach.copy
attach_copied_obj.tag_list.add(c_attach.tag_list) # tag关联
attach_copied_obj.container = @course
attach_copied_obj.created_on = Time.now
attach_copied_obj.author_id = User.current.id
attach_copied_obj.copy_from = c_attach.copy_from.nil? ? c_attach.id : c_attach.copy_from
if attach_copied_obj.attachtype == nil
attach_copied_obj.attachtype = 4
end
attach_copied_obj.save
update_quotes attach_copied_obj
end
end
end
end
if @course
respond_to do |format|
flash[:notice] = l(:notice_successful_create)
@ -751,6 +819,11 @@ class CoursesController < ApplicationController
#param id:已有课程ID
def copy_course
if @course
@new_course = Course.new
respond_to do |format|
format.js
end
=begin
@new_course = Course.new @course.attributes
@new_course.tea_id = User.current.id
@new_course.created_at = DateTime.now
@ -769,6 +842,7 @@ class CoursesController < ApplicationController
@new_course.course_infos << course
redirect_to settings_course_url @new_course
end
=end
else
render_404
end
@ -829,6 +903,33 @@ class CoursesController < ApplicationController
end
private
def update_quotes attachment
if attachment.copy_from
attachments = Attachment.find_by_sql("select * from attachments where copy_from = #{attachment.copy_from} or id = #{attachment.copy_from}")
else
attachments = Attachment.find_by_sql("select * from attachments where copy_from = #{attachment.id} or id = #{attachment.copy_from}")
end
attachment.quotes = get_qute_number attachment
attachment.save
attachments.each do |att|
att.quotes = attachment.quotes
att.save
end
end
def get_qute_number attachment
if attachment.copy_from
result = Attachment.find_by_sql("select count(*) as number from attachments where copy_from = #{attachment.copy_from}")
else
result = Attachment.find_by_sql("select count(*) as number from attachments where copy_from = #{attachment.id}")
end
if result.nil? || result.count <= 0
return 0
else
return result[0].number
end
end
def allow_join course
if course_endTime_timeout? course
respond_to do |format|

File diff suppressed because it is too large Load Diff

View File

@ -2757,4 +2757,11 @@ int main(int argc, char** argv){
ss.html_safe
end
#代码提交数量
def changesets_num project
g = Gitlab.client
project.gpid.nil? ? 0 : g.commits_total_count(project.gpid).count
# # commits_total_count(project.gpid)
# project.changesets.count
end
end

View File

@ -20,14 +20,6 @@ module ProjectScoreHelper
project.documents.count
end
#代码提交数量
def changesets_num project
g = Gitlab.client
project.gpid.nil? ? 0 : g.commits_total_count(project.gpid).count
# # commits_total_count(project.gpid)
# project.changesets.count
end
#讨论区帖子数量
def board_message_num project
board_message_count = 0

View File

@ -591,7 +591,7 @@ module UsersHelper
option << "请选择发布作业的课程"
option << -1
type << option
user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").select{|c| user.allowed_to?(:as_teacher,c)}.each do |course|
user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").select{|c| user.allowed_to?(:as_teacher,c)}.each do |course|
option = []
option << course.name+""+course.time.to_s+course.term+""
option << course.id

View File

@ -193,6 +193,7 @@ class CoursesService
@course.extra = 'course' + DateTime.parse(Time.now.to_s).strftime('%Y-%m-%d_%H-%M-%S').to_s
@course.send(:safe_attributes=, params[:course], current_user)
#@course.safe_attributes(current_user,params[:course])
@course.password = params[:course][:password]
@course.tea_id = current_user.id
@course.term = params[:term]
@course.time = params[:time]

View File

@ -0,0 +1,19 @@
<% if activity.attachments.any? %>
<% activity.attachments.each do |attachment| %>
<div class="break_word">
<span class="fl">
<span title="<%= attachment.filename %>" id="attachment_<%=attachment.id %>">
<%= link_to_short_attachment attachment,:length=> 58, :class => 'mw400 hidden link_file_a fl newsBlue', :download => true -%>
</span>
</span>
<span class="postAttSize">(
<%= number_to_human_size attachment.filesize %>)
</span>
<span class="author" title="<%= attachment.author%>">
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
<%= format_time(attachment.created_on) %>
</span>
</div>
<div class="cl"></div>
<% end %>
<% end %>

View File

@ -5,20 +5,4 @@
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
//init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%", 'UserActivity');
<% end %>
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
showNormalImage('activity_description_<%= @user_activity_id %>');
if($("#intro_content_<%= @user_activity_id %>").height() > 810) {
$("#intro_content_show_<%= @user_activity_id %>").show();
}
$("#intro_content_show_<%= @user_activity_id %>").click(function(){
$("#activity_description_<%= @user_activity_id %>").toggleClass("maxh360");
$("#activity_description_<%= @user_activity_id%>").toggleClass("lh18");
$("#intro_content_show_<%= @user_activity_id %>").hide();
$("#intro_content_hide_<%= @user_activity_id %>").show();
});
$("#intro_content_hide_<%= @user_activity_id %>").click(function(){
$("#activity_description_<%= @user_activity_id %>").toggleClass("maxh360");
$("#activity_description_<%= @user_activity_id%>").toggleClass("lh18");
$("#intro_content_hide_<%= @user_activity_id %>").hide();
$("#intro_content_show_<%= @user_activity_id %>").show();
});
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');

View File

@ -57,7 +57,7 @@
<div class="homepagePostDate">
发帖时间:<%= format_time(activity.created_on) %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<% if activity.parent_id.nil? %>
<%= activity.content.to_s.html_safe%>
@ -67,17 +67,19 @@
</div>
</div>
<div class="cl"></div>
<div class=" fl" style="width: 600px">
<% if activity.attachments.any?%>
<% options = {:author => true, :deletable => false } %>
<%= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => activity.attachments, :options => options, :is_float => true} %>
<% end %>
<!--<div class=" fl" style="width: 600px">
<%# if activity.attachments.any?%>
<%# options = {:author => true, :deletable => false } %>
<%#= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => activity.attachments, :options => options, :is_float => true} %>
<%# end %>
</div>
<div class="cl"></div>
<div class="cl"></div>-->
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
<ul>
<li class="homepagePostSettingIcon">
@ -176,3 +178,6 @@
<% end %>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -75,22 +75,6 @@
$(function () {
init_activity_KindEditor_data(<%= topic.id%>, null, "87%", "<%=topic.class.to_s%>");
showNormalImage('activity_description_<%= topic.id %>');
if($("#intro_content_<%= topic.id %>").height() > 810) {
$("#intro_content_show_<%= topic.id %>").show();
}
$("#intro_content_show_<%= topic.id %>").click(function(){
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
$("#intro_content_show_<%= topic.id %>").hide();
$("#intro_content_hide_<%= topic.id %>").show();
});
$("#intro_content_hide_<%= topic.id %>").click(function(){
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= topic.id %>").hide();
$("#intro_content_show_<%= topic.id %>").show();
});
});
</script>
<% if topic %>

View File

@ -41,22 +41,6 @@
$(function () {
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
showNormalImage('activity_description_<%= topic.id %>');
if($("#intro_content_<%= topic.id %>").height() > 810) {
$("#intro_content_show_<%= topic.id %>").show();
}
$("#intro_content_show_<%= topic.id %>").click(function(){
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
$("#intro_content_show_<%= topic.id %>").hide();
$("#intro_content_hide_<%= topic.id %>").show();
});
$("#intro_content_hide_<%= topic.id %>").click(function(){
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= topic.id %>").hide();
$("#intro_content_show_<%= topic.id %>").show();
});
});
</script>
<% if topic %>

View File

@ -40,22 +40,6 @@
$(function () {
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
showNormalImage('activity_description_<%= topic.id %>');
if($("#intro_content_<%= topic.id %>").height() > 810) {
$("#intro_content_show_<%= topic.id %>").show();
}
$("#intro_content_show_<%= topic.id %>").click(function(){
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
$("#intro_content_show_<%= topic.id %>").hide();
$("#intro_content_hide_<%= topic.id %>").show();
});
$("#intro_content_hide_<%= topic.id %>").click(function(){
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= topic.id %>").hide();
$("#intro_content_show_<%= topic.id %>").show();
});
});
</script>
<% if topic %>

View File

@ -0,0 +1,142 @@
<script type="text/javascript">
$(document).ready(function(){
$("#time").change(function(){
document.getElementById("end_time").options[document.getElementById("time").selectedIndex].selected = true;
});
$("#term").change(function(){
document.getElementById("end_term").options[document.getElementById("term").selectedIndex].selected = true;
});
var popupHeight = $(".referenceResourcesPopup").outerHeight(true);
$(".referenceResourcesPopup").css("marginTop",-popupHeight/2);
$(".resourcePopupClose").click(function(){
hideModal();
});
$("#copyResource").click(function(){
if ($("#allResource").is(":checked")){
$("input[name='course_attachment_type[]']").attr("checked",true);
}
else{
$("input[name='course_attachment_type[]']").attr("checked",false);
}
});
$("#copyResource2").click(function(){
if ($("input[name='course_attachment_type[]']:checked").length == 6){
$("#allResource").attr("checked",true);
}
else{
$("#allResource").attr("checked",false);
}
});
});
</script>
<div>
<div class="referenceText">信息配置</div>
</div>
<ul class="mt10">
<%=labelled_form_for @new_course do |f| %>
<input name="copy_course" value="<%=@course.id %>" style="display: none"/>
<li class="ml45 mb10"> <a href="javascript:void(0)" class="upimg fl"> <img alt="上传图片" id="avatar_image" src="images/courses/pic_courses.jpg" height="60" width="60"> </a> <!--<a href="javascript:void(0)" class="upbtn fl ml30" onclick="$('#upload_course_logo').click();">上传图片</a>-->
<!--</span>-->
<div class="cl"></div>
</li>
<li class="ml45">
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="course_name" class="courses_input grey_border" maxlength="100" onkeyup="regex_course_name();" value="<%=@course.name %>">
<span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空</span>
<div class="cl"></div>
<li class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</label>
<input type="text" name="class_period" id="class_period" class="hwork_input02 grey_border" onkeyup="regex_course_class_period();" maxlength="6" value="<%=@course.class_period %>">
<span class="c_red" id="course_class_period_notice" style="display: none;"></span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_course_term)%>&nbsp;&nbsp;</label>
<%= select_tag :time,options_for_select(course_time_option(@new_course.time),@new_course.time), {} %>
<%= select_tag :term,options_for_select(course_term_option,@new_course.term || cur_course_term),{} %>
<span class="c_red" id="course_time_term_notice"></span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;结束学期&nbsp;&nbsp;</label>
<%= select_tag :end_time,options_for_select(course_time_option(@new_course.end_time),@new_course.end_time), {} %>
<%= select_tag :end_term,options_for_select(course_term_option,@new_course.end_term || cur_course_term),{} %>
<span class="mr15 c_red">仅针对跨越多个学期的班级,否则不用修改。</span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_new_course_password)%>&nbsp;&nbsp;</label>
<input type="text" style="display: none;">
<input type="text" name="course[password]" id="course_course_password" class="hwork_input02 grey_border" onkeyup="regex_course_password();" value="<%=@course.password %>">
<!--<a id="psw_btn" href="javascript:void(0)">显示明码</a>-->
<span class="c_red" id="course_course_password_notice"></span>
<div class="cl"></div>
<span class="ml95 c_red">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
</li>
<li class="ml50">
<label class="fl" >&nbsp;&nbsp;<%= l(:label_new_course_description)%>&nbsp;&nbsp;</label>
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl grey_border" ><%= @course.description.nil? ? "" : @course.description %></textarea>
<div class="cl"></div>
</li>
<li class=" mb5 ml85">
<label >公开&nbsp;&nbsp;</label>
<input <%= @course.is_public == 1 ? 'checked' : ''%> id="course_is_public" name="course[is_public]" type="checkbox" value="<%=@course.is_public.to_i %>">
<span class="c_grey">(选中后课外用户可见该课程,否则仅对课内成员可见)</span>
<div class="cl"></div>
</li>
<li class="ml58">
<label class="fl">复制资源&nbsp;&nbsp;</label>
<ul class="fl" id="copyResource">
<li class="sendCourseName fl mr15 ml5">
<label>
<input name="checkAll" type="checkbox" id="allResource" value="0" class="resourceCopy"/>
全部</label>
</li>
</ul>
<ul class="fl" id="copyResource2">
<li class="sendCourseName fl mr15">
<label>
<input name="course_attachment_type[]" type="checkbox" value="1" class="resourceCopy"/>
课件</label>
</li>
<li class="sendCourseName fl mr15">
<label>
<input name="course_attachment_type[]" type="checkbox" value="2" class="resourceCopy"/>
软件</label>
</li>
<li class="sendCourseName fl mr15">
<label>
<input name="course_attachment_type[]" type="checkbox" value="3" class="resourceCopy"/>
媒体</label>
</li>
<li class="sendCourseName fl mr15">
<label>
<input name="course_attachment_type[]" type="checkbox" value="4" class="resourceCopy"/>
代码</label>
</li>
<li class="sendCourseName fl mr15">
<label>
<input name="course_attachment_type[]" type="checkbox" value="6" class="resourceCopy"/>
论文</label>
</li>
<li class="sendCourseName fl mr15">
<label>
<input name="course_attachment_type[]" type="checkbox" value="5" class="resourceCopy"/>
其它</label>
</li>
<div class="cl"></div>
</ul>
<span class="c_red ml5 fl mb10">您可以通过选择资源类型,将对应资源复制到新课程中。</span>
<div class="cl"></div>
</li>
<% end %>
</ul>
<div>
<a href="javascript:void(0);" class="greyBtn fr mr40 f12" onclick="submit_new_course();">完成</a>
<a href="javascript:void(0);" class="greyBtn fr mr10 f12" onclick="hideResource();">取消</a>
</div>
<div class="cl"></div>

View File

@ -73,22 +73,6 @@
$(function () {
init_activity_KindEditor_data(<%= activity.id%>, null, "87%", "<%= activity.class.to_s %>");
showNormalImage('activity_description_<%= activity.id %>');
if($("#intro_content_<%= activity.id %>").height() > 360) {
$("#intro_content_show_<%= activity.id %>").show();
}
$("#intro_content_show_<%= activity.id %>").click(function(){
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
$("#intro_content_show_<%= activity.id %>").hide();
$("#intro_content_hide_<%= activity.id %>").show();
});
$("#intro_content_hide_<%= activity.id %>").click(function(){
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= activity.id %>").hide();
$("#intro_content_show_<%= activity.id %>").show();
});
});
</script>
<% if activity && activity.course_act%>

View File

@ -0,0 +1,10 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'copy_course') %>');
showModal('ajax-modal', '730px');
$('#ajax-modal').css('height','530px').css('width','730px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<div class='resourcePopupClose mt5 mr-5'>" +
"<a href='javascript:void(0)' class='resourceClose' onclick='hideResource();'></a></div>");
$('#ajax-modal').parent().css("top","30%").css("left","").css("position","fixed");
$('#ajax-modal').parent().addClass("popbox").addClass("copyCoursePopup");

View File

@ -5,29 +5,6 @@
$("#Container").css("width","1000px");
});
// 匿评弹框提示
<%# if @is_evaluation && !@stundet_works.empty?%>
// $(function(){
// $('#ajax-modal').html('<%#= escape_javascript(render :partial => 'student_work/praise_alert') %>');
// showModal('ajax-modal', '500px');
// $('#ajax-modal').siblings().remove();
// $('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
// "<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
// $('#ajax-modal').parent().css("top","").css("left","");
// $('#ajax-modal').parent().addClass("anonymos");
// });
<%# end%>
//设置评分规则
function set_score_rule(){
$('#ajax-modal').html('<%#= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework,:student_path => true}) %>');
showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
}
$(function(){
$("#homework_info_hidden").click(function(){
$("#homeworkInformation").hide();
@ -84,6 +61,20 @@
<!---menu_r end--->
</div>
<!--div class="hworkInfor"><a href="javascript:void(0);" class="linkBlue">作业信息</a></div-->
<% if @is_teacher%>
<div class="fr mt5">
<ul class="resourcesSelect">
<li class="resourcesSelected">
<a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="hworkMenu">
<li>
<%= link_to "导出测验成绩", student_exercise_list_exercise_path(@exercise.id,:course_id => @course.id, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%>
</li>
</ul>
</li>
</ul>
</div>
<% end%>
<div class="cl"></div>
</div>

View File

@ -3,9 +3,7 @@
<% if @homework_detail_manual.comment_status == 1%>
<h2>开启匿评功能</h2>
<p>
开启匿评后学生将不能对作品进行
<span class="c_blue">修改、删除</span>
等操作,开启匿评后的提交作品,将
开启匿评后提交的作品将
<span class="c_blue">不能参与匿评</span>
匿评评分将被记为
<span class="c_pink">0分</span>

View File

@ -19,22 +19,6 @@
$(function () {
init_activity_KindEditor_data(<%= issue.id%>, null, "87%", "<%= issue.class.name %>");
showNormalImage('activity_description_<%= issue.id %>');
if ($("#intro_content_<%= issue.id %>").height() > 360) {
$("#intro_content_show_<%= issue.id %>").show();
}
$("#intro_content_show_<%= issue.id %>").click(function () {
$("#activity_description_<%= issue.id %>").toggleClass("maxh360");
$("#activity_description_<%= issue.id%>").toggleClass("lh18");
$("#intro_content_show_<%= issue.id %>").hide();
$("#intro_content_hide_<%= issue.id %>").show();
});
$("#intro_content_hide_<%= issue.id %>").click(function () {
$("#activity_description_<%= issue.id %>").toggleClass("maxh360");
$("#activity_description_<%= issue.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= issue.id %>").hide();
$("#intro_content_show_<%= issue.id %>").show();
});
});
</script>
<%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>

View File

@ -84,7 +84,7 @@ ID:<%= @course.id%>
<ul class="homepagePostSettiongText boxShadow">
<li><%= link_to "课程配置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "postOptionLink" %></li>
<li><%= link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => @course},:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗", :class => "postOptionLink" %></li>
<!--<li><%#= link_to "复制学期", copy_course_course_path(@course.id), :class => "postOptionLink" %></li>-->
<li><%= link_to "复制学期", copy_course_course_path(@course.id),:remote=>true, :class => "postOptionLink" %></li>
</ul>
</li>
</ul>

View File

@ -5,20 +5,4 @@
<% elsif @org_subfield %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
<%end%>
init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", "UserActivity");
showNormalImage('activity_description_<%= @user_activity_id %>');
if($("#intro_content_<%= @user_activity_id %>").height() > 810) {
$("#intro_content_show_<%= @user_activity_id %>").show();
}
$("#intro_content_show_<%= @user_activity_id %>").click(function(){
$("#activity_description_<%= @user_activity_id %>").toggleClass("maxh360");
$("#activity_description_<%= @user_activity_id %>").toggleClass("lh18");
$("#intro_content_show_<%= @user_activity_id %>").hide();
$("#intro_content_hide_<%= @user_activity_id %>").show();
});
$("#intro_content_hide_<%= @user_activity_id %>").click(function(){
$("#activity_description_<%= @user_activity_id %>").toggleClass("maxh360");
$("#activity_description_<%= @user_activity_id %>").toggleClass("lh18");
$("#intro_content_hide_<%= @user_activity_id %>").hide();
$("#intro_content_show_<%= @user_activity_id %>").show();
});
init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", "UserActivity");

View File

@ -92,7 +92,7 @@
<div class="homepagePostDeadline">匿评截止时间:<%= activity.homework_detail_manual.evaluation_end.to_s %>&nbsp;23:59</div>
<% end %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<%= activity.description.html_safe %>
</div>
@ -101,6 +101,9 @@
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
<div class="mt10">
<div class="homepagePostDeadline">
迟交扣分:<%= activity.late_penalty%>分
@ -141,16 +144,13 @@
<% end %>
<% end %>
<div class="cl"></div>
<div>
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %>
<div class="cl"></div>
</div>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<div class="mt10">
<% projects = activity.student_work_projects.where("is_leader = 1") %>
<div class="fl mr20 fontGrey3 w80">
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
</div>
<div class="cl"></div>
<% projects.each do |pro| %>
<% project = Project.find pro.project_id %>
<script type="text/javascript">
@ -163,7 +163,7 @@
});
</script>
<div class="mr20 mb10 fl w80" style="text-align: center;">
<div class="mr20 mb10 mt10 fl w110 fontGrey3" style="text-align: center;">
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
<% else %>
@ -172,7 +172,7 @@
<% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
<p><%=time_from_now time %></p>
<p><%=time_from_now time %>&nbsp;&nbsp;<%=changesets_num project %>提交</p>
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
@ -290,4 +290,7 @@
<div class="cl"></div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -30,7 +30,7 @@
<div class="homepagePostDate">
发帖时间:<%= format_time(activity.created_on) %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<% if activity.parent_id.nil? %>
<%= activity.content.to_s.html_safe%>
@ -43,6 +43,9 @@
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
<ul>
<li class="homepagePostSettingIcon">
@ -138,3 +141,6 @@
<% end %>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -22,7 +22,7 @@
<div class="homepagePostDate">
发布时间:<%= format_time(activity.created_on) %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<%= activity.description.html_safe %>
</div>
@ -31,6 +31,9 @@
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
</div>
<div class="cl"></div>
</div>
@ -103,4 +106,7 @@
<div class="cl"></div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -29,7 +29,7 @@
<div class="homepagePostDate">
发布时间:<%= format_time(activity.published_at) %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<%= activity.polls_description.html_safe %>
</div>
@ -53,4 +53,7 @@
<div class="cl"></div>
</div>
</div>
<% end %>
<% end %>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -33,7 +33,7 @@
<%=format_time(activity.created_on) %>
</div>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<% if activity.description? %>
<%= textAreailizable activity, :description, :attachments => activity.attachments %>
@ -45,32 +45,7 @@
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<% if activity.attachments.any? %>
<% activity.attachments.each do |attachment| %>
<div class="break_word">
<span class="fl">
<span title="<%= attachment.filename %>" id="attachment_">
<%= link_to_short_attachment attachment,:length=> 58, :class => 'link_file_a fl newsBlue', :download => true -%>
</span>
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
:controller => 'attachments',
:action => 'show',
:id => attachment,
:class => 'fl',
:filename => attachment.filename %>
<% end %>
</span>
<span class="postAttSize">(
<%= number_to_human_size attachment.filesize %>)
</span>
<span class="author" title="<%= attachment.author%>">
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
<%= format_time(attachment.created_on) %>
</span>
</div>
<% end %>
<% end %>
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
</div>
<div class="cl"></div>
@ -150,3 +125,6 @@
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -26,7 +26,7 @@
<div class="homepagePostDate">
时间:<%= format_time(activity.created_on) %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<% if activity.parent_id.nil? %>
<%= activity.content.to_s.html_safe%>
@ -39,6 +39,9 @@
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
</div>
<div class="cl"></div>
</div>
@ -115,4 +118,7 @@
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -26,7 +26,7 @@
<div class="homepagePostDate">
时间:<%= format_time(activity.created_on) %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<% if activity.parent_id.nil? %>
<%= activity.content.to_s.html_safe%>
@ -39,6 +39,9 @@
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
</div>
<div class="cl"></div>
</div>
@ -115,4 +118,7 @@
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -21,7 +21,7 @@
发布时间:<%= format_time(activity.created_on) %>
</div>
<p class="mt5 break_word"><%= textAreailizable activity, :description %><br/></p>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id %>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id %>">
<div id="intro_content_<%= user_activity_id %>">
<%#= activity.description.html_safe %>
</div>
@ -32,4 +32,7 @@
<div class="cl"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -33,22 +33,6 @@
$(function () {
init_activity_KindEditor_data(<%= activity.id%>, null, "87%", "<%= activity.class.to_s %>");
showNormalImage('activity_description_<%= activity.id %>');
if ($("#intro_content_<%= activity.id %>").height() > 810) {
$("#intro_content_show_<%= activity.id %>").show();
}
$("#intro_content_show_<%= activity.id %>").click(function () {
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
$("#intro_content_show_<%= activity.id %>").hide();
$("#intro_content_hide_<%= activity.id %>").show();
});
$("#intro_content_hide_<%= activity.id %>").click(function () {
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= activity.id %>").hide();
$("#intro_content_show_<%= activity.id %>").show();
});
});
</script>
<!--创建-->

View File

@ -22,7 +22,7 @@
<div class="homepagePostDate">
发布时间:<%= format_time(activity.created_on) %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id %>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id %>">
<div id="intro_content_<%= user_activity_id %>">
<%= activity.description.html_safe %>
</div>
@ -31,6 +31,9 @@
<div id="intro_content_show_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
</div>
<div class="cl"></div>
</div>
@ -103,4 +106,7 @@
<div class="cl"></div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -31,52 +31,50 @@
<div class="cl"></div>
</li>
<% if @is_teacher%>
<li class="mt10 fl">
<span class="tit_fb ">
测试结果:
</span>
<div class="show_hwork_p break_word">
<% work.student_work_tests.each_with_index do |test, index| %>
<div class="ProResultTop">
<p class="c_blue fl">
第<%= work.student_work_tests.count - index%>次测试
</p>
<span class="fr c_grey">
<%= test.created_at.to_s(:db) %>
</span>
<div class="cl"></div>
<li class="mt10 fl">
<span class="tit_fb ">
测试结果:
</span>
<div class="show_hwork_p break_word">
<% work.student_work_tests.each_with_index do |test, index| %>
<div class="ProResultTop">
<p class="c_blue fl">
第<%= work.student_work_tests.count - index%>次测试
</p>
<span class="fr c_grey">
<%= test.created_at.to_s(:db) %>
</span>
<div class="cl"></div>
</div>
<% if test.status.to_i == -2 %>
<div class="ProResultCon ">
<%= test.results.first %>
</div>
<% else %>
<div class="ProResultTable " >
<ul class="ProResultUl " >
<% test.results.each_with_index do |x, i| %>
<li >
<span class="w60 T_C">测试<%=i+1%></span>
<% if x["status"].to_i != 0 %>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="width150"><%=x["result"]%></span>
<span class="w60">正确输出:</span>
<span class="width150"><%=x["output"]%></span>
<div class="cl"></div>
<% else %>
<span class="w150 c_green">测试正确!</span>
<div class="cl"></div>
<% end %>
</li>
<% end %>
</ul>
</div>
<% if test.status.to_i == -2 %>
<div class="ProResultCon ">
<%= test.results.first %>
</div>
<% else %>
<div class="ProResultTable " >
<ul class="ProResultUl " >
<% test.results.each_with_index do |x, i| %>
<li >
<span class="w60 T_C">测试<%=i+1%></span>
<% if x["status"].to_i != 0 %>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="width150"><%=x["result"]%></span>
<span class="w60">正确输出:</span>
<span class="width150"><%=x["output"]%></span>
<div class="cl"></div>
<% else %>
<span class="w150 c_green">测试正确!</span>
<div class="cl"></div>
<% end %>
</li>
<% end %>
</ul>
</div>
<% end %>
<% end %>
</div>
</li>
<% end%>
<% end %>
</div>
</li>
<li >
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%>

View File

@ -40,18 +40,48 @@
<% end%>
<div class="cl"></div>
<div id="about_hwork_<%= student_work.id%>">
<% if @homework.homework_type != 3 && student_work.user == User.current && !@is_evaluation %>
<% if @homework.homework_type == 2%>
<%=render :partial => 'programing_work_show', :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
<% else %>
<%=render :partial => 'show' , :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
<% end %>
<% elsif @homework.homework_type == 3 %>
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
<% if pro && pro.student_work_id == student_work.id && !@is_evaluation %>
<%=render :partial => 'show' , :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
<% end %>
<% end %>
</div>
<div class="cl"></div>
<% end%>
<% end%>
<script type="text/javascript">
$(function(){
<% if !@is_evaluation && !@is_teacher %>
<% work=@homework.student_works.where("user_id = ?",User.current.id).first %>
<% unless work.nil? %>
<% if @homework.homework_type == 2 %>
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>work,:score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
var program_name = "text/x-csrc";
var language = <%= @homework.language %>;
if (language == 1) {
program_name = 'text/x-csrc';
} else if(language==2){
program_name = 'text/x-c++src';
}else if(language==3){
program_name = 'text/x-cython';
} else if(language==4){
program_name = 'text/x-java';
}
var editor = CodeMirror(document.getElementById("work-code"), {
mode: {name: program_name,
version: 2,
singleLineStringErrors: false},
lineNumbers: true,
indentUnit: 2,
matchBrackets: true,
readOnly: true,
value: $("#work-src").text()
});
<% elsif @homework.homework_type == 1 %>
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
<% elsif @homework.homework_type == 3 %>
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
<% if pro && pro.student_work_id == work.id %>
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
<% end %>
<% end %>
<% end %>
$('#score_<%= work.id%>').peSlider({range: 'min'});
<% end %>
});
</script>

View File

@ -92,7 +92,7 @@
<div class="homepagePostDeadline">匿评截止时间:<%= activity.homework_detail_manual.evaluation_end.to_s %>&nbsp;23:59</div>
<% end %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<%= activity.description.html_safe %>
</div>
@ -101,7 +101,9 @@
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
<div class="mt10">
<div class="homepagePostDeadline">
迟交扣分:<%= activity.late_penalty%>分
@ -142,16 +144,13 @@
<% end %>
<% end %>
<div class="cl"></div>
<div>
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %>
<div class="cl"></div>
</div>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<div class="mt10">
<% projects = activity.student_work_projects.where("is_leader = 1") %>
<div class="fl mr20 fontGrey3 w80">
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
</div>
<div class="cl"></div>
<% projects.each do |pro| %>
<% project = Project.find pro.project_id %>
<script type="text/javascript">
@ -164,7 +163,7 @@
});
</script>
<div class="mr20 mb10 fl w80" style="text-align: center;">
<div class="mr20 mb10 mt10 fl w110 fontGrey3" style="text-align: center;">
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
<% else %>
@ -173,7 +172,7 @@
<% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
<p><%=time_from_now time %></p>
<p><%=time_from_now time %>&nbsp;&nbsp;<%=changesets_num project %>提交</p>
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
@ -297,4 +296,7 @@
<div class="cl"></div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -30,7 +30,7 @@
<div class="homepagePostDate">
发帖时间:<%= format_time(activity.created_on) %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<% if activity.parent_id.nil? %>
<%= activity.content.to_s.html_safe%>
@ -43,7 +43,9 @@
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
<div class="homepagePostSetting" id="message_setting_<%= user_activity_id%>" style="display: none">
<ul>
@ -159,3 +161,6 @@
<% end %>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -22,7 +22,7 @@
<div class="homepagePostDate">
发布时间:<%= format_time(activity.created_on) %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<%= activity.description.html_safe %>
</div>
@ -31,6 +31,9 @@
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
</div>
<div class="cl"></div>
</div>
@ -103,4 +106,7 @@
<div class="cl"></div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -29,7 +29,7 @@
<div class="homepagePostDate">
发布时间:<%= format_time(activity.published_at) %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<%= activity.polls_description.html_safe %>
</div>
@ -53,4 +53,7 @@
<div class="cl"></div>
</div>
</div>
<% end %>
<% end %>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -45,7 +45,7 @@
<%=format_time(activity.created_on) %>
</div>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<% if activity.description? %>
<%= textAreailizable activity, :description, :attachments => activity.attachments %>
@ -57,33 +57,7 @@
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<% if activity.attachments.any? %>
<% activity.attachments.each do |attachment| %>
<div class="break_word">
<span class="fl">
<span title="<%= attachment.filename %>" id="attachment_">
<%= link_to_short_attachment attachment,:length=> 58, :class => 'link_file_a fl newsBlue', :download => true -%>
</span>
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
:controller => 'attachments',
:action => 'show',
:id => attachment,
:class => 'fl',
:filename => attachment.filename %>
<% end %>
</span>
<span class="postAttSize">(
<%= number_to_human_size attachment.filesize %>)
</span>
<span class="author" title="<%= attachment.author%>">
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
<%= format_time(attachment.created_on) %>
</span>
</div>
<div class="cl"></div>
<% end %>
<% end %>
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
</div>
<div class="cl"></div>
@ -163,3 +137,6 @@
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -31,7 +31,7 @@
<div class="homepagePostDate">
发帖时间:<%= format_time(activity.created_on) %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<% if activity.parent_id.nil? %>
<%= activity.content.to_s.html_safe%>
@ -44,7 +44,9 @@
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
<div class="homepagePostSetting" id="message_setting_<%= user_activity_id%>" style="display: none">
<ul>
<li class="homepagePostSettingIcon">
@ -146,7 +148,8 @@
</div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -40,22 +40,6 @@
$(function() {
init_activity_KindEditor_data(<%= user_activity.id%>, null, "87%", "<%=user_activity.class.to_s%>");
showNormalImage('activity_description_<%= user_activity.id %>');
if($("#intro_content_<%= user_activity.id %>").height() > 360) {
$("#intro_content_show_<%= user_activity.id %>").show();
}
$("#intro_content_show_<%= user_activity.id %>").click(function(){
$("#activity_description_<%= user_activity.id %>").toggleClass("maxh360");
$("#activity_description_<%= user_activity.id%>").toggleClass("lh18");
$("#intro_content_show_<%= user_activity.id %>").hide();
$("#intro_content_hide_<%= user_activity.id %>").show();
});
$("#intro_content_hide_<%= user_activity.id %>").click(function(){
$("#activity_description_<%= user_activity.id %>").toggleClass("maxh360");
$("#activity_description_<%= user_activity.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= user_activity.id %>").hide();
$("#intro_content_show_<%= user_activity.id %>").show();
});
});
</script>
<% unless user_activity.act_type == "ProjectCreateInfo" %>

View File

@ -28,7 +28,7 @@
<div class="homepagePostDate">
发布时间:<%= format_time(activity.created_on) %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<%= activity.content.html_safe %>
</div>
@ -37,6 +37,9 @@
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
</div>
<div class="cl"></div>
</div>
@ -116,4 +119,7 @@
</div>
<% end %>
</div>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -95,7 +95,7 @@
</div>
<% end %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="homework_description_<%= homework_common.id%>">
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="homework_description_<%= homework_common.id%>">
<div id="intro_content_<%= homework_common.id%>">
<%= homework_common.description.html_safe %>
</div>
@ -104,7 +104,9 @@
<div id="intro_content_show_<%= homework_common.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= homework_common.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => homework_common} %>
</div>
<div class="mt10">
<div class="homepagePostDeadline">
迟交扣分:<%= homework_common.late_penalty%>分
@ -145,16 +147,13 @@
<% end %>
<% end %>
<div class="cl"></div>
<div>
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework_common.attachments} %>
<div class="cl"></div>
</div>
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %>
<div class="mt10">
<% projects = homework_common.student_work_projects.where("is_leader = 1") %>
<div class="fl mr20 fontGrey3 w80">
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
</div>
<div class="cl"></div>
<% projects.each do |pro| %>
<% project = Project.find pro.project_id %>
<script type="text/javascript">
@ -166,7 +165,7 @@
});
});
</script>
<div class="mr20 mb10 fl w80" style="text-align: center;">
<div class="mr20 mb10 mt10 fl w110 fontGrey3" style="text-align: center;">
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像" %>
<% else %>
@ -175,7 +174,7 @@
<% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
<p><%=time_from_now time %></p>
<p><%=time_from_now time %>&nbsp;&nbsp;<%=changesets_num project %>提交</p>
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=homework_common.id %>">
项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
@ -301,4 +300,7 @@
<div class="cl"></div>
</div>
</div>
</div><!----HomeWork end-->
</div><!----HomeWork end-->
<script type="text/javascript">
$(homework_description_show_hide(<%=homework_common.id %>));
</script>

View File

@ -18,22 +18,6 @@
<script type="text/javascript">
$(function() {
init_activity_KindEditor_data(<%= homework_common.id%>, null, "87%", "<%=homework_common.class.to_s%>");
showNormalImage('homework_description_<%= homework_common.id%>');
if($("#intro_content_<%= homework_common.id%>").height() > 360) {
$("#intro_content_show_<%= homework_common.id%>").show();
}
$("#intro_content_show_<%= homework_common.id%>").click(function(){
$("#homework_description_<%= homework_common.id%>").toggleClass("maxh360");
$("#homework_description_<%= homework_common.id%>").toggleClass("lh18");
$("#intro_content_show_<%= homework_common.id%>").hide();
$("#intro_content_hide_<%= homework_common.id%>").show();
});
$("#intro_content_hide_<%= homework_common.id%>").click(function(){
$("#homework_description_<%= homework_common.id%>").toggleClass("maxh360");
$("#homework_description_<%= homework_common.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= homework_common.id%>").hide();
$("#intro_content_show_<%= homework_common.id%>").show();
});
});
function expand_reply(container,btnid){

View File

@ -1871,6 +1871,7 @@ zh:
excel_been_rated: 已评
excel_not_rated: 未评
label_export_excel: 导出列表
excel_exercise_list: 测验成绩列表
label_softapplication: 应用软件
label_attending_contest: 参加竞赛

View File

@ -5,6 +5,41 @@
/* Redmine - project management software
Copyright (C) 2006-2013 Jean-Philippe Lang */
//动态高度控制
function description_show_hide(id){
showNormalImage('activity_description_'+id);
if($("#intro_content_"+id).height() > 810) {
$("#intro_content_show_"+id).show();
}
$("#intro_content_show_"+id).click(function(){
$("#activity_description_"+id).toggleClass("maxh360");
$("#intro_content_show_"+id).hide();
$("#intro_content_hide_"+id).show();
});
$("#intro_content_hide_"+id).click(function(){
$("#activity_description_"+id).toggleClass("maxh360");
$("#intro_content_hide_"+id).hide();
$("#intro_content_show_"+id).show();
});
}
function homework_description_show_hide(id){
showNormalImage('homework_description_'+id);
if($("#intro_content_"+id).height() > 810) {
$("#intro_content_show_"+id).show();
}
$("#intro_content_show_"+id).click(function(){
$("#homework_description_"+id).toggleClass("maxh360");
$("#intro_content_show_"+id).hide();
$("#intro_content_hide_"+id).show();
});
$("#intro_content_hide_"+id).click(function(){
$("#homework_description_"+id).toggleClass("maxh360");
$("#intro_content_hide_"+id).hide();
$("#intro_content_show_"+id).show();
});
}
function cleanArray (actual){
var newArray = new Array();
for (var i = 0; i< actual.length; i++){

View File

@ -121,6 +121,7 @@ a.linkGrey6:hover {color:#ffffff !important;}
.w70{ width:70px;}
.w80{ width:80px;}
.w90{ width:90px;}
.w110{width:110px;}
.w210{ width:210px;}
.w150{ width:150px;}
.w280{ width:280px;}
@ -1384,7 +1385,7 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.proHelp {background:url(/images/course/hwork_icon.png) -5px -124px no-repeat; display:inline-block; width:15px; height:15px; display:inline-block;}
.hworkPrName {width:110px; max-width:110px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;}
.mr150 {margin-right:150px;}
.captainName {max-width:40px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;}
.captainName {max-width:75px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;}
/* @功能 定义 */
span.at {color:#269ac9;}

File diff suppressed because it is too large Load Diff