diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb index 8ddc3062d..9e13cbafc 100644 --- a/app/views/blogs/_article.html.erb +++ b/app/views/blogs/_article.html.erb @@ -1,7 +1,7 @@
-

博客列表

+

博客列表

排序: <%= link_to "时间", {:controller => 'blogs', :action => 'index', :id =>@user, :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %> @@ -21,9 +21,9 @@
  • <% 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 %> @@ -36,7 +36,8 @@ <% end %>
  • - <% count=BlogComment.where("root_id = #{activity.id}").count%>
  • + <% count=BlogComment.where("root_id = #{activity.id}").count%> +
  • 发布:<%= format_time(activity.created_on) %> 更新:<%= format_time(activity.updated_on) %>

    diff --git a/app/views/courses/member.html.erb b/app/views/courses/member.html.erb index 2d2eecab1..606c0d67c 100644 --- a/app/views/courses/member.html.erb +++ b/app/views/courses/member.html.erb @@ -4,7 +4,7 @@

    <%= @subPage_title%>

    <% if User.current.allowed_to?(:as_teacher,@course) %> - <%=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' %> <% end %>
@@ -13,21 +13,12 @@ <% else %>
-

<%= @subPage_title %>

-
-
    -
  • -
      -
    • <%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'hw_more_li'%>
    • - <% if User.current.allowed_to?(:as_teacher,@course) %> -
    • - <%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'hw_more_li' %> -
    • - <% end %> -
    -
  • -
-
+

<%= @subPage_title %>

+ <% if User.current.allowed_to?(:as_teacher,@course) %> + <%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'link-blue ml10 fr mt5' %> + <% end %> + <%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'link-blue fr mt5'%> +
<%= render :partial => 'course_student', :locals => {:members => @members} %>
diff --git a/app/views/student_work/_evaluation_un_group_work.html.erb b/app/views/student_work/_evaluation_un_group_work.html.erb index 82dae65bb..4545b16e7 100644 --- a/app/views/student_work/_evaluation_un_group_work.html.erb +++ b/app/views/student_work/_evaluation_un_group_work.html.erb @@ -14,28 +14,31 @@
关联项目:
- <% 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 %> - <% end %> + <% else %> + <% end %> <% project = student_work.project %>
-

<%= project.name %>

+

<%= project.name %><%= project.status == 9 ? "(已删除)" : ""%>

创建者:<%= project.creater %>成员数量:<%= project.members.count %>

<% project_score = project.project_score %> -

项目综合得分:<%= static_project_score(project_score).to_i %>

+

项目综合得分:<%= project.status == 9 ? 0 : static_project_score(project_score).to_i %>

+ <% if project.status != 9 %>

= 代码提交得分 + issue得分 + 资源得分 + 帖子得分

= <%= (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 %>

+ <% end %>
diff --git a/app/views/student_work/_relate_projects.html.erb b/app/views/student_work/_relate_projects.html.erb index 8b977b47a..b538d2aa6 100644 --- a/app/views/student_work/_relate_projects.html.erb +++ b/app/views/student_work/_relate_projects.html.erb @@ -1,13 +1,15 @@
<% 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)) %>

<% 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 %> <%=project.name %> + <% else %> + <%=project.name %> <% end %>

<%= project.is_public? ? '公开' : '私有' %> diff --git a/app/views/syllabuses/_syllabus_course_list.html.erb b/app/views/syllabuses/_syllabus_course_list.html.erb index 1ce62a1b4..3af4eee43 100644 --- a/app/views/syllabuses/_syllabus_course_list.html.erb +++ b/app/views/syllabuses/_syllabus_course_list.html.erb @@ -36,8 +36,8 @@ <% end %>
-

- 创建老师:<%=link_to course.teacher.show_name, user_path(course.teacher), :class => 'sy_cblue' %> +

+ <% if User.current.admin? || User.current.allowed_to?(:as_teacher,course) %> <% homework_num = course.homework_commons.count %> <% else %> @@ -59,7 +59,7 @@ 学期:<%= current_time_and_term course %> 更新时间:<%= format_date(course.updated_on) %> -

