From 35b1bc80694dd7b35770024bdb2b99ef698a3258 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 28 Sep 2015 15:52:30 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=86=85=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E5=88=97=E8=A1=A8=E7=95=8C=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 10 +- app/views/courses/show.html.erb | 1 - app/views/homework_common/index.html.erb | 164 ++++-------------- app/views/users/_user_homework_form.html.erb | 12 +- public/javascripts/course.js | 91 ++++++++++ public/stylesheets/courses.css | 95 ++++++++-- 6 files changed, 220 insertions(+), 153 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 00d814bd3..9deb2eb5f 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -11,11 +11,17 @@ class HomeworkCommonController < ApplicationController before_filter :member_of_course, :only => [:index] def index - homeworks = @course.homework_commons.order("created_at desc") + @new_homework = HomeworkCommon.new + @new_homework.homework_detail_manual = HomeworkDetailManual.new + @new_homework.course = @course + @page = params[:page] ? params[:page].to_i + 1 : 0 + @homeworks = @course.homework_commons.order("created_at desc").limit(10).offset(@page * 10) @is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) @is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher)) - @homeworks = paginateHelper homeworks,20 + # @homework_commons = HomeworkCommon.where("course_id in #{user_course_ids}").order("created_at desc").limit(10).offset() + # @homeworks = paginateHelper homeworks,20 respond_to do |format| + format.js format.html end end diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index bc6dcacfa..bb8bb546a 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -1,7 +1,6 @@ diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 8799bcab9..8a89d66bc 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -1,129 +1,41 @@ -
-

- <%= l(:label_homework)%> -

-
-
-

- <%= l(:label_totle)%> - <%= @obj_count%> - <%= l(:label_homework_count)%> -

- <%#= link_to( l(:label_course_homework_new), new_homework_common_path(:course => @course.id), :class => 'problem_new_btn fl c_dorange') if @is_teacher %> + + + +
+
+
作业
+
+ + <% if @is_teacher%> + +
+ <%= labelled_form_for @new_homework,:url => user_new_homework_users_path,:method => "post" do |f| %> +
+ <%= render :partial => 'users/user_homework_form', :locals => { :homework => @new_homework,:f => f,:edit_mode => false,:select_course => false } %> +
+ <% end%> +
+ <% end%> + + <%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homeworks,:page => 0} %>
-<% @homeworks.each do |homework|%> -
- <%= link_to(image_tag(url_to_avatar(homework.user), :width => "42", :height => "42"), user_path(homework.user), :class => "problem_pic fl") %> -
- <%= link_to(homework.user.lastname+homework.user.firstname, user_path(homework.user),:class => 'problem_name fl',:target => "_blank") %> - <%= l(:label_user_create_project_homework) %>: - <%= link_to(homework.name, student_work_index_path(:homework => homework.id), :class => 'problem_tit fl fb c_dblue',:target => "_blank") %> -
-

- <%= l(:lebel_homework_commit)%> - ( <%= link_to homework.student_works.count, student_work_index_path(:homework => homework.id), :class => 'c_red'%> ) -

- <% if @is_teacher%> - <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework,:is_in_course => 1),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %> - <%= link_to(l(:button_edit),edit_homework_common_path(homework,:is_in_course => 1), :class => "fr mr10 work_edit ml10") %> - <%= homework_anonymous_comment(homework)%> - <% elsif @is_student%> - <%= student_anonymous_comment homework %> - <%= student_new_homework homework %> - <% end %> -
- -
-
- <%= homework.description.html_safe %> -
-
-
+
- -
- - <% if homework.homework_type == 2 && homework.homework_detail_programing%> - <% if @is_teacher%> - - - "> - - - - <% homework.homework_tests.each do |test|%> - "> - - - - <% end%> - -
- 输入 - - 输出 -
- <%=test.input%> - - <%= test.output%> -
-
- <% end%> - -
- 开发语言: -
- <%= homework.language_name%> -
-
-
- <% end%> - - <% unless homework.attachments.empty?%> -
- 附件: -
- <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework.attachments} %> -
-
-
- <% end%> - - - - <%= l(:label_end_time)%>:<%= homework.end_time%> - <% if betweentime(homework.end_time) < 0 %> - - <%= l(:label_commit_limit)%> - - <% else %> - -
-
- <% end %> -
-
-
-<% end%> - - -
\ No newline at end of file diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 6e07e7122..f4c4c64d4 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -37,11 +37,13 @@
-
- <%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w709",:value => "请选择发布作业的课程"} %> -
-

-
+ <% unless defined?(select_course)%> +
+ <%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w709",:value => "请选择发布作业的课程"} %> +
+

