This commit is contained in:
zhuhao 2014-11-24 17:06:29 +08:00
commit 76120a460b
14 changed files with 92 additions and 59 deletions

View File

@ -433,8 +433,8 @@ class HomeworkAttachController < ApplicationController
#删除留言
def destroy_jour
@homework = HomeworkAttach.find(params[:jour_id])
@course=@homework.bid.courses.first
@journal_destroyed = JournalsForMessage.find(params[:object_id])
@is_comprehensive_evaluation = @journal_destroyed.is_comprehensive_evaluation
@journal_destroyed.destroy

View File

@ -21,7 +21,13 @@ class ZipdownController < ApplicationController
def assort
if params[:obj_class] == "Bid"
bid = Bid.find params[:obj_id]
zipfile = zip_bid bid
file_count = 0
bid.homeworks.map { |homework| file_count += homework.attachments.count}
if file_count > 0
zipfile = zip_bid bid
else
render file: 'public/no_file_found.html'
end
else
logger.error "[ZipDown#assort] ===> #{params[:obj_class]} unKown !!"
end

View File

@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>开启匿评功能</title>
<style>
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
body{ font-size:12px; font-family:"微软雅黑","宋体"; background:#fff; font-style:normal;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,textarea{ margin:0; padding:0;}
div,img,tr,td,textarea{ border:0;}
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
@ -19,7 +19,7 @@
.ni_con h2{ display:block; height:40px; width:425px; text-align:center; color:#3a3a3a;}
.ni_con p{ color:#808181; }
.ni_con a:hover{ text-decoration:none;}
.ni_btn{ width:190px; margin:15px auto; }
.ni_btn{ width:190px; margin:15px auto; line-height:1.9;}
a.tijiao{ height:28px; display:block; width:80px; color:#fff; background:#15bccf; text-align:center; padding-top:4px; float:left; margin-right:15px;}
a:hover.tijiao{ background:#0f99a9;}
.c_blue{ color:#0195bd;}

View File

@ -83,7 +83,7 @@
<% when 1 %>
<%= link_to '关闭匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true %>
<% when 2 %>
匿评结束
<a href="#" style="background:#8e8e8e;">匿评结束</a>
<% end %>
</span>
<%end%>

View File

@ -1,2 +1,2 @@
alert('关闭成功');
$("#<%= @bid.id %>_anonymous_comment").html('匿评结束');
$("#<%= @bid.id %>_anonymous_comment").html('<a href="#" style="background:#8e8e8e;">匿评结束</a>');

View File

@ -20,8 +20,10 @@
<% members.each do |member| %>
<% next if member.new_record? %>
<tr id="member-<%= member.id %>" class="<%= cycle 'odd', 'even' %> member">
<td class="<%= member.principal.class.name.downcase %>" style="text-align: center"><%= link_to_user member.principal %></td>
<td class="roles" style="text-align: center">
<td class="<%= member.principal.class.name.downcase %>">
<%= link_to_user member.principal %>
</td>
<td class="roles">
<span id="member-<%= member.id %>-roles">
<%= h member.roles.sort.collect(&:to_s).join(', ') %>
</span>
@ -31,9 +33,14 @@
) do |f| %>
<p>
<% roles.each do |role| %>
<label><%= radio_button_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %> <%= h role %></label><br/>
<% end %></p>
<label>
<%= radio_button_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
<%= h role %>
</label>
<br/>
<% end %>
</p>
<%= hidden_field_tag 'membership[role_ids][]', '' %>
<p><%= submit_tag l(:button_change), :class => "small" %>
<%= link_to_function l(:button_cancel),
@ -43,7 +50,9 @@
</td>
<!--modified by huang for: if the user'roles is Manager that he will can't modified himself-->
<% if member.roles.first.to_s == "Manager" %>
<td class="buttons"></td>
<td class="buttons">
</td>
<% else %>
<td class="buttons">
<%= link_to_function l(:button_edit),
@ -61,7 +70,9 @@
</tbody>
</table>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% end %>
</div>
@ -69,9 +80,14 @@
<% if roles.any? %>
<%= form_for(@member, {:as => :membership, :url => course_memberships_path(@course), :remote => true, :method => :post}) do |f| %>
<fieldset>
<legend><%= l(:label_member_new) %></legend>
<legend>
<%= l(:label_member_new) %>
</legend>
<p><%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %></p>
<p>
<%= label_tag "principal_search", l(:label_principal_search) %>
<%= text_field_tag 'principal_search', nil %>
</p>
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_course_memberships_path(@course, :format => 'js') }')" %>
<div id="principals_for_new_member">
@ -83,13 +99,22 @@
<% roles.each do |role| %>
<% if role.id == 10 %> <!-- 默认学生角色 -->
<label><%= radio_button_tag 'membership[role_ids][]', role.id, true %> <%= h role %></label>
<label>
<%= radio_button_tag 'membership[role_ids][]', role.id, true %>
<%= h role %>
</label>
<% else %>
<label><%= radio_button_tag 'membership[role_ids][]', role.id %> <%= h role %></label>
<label>
<%= radio_button_tag 'membership[role_ids][]', role.id %>
<%= h role %>
</label>
<% end %>
<% end %></p>
<% end %>
</p>
<p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p>
<p>
<%= submit_tag l(:button_add), :id => 'member-add-submit' %>
</p>
</fieldset>
<% end %>
<% end %>

View File

@ -35,7 +35,7 @@
</span>
</li>
<li class="c_red" style="margin:25px 0 0 20px;"> 您还没交作业,请创建作业!</li>
<% if @bid.comment_status == 0 || @bid.comment_status == 1%>
<% if @bid.comment_status == 0 || @bid.open_anonymous_evaluation == 0%>
<!-- 老师布置的作业在创建和开启匿评这段时间才允许创建作品 -->
<li class="wping">
<%= link_to "提交作业", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %>

View File

@ -22,7 +22,7 @@
<span style="float:left">
<%= l(:label_work_rating) %>
</span>
<%= render :partial => 'show_score', locals: {:stars => get_homework_score(jour.user,@homework ) } %>
<%= render :partial => 'homework_attach/show_score', locals: {:stars => get_homework_score(jour.user,@homework ) } %>
<% end %>
</span>
<div class="cl"></div>
@ -46,7 +46,7 @@
</div>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => jour,:show_name=> show_name } %>
<%= render :partial => "words/journal_reply", :locals => {:journal => jour,:show_name=> show_name, :show_real_name => true } %>
</div>
</div>
<div class="cl"></div>

View File

@ -1,23 +1,19 @@
//教师评论
<% if @add_jour.is_comprehensive_evaluation == 1 %>
//$('#comprehensive_evaluation').html('<#%= escape_javascript(render(:partial => 'comprehensive_evaluation',
//:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework,:teaher_score => @teaher_score} )) %>');
HoverLi(4);
$('#jour_count_4').html('<%= @comprehensive_evaluation.count %>')
$('#tbc_04').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false})) %>')
$('#jour_count_4').html('<%= @comprehensive_evaluation.count %>');
$('#tbc_04').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false})) %>');
//匿评
<% elsif @add_jour.is_comprehensive_evaluation == 2 %>
// $('#message').html('<#%= escape_javascript(render(:partial => 'showjour', :locals => {:jour =>@jour, :state => false,:homework => @homework} )) %>');
// $('#pre_show').html('<#%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
$('#add_jour').html('<%= escape_javascript(render(:partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation})) %>')
$('#add_jour').html('<%= escape_javascript(render(:partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation})) %>');
HoverLi(5);
$('#jour_count_5').html('<%= @anonymous_comments.count %>')
$('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false})) %>')
$('#jour_count_5').html('<%= @anonymous_comments.count %>');
$('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false})) %>');
//留言
<% else %>
HoverLi(3);
$('#jour_count_3').html('<%= @jours.count %>')
$('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true})) %>')
$('#jour_count_3').html('<%= @jours.count %>');
$('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true})) %>');
<% end %>
$('#new_form_user_message').val("");
$('#new_form_reference_user_id').val("");

