This commit is contained in:
cxt 2015-09-28 08:46:20 +08:00
commit 9190f0515d
10 changed files with 61 additions and 44 deletions

View File

@ -73,7 +73,7 @@ class Attachment < ActiveRecord::Base
cattr_accessor :thumbnails_storage_path
@@thumbnails_storage_path = File.join(Rails.root, "tmp", "thumbnails")
before_save :files_to_final_location,:act_as_course_activity,:act_as_forge_activity
before_save :files_to_final_location,:act_as_course_activity
after_create :office_conver, :be_user_score,:act_as_forge_activity
after_update :office_conver, :be_user_score
after_destroy :delete_from_disk,:down_user_score

View File

@ -16,7 +16,7 @@ class JournalReply < ActiveRecord::Base
replier = User.find(self.reply_id)
receivers = []
# 被回复的人发送消息
if journal.user_id != self.reply_id && self.reply_id != journal.issue.author_id
if journal.user_id != self.reply_id && self.reply_id != journal.issue.author_id && self.reply_id != journal.issue.assigned_to_id
receivers << replier
end
if journal.user_id != journal.issue.author_id && self.reply_id != journal.issue.author_id

View File

@ -1,26 +1,38 @@
<h3><%=h @attachment.filename %></h3>
<div id="wrapper">
<div id="wrapper2">
<div id="wrapper3">
<div id="main" class="nosidebar">
<div id="content_">
<h3><%=h @attachment.filename %></h3>
<div class="attachments">
<p><%= h("#{@attachment.description} - ") unless @attachment.description.blank? %>
<span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
<p><%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%>
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span>&nbsp&nbsp&nbsp
<span class="size">
<% if @attachment!=nil &&(@attachment.container_type == 'Document' || @attachment.container_type == 'WikiPage') &&
User.current.allowed_to?({:controller => 'code_review', :action => 'update_diff_view'}, @attachment.project) %>
<%= l(:review_assignments)+":" %><%= link = link_to(l(:button_add), {:controller => 'code_review',
:action => 'assign', :action_type => 'attachment',
:id=>@attachment.project,
:change_id => '', :attachment_id => @attachment.id,
}, :class => 'icon icon-add') %>
<% end %>
</span></p>
<div class="attachments">
<p><%= h("#{@attachment.description} - ") unless @attachment.description.blank? %>
<span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
<p><%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%>
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span>&nbsp&nbsp&nbsp
<span class="size">
<% if @attachment!=nil &&(@attachment.container_type == 'Document' || @attachment.container_type == 'WikiPage') &&
User.current.allowed_to?({:controller => 'code_review', :action => 'update_diff_view'}, @attachment.project) %>
<%= l(:review_assignments)+":" %><%= link = link_to(l(:button_add), {:controller => 'code_review',
:action => 'assign', :action_type => 'attachment',
:id=>@attachment.project,
:change_id => '', :attachment_id => @attachment.id,
}, :class => 'icon icon-add') %>
<% end %>
</span></p>
</div>
&nbsp;
<%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %>
<% html_title @attachment.filename %>
<% content_for :header_tags do -%>
<%= stylesheet_link_tag "scm" -%>
<% end -%>
<div style="clear:both;"></div>
</div>
</div>
</div>
</div>
</div>
&nbsp;
<%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %>
<% html_title @attachment.filename %>
<% content_for :header_tags do -%>
<%= stylesheet_link_tag "scm" -%>
<% end -%>

View File

@ -3,7 +3,7 @@
<% if tag_name && tag_name == k%>
<a href="javascript:void(0);" class="files_tag_select"><%= k%>×<%= v%></a>
<% else%>
<span class="files_tag_icon"> <a href="javascript:void(0);" ondblclick="rename_tag($(this),'<%= k %>','',<%= 6 %>);"><%= k%>×<%= v%></a></span>
<span class="files_tag_icon"> <a ondblclick="rename_tag($(this),'<%= k %>','',<%= 6 %>);"><%= k%>×<%= v%></a></span>
<% end%>
<% end%>
<% end%>

View File

