diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ca897fc3d..b396b9c84 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -304,6 +304,9 @@ class UsersController < ApplicationController #用户作业列表 def user_homeworks + user_course_ids = "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" + homework_commons = HomeworkCommon.where("course_id in #{user_course_ids}").order("created_at desc") + @homework_commons = paginateHelper homework_commons,10 respond_to do |format| format.html {render :layout => 'new_base_user'} end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7c7f0c63f..709426d41 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2314,7 +2314,27 @@ module ApplicationHelper elsif homework.homework_type == 2 #编程作业不能修改作品 "作品已交".html_safe else - link_to l(:label_edit_homework), edit_student_work_path(work.id),:class => 'fr mr10 work_edit' + link_to l(:label_edit_homework), edit_student_work_path(work.id),:class => 'fr mr10 work_edit c_blue' + end + end + end + + #根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量 + def user_for_homework_common homework,is_teacher + if is_teacher #老师显示作品数量 + link_to "提交(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue" + else #学生显示提交作品、修改作品等按钮 + work = cur_user_works_for_homework homework + if work.nil? + link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'c_blue' + else + if homework.homework_type == 1 && homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前 + link_to "修改作品", "", :class => 'c_blue', :title => "开启匿评后不可修改作品" + elsif homework.homework_type == 2 #编程作业不能修改作品 + link_to "作品已交", "",:class => 'c_blue',:title => "编程作业不可修改作品" + else + link_to "修改作品", edit_student_work_path(work.id),:class => 'c_blue' + end end end end diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index 763c87c39..a6032a60b 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -1,101 +1,97 @@ -
-
-
发布作业
-
-
-
- -
-
- 导入作业 - -
- -
-
-
-
- -
-
- -
- - -
- 高级功能 -
-
-
+<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%> + + +<% end%> -
-
-
-
-
用户头像
-
- - -
-
指派给  苏稳
-
时间:2015-08-20
+<% @homework_commons.each do |homework_common|%> + <% is_teacher = User.current.allowed_to?(:as_teacher,homework_common.course) %> +
+
+
+ <%=link_to image_tag(url_to_avatar(homework_common.user),width:"90px", height: "90px"), user_activities_path(homework_common.user.id)%> +
+
+
+ <%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%> + TO + <%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%> +
+
+ <%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%> +
+ +
+
+ <%= user_for_homework_common homework_common,is_teacher %> +
+
+ <%= l(:label_end_time)%>:<%= homework_common.end_time%> +
+
+
+ <%= homework_common.description.html_safe %> +
+
+ <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework_common.attachments} %> +
+
+ <% if is_teacher%> +
+
    +
  • +
      +
    • + <%= link_to l(:button_edit),edit_homework_common_path(homework_common), :class => "postOptionLink"%> +
    • +
    • + <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %> +
    • +
    +
  • +
+
+ <% end%> +
+
-
(缺陷描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
- -
- -
-
-
-
-
-
-
-
用户头像
-
- - -
-
指派给  苏稳
-
时间:2015-08-20
-
-
(缺陷描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
- -
- -
-
-
-
-
\ No newline at end of file +
+<% end%> diff --git a/public/stylesheets/new_public.css b/public/stylesheets/new_public.css index fde65f63d..a5f4dd8f4 100644 --- a/public/stylesheets/new_public.css +++ b/public/stylesheets/new_public.css @@ -10,6 +10,9 @@ a:hover,a:active{color:#000;} /*常用*/ /*#RSide{ background:#fff;}*/ +/*上传图片处理*/ +.upload_img img{max-width: 100%;} +blockquote img{max-width: 100%;} .hidden{overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .none{display: none;} .rside_back{ width:670px; margin-left:10px; background:#fff; margin-bottom:10px;} @@ -475,7 +478,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no- .homepageFollowCancel {background:url(../images/homepage_icon.png) -178px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;} .homepageEditProfile {width:20px; height:20px; border-radius:2px; background-color:#888888; position:absolute; right:9px; bottom:9px; font-size:12px; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5;} .homepageEditProfileIcon {background:url(../images/homepage_icon.png) -11px -35px no-repeat; width:20px; height:20px; display:block;} -.homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:20px; float:left;} +.homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:21px; float:left;} .homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;} .homepageImageSexWomen {width: 20px;height: 20px;background: url(../images/homepage_icon.png) -10px -149px no-repeat;float: left;} .homepageSignatureTextarea {width:207px; height:80px; max-width:207px; max-height:80px; border:1px solid #d9d9d9; outline:none; margin:0px 0px 12px 15px;;} @@ -820,6 +823,7 @@ a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;} .SearchIcon:hover{background:url(../images/homepage_icon.png) 676px -419px no-repeat; } a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} +a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;} a.FilesName{ max-width:540px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;} a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;} .ProResultUl span { display:block; float:left;}