View File

@ -1,24 +1,19 @@
<% if @journal_destroyed.nil? %>
alert('<%=l(:notice_failed_delete)%>');
<% else %>
//教师评论
<% if @is_comprehensive_evaluation == 1 %>
//$('#comprehensive_evaluation').html('<#%= escape_javascript(render(:partial => 'comprehensive_evaluation',
//:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework,:teaher_score => @teaher_score} )) %>');
HoverLi(4);
$('#jour_count_4').html('<%= @comprehensive_evaluation.count %>')
$('#tbc_04').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false})) %>')
//匿评
<% elsif @is_comprehensive_evaluation == 2 %>
// $('#message').html('<#%= escape_javascript(render(:partial => 'showjour', :locals => {:jour =>@jour, :state => false,:homework => @homework} )) %>');
// $('#pre_show').html('<#%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
HoverLi(5);
$('#jour_count_5').html('<%= @anonymous_comments.count %>')
$('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false})) %>')
//留言
<% else %>
HoverLi(3);
$('#jour_count_3').html('<%= @jours.count %>')
$('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true})) %>')
<% end %>
<% if @is_comprehensive_evaluation == 1 %>
HoverLi(4);
$('#jour_count_4').html('<%= @comprehensive_evaluation.count %>');
$('#tbc_04').html('<%= escape_javascript(render(:partial => "homework_attach/jour",:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false})) %>');
//匿评
<% elsif @is_comprehensive_evaluation == 2 %>
HoverLi(5);
$('#jour_count_5').html('<%= @anonymous_comments.count %>');
$('#tbc_05').html('<%= escape_javascript(render(:partial => "homework_attach/jour",:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false})) %>');
//留言
<% else %>
HoverLi(3);
$('#jour_count_3').html('<%= @jours.count %>');
$('#tbc_03').html('<%= escape_javascript(render(:partial => "homework_attach/jour",:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true})) %>');
<% end %>
<% end %>