@ -1,5 +1,5 @@
<%# course_model %>
<% teacher_num = teacherCount(@course) %>
<% teacher_num = searchTeacherAndAssistant(@course).count %>
<% student_num = studentCount(@course) %>
<% course_file_num = visable_attachemnts_incourse(@course).count%>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>

View File

@ -28,14 +28,14 @@
</div>
<div>
<textarea type="text" id="memo_subject" name="memo[subject]" class="postDetailInput" placeholder="对应帖子标题" ><%= @memo.subject%></textarea>
<textarea type="text" id="memo_subject" name="memo[subject]" maxlength="50" class="postDetailInput" placeholder="对应帖子标题" ><%= @memo.subject%></textarea>
<script>
var ta = document.getElementById('memo_subject')
autoTextarea(ta)
</script>
</div>
<div class="mt15">
<textarea type="text" id="memo_content" name="memo[content]" class="postDetailInput" placeholder="对应帖子内容" ><%= @memo.content.html_safe%></textarea>
<textarea type="text" id="memo_content" name="memo[content]" maxlength="5000" class="postDetailInput" placeholder="对应帖子内容" ><%= @memo.content.html_safe%></textarea>
<script>
var ta1 = document.getElementById('memo_content')
autoTextarea(ta1)

View File

@ -75,7 +75,9 @@
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %></div>
<div class="homepagePostReplyBannerTime"></div>
<div class="homepagePostReplyBannerMore">
<% if @reply_count > 2%>
<a href="javascript:void(0);" class="replyGrey" id="reply_btn_<%= @memo.id%>" onclick="expand_reply('#reply_div_<%= @memo.id %>','#reply_btn_<%= @memo.id%>')" data-count="<%= @reply_count %>" data-init="0" >点击展开更多回复</a>
<% end %>
</div>
</div>
<div class="" id="reply_div_<%= @memo.id %>">

View File

@ -20,8 +20,9 @@ $('#tags_name2').val("");
$("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course,:tag_name => @select_tag_name}) %>");
<%else%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/course_attachment_tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").replaceWith('<%= escape_javascript(render :partial => 'tags/tag_new', :locals => {:obj => @obj, :object_flag => "6"}) %>');
//render :partial => 'tags/course_attachment_tag_name',
//:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag})
<%end%>
$("#tags_name_<%=@obj.id%>").val("");

View File

@ -127,18 +127,7 @@
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %></a></li>
<div style="display: none" class="message_title_red system_message_style">
<% if User.current.members.where("course_id = ?", ma.course_message.course.id).first.roles.first.name == 'Student' %>
<p><%= User.current.lastname + User.current.firstname %>同学你好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:</p>
<p>课程名称:<%= ma.course_message.course.name %>
(<%= ma.course_message.course.term %>)</p>
<p>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></p>
<p>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %>&nbsp;&nbsp;24点</span></p>
<p>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;24点</span></p>
<p>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></p>
<p>
请抓紧时间提交自己的作品,谢谢!
</p>
<% else %>
<% if User.current.allowed_to?(:as_teacher,ma.course_message) %>
<p>
<%= User.current.lastname + User.current.firstname %>老师您好!
<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:
@ -154,6 +143,17 @@
<p>
您可以修改作业内容、评分规则、匿评过程等,谢谢!
</p>
<% else %>
<p><%= User.current.lastname + User.current.firstname %>同学你好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:</p>
<p>课程名称:<%= ma.course_message.course.name %>
(<%= ma.course_message.course.term %>)</p>
<p>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></p>
<p>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %>&nbsp;&nbsp;24点</span></p>
<p>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;24点</span></p>
<p>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></p>
<p>
请抓紧时间提交自己的作品,谢谢!
</p>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>

View File

@ -362,9 +362,11 @@ $(document).ready(function () {
});
function showAndScrollTo(id, focus) {
$('#' + id).show();
if (focus !== null) {
$('#' + focus).focus();
$('#' + focus).focus();
issue_journal_kind_reply.focus();
}
$('html, body').animate({scrollTop: $('#' + id).offset().top}, 400);
}