+
+ <% end%>
diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 07a149adb..13f093538 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -986,3 +986,94 @@ function show_student_work(url){ } ); } + +///////////////////////////////////////////////////////////////////////////////////////// + +var autoTextarea2 = function (elem,elem2, extra, maxHeight) { + extra = extra || 0; + var isFirefox = !!document.getBoxObjectFor || 'mozInnerScreenX' in window, + isOpera = !!window.opera && !!window.opera.toString().indexOf('Opera'), + addEvent = function (element, type, callback) { + element.addEventListener ? + element.addEventListener(type, callback, false) : + element.attachEvent('on' + type, callback); + }, + getFirstStyle = elem.currentStyle ? function (name) { + var val = elem.currentStyle[name]; + + if (name === 'height' && val.search(/px/i) !== 1) { + var rect = elem.getBoundingClientRect(); + return rect.bottom - rect.top - + parseFloat(getFirstStyle('paddingTop')) - + parseFloat(getFirstStyle('paddingBottom')) + 'px'; + }; + + return val; + } : function (name) { + return getComputedStyle(elem, null)[name]; + }, + minHeight = parseFloat(getFirstStyle('height')) + + elem.style.resize = 'none'; + elem2.style.resize = 'none'; + var change = function () { + var scrollTop, height, + padding = 0, + style = elem.style, + style2 = elem2.style; + + + if (elem._length === elem.value.length) return; + elem._length = elem.value.length; + elem2._length = elem._length; + if (!isFirefox && !isOpera) { + padding = parseInt(getFirstStyle('paddingTop')) + parseInt(getFirstStyle('paddingBottom')); + }; + scrollTop = document.body.scrollTop || document.documentElement.scrollTop; + + elem.style.height = minHeight + 'px'; + elem2.style.height = minHeight + 'px'; + if (elem.scrollHeight > minHeight) { + if (maxHeight && elem.scrollHeight > maxHeight) { + height = maxHeight - padding; + style.overflowY = 'auto'; + style2.overflowY = 'auto'; + } else { + height = elem.scrollHeight - padding; + style.overflowY = 'hidden'; + style2.overflowY = 'hidden'; + }; + style.height = height + extra + 'px'; + style2.height = height + extra + 'px'; + scrollTop += parseInt(style.height) - elem.currHeight; + document.body.scrollTop = scrollTop; + document.documentElement.scrollTop = scrollTop; + elem.currHeight = parseInt(style.height); + }; + if (elem2.scrollHeight > minHeight) { + if (maxHeight && elem2.scrollHeight > maxHeight) { + height = maxHeight - padding; + style.overflowY = 'auto'; + style2.overflowY = 'auto'; + } else { + height = elem2.scrollHeight - padding; + style.overflowY = 'hidden'; + style2.overflowY = 'hidden'; + }; + style.height = height + extra + 'px'; + style2.height = height + extra + 'px'; + scrollTop += parseInt(style2.height) - elem2.currHeight; + document.body.scrollTop = scrollTop; + document.documentElement.scrollTop = scrollTop; + elem2.currHeight = parseInt(style2.height); + }; + }; + + addEvent(elem, 'propertychange', change); + addEvent(elem, 'input', change); + addEvent(elem, 'focus', change); + addEvent(elem2, 'propertychange', change); + addEvent(elem2, 'input', change); + addEvent(elem2, 'focus', change); + change(); +}; \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 4fd8d99d2..c559261ef 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -176,7 +176,7 @@ a.homepageWhite:hover {color:#a1ebff} a.newsGrey {color:#4b4b4b;} a.newsGrey:hover {color:#000000;} a.newsRed {color:red;} -a.newsRed:hovor {color:#888888;} +a.newsRed:hover {color:#888888;} a.replyGrey {color:#888888; display:inline-block;} a.replyGrey:hover {color:#4b4b4b;} a.replyGrey1 {color:#888888;} @@ -891,54 +891,109 @@ a:hover.about_me{ color:#0781b4;} /*20150820课程作业 LB*/ -.HomeWork {width:708px; background-color:#ffffff; padding:10px 20px 20px 20px; border:1px solid #dddddd;} +.HomeWork {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd; float:right;} .RightBanner {width:708px; height:34px; border-bottom:1px solid #e9e9e9;} select.InputBox,input.InputBox,textarea.InputBox{ border:1px solid #d9d9d9; color:#888888; height:28px; line-height:28px; padding-left:5px; font-size:14px;} -a.BlueCirBtn{ display:block;width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; text-align:center; border:1px solid #15bccf; color:#15bccf; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} -a:hover.BlueCirBtn{ background:#15bccf; color:#fff;} +a.BlueCirBtn{ display:block;width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; text-align:center; border:1px solid #269ac9; color:#269ac9; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} +a:hover.BlueCirBtn{ background:#269ac9; color:#fff;} .W440{ width:440px;} .W120{ width:110px;} .W700{ width:700px;max-width: 700px;min-width: 700px;} .w708{width: 708px;} -a.AnnexBtn{ background: url(../images/homepage_icon2.png) 0px -343px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;} -a:hover.AnnexBtn{background: url(../images/homepage_icon2.png) -90px -343px no-repeat; color:#15bccf;} +.w712{width:712px;max-width:712px;min-width: 712px;} +.w720{width:721px;} +.w709{width: 709px;} +.w701{width: 701px;} +a.AnnexBtn{ background: url(images/homepage_icon2.png) 0px -343px no-repeat !important; width:70px; height:20px; display:block; padding-left:20px; color:#888888;} +a:hover.AnnexBtn{background: url(images/homepage_icon2.png) -90px -343px no-repeat !important; color:#3598db;} a.FilesBtn{ background: url(../images/homepage_icon2.png) 0px -373px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;} -a:hover.FilesBtn{background: url(../images/homepage_icon2.png) -89px -372px no-repeat; color:#15bccf;} -a.BlueCirBtnMini{ display:block;width:40px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #15bccf; color:#15bccf; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} -a:hover.BlueCirBtnMini{ background:#15bccf; color:#fff;} +a:hover.FilesBtn{background: url(../images/homepage_icon2.png) -89px -372px no-repeat; color:#269ac9;} +a.BlueCirBtnMini{ display:block;width:40px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #269ac9; color:#269ac9; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} +a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;} a.DropBtn{background: url(../images/homepage_icon2.png) -125px -339px no-repeat; width:85px; height:20px; display:block; color:#888888; font-size:14px;} a:hover.DropBtn{background: url(../images/homepage_icon2.png) -125px -370px no-repeat;} .DropLine{border-top:1px solid #d9d9d9; float:left; width:623px; height:10px; margin-top:10px;} +/*20150820课程作业 LB*/ +.HomeWork {width:708px; background-color:#ffffff; padding:20px; border:1px solid #dddddd;} +.RightBanner {font-size:16px; width:733px; color:#4b4b4b; padding:10px 0 0 15px; margin-bottom:10px; background:#fff; border:1px solid #dddddd;height:34px;} +select.InputBox,input.InputBox,textarea.InputBox{ border:1px solid #d9d9d9; color:#888888; height:28px; line-height:28px; padding-left:5px; font-size:14px;} +a.BlueCirBtn{ display:block;width:75px; height:28px; background-color:#fff; line-height:28px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} +a:hover.BlueCirBtn{ background:#3598db; color:#fff;} +.W440{ width:440px;} +.W120{ width:110px;} +.W700{ width:700px;} +/*a.AnnexBtn{ background: url(../images/homepage_icon.png) 0px -343px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}*/ +/*a:hover.AnnexBtn{background: url(../images/homepage_icon.png) -90px -343px no-repeat; color:#3598db;}*/ +a.FilesBtn{ background: url(../images/homepage_icon.png) 0px -373px no-repeat; width:38px; height:20px; display:block; padding-left:20px; color:#888888;} +a:hover.FilesBtn{background: url(../images/homepage_icon.png) -89px -372px no-repeat; color:#3598db;} +a.BlueCirBtnMini{ display:block;width:40px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} +a:hover.BlueCirBtnMini{ background:#3598db; color:#fff;} +a.ProBtn{background: url(../images/homepage_icon.png) -86px -396px no-repeat; width:30px; height:20px; display:block; padding-left:20px; color:#888888;} +a:hover.ProBtn{background: url(../images/homepage_icon.png) -86px -426px no-repeat; color:#3598db;} + +a.DropBtn{background: url(../images/homepage_icon.png) -125px -339px no-repeat; width:85px; height:20px; display:block; color:#888888; font-size:14px;} +a:hover.DropBtn{background: url(../images/homepage_icon.png) -125px -370px no-repeat;} +.DropLine{border-top:1px solid #d9d9d9; float:left; width:623px; height:10px; margin-top:10px;} /*20150820编程作业 LB*/ .W320{ width:320px;} -.icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;} -a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;} -.icon_remove{background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:left;} -a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;} +.icon_add{ background:url(../images/course/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;} +a:hover.icon_add{background:url(../images/course/icons.png) -20px -310px no-repeat;} +.icon_remove{background:url(../images/course/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:left;} +a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-repeat;} /*20150820提交作业 LB*/ .HomeWorkBox{ background:#f6f6f6; padding:10px; margin:10px 0;} .c_grey{ color:#888888;} -.c_dark_grey{color:#a9a9a9 !important;} .HomeWorkP{ width:690px; font-size:14px;} +.HomeWorkP p{background-color: transparent !important;} +.HomeWorkP div{background-color: transparent !important;} .H150{ height:150px;} .ProResult{width:748px; background-color:#fff; border:1px solid #dddddd;border-bottom:none; } .ProResultTop{ height:38px; line-height:38px; border-bottom:1px solid #dddddd; background:#f2f2f2; padding:0 10px;} .ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; } .W50{ width:50px;} .W200{ width:200px;} +.m_w530{max-width: 530px;} .ProResultTable{ color:#888888;} .T_C{ text-align:center;} .SearchIcon{background:url(../images/homepage_icon2.png) 676px -393px no-repeat; } .SearchIcon:hover{background:url(../images/homepage_icon2.png) 676px -419px no-repeat; } -a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } -a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} +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;} .ProResultUl li{ line-height:35px; border-bottom:1px solid #dddddd; } .DateBorder{border:1px solid #d9d9d9; border-left:none; padding:7px 6px 6px 6px;} -.mb50{margin-bottom: 50px;} + +a.UsersEditBtn{ display:block; width:55px; height:20px; border:1px solid #6d6d6d; color:#fff; background:#888888 url(../images/homepage_icon.png) -11px -35px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;} +a:hover.UsersEditBtn{ color:#484848; background:#888888 url(../images/homepage_icon.png) -11px -74px no-repeat;} +a.UsersAttBtn{ display:block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -9px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;} +a:hover.UsersAttBtn{border:1px solid #888888; } +a.UsersApBtn{ display:block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -177px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;} +a:hover.UsersApBtn{border:1px solid #888888; } +/*20150906编程作业设置弹框 LB*/ +.C_lgrey{ color:#a5a5a5;} +.C_Blue{ color:#3598db;} +a.C_Blue{ color:#3598db;} +a:hover.C_Blue{ color:#297fb8;} +.BluePopupBox{ padding:20px; background:#fff; width:707px;} +/*.BluePopupBox:hover{ border:3px solid #297fb8; }*/ +a.CloseBtn{background:url(../images/CloseBtn.png) 0px 0px no-repeat; width:13px; height:13px; display:block; float:right;} +a:hover.CloseBtn{background:url(../images/CloseBtn.png) 0px -24px no-repeat; } +.BluePopuph2{ font-size:16px; font-weight:bold; color:#3598db; } +.ProBoxResult{width:706px; background-color:#fff; border:1px solid #dddddd;border-bottom:none; max-height:300px; overflow:auto; } +.W108{ width:108px;} +.HomeWorkCon{ width:706px;} +/*20150906导入作业弹框 LB*/ +.ImportBox{ width:708px; max-height:300px;overflow:auto;} +.ImportBox li{ margin-bottom:10px;} +.WorkTitle{ max-width:660px; font-size:14px; font-weight:bold; color:#484848;} +.W520{ width:680px;} +.ImportSearchIcon{background:url(../images/homepage_icon.png) 656px -393px no-repeat; } +.ImportSearchIcon:hover{background:url(../images/homepage_icon.png) 656px -419px no-repeat; } +.calendar_input{border-left:none !important;border-bottom: none!important; border-top: none!important; border-right: 1px solid #d9d9d9;} +.calendar_div{border: 1px solid #d9d9d9;} /* 课程主页 */ .rside_nav{ background:#eaebec; padding:10px 10px;} @@ -980,6 +1035,8 @@ a:hover.c_grey{ color:#333;} .link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .last_time{width:auto; text-align:right; margin-right:70px;} .link_file_box{ width:360px;} -a.postOptionLink{float: right;color: #64bdd9;display: block;padding: 1px 5px;border: 1px solid #64bdd9;width: initial;} -a:hover.postOptionLink {color: #fff;background: #64bdd9;} +/*a.postOptionLink{float: right;color: #64bdd9;display: block;padding: 1px 5px;border: 1px solid #64bdd9;width: initial;}*/ +/*a:hover.postOptionLink {color: #fff;background: #64bdd9;}*/ +a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;} +a.postOptionLink:hover {color:#ffffff; background-color:#15bccf;} From 6194be893344bfa1e63e09ee0578d8c447a1e2c3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 28 Sep 2015 17:09:07 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E3=80=82js=E4=BF=AE=E6=94=B9=20=E5=9C=A8?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=86=85=E5=8F=91=E5=B8=83=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=97=B6=E6=97=A0=E8=AF=BE=E7=A8=8Bid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_courses.html.erb | 2 +- app/views/users/_show_user_resource.html.erb | 2 +- app/views/users/_user_homework_form.html.erb | 13 +- app/views/users/user_import_resource.js.erb | 4 +- public/javascripts/course.js | 5 + public/javascripts/new_user.js | 5 + public/stylesheets/new_user.css | 17 +-- public/stylesheets/public.css | 143 ++++++------------- 8 files changed, 62 insertions(+), 129 deletions(-) diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index fe0b5ef84..c226599e2 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -17,7 +17,7 @@ <%= javascript_heads %> <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> - <%= stylesheet_link_tag 'public', 'leftside', 'jquery/jquery-ui-1.9.2','prettify', 'courses','header'%> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','public', 'leftside','prettify', 'courses','header'%> <%= javascript_include_tag "course","header","attachments",'prettify' %> <%= yield :header_tags -%> diff --git a/app/views/users/_show_user_resource.html.erb b/app/views/users/_show_user_resource.html.erb index 24d81a787..929cea75b 100644 --- a/app/views/users/_show_user_resource.html.erb +++ b/app/views/users/_show_user_resource.html.erb @@ -60,7 +60,7 @@
确定 - 取消 + 取消
<% end %> diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index f4c4c64d4..fe320992a 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -36,14 +36,11 @@
- - <% unless defined?(select_course)%> -
- <%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w709",:value => "请选择发布作业的课程"} %> -
-

