diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 2f6c4ecc7..63f152eb2 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -683,7 +683,7 @@ class StudentWorkController < ApplicationController if !params[:name].nil? condition = "%#{params[:name].strip}%".gsub(" ","") end - @project_ids = Project.where("user_id = #{User.current.id} and name like '#{condition}'") + @project_ids = Project.visible.where("user_id = #{User.current.id} and name like '#{condition}'") @first = params[:first].to_i respond_to do |format| format.js diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb index 51758ea4c..60fc6f96d 100644 --- a/app/views/layouts/_project_info.html.erb +++ b/app/views/layouts/_project_info.html.erb @@ -1,92 +1,99 @@ -<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> -<% teacher_num = searchTeacherAndAssistant(@course).count %> -<% student_num = studentCount(@course) %> -<% course_file_num = visable_attachemnts_incourse(@course).count%> - -
<%= @course.is_public == 0 ? "私有课程" : "公开课程" %>
-
-ID:<%= @course.id%> -
- -
- - - - - - - - - - - - - - - - - - - - -
- -
- - <%= @course.name %> - - <%# if @course.is_public == 0%> - - - <%# end %> - - <%if User.current && @course.tea_id == User.current.id && (@course.outline == 0 || BlogComment.where(:id=>@course.outline).count == 0) %> - - <% elsif User.current && @course.tea_id == User.current.id && @course.outline != 0 && BlogComment.where(:id=>@course.outline).count != 0%> - - <% elsif User.current && @course.tea_id != User.current.id && !@course.is_public? && User.current.member_of_course?(@course) && @course.outline != 0%> - - <% elsif User.current && @course.tea_id != User.current.id && @course.is_public? && @course.outline != 0%> - - <%else%> - <%end %> - -
-
-
-
-<%= l(:label_account_identity_teacher)%>(<%= course_teacher_link teacher_num %>) - -<%= l(:label_account_identity_student)%>(<%= course_student_link student_num %>) - -<%= l(:project_module_attachments)%>(<%= link_to course_file_num, course_files_path(@course), :class => 'info_foot_num c_blue',:id=>'courses_files_count_info' %>)
-
-<% if is_teacher %> -
- -
-<% end %> +<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> +<% teacher_num = searchTeacherAndAssistant(@course).count %> +<% student_num = studentCount(@course) %> +<% course_file_num = visable_attachemnts_incourse(@course).count%> + +
<%= @course.is_public == 0 ? "私有课程" : "公开课程" %> + <% if @course.id == 370 %> + 精品课程 + <% end %> +
+
+ID:<%= @course.id%> +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + <%= @course.name %> + + <%# if @course.is_public == 0%> + + + <%# end %> + + <%if User.current && @course.tea_id == User.current.id && (@course.outline == 0 || BlogComment.where(:id=>@course.outline).count == 0) %> + + <% elsif User.current && @course.tea_id == User.current.id && @course.outline != 0 && BlogComment.where(:id=>@course.outline).count != 0%> + + <% elsif User.current && @course.tea_id != User.current.id && !@course.is_public? && User.current.member_of_course?(@course) && @course.outline != 0%> + + <% elsif User.current && @course.tea_id != User.current.id && @course.is_public? && @course.outline != 0%> + + <%else%> + <%end %> + +
+
+
+
+<%= l(:label_account_identity_teacher)%>(<%= course_teacher_link teacher_num %>) + +<%= l(:label_account_identity_student)%>(<%= course_student_link student_num %>) + +<%= l(:project_module_attachments)%>(<%= link_to course_file_num, course_files_path(@course), :class => 'info_foot_num c_blue',:id=>'courses_files_count_info' %>)
+
+<% if is_teacher %> +
+ +
+<% end %> diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 4f2a7b662..4245be9eb 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -173,7 +173,7 @@ <% time=project.updated_on %> <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>

<%=(User.find project.user_id).show_name %>(组长)

-

<%=time_from_now time %>

+

<%=time_from_now time %>  <%= project.commits_count %>提交

项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
diff --git a/app/views/organizations/_project_create.html.erb b/app/views/organizations/_project_create.html.erb index 3b35838a7..6b45a2a13 100644 --- a/app/views/organizations/_project_create.html.erb +++ b/app/views/organizations/_project_create.html.erb @@ -23,7 +23,7 @@ 创建时间:<%= format_time(project.created_on) %>
- 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> + 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='ProjectCreateInfo' and forge_act_id =#{project.id}").first.updated_at) %>