This commit is contained in:
sw 2015-09-29 10:49:04 +08:00
commit 3c0a497d4e
7 changed files with 36 additions and 20 deletions

View File

@ -173,6 +173,12 @@ class StudentWorkController < ApplicationController
end
if student_work.save
course_activity = CourseActivity.where("course_act_type='HomeworkCommon' and course_act_id =#{@homework.id}").first
course_activity.updated_at = Time.now
course_activity.save
user_activity = UserActivity.where("act_type='HomeworkCommon' and act_id =#{@homework.id}").first
user_activity.updated_at = Time.now
user_activity.save
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_create)

View File

@ -62,7 +62,8 @@
<% end %>
<%= format_time(comment.created_on) %>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img"><%= comment.notes.html_safe %></div>
<div class="homepagePostReplyContent break_word list_style upload_img" id="reply_content_<%= user_activity_id %>">
<%= comment.notes.html_safe %></div>
<% fetch_user_leaveWord_reply(comment).each do |reply| unless fetch_user_leaveWord_reply(comment).nil? %>
<div class="recall">
<div class="homepagePostReplyPortrait">
@ -83,7 +84,8 @@
<% end %>
<%= format_time reply.created_on %>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img"><%= reply.notes.html_safe %></div>
<div class="homepagePostReplyContent break_word list_style upload_img" id="reply_content_<%= user_activity_id %>">
<%= reply.notes.html_safe %></div>
<div class="cl"></div>
</div>
<div class="cl"></div>

View File

@ -87,7 +87,7 @@
<% end %>
<%= format_time(reply.created_on) %>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img">
<div class="homepagePostReplyContent break_word list_style upload_img" id="reply_content_<%= user_activity_id %>">
<%= reply.content.html_safe %>
</div>
</div>

View File

@ -60,7 +60,8 @@
<% end %>
<%= format_time(comment.created_on) %>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img"><%= comment.comments.html_safe %></div>
<div class="homepagePostReplyContent break_word list_style upload_img" id="reply_content_<%= user_activity_id %>">
<%= comment.comments.html_safe %></div>
</div>
<div class="cl"></div>
</li>

View File

@ -97,7 +97,7 @@
<% end %>
<%= format_time(reply.created_on) %>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img">
<div class="homepagePostReplyContent break_word list_style upload_img" id="reply_content_<%= user_activity_id %>">
<% if reply.details.any? %>
<% details_to_strings(reply.details).each do |string| %>
<p><%= string %></p>
@ -133,17 +133,3 @@
</div>
</div>
<script type="text/javascript">
$(function(){
var images=$("div#activity_description_<%= user_activity_id %>").find("img");
if (images.length>0) {
for (var i=0; i<images.length; i++){
var image=$(images[i]);
var element=$("<a></a>").attr("href",image.attr('src'));
image.wrap(element);
}
}
$('#activity_description_<%= user_activity_id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
});
</script>

View File

@ -74,7 +74,8 @@
<% end %>
<%= format_time(reply.created_on) %>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img"><%= reply.content.html_safe %></div>
<div class="homepagePostReplyContent break_word list_style upload_img" id="reply_content_<%= user_activity_id %>">
<%= reply.content.html_safe %></div>
</div>
<div class="cl"></div>
</li>

View File

@ -37,6 +37,26 @@
$(function() {
init_activity_KindEditor_data(<%= user_activity.id%>,null,"87%");
var description_images=$("div#activity_description_<%= user_activity.id %>").find("img");
if (description_images.length>0) {
for (var i=0; i<description_images.length; i++){
var image=$(description_images[i]);
var element=$("<a></a>").attr("href",image.attr('src'));
image.wrap(element);
}
}
$('#activity_description_<%= user_activity.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
var reply_images=$("div#reply_content_<%= user_activity.id %>").find("img");
if (reply_images.length>0) {
for (var i=0; i<reply_images.length; i++){
var image=$(reply_images[i]);
var element=$("<a></a>").attr("href",image.attr('src'));
image.wrap(element);
}
}
$('#reply_content_<%= user_activity.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
});
</script>
<% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %>