Merge branch 'Homework' of http://repository.trustie.net/xianbo/trustie2 into Homework

This commit is contained in:
sw 2014-11-08 13:44:41 +08:00
commit 6157a67e23
2 changed files with 27 additions and 26 deletions

View File

@ -3,7 +3,8 @@
<%#= render :partial => 'show_score', locals: {:stars => totle_score} %> --> <%#= render :partial => 'show_score', locals: {:stars => totle_score} %> -->
<% elsif is_comprehensive_evaluation == 2 %> <% elsif is_comprehensive_evaluation == 2 %>
<% if has_evaluation %> <% if has_evaluation %>
<%= l(:label_work_rating) %>
<%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %>
<% else %> <% else %>
<%= l(:label_work_rating) %> <%= l(:label_work_rating) %>
<%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %> <%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %>

View File

@ -1,25 +1,25 @@
$(document).ready(function(){ $(document).ready(function(){
$(".rateable").jRating({ $(".rateable").jRating({
//default options displayed below -> //default options displayed below ->
rateMax: 5, //Maximal rate rateMax: 5, //Maximal rate
length : 5, //Number of stars length : 5, //Number of stars
//decimalLength : 0, //Number of decimals in the rate //decimalLength : 0, //Number of decimals in the rate
//type : 'big', //Big or small //type : 'big', //Big or small
//step : true, //If set to true, filling of the stars is done star by star (step by step). //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 //isDisabled: false, //Set true to display static rating
//showRateInfo:false, //Rate info panel, set true to display //showRateInfo:false, //Rate info panel, set true to display
//rateInfosX : 45, //In pixel - Absolute left position of the information box during mousemove. //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. //rateInfosY : 5, //In pixel - Absolute top position of the information box during mousemove.
path : '/rateable/ratings', path : '/rateable/ratings',
onSuccess : function(element, rate){ onSuccess : function(element, rate){
//something like -> //something like ->
alert('本次打分成功!'); //alert('本次打分成功!');
//$('<span class="text-success"><small style="display:inline-block;">Thanks for rating!</small></span>').insertAfter(element) //$('<span class="text-success"><small style="display:inline-block;">Thanks for rating!</small></span>').insertAfter(element)
}, },
onError : function(element, rate) { onError : function(element, rate) {
$('<span class="text-error"><small style="display:inline-block;">You have already rated!</small></span>').insertAfter(element) $('<span class="text-error"><small style="display:inline-block;">You have already rated!</small></span>').insertAfter(element)
} }
}); });
}); });