+
<% if @list_type == 0 %> <% if User.current.member_of_course?(course) %> diff --git a/app/views/users/_course_boardlist.html.erb b/app/views/users/_course_boardlist.html.erb index 2118dee64..d060bd8b9 100644 --- a/app/views/users/_course_boardlist.html.erb +++ b/app/views/users/_course_boardlist.html.erb @@ -1,7 +1,7 @@
-

讨论区列表

+

讨论区列表

排序: <%= 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 @@
<% 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 %> @@ -30,20 +30,20 @@ <% if activity.locked %> <% end %> - <% u = User.where("id=?",activity.author_id).first%> + <%# u = User.where("id=?",activity.author_id).first%>
-
- <% if activity.parent_id.nil? %> - <% content = activity.content %> - <% else %> - <% content = activity.parent.content %> - <% end %> -

<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>75, :maxwidth=>563} %>

-
+ + + + + + + +
- - 发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> + + 发帖人:<%= link_to activity.author.show_name, user_path(activity.author), :class => "link-blue" %> 更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %> <% all_comments = []%> diff --git a/app/views/users/_course_newslist.html.erb b/app/views/users/_course_newslist.html.erb index 8efcc6fec..65f9572d6 100644 --- a/app/views/users/_course_newslist.html.erb +++ b/app/views/users/_course_newslist.html.erb @@ -1,7 +1,7 @@
-

通知列表

+

通知列表

排序: <%= 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| %>
- <%= 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 %> <% end%> - <% u = User.where("id=?",activity.author_id).first%>
-
-
-

<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54, :maxwordsnum=>100, :maxwidth=>563} %>

+ <% u = User.where("id=?",activity.author_id).first%> +
+ + +
- - 发布者: <%= activity.author.show_name %> + + 发布者:<%= link_to activity.author.show_name, user_path(activity.author), :class => "link-blue" %> 更新:<%= format_time(activity.course_acts.first.try(:updated_at)) %> <% count=0 %> diff --git a/app/views/users/_project_boardlist.html.erb b/app/views/users/_project_boardlist.html.erb index 84f98c0b2..dbc0b3992 100644 --- a/app/views/users/_project_boardlist.html.erb +++ b/app/views/users/_project_boardlist.html.erb @@ -1,7 +1,7 @@
-

讨论区列表

+

讨论区列表

排序: <%= link_to "时间", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %> @@ -20,9 +20,9 @@
<% 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 %> @@ -30,20 +30,20 @@ <% if activity.locked %> <% end %> - <% u = User.where("id=?",activity.author_id).first%> + <%# u = User.where("id=?",activity.author_id).first%>
-
- <% if activity.parent_id.nil? %> - <% content = activity.content %> - <% else %> - <% content = activity.parent.content %> - <% end %> -

<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>225, :maxwidth=>950} %>

-
+ + + + + + + +
- - 发帖人:<%=(u.try(:realname) != " " ? u.try(:lastname) + u.try(:firstname) : u.try(:login)) unless u.nil? %> + + 发帖人:<%= link_to activity.author.show_name, user_path(activity.author), :class => "link-blue" %> 更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %> <% all_comments = []%> diff --git a/app/views/users/_user_course_list.html.erb b/app/views/users/_user_course_list.html.erb index f757b170b..c1d99baed 100644 --- a/app/views/users/_user_course_list.html.erb +++ b/app/views/users/_user_course_list.html.erb @@ -1,5 +1,5 @@
-

课程列表

+

课程列表

排序: <%= link_to "时间", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt", :remote => true %> @@ -19,7 +19,7 @@
  • - <%= 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%> diff --git a/app/views/users/_user_project_list.html.erb b/app/views/users/_user_project_list.html.erb index 77db8bc3e..d03c90b0f 100644 --- a/app/views/users/_user_project_list.html.erb +++ b/app/views/users/_user_project_list.html.erb @@ -82,7 +82,7 @@
    -

    项目列表

    +

    项目列表

    排序: <%= link_to "时间", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt", :remote => true %> @@ -102,7 +102,7 @@
    • - <%= 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%> <%='创建者:'+(projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)) %> diff --git a/db/migrate/20161125024643_migrate_student_works.rb b/db/migrate/20161125024643_migrate_student_works.rb new file mode 100644 index 000000000..16461ac22 --- /dev/null +++ b/db/migrate/20161125024643_migrate_student_works.rb @@ -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 diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index 96abaf93d..aa78e8686 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -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;}