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

Homework v20141107
sw 11 years ago
commit e550f9d91d

@ -16,7 +16,7 @@
<div class="add_frame_header" > <div class="add_frame_header" >
<%= l(:label_message_new) %> <%= l(:label_message_new) %>
</div> </div>
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %> <%= render :partial => 'messages/form', :locals => {:f => f} %>
<p> <p>
<input type="button" onclick="submitCoursesBoard();" class = "whiteButton m3p10 h30" value="<%= l(:button_submit)%>"> <input type="button" onclick="submitCoursesBoard();" class = "whiteButton m3p10 h30" value="<%= l(:button_submit)%>">

@ -1,6 +1,6 @@
<span class="user" style="font-size: 15px"> <span class="user" style="font-size: 15px">
<div data-kls="HomeworkAttach" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled" <div data-kls="HomeworkAttach" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled"
style="height: 20px; width: 100px; overflow: hidden; z-index: 1; position: relative;"> style="height: 20px; width: 115px; overflow: hidden; z-index: 1; position: relative;">
<% if stars != nil %> <% if stars != nil %>
<div class="jRatingColor" style="width: <%=stars.to_f * 20 %>%;"></div> <div class="jRatingColor" style="width: <%=stars.to_f * 20 %>%;"></div>
<% else %> <% else %>

@ -1,15 +1,15 @@
<% if is_comprehensive_evaluation == 3 || User.current == homework.user%> <% if is_comprehensive_evaluation == 3 || User.current == homework.user%>
<!-- <#%= l(:label_work_rating) %> <!-- <#%= l(:label_work_rating) %>
<%#= 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 %>
<% else %> <% else %>
<%= l(:label_work_rating) %> <%= l(:label_work_rating) %>
<%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %> <%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %>
<% end %> <% end %>
<% elsif @is_comprehensive_evaluation == 1%> <% elsif @is_comprehensive_evaluation == 1%>
<%= l(:label_work_rating) %> <%= l(:label_work_rating) %>
<%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %> <%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %>
<% end %> <% end %>

@ -7,10 +7,11 @@ module SeemsRateable
:dimension => nil, :dimension => nil,
:static => false, :static => false,
:class => 'rateable', :class => 'rateable',
:id => nil :id => nil,
:start_score => nil
}.update(opts) }.update(opts)
content_tag :div, "", "data-average" => obj.average(options[:dimension]) ? obj.average(options[:dimension]).avg : 0, :id => options[:id], content_tag :div, "", "data-average" => options[:start_score].nil? ? (obj.average(options[:dimension]) ? obj.average(options[:dimension]).avg : 0):options[:start_score], :id => options[:id],
:class => "#{options[:class]}#{jdisabled?(options[:static])}", :class => "#{options[:class]}#{jdisabled?(options[:static])}",
"data-id" => obj.id, "data-kls" => obj.class.name, "data-dimension" => options[:dimension] "data-id" => obj.id, "data-kls" => obj.class.name, "data-dimension" => options[:dimension]
end end

Loading…
Cancel
Save