View File

@ -126,7 +126,7 @@
<% when 1 %>
<%= link_to '关闭匿评', alert_anonymous_comment_bid_path(@bid), id: "#{@bid.id}_stop_anonymous_comment", remote: true %>
<% when 2 %>
匿评结束
<a href="#" style="background:#8e8e8e;">匿评结束</a>
<% end %>
</span>
<%end%>

View File

@ -1,7 +1,8 @@
<% id = "journal_reply_ul_" + journal.id.to_s%>
<% show_real_name ||= false%>
<div id = '<%= id %>' >
<% fetch_user_leaveWord_reply(journal).each do |reply|%>
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name} %>
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name, :show_real_name => show_real_name} %>
<% end %>
</div>

View File

@ -1,3 +1,4 @@
<% show_real_name ||= false %>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
<div class="recall" id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
@ -10,10 +11,19 @@
</div>
<div class="recall_con">
<% id = 'project_respond_form_'+ reply.id.to_s %>
<%= link_to reply.user.name, user_path(reply.user) %>
<% if show_real_name%>
<%= link_to reply.user.lastname+reply.user.firstname, user_path(reply.user) %>
<% else %>
<%= link_to reply.user.name, user_path(reply.user) %>
<% end %>
回复
<% if show_name %>
<%= link_to reply.at_user.name,user_path(reply.at_user) %>
<% parent_jour = JournalsForMessage.find reply.m_reply_id %>
<% if show_name && parent_jour %>
<% if show_real_name%>
<%= link_to parent_jour.user.lastname+reply.user.firstname, user_path(parent_jour.user) %>
<% else %>
<%= link_to parent_jour.user.name, user_path(parent_jour.user) %>
<% end %>
<% else %>
<%= l(:label_anonymous) %>
<% end %>

View File

@ -83,7 +83,7 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;}
.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_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_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;padding-top: 5px;}
a.ping_sub1{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;line-height: 1.9;}
a:hover.ping_sub{ background:#14a8b9;}
.recall{ border-top:1px solid #CCC; padding:5px 0;}