Merge branch 'cxt_course' into develop

This commit is contained in:
cxt 2016-11-25 14:03:01 +08:00
commit 88c4a26303
12 changed files with 89 additions and 71 deletions

View File

@ -1,7 +1,7 @@
<div class = "cl"> </div>
<div id="blog-list">
<div class="listbox mt10" >
<h2 class="list-h2">博客列表</h2>
<p class="list-h2">博客列表</p>
<div class="category">
<span class="grayTxt ">排序:</span>
<%= link_to "时间", {:controller => 'blogs', :action => 'index', :id =>@user, :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
@ -21,9 +21,9 @@
<ul class="list-file">
<li><span class="item_list fl"></span>
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=> activity.author, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl" %>
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=> activity.author, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title-normal fl" %>
<% else %>
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl"%>
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title-normal fl"%>
<% end %>
<%# if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
<!--<span class="font_normal ml10 fr">[已设为首页]</span>-->
@ -36,7 +36,8 @@
<% end %>
<div class="cl"></div>
</li>
<% count=BlogComment.where("root_id = #{activity.id}").count%> <li class="ml15">
<% count=BlogComment.where("root_id = #{activity.id}").count%>
<li class="ml15">
<span class="grayTxt">发布:<%= format_time(activity.created_on) %></span>
<span class="grayTxt">更新:<%= format_time(activity.updated_on) %></span>
<p class="list-info fr grayTxt">

View File

@ -4,7 +4,7 @@
<h2 class="project_h2 fl"><%= @subPage_title%></h2>
<% if User.current.allowed_to?(:as_teacher,@course) %>
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
<%=link_to "成员管理", :controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member', :class => 'hw_more_li' %>
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member'}, :class => 'hw_more_li' %>
</span>
<% end %>
</div>
@ -13,21 +13,12 @@
<% else %>
<div class="sy_class_r sy_class_nobg fr ml10">
<div class="sy_class_r_head mb10">
<h3><%= @subPage_title %></h3>
<div class="hw_more_box">
<ul>
<li class="hw_more_icons">
<ul class="hw_more_txt">
<li><%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'hw_more_li'%></li>
<h3 class="fl"><%= @subPage_title %></h3>
<% if User.current.allowed_to?(:as_teacher,@course) %>
<li>
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'hw_more_li' %>
</li>
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'link-blue ml10 fr mt5' %>
<% end %>
</ul>
</li>
</ul>
</div>
<%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'link-blue fr mt5'%>
<div class="cl"></div>
</div>
<%= render :partial => 'course_student', :locals => {:members => @members} %>
</div>

View File

@ -14,28 +14,31 @@
<div class="pr">
<span class="fl ml25 fontGrey2">关联项目:</span>
<div class="fl projectName">
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course) %>
<% if student_work.project.status != 9 && (student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course)) %>
<%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fl hidden', :style => "max-width:550px;", :title => "项目名称", :target => "_blank" %>
<% else %>
<% elsif student_work.project.status != 9 %>
<span class="fontBlue fr hidden" style="max-width:550px;" title="该项目是私有的"><%= student_work.project.name %></span>
<% end %>
<% else %>
<span class="fontGrey2 fr hidden" style="max-width:550px;" title="该项目已删除"><%= student_work.project.name %>(已删除)</span><% end %>
<% project = student_work.project %>
<div class="score-tip none tl f12" style="width:300px; top:-48px; right:-372px;">
<em style="bottom:45px;"></em>
<font style="bottom:45px;"></font>
<p class="fb break_word mw280"><%= project.name %></p>
<p class="fb break_word mw280"><%= project.name %><%= project.status == 9 ? "(已删除)" : ""%></p>
<p class="mb10">
<span class="mr15">创建者:<%= project.creater %></span><span>成员数量:<%= project.members.count %></span></p>
<% project_score = project.project_score %>
<p>项目综合得分:<%= static_project_score(project_score).to_i %></p>
<p>项目综合得分:<%= project.status == 9 ? 0 : static_project_score(project_score).to_i %></p>
<% if project.status != 9 %>
<p>= 代码提交得分 + issue得分 + 资源得分 + 帖子得分</p>
<p>= <%= (project_score.changeset_num||0) * 4 %>
+ <%= project_score.issue_num * 4 + project_score.issue_journal_num %> + <%= project_score.attach_num * 5 %>
+ <%= project_score.board_num * 2 + project_score.board_message_num + project_score.news_num %></p>
<% end %>
</div>
</div>
</div>

View File

@ -1,13 +1,15 @@
<div class="syllabus_courses_box">
<% projects.each do |project|%>
<% allow_visit = project.is_public || User.current.member_of?(project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course) %>
<% allow_visit = project.status != 9 && (project.is_public || User.current.member_of?(project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course)) %>
<div class="syllabus_courses_list" style="cursor: default">
<div class="sy_courses_open">
<h3>
<% if allow_visit %>
<%= link_to "#{project.name}", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<% else %>
<% elsif project.status != 9 %>
<a href="javascript:void(0)" class="new_project_title fl" title="私有项目不可访问"><%=project.name %></a>
<% else %>
<a href="javascript:void(0)" class="new_project_title fl" title="项目已删除"><%=project.name %></a>
<% end %>
</h3>
<span class="<%= project.is_public? ? 'syllabus_class_open' : 'syllabus_class_private' %> fl ml10 mt3 syllabus_class_property"><%= project.is_public? ? '公开' : '私有' %></span>

