From cd1be67b8cd1753da61d51d3c7c634977d713338 Mon Sep 17 00:00:00 2001 From: z9hang Date: Sat, 8 Nov 2014 13:43:07 +0800 Subject: [PATCH] =?UTF-8?q?=20=E5=AD=A6=E7=94=9F=E5=8F=AF=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E8=AF=84=E5=88=86=E3=80=81=E8=AF=84=E5=88=86=E5=AE=8C?= =?UTF-8?q?=E6=AF=95=E4=B8=8D=E5=9C=A8=E6=8F=90=E7=A4=BA=E8=AF=84=E5=88=86?= =?UTF-8?q?=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_attach/_show_star.html.erb | 3 +- public/javascripts/seems_rateable/rateable.js | 50 +++++++++---------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/app/views/homework_attach/_show_star.html.erb b/app/views/homework_attach/_show_star.html.erb index b10455f1a..2181fbf90 100644 --- a/app/views/homework_attach/_show_star.html.erb +++ b/app/views/homework_attach/_show_star.html.erb @@ -3,7 +3,8 @@ <%#= render :partial => 'show_score', locals: {:stars => totle_score} %> --> <% elsif is_comprehensive_evaluation == 2 %> <% if has_evaluation %> - + <%= l(:label_work_rating) %>: + <%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %> <% else %> <%= l(:label_work_rating) %>: <%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %> diff --git a/public/javascripts/seems_rateable/rateable.js b/public/javascripts/seems_rateable/rateable.js index f35a43437..b42375c45 100644 --- a/public/javascripts/seems_rateable/rateable.js +++ b/public/javascripts/seems_rateable/rateable.js @@ -1,25 +1,25 @@ -$(document).ready(function(){ - $(".rateable").jRating({ - //default options displayed below -> - - rateMax: 5, //Maximal rate - length : 5, //Number of stars - //decimalLength : 0, //Number of decimals in the rate - //type : 'big', //Big or small - //step : true, //If set to true, filling of the stars is done star by star (step by step). - //isDisabled: false, //Set true to display static rating - //showRateInfo:false, //Rate info panel, set true to display - //rateInfosX : 45, //In pixel - Absolute left position of the information box during mousemove. - //rateInfosY : 5, //In pixel - Absolute top position of the information box during mousemove. - path : '/rateable/ratings', - onSuccess : function(element, rate){ - //something like -> - alert('本次打分成功!'); - //$('Thanks for rating!').insertAfter(element) - }, - onError : function(element, rate) { - $('You have already rated!').insertAfter(element) - } - }); - -}); +$(document).ready(function(){ + $(".rateable").jRating({ + //default options displayed below -> + + rateMax: 5, //Maximal rate + length : 5, //Number of stars + //decimalLength : 0, //Number of decimals in the rate + //type : 'big', //Big or small + //step : true, //If set to true, filling of the stars is done star by star (step by step). + //isDisabled: false, //Set true to display static rating + //showRateInfo:false, //Rate info panel, set true to display + //rateInfosX : 45, //In pixel - Absolute left position of the information box during mousemove. + //rateInfosY : 5, //In pixel - Absolute top position of the information box during mousemove. + path : '/rateable/ratings', + onSuccess : function(element, rate){ + //something like -> + //alert('本次打分成功!'); + //$('Thanks for rating!').insertAfter(element) + }, + onError : function(element, rate) { + $('You have already rated!').insertAfter(element) + } + }); + +});