From 38a912672af4bfd23094191c45233daa3f50b65d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 1 Dec 2014 11:15:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E5=86=99=E8=AF=84=E5=88=86=E7=9B=B8?= =?UTF-8?q?=E5=85=B3js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 8 ++--- app/views/homework_attach/_show.html.erb | 31 +++++++++++------- app/views/homework_attach/_show_star.html.erb | 22 ++++--------- app/views/homework_attach/show.js.erb | 2 +- public/images/bid/star.png | Bin 0 -> 1601 bytes public/stylesheets/css.css | 3 +- 6 files changed, 30 insertions(+), 36 deletions(-) create mode 100644 public/images/bid/star.png diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index ff6463036..dacf897da 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -393,17 +393,15 @@ class HomeworkAttachController < ApplicationController unless annymous_users.nil? || annymous_users.count == 0 @anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC") end - @totle_score = score_for_homework @homework - @teaher_score = teacher_score_for_homework @homework + #@totle_score = score_for_homework @homework + #@teaher_score = teacher_score_for_homework @homework is_student = is_cur_course_student @homework.bid.courses.first is_teacher = is_course_teacher User.current,@homework.bid.courses.first @is_anonymous_comments = @homework.bid.comment_status == 1 #是否开启了匿评 if !User.current.member_of_course?(@homework.bid.courses.first) @is_comprehensive_evaluation = 3 #留言 - elsif is_student && @is_anonymous_comments && !@has_evaluation#是学生且开启了匿评且未进行评分 - @is_comprehensive_evaluation = 2 #匿评 - elsif is_student && @is_anonymous_comments && @has_evaluation #是学生且开启了匿评,但已评分 + elsif is_student && @is_anonymous_comments#是学生且开启了匿评 @is_comprehensive_evaluation = 2 #匿评 elsif is_student && !@is_anonymous_comments #是学生未开启匿评 @is_comprehensive_evaluation = 3 #留言 diff --git a/app/views/homework_attach/_show.html.erb b/app/views/homework_attach/_show.html.erb index bf797e441..416ca4f66 100644 --- a/app/views/homework_attach/_show.html.erb +++ b/app/views/homework_attach/_show.html.erb @@ -36,17 +36,18 @@ this.relatedElement.className = ''; this.relatedElement.firstChild.nodeValue = currentLength; } - function test(){alert('test');} - //中的onmouseover 改成 onclick; - //]]> + function g(o){return document.getElementById(o);} + function HoverLi(n){ + for(var i=3;i<=5;i++){g('ping_tb_'+i).className='ping_normaltab';g('tbc_0'+i).className='ping_undis';}g('tbc_0'+n).className='ping_dis';g('ping_tb_'+n).className='ping_hovertab'; + } + + function ChoseStars(num) + { + for (var i = num + 1; i <= 5; i++) {$("#star0" + i).css("background-position","-2px 0");} + for (var i = num; i >= 0; i--) {$("#star0" + i).css("background-position","-24px 0px");} + $("#stars_value").val(num); + } -<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%>

<%= @homework.name %>

@@ -113,8 +114,14 @@