View File

@ -36,8 +36,8 @@
<% end %>
<span class="<%= course.is_public == 0 ? 'hw_icon_private' : 'hw_icon_open' %> fl mr20 mt3"></span>
<div class="cl"></div>
<p class="sy_cgrey">
<span class=" mr15">创建老师:<%=link_to course.teacher.show_name, user_path(course.teacher), :class => 'sy_cblue' %></span>
<div class="sy_cgrey">
<p class="mr15 hidden fl" style="max-width: 140px;">创建老师:<%=link_to course.teacher.show_name, user_path(course.teacher), :class => 'sy_cblue', :title => "#{course.teacher.show_name}" %></p>
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,course) %>
<% homework_num = course.homework_commons.count %>
<% else %>
@ -59,7 +59,7 @@
</span>
<span class=" mr15">学期:<%= current_time_and_term course %></span>
<span class=" mr15">更新时间:<%= format_date(course.updated_on) %></span>
</p>
</div>
</div>
<% if @list_type == 0 %>
<% if User.current.member_of_course?(course) %>

View File

@ -1,7 +1,7 @@
<div class = "cl"> </div>
<div id="course-boardlist">
<div class="listbox mt10" >
<h2 class="list-h2">讨论区列表</h2>
<p class="list-h2">讨论区列表</p>
<div class="category">
<span class="grayTxt ">排序:</span>
<%= link_to "时间", {:controller => 'boards', :action => 'index', :board_id =>@board.id, :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
@ -20,9 +20,9 @@
<div class="list-file">
<div><span class="item_list fl"></span>
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to activity.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class => "list-title fl" %>
<%= link_to activity.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class => "list-title-normal fl" %>
<% else %>
<%= link_to activity.parent.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class => "list-title f1" %>
<%= link_to activity.parent.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class => "list-title-normal f1" %>
<% end %>
<% if activity.sticky == 1 %>
<span class="fl ml10 red-cir-btn">顶</span>
@ -30,20 +30,20 @@
<% if activity.locked %>
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
<% end %>
<% u = User.where("id=?",activity.author_id).first%>
<%# u = User.where("id=?",activity.author_id).first%>
<div class="cl"></div>
</div>
<div class="massages-content ml15">
<% if activity.parent_id.nil? %>
<% content = activity.content %>
<% else %>
<% content = activity.parent.content %>
<% end %>
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>75, :maxwidth=>563} %></p>
</div>
<!--<div class="massages-content ml15">-->
<!--<%# if activity.parent_id.nil? %>-->
<!--<% content = activity.content %>-->
<!--<%# else %>-->
<!--<%# content = activity.parent.content %>-->
<!--<%# end %>-->
<!--<p><%#=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>75, :maxwidth=>563} %></p>-->
<!--</div>-->
<div class="ml15 mt10">
<span class="grayTxt">
发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
<span class="grayTxt mr15">
发帖人:<%= link_to activity.author.show_name, user_path(activity.author), :class => "link-blue" %>
</span>
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
<% all_comments = []%>

View File

@ -1,7 +1,7 @@
<div class = "cl"> </div>
<div id="course-newslist">
<div class="listbox mt10" >
<h2 class="list-h2">通知列表</h2>
<p class="list-h2">通知列表</p>
<div class="category">
<span class="grayTxt ">排序:</span>
<%= link_to "时间", {:controller => 'news', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
@ -19,18 +19,19 @@
<% topics.each do |activity| %>
<div class="list-file">
<div><span class="item_list fl"></span>
<%= link_to activity.title.to_s, User.current.logged? ? news_path(activity) : signin_url_without_domain, :class => "list-title fl" %>
<%= link_to activity.title.to_s, User.current.logged? ? news_path(activity) : signin_url_without_domain, :class => "list-title-normal fl" %>
<% if activity.sticky == 1 %>
<span class="fl ml10 red-cir-btn">顶</span>
<% end%>
<% u = User.where("id=?",activity.author_id).first%> <div class="cl"></div>
</div>
<div class="massages-content ml15">
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54, :maxwordsnum=>100, :maxwidth=>563} %></p>
<% u = User.where("id=?",activity.author_id).first%>
<div class="cl"></div>
</div>
<!--<div class="massages-content ml15">-->
<!--<p><%#=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54, :maxwordsnum=>100, :maxwidth=>563} %></p>-->
<!--</div>-->
<div class="ml15 mt10">
<span class="grayTxt">
发布者: <%= activity.author.show_name %>
<span class="grayTxt mr15">
发布者:<%= link_to activity.author.show_name, user_path(activity.author), :class => "link-blue" %>
</span>
<span class="grayTxt">更新:<%= format_time(activity.course_acts.first.try(:updated_at)) %></span>
<% count=0 %>

View File