-
- <% end%> +
+ <%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w709",:value => "请选择发布作业的课程"} %> +
+

+
diff --git a/app/views/users/user_import_resource.js.erb b/app/views/users/user_import_resource.js.erb index 32a2cd697..0e35acd95 100644 --- a/app/views/users/user_import_resource.js.erb +++ b/app/views/users/user_import_resource.js.erb @@ -3,6 +3,6 @@ showModal('ajax-modal', '730px'); $('#ajax-modal').css('height','500px').css("width","730px"); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("
" + -"
"); -$('#ajax-modal').parent().css("top","30%").css("left","").css("position","fixed").css("padding-left","16px").css("padding-bottom","16px").css("padding-right","16px"); +"
"); +$('#ajax-modal').parent().css("top","30%").css("left","").css("position","fixed"); $('#ajax-modal').parent().addClass("popbox").addClass("referenceResourcesPopup"); \ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 13f093538..4a6f10360 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -935,6 +935,11 @@ function clickOK(path) } }); } +//关闭引入资源弹框 +function hideResource(){ + $('#ajax-modal').parent().removeClass("popbox").removeClass("referenceResourcesPopup"); + hideModal(); +} //查询 function SearchByName(url,event) { diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index 22c049ecc..28fa9597f 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -419,6 +419,11 @@ function clickOK(path) } }); } +//关闭引入资源弹框 +function hideResource(){ + $('#ajax-modal').parent().removeClass("popbox").removeClass("referenceResourcesPopup"); + hideModal(); +} ///////////////////////////////////////////////////////////////////////////////////////// var autoTextarea2 = function (elem,elem2, extra, maxHeight) { diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 4027121b4..0c89c3bd8 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -318,16 +318,12 @@ a:hover.search_btn{ background: #0fa9bb;} /*资源库*/ .resources {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;float: right} -/*.resources {width:730px; background-color:#ffffff; padding:10px;float: right}*/ .resourcesBanner {width:730px; height:40px; background-color:#eaeaea; margin-bottom:10px;} .bannerName {background:#64bdd9; color:#ffffff; height:40px; line-height:40px; width:90px; text-align:center; font-weight:normal; vertical-align:middle; font-size: 16px; float:left;} .resourcesSelect {width:30px; height:24px; float:right; position:relative; margin-top:-6px;} .resourcesSelected {width:25px; height:20px; position:relative; background:url(images/resource_icon_list.png) 0px 0px no-repeat;} .resourcesSelected:hover { background:url(images/resource_icon_list.png) 0px -25px no-repeat;} .resourcesIcon {margin-top:15px; display:block; width:25px; height:20px;} -/*.resourcesIcon {margin-top:15px; display:block; position:relative; background:url(images/resource_icon_list.png) 0px 0px no-repeat; width:25px; height:20px;}*/ -/*.resourcesIcon:hover { background:url(images/resource_icon_list.png) 0px -25px no-repeat;}*/ -/*.resourcesType {width:50px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:35px; padding:5px 10px; left:-30px; font-size:12px; color:#888888; display:none;}*/ a.resourcesGrey {font-size:12px; color:#888888;} a.resourcesGrey:hover {font-size:12px; color:#269ac9;} .resourcesBanner ul li:hover ul.resourcesType {display:block;} @@ -339,21 +335,13 @@ a.uploadText {color:#ffffff; font-size:14px;} .resourcesSearchloadBox {border:1px solid #e6e6e6; width:225px; float:left; background-color:#ffffff;} .searchResource {border:none; outline:none; background-color:#ffffff; width:184px; height:32px; padding-left:10px; display:block; float:left;} .searchIcon{width:31px; height:32px; background-color:#ffffff; background:url(images/resource_icon_list.png) -40px -15px no-repeat; display:block; float:left;} -/*.resourcesSearchBanner {height:34px; margin-bottom:10px;}*/ .resourcesSearchBanner {width:710px; height:34px; margin-bottom:10px; margin-top:15px; margin-left:auto; margin-right:auto;} -/*.resourcesListTab {width:730px; height:40px; background-color:#f6f6f6; border-bottom:1px solid #eaeaea; font-size:14px; color:#7a7a7a;}*/ .resourcesListTab {width:710px; height:40px; background-color:#f6f6f6; border-bottom:1px solid #eaeaea; font-size:14px; color:#7a7a7a; margin-left:auto; margin-right:auto;} -/*.resourcesListName {width:175px; height:40px; line-height:40px; text-align:center;}*/ -/*.resourcesListSize {width:110px; height:40px; line-height:40px; text-align:center;}*/ -/*.resourcesListType {width:150px; height:40px; line-height:40px; text-align:center;}*/ -/*.resourcesListUploader {width:130px; height:40px; line-height:40px; text-align:center;}*/ -/*.resourcesListTime {width:165px; height:40px; line-height:40px; text-align:center;}*/ .resourcesListName {width:340px; height:40px; line-height:40px; text-align:left;} .resourcesListSize {width:85px; height:40px; line-height:40px; text-align:center;} .resourcesListType {width:85px; height:40px; line-height:40px; text-align:center;} .resourcesListUploader {width:85px; height:40px; line-height:40px; text-align:center;} .resourcesListTime {width:95px; height:40px; line-height:40px; text-align:center;} -/*.resourcesList {width:730px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px;}*/ a.resourcesBlack {font-size:12px; color:#4c4c4c;white-space: nowrap;text-align: left} a.resourcesBlack:hover {font-size:12px; color:#000000;} .resourcesListCheckbox {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle;} @@ -362,7 +350,6 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;} .resourcesListOption {width:710px; height:40px; line-height:40px; vertical-align:middle; margin-left:auto; margin-right:auto; background-color:#f6f6f6;} .resourcesCheckAll {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle; float:left;} .resourcesSelectSend {float:right;} -/*.resourcesSelectSendButton {width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; margin-top:5px; margin-right:10px; margin-left:15px; text-align:center; border:1px solid #15bccf; border-radius:5px; float:right;}*/ .resourcesSelectSendButton {width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; margin-top:5px; margin-right:10px; margin-left:15px; text-align:center; border:1px solid #269ac9; border-radius:5px; float:right;} a.sendButtonBlue {color:#269ac9;} a.sendButtonBlue:hover {color:#ffffff;} @@ -460,7 +447,7 @@ input.sendSourceText:hover {background-color:#297fb8;} .resourcesSendTo {float:left; height:20px; margin-top:15px;} .resourcesSendType {border:1px solid #e6e6e6; width:60px; height:24px; outline:none; font-size:14px; color:#888888;} .courseReferContainer {float:left; max-height:120px;margin-right:16px;margin-bottom:10px; overflow:auto; overflow-x:hidden;} -.popbox{/* width:300px; *//* height:100px; */position:fixed !important;/* z-index:100; */left:50%;top:50%;margin:-100px 0 0 -150px; /* background:#fff; */ -moz-border-radius:5px; /* -webkit-border-radius:5px; */ /* border-radius:5px; */ /* box-shadow:0px 0px 8px #194a81; */ /* overflow:auto; */} +.popbox{position:fixed !important;left:50%;top:50%;margin:-100px 0 0 -150px; -moz-border-radius:5px;} /*上传资源弹窗*/ .resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;} .uploadText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; width:140px; display:inline-block;} @@ -702,7 +689,7 @@ ul.list_watch{ .w450{width: 450px;} /*引用资源库弹窗*/ -.referenceResourcesPopup {width:710px; height:500px !important; border:3px solid #269ac9 !important; padding-left:20px; padding-right:20px; padding-bottom:35px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-375px; z-index:1000;} +.referenceResourcesPopup {width:710px; height:500px !important; border:3px solid #269ac9 !important; padding-left:16px !important; padding-right:16px !important; padding-bottom:16px !important; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-375px; z-index:1000;} .referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;} .referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;} .searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index b653fb78b..144b8526c 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -391,83 +391,6 @@ a:hover.search_btn{ background: #0fa9bb;} #LSide{ width:240px; } #RSide{ width:670px; margin-left:10px; background:#fff; padding:10px; margin-bottom:10px;} - -/*资源库*/ -.resources {width:728px; background-color:#ffffff; padding:10px 10px 20px 10px; border:1px solid #dddddd;} -.resourcesBanner {width:730px; height:40px; background-color:#eaeaea; margin-bottom:10px;} -.bannerName {background:#64bdd9; color:#ffffff; height:40px; line-height:40px; width:90px; text-align:center; font-weight:normal; vertical-align:middle; font-size: 16px; float:left;} -.resourcesSelect {width:30px; height:34px; float:right; position:relative; margin-top:-6px;} -.resourcesSelected {width:25px; height:20px; position:relative; background:url(../images/resource_icon_list.png) 0px 0px no-repeat;} -.resourcesSelected:hover { background:url(../images/resource_icon_list.png) 0px -25px no-repeat;} -.resourcesIcon {margin-top:15px; display:block; width:25px; height:20px;} -.resourcesType {width:75px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 20px; left:-90px; font-size:12px; color:#888888; display:none; line-height:2;} -a.resourcesTypeAll {background:url(../images/homepage_icon.png) -180px -89px no-repeat; padding-left:23px;} -a.resourcesTypeAtt {background:url(../images/homepage_icon.png) -180px -49px no-repeat; padding-left:23px;} -a.resourcesGrey {font-size:12px; color:#888888;} -a.resourcesGrey:hover {font-size:12px; color:#269ac9;} -.resourcesBanner ul li:hover ul.resourcesType {display:block;} -ul li:hover ul {display:block;} -.resourcesUploadBox {float:right; width:103px; height:34px; background-color:#269ac9; line-height:34px; vertical-align:middle; text-align:center; margin-left:12px;} -.resourcesUploadBox:hover {background-color:#297fb8;} -a.uploadBoxIcon {background:url(../images/resource_icon_list.png) -35px 10px no-repeat; float:left; display:block; width:81px; height:30px; padding-left:22px; font-size:14px; color:#ffffff;} -.resourcesSearchloadBox {border:1px solid #e6e6e6; width:225px; float:left; background-color:#ffffff;} -.searchResource {border:none; outline:none; background-color:#ffffff; width:184px; height:32px; padding-left:10px; display:block; float:left;} -.searchIcon{width:31px; height:32px; background-color:#ffffff; background:url(../images/resource_icon_list.png) -40px -15px no-repeat; display:block; float:left;} -.resourcesSearchBanner {width:710px; height:34px; margin-bottom:10px; margin-top:15px; margin-left:auto; margin-right:auto;} -.resourcesListTab {width:710px; height:40px; background-color:#f6f6f6; border-bottom:1px solid #eaeaea; font-size:14px; color:#7a7a7a; margin-left:auto; margin-right:auto;} -.resourcesListCheckbox {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle;} -.resourcesCheckbox {padding:0px; margin:0px; margin-top:14px; width:12px; height:12px;} -.resourcesListName {width:160px; height:40px; line-height:40px; text-align:left;} -.resourcesListSize {width:105px; height:40px; line-height:40px; text-align:center;} -.resourcesListType {width:150px; height:40px; line-height:40px; text-align:center;} -.resourcesListUploader {width:180px; height:40px; line-height:40px; text-align:center;} -.resourcesListTime {width:95px; height:40px; line-height:40px; text-align:center;} -.resourcesList {width:710px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px; margin-left:auto; margin-right:auto;} -.resourcesListOption {width:710px; height:40px; line-height:40px; vertical-align:middle; margin-left:auto; margin-right:auto; background-color:#f6f6f6;} -.resourcesCheckAll {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle; float:left;} -.resourcesSelectSend {float:right;} -.resourcesSelectSendButton {width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; margin-top:5px; margin-right:10px; margin-left:15px; text-align:center; border:1px solid #269ac9; border-radius:5px; float:right;} -a.sendButtonBlue {color:#269ac9;} -a.sendButtonBlue:hover {color:#ffffff;} -.resourcesSelectSendButton:hover {background-color:#297fb8;} -a.resourcesBlack {font-size:12px; color:#4c4c4c;} -a.resourcesBlack:hover {font-size:12px; color:#000000;} -.dropdown-menu { - position: absolute; - top: 100%; - left: 0; - z-index: 1000; - display: none; - float: left; - min-width: 80px; - padding: 5px 0; - margin: 2px 0 0; - font-size: 12px; - text-align: left; - background-color: #fff; - -webkit-background-clip: padding-box; - background-clip: padding-box; - border: 1px solid #ccc; - border-radius: 4px; - -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); - box-shadow: 0 6px 12px rgba(0, 0, 0, .175); -} -.dropdown-menu > li > a { - display: block; - padding: 3px 20px; - clear: both; - font-weight: normal; - line-height: 1.5; - color:#616060; - white-space: nowrap; -} -.dropdown-menu > li > a:hover{ - color: #ffffff; - text-decoration: none; - background-color: #64bdd9; - outline:none; -} - /*发送资源弹窗*/ /*.resourceShareContainer {width:100%; height:100%; background:#666; filter:alpha(opacity=50); opacity:0.5; -moz-opacity:0.5; position:absolute; left:0; top:0; z-index:-999;}*/ .resourceSharePopup {width:300px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-150px; z-index:1000;} @@ -578,7 +501,7 @@ a.homepageWhite:hover {color:#a1ebff} a.newsGrey {color:#4b4b4b;} a.newsGrey:hover {color:#000000;} a.newsRed {color:red;} -a.newsRed:hovor {color:#888888;} +a.newsRed:hover {color:#888888;} a.replyGrey {color:#888888; display:inline-block;} a.replyGrey:hover {color:#4b4b4b;} a.replyGrey1 {color:#888888;} @@ -683,29 +606,30 @@ a.loginChooseTab {color:#484848; height:30px; display:block;} .loginSignRow {height:60px; min-height:60px;} /*课程选择弹窗*/ -.coursesChoosePopup {width:530px; height:auto; border:3px solid #269ac9; padding-left:20px; padding-bottom:35px; background-color:#ffffff; position:absolute; top:0; left:0; z-index:1000;} +.coursesChoosePopup {width:530px; height:auto; padding-left:20px; padding-bottom:35px; background-color:#ffffff;} .coursesSearchBox {border:1px solid #e6e6e6; width:515px; height:25px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;} .searchCoursesPopup {border:none; outline:none; background-color:#ffffff; width:470px; height:25px; padding-left:10px; display:inline-block; float:left;} .searchIconPopup{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -180px -273px no-repeat; display:inline-block; float:left;} .searchIconPopup:hover {background:url(../images/homepage_icon.png) -180px -314px no-repeat;} /*导入作业弹窗*/ -.homeworkPublish {width:260px; height:15px; line-height:15px;} +.homeworkPublish {width:500px; height:15px; line-height:15px;} .homeworkPublishTime {font-size:12px; color:#b1b1b1; margin-left:22px; margin-bottom:8px;} +.homeworkListForm{height: 160px;width: 550px;overflow: scroll;overflow-x: hidden;} +.w450{width: 450px;} /*引用资源库弹窗*/ -.referenceResourcesPopup {width:710px; height:auto; border:3px solid #269ac9; padding-left:20px; padding-right:20px; padding-bottom:35px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-375px; z-index:1000;} +.popbox{position:fixed !important;left:50%;top:50%;margin:-100px 0 0 -150px; -moz-border-radius:5px;} +.referenceResourcesPopup {width:710px; height:500px !important; border:3px solid #269ac9 !important; padding-left:16px !important; padding-right:16px !important; padding-bottom:16px !important; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-375px; z-index:1000;} .referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;} .referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;} .searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;} -.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -170px -135px no-repeat; display:inline-block; float:left;} -.referenceSearchIcon:hover {background:url(../images/homepage_icon.png) -170px -190px no-repeat;} -.referenceResourceType {font-size:14px; width:355px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;} +.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -180px -270px no-repeat; display:inline-block; float:left;} +.referenceSearchIcon:hover {background:url(../images/homepage_icon.png) -180px -311px no-repeat;} +.referenceResourceType {font-size:14px; width:475px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;} .referenceTypeActive {background-color:#269ac9; color:#ffffff !important;} a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;} - - /*底部*/ #Footer{background-color:#ffffff; margin-bottom:10px; padding-bottom:15px; color:#666666;} .footerAboutContainer {width:auto; border-bottom:1px solid #efefef;} @@ -888,34 +812,45 @@ a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;} /*a.f_grey:hover {color:#000000;}*/ /*资源库*/ -.resources {width:730px; background-color:#ffffff; padding:10px;} +.resources {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;float: right} .resourcesBanner {width:730px; height:40px; background-color:#eaeaea; margin-bottom:10px;} .bannerName {background:#64bdd9; color:#ffffff; height:40px; line-height:40px; width:90px; text-align:center; font-weight:normal; vertical-align:middle; font-size: 16px; float:left;} .resourcesSelect {width:30px; height:24px; float:right; position:relative; margin-top:-6px;} .resourcesSelected {width:25px; height:20px; position:relative; background:url(images/resource_icon_list.png) 0px 0px no-repeat;} .resourcesSelected:hover { background:url(images/resource_icon_list.png) 0px -25px no-repeat;} .resourcesIcon {margin-top:15px; display:block; width:25px; height:20px;} -.resourcesType {width:50px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:35px; padding:5px 10px; left:-30px; font-size:12px; color:#888888; display:none;} a.resourcesGrey {font-size:12px; color:#888888;} -a.resourcesGrey:hover {font-size:12px; color:#15bccf;} +a.resourcesGrey:hover {font-size:12px; color:#269ac9;} .resourcesBanner ul li:hover ul.resourcesType {display:block;} .resourcesSelected:hover ul {display:block;} -.resourcesUploadBox {float:right; width:103px; height:34px; background-color:#64bdd9; line-height:34px; vertical-align:middle; text-align:center; margin-left:12px;} -.uploadIcon {background:url(../images/resource_icon_list.png) -35px 10px no-repeat; float:left; display:block; width:30px; height:30px; margin-left:-3px;} +.resourcesUploadBox {float:right; width:103px; height:34px; background-color:#269ac9; line-height:34px; vertical-align:middle; text-align:center; margin-left:12px;} +.resourcesUploadBox:hover {background-color:#297fb8;} +.uploadIcon {background:url(images/resource_icon_list.png) -35px 10px no-repeat; float:left; display:block; width:30px; height:30px; margin-left:-3px;} a.uploadText {color:#ffffff; font-size:14px;} -.resourcesSearchloadBox {border:1px solid #e6e6e6; width:225px; float:right; background-color:#ffffff;} +.resourcesSearchloadBox {border:1px solid #e6e6e6; width:225px; float:left; background-color:#ffffff;} .searchResource {border:none; outline:none; background-color:#ffffff; width:184px; height:32px; padding-left:10px; display:block; float:left;} -.searchIcon{width:31px; height:32px; background-color:#ffffff; background:url(../images/resource_icon_list.png) -40px -15px no-repeat; display:block; float:left;} -.resourcesSearchBanner {height:34px; margin-bottom:10px;} -.resourcesListTab {width:730px; height:40px; background-color:#f6f6f6; border-bottom:1px solid #eaeaea; font-size:14px; color:#7a7a7a;} -.resourcesListName {width:175px; height:40px; line-height:40px; text-align:center;} -.resourcesListSize {width:110px; height:40px; line-height:40px; text-align:center;} -.resourcesListType {width:150px; height:40px; line-height:40px; text-align:center;} -.resourcesListUploader {width:130px; height:40px; line-height:40px; text-align:center;} -.resourcesListTime {width:165px; height:40px; line-height:40px; text-align:center;} -.resourcesList {width:730px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px;} -a.resourcesBlack {font-size:12px; color:#4c4c4c;} +.searchIcon{width:31px; height:32px; background-color:#ffffff; background:url(images/resource_icon_list.png) -40px -15px no-repeat; display:block; float:left;} +.resourcesSearchBanner {width:710px; height:34px; margin-bottom:10px; margin-top:15px; margin-left:auto; margin-right:auto;} +.resourcesListTab {width:710px; height:40px; background-color:#f6f6f6; border-bottom:1px solid #eaeaea; font-size:14px; color:#7a7a7a; margin-left:auto; margin-right:auto;} +.resourcesListName {width:340px; height:40px; line-height:40px; text-align:left;} +.resourcesListSize {width:85px; height:40px; line-height:40px; text-align:center;} +.resourcesListType {width:85px; height:40px; line-height:40px; text-align:center;} +.resourcesListUploader {width:85px; height:40px; line-height:40px; text-align:center;} +.resourcesListTime {width:95px; height:40px; line-height:40px; text-align:center;} +a.resourcesBlack {font-size:12px; color:#4c4c4c;white-space: nowrap;text-align: left} a.resourcesBlack:hover {font-size:12px; color:#000000;} +.resourcesListCheckbox {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle;} +.resourcesCheckbox {padding:0px; margin:0px; margin-top:14px; width:12px; height:12px;} +.resourcesList {width:710px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px; margin-left:auto; margin-right:auto;} +.resourcesListOption {width:710px; height:40px; line-height:40px; vertical-align:middle; margin-left:auto; margin-right:auto; background-color:#f6f6f6;} +.resourcesCheckAll {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle; float:left;} +.resourcesSelectSend {float:right;} +.resourcesSelectSendButton {width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; margin-top:5px; margin-right:10px; margin-left:15px; text-align:center; border:1px solid #269ac9; border-radius:5px; float:right;} +a.sendButtonBlue {color:#269ac9;} +a.sendButtonBlue:hover {color:#ffffff;} +.resourcesSelectSendButton:hover {background-color:#297fb8;} +.db {display:block !important;} + .dropdown-menu { position: absolute; top: 100%; @@ -951,6 +886,10 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;} background-color: #64bdd9; outline:none; } +a.resourcesTypeAll {background:url(images/homepage_icon.png) -180px -89px no-repeat; padding-left:23px;} +a.resourcesTypeAtt {background:url(images/homepage_icon.png) -180px -49px no-repeat; padding-left:23px;} +a.resourcesTypeUser {background:url(images/homepage_icon.png) -178px -453px no-repeat; padding-left:23px;} +.resourcesType {width:75px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 20px; left:-90px; font-size:12px; color:#888888; display:none; line-height:2;} .AgreementBox{margin: 20px 0; color: #666666; font-size: 14px; line-height: 1.9;} .Agreementh4{ color:#2980b9; font-weight:bold; font-size:14px; margin-top:30px; border: none;} From 9a5dba777382bc39172e09738c9156ea4e2adacf Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 28 Sep 2015 17:27:01 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=86=85=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E3=80=81=E4=BF=AE=E6=94=B9=E3=80=81=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=90=8E=E8=B7=B3=E8=BD=AC=E4=BB=8D=E5=9C=A8?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=86=85=E7=9A=84=E4=BD=9C=E4=B8=9A=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 8 +++++++- app/views/homework_common/index.html.erb | 3 ++- app/views/users/_user_homework_list.html.erb | 4 ++-- app/views/users/user_homeworks.html.erb | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9a6f72e2e..6caa137ee 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -508,7 +508,13 @@ class UsersController < ApplicationController if homework.save homework_detail_manual.save if homework_detail_manual homework_detail_programing.save if homework_detail_programing - redirect_to user_homeworks_user_path(User.current.id) + + if params[:is_in_course] == "1" + redirect_to homework_common_index_path(:course => homework.course_id) + else + redirect_to user_homeworks_user_path(User.current.id) + end + end end else diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 8a89d66bc..4a4c95757 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -30,12 +30,13 @@ <%= labelled_form_for @new_homework,:url => user_new_homework_users_path,:method => "post" do |f| %>
<%= render :partial => 'users/user_homework_form', :locals => { :homework => @new_homework,:f => f,:edit_mode => false,:select_course => false } %> +
<% end%> <% end%> - <%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homeworks,:page => 0} %> + <%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homeworks,:page => 0,:is_in_course => 1} %>
diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb index f7017deab..dbbc619a3 100644 --- a/app/views/users/_user_homework_list.html.erb +++ b/app/views/users/_user_homework_list.html.erb @@ -58,10 +58,10 @@