- <%= render :partial => 'show_star',:locals => {:is_comprehensive_evaluation => @is_comprehensive_evaluation,:totle_score => @totle_score,:has_evaluation => @has_evaluation , - :homework => @homework} %> + <% if @is_comprehensive_evaluation == 3 || User.current == homework.user%> + + <% else @is_comprehensive_evaluation == 2 %> + + <%= l(:label_work_rating) %>: + <%= render :partial => 'show_star',:locals => {start_score:@m_score} %> + <% end %> +
diff --git a/app/views/homework_attach/_show_star.html.erb b/app/views/homework_attach/_show_star.html.erb index 0f842a1cd..d98e35a0e 100644 --- a/app/views/homework_attach/_show_star.html.erb +++ b/app/views/homework_attach/_show_star.html.erb @@ -1,16 +1,6 @@ -<% if is_comprehensive_evaluation == 3 || User.current == homework.user%> - -<% elsif is_comprehensive_evaluation == 2 %> - <% if has_evaluation %> - <%= l(:label_work_rating) %>: - <%= rating_for homework, dimension: :quality,start_score: @m_score, class: 'rateable div_inline' %> - <% else %> - <%= l(:label_work_rating) %>: - <%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %> - <% end %> - -<% elsif @is_comprehensive_evaluation == 1%> - <%= l(:label_work_rating) %>: - <%= rating_for homework, dimension: :quality,start_score: @m_score, class: 'rateable div_inline' %> -<% end %> \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/app/views/homework_attach/show.js.erb b/app/views/homework_attach/show.js.erb index d63b5fb8f..ac0a3e505 100644 --- a/app/views/homework_attach/show.js.erb +++ b/app/views/homework_attach/show.js.erb @@ -1,4 +1,4 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show',:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework, :teaher_score => @teaher_score}) %>'); +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show',:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework}) %>'); showModal('ajax-modal', '513px'); $('#ajax-modal').css('height','569px'); $('#ajax-modal').siblings().remove(); diff --git a/public/images/bid/star.png b/public/images/bid/star.png new file mode 100644 index 0000000000000000000000000000000000000000..507e19020d7030cd0ccd5e07f0f74cebce399475 GIT binary patch literal 1601 zcmV-H2EO@;P)(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ>$4Nv%RCwC#m_ck4R~pBEGd8xd9UGirBH9pD1%iVjN+}XZyP!s^4J)mXno|!8 z((Z-54}DN<9>D*aOvSwNkPYyAmsbHqvU*T7oJSE{;tgq)zN63{D)^j>j|e z=Jnvlj^o%&7WcIMq)+mE{=fgc`Oo*h_q|c1l>BV1rtWrtuIoRYl9j*yWZb1vX;<9J zZZbyGG#Lm4c>er3Cr+GDx;pcW(wN9$*;Ve@+1WaGEEZF`nlVBM>G62*`Fw;zA` z=P?YU?(_5W-K#O>a#?yj9#mDuwryN47vXT2#l^+ff3s^hB*nYU!W8e;;;(5dD=RXe z&$BgS^7%X~D=YGKYK*jPn@XjEWm)v}^dP0gw(U9~m&>td&mImQJc!HX0&rFvq>$Jp zDEtMoe{7F?;|tjLA*ex6T#mS+3vu z@}wRMg+dGu4-*cDm6oOS=+ProRi&@5k4Pj!Fc|D83V`45r?6Dnr}D<6oJz_V7~%Fz|kMC zf7Q9axpnK-|6H&yU%sroviM3V<()fsID7Uie!rg`YE#`d3v@gl=iW#bS{}BGJ@?UA=l0kH^!(?QVAikH@2w%Vnu33a>gg$oF+cU?pNn6$*`q`hMtikb*pyzEUJcjgVko|izUQr$QG1Y1n zfRT|AW@cu1`t&JX2RM@+B zZ&Ok3?d_#pE)x!ioe5LTH?jd>@ovpK;e7`jQEzN)uqn*Vn>SnjUs_t?{{8z+_|2n^ zBVj6)3U0R>%d#*{lT<22B9WlKzn|shWkyCuIDY&%UayxxAV8r|a4t;g+h$<^_5|V0 zi?H-hFiWj?hr+C`u3{L*_T|OVqeq#Wn``-R>lx6IFoi+^%d$u&lg!S}a_Q0~&Ye4_ zZ0$C0-@Z*O7GwYZ{gg^2=S%7POzljxX}`~dH_}Mw>Z;^Vz0LT(_naNQ*48l1hU(X^ zU&rtFD_b%|Ub}X!2|q9}(7q4Z?m`GTIXNkl$)vPxTeia`lSw%_IVr2vYFkW;3scI^ zk#g}~=P`@-YB*s!<`zQ8iHQlBPNzGLNvG3tVq!uHA$G)d{7_}vwsg{$2qC1)<=WlH zC8q^-7ln6g0ahIB8l7;;&)A?E00000NkvXXu0mjf)oc^Q literal 0 HcmV?d00001 diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index 17316c095..b6d61c865 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -80,8 +80,7 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;} .ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;} .ping_con p span a{ color:#777777;} .ping_star{ width:160px; color:#333; font-weight:bold; margin-bottom:5px;} -.ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png) -2px 0 no-repeat; margin-right:3px;} -.ping_star span a:hover{background:url(images/star.png) -24px 0 no-repeat;} +.ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png);background-repeat: no-repeat; margin-right:3px;} .ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;} a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;} a.ping_sub1{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;}