@ -1,7 +1,7 @@
<div class = "cl"> </div>
<div id="project-boardlist">
<div class="container-big mt10" >
<h2 class="list-h2">讨论区列表</h2>
<p class="list-h2">讨论区列表</p>
<div class="category">
<span class="grayTxt ">排序:</span>
<%= link_to "时间", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
@ -20,9 +20,9 @@
<div class="list-file">
<div><span class="item_list fl"></span>
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to activity.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title fl", :style => "max-width:950px;" %>
<%= link_to activity.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title-normal fl", :style => "max-width:950px;" %>
<% else %>
<%= link_to activity.parent.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title f1", :style => "max-width:950px;" %>
<%= link_to activity.parent.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title-normal f1", :style => "max-width:950px;" %>
<% end %>
<% if activity.sticky == 1 %>
<span class="fl ml10 red-cir-btn">顶</span>
@ -30,20 +30,20 @@
<% if activity.locked %>
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
<% end %>
<% u = User.where("id=?",activity.author_id).first%>
<%# u = User.where("id=?",activity.author_id).first%>
<div class="cl"></div>
</div>
<div class="ml15">
<% if activity.parent_id.nil? %>
<% content = activity.content %>
<% else %>
<% content = activity.parent.content %>
<% end %>
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>225, :maxwidth=>950} %></p>
</div>
<!--<div class="ml15">-->
<!--<%# if activity.parent_id.nil? %>-->
<!--<%# content = activity.content %>-->
<!--<%# else %>-->
<!--<%# content = activity.parent.content %>-->
<!--<%# end %>-->
<!--<p><%#=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>225, :maxwidth=>950} %></p>-->
<!--</div>-->
<div class="ml15 mt10 f12">
<span class="grayTxt">
发帖人:<%=(u.try(:realname) != " " ? u.try(:lastname) + u.try(:firstname) : u.try(:login)) unless u.nil? %>
<span class="grayTxt mr15">
发帖人<%= link_to activity.author.show_name, user_path(activity.author), :class => "link-blue" %>
</span>
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
<% all_comments = []%>

View File

@ -1,5 +1,5 @@
<div class="listbox" id="course-list">
<h2 class="list-h2">课程列表</h2>
<p class="list-h2">课程列表</p>
<div class="category">
<span class="grayTxt ">排序:</span>
<%= link_to "时间", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
@ -19,7 +19,7 @@
<ul class="list-file">
<li>
<span class="item_list fl"></span>
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "list-title fl #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "list-title-normal fl #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%>
<% teacher = User.where("id=?",course.tea_id).first%>
<span class="fr grayTxt">

View File

@ -82,7 +82,7 @@
<div class="listbox" id="project-list">
<h2 class="list-h2">项目列表</h2>
<p class="list-h2">项目列表</p>
<div class="category">
<span class="grayTxt ">排序:</span>
<%= link_to "时间", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
@ -102,7 +102,7 @@
<ul class="list-file">
<li>
<span class="item_list fl"></span>
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "list-title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "list-title-normal fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<% projectUser = User.where("id=?",project.user_id).first%>
<span class="fr grayTxt">
<%='创建者:'+(projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)) %>

View File

@ -0,0 +1,18 @@
class MigrateStudentWorks < ActiveRecord::Migration
def up
count = Course.all.count / 30 + 2
transaction do
for i in 1 ... count do i
Course.page(i).per(30).each do |course|
homework_ids = course.homework_commons.blank? ? "(-1)" : "(" + course.homework_commons.map{|hw| hw.id}.join(",") + ")"
student_ids = course.student.blank? ? "(-1)" : "(" + course.student.map{|st| st.student_id}.join(",") + ")"
student_works = StudentWork.where("homework_common_id in #{homework_ids} and user_id not in #{student_ids}")
student_works.update_all(:is_delete => 1)
end
end
end
end
def down
end
end

View File

@ -493,7 +493,7 @@ ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
/*博客列表界面样式*/
.listbox{ width:730px; background-color:#fff; border:1px solid #ddd; padding:10px; }
/*.bloglistbox{ min-height:690px;}*/
.list-h2{ font-size:16px; font-weight:bold; color:#000; padding-bottom:5px;}
.list-h2{ font-size:16px; color:#000; padding-bottom:5px;}
.category{ padding:10px 0; border-bottom:1px solid #ddd;}
.category a,.category span{ float:left; margin-right:5px;}
.grayTxt{ color:#9093a6;}
@ -504,6 +504,8 @@ a.sortdownbtn{ background: url(/images/liststyle.png) 0 -12px no-repeat; width:1
.item_list{ display:block; width:5px; height:5px;-webkit-border-radius: 25px;border-radius:25px; background-color:#adadad; margin:10px 10px 0 0;}
.list-file a.list-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:550px;}
a:hover.list-title{ color:#269ac9;}
.list-file a.list-title-normal{ font-size:14px; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:550px;}
a:hover.list-title-normal{ color:#269ac9;}
.font_normal{ font-weight:normal; font-size:12px;}
.list-file{ padding:10px 0; border-bottom:1px dashed #ddd;}
.list-file li{ line-height:1.9;}