This commit is contained in:
sw 2015-09-28 14:20:10 +08:00
commit 821290da31
17 changed files with 152 additions and 1778 deletions

View File

@ -2,15 +2,15 @@
<% if forums.any? %>
<% forums.each do |forum| %>
<div class="postRow">
<div class="postPortrait"><a href="javascript:void(0);" class="linkGrey2">
<div class="postPortrait">
<%= link_to image_tag(url_to_avatar(forum.creator),:width=>75,:height => 75 ),user_path( forum.creator) %>
</div>
<div class="postWrap">
<div class="postTitle">
<!--<a href="javascript:void(0);" class="f16 linkBlue">新手讨论吧</a>-->
<%= link_to forum.name, forum_path(forum),:class=>"f16 linkBlue" %>
<a href="<%= forum_path(forum) %>" class="f16 linkBlue" style="word-break: break-all;word-wrap : break-word ;white-space:pre-wrap;"><%=forum.name.gsub(/(\r\n)/,'<br/>').html_safe %></a>
<%#= link_to forum.name.gsub(/(\r\n|\s+)/,'<br/>'), forum_path(forum),:class=>"f16 linkBlue" %>
</div>
<div class="postDes" style="word-break: break-all;word-wrap : break-word ;"><%= textAreailizable forum.description%></div>
<div class="postDes" style="word-break: break-all;word-wrap : break-word ;white-space:pre-wrap;"><%= textAreailizable forum.description%></div>
<div class="postCreater">创建者:<a href="<%= user_path( forum.creator)%>" class="linkGrey2" target="_blank"><%= forum.creator.name %></a></div>
<div class="postDate">创建时间:<%= format_date(forum.created_at) %></div>
</div>

View File

@ -21,7 +21,7 @@
function edit_desc(){
if(<%=@forum.creator.id == User.current.id%>) {
desc = $("#forum_desc_span").html();
$("#forum_desc_span").html("<textarea id='forum_desc_input' onblur='change_forum_desc();' class='homepageSignatureTextarea'>" + desc + "</textarea>");
$("#forum_desc_span").html("<textarea id='forum_desc_input' onblur='change_forum_desc();' style='width: 200px;height: 80px; max-width: 207px; max-height: 80px; border: 1px solid #d9d9d9;outline: none;margin: 0px 0px 12px 0px;'>" + desc + "</textarea>");
$("#forum_desc_input").focus();
}
}
@ -149,15 +149,14 @@
<!--<div class="homepageEditProfile"><a href="javascript:void(0);" class="homepageEditProfileIcon"></a></div>-->
</div>
<div class="fl">
<div class="f16 fontBlue mb10" style="word-break: break-all; word-wrap:break-word;"><%= @forum.name%></div>
<div class="f16 fontBlue mb10" style="word-break: break-all; word-wrap:break-word;white-space:pre-wrap;"><%= @forum.name%></div>
<div class="fontGrey2 mb8">吧主:<a href="<%= user_path(@forum.creator)%>" class="linkBlue"><%= @forum.creator.name%></a></div>
<div class="fontGrey3">回答:<a href="javascript:void(0);" class="linkOrange mr5" style="cursor: default"><%= @forum.memo_count %></a> 帖子:<a href="javascript:void(0);" class="linkOrange" style="cursor: default"><%=@forum.topic_count%></a></div>
</div>
<div class="cl"></div>
<div class="fontGrey2 mt10"><span id="forum_desc_span" style="word-break:normal; width:auto; display:block; white-space:pre-wrap;word-wrap : break-word ;overflow: hidden ;"><%= @forum.description%></span>
<div class="fontGrey2 mt10"><span id="forum_desc_span" style="word-break:normal; width:auto; display:block; white-space:pre-wrap;word-wrap : break-word ;overflow: hidden ;"><%= @forum.description.html_safe%></span>
<%if @forum.creator.id == User.current.id%>
<a href="javascript:void(0);" onclick="edit_desc();">
<!--<img src="<%#= Rails.root%>/images/signature_edit.png" width="12" height="12" />-->
<%= image_tag('signature_edit.png',{:width=>12,:height=>12})%>
</a>
<%end%>

View File

@ -14,7 +14,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'public_new', 'leftside_new',prettify,'users', :media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'public_new', 'leftside_new','prettify','users', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "avatars",'prettify'%>

View File

@ -20,7 +20,7 @@
<div class="cl"></div>
<% else %>
<span class="pic_files fl "></span>
<%= link_to_short_attachment attachment, :class => 'fl FilesName02', :download => true, :length => 32 -%>
<%= link_to_short_attachment attachment, :class => 'fl FilesName02', :download => true, :length => 80 -%>
<a href="javascript:void(0);" class="fl FilesName02"> (<%= number_to_human_size attachment.filesize , :precision => 0 %>)</a>
<% if options[:deletable] %>
<%#= link_to image_tag('delete.png'), attachment_path(attachment),

View File

@ -30,6 +30,14 @@
$(function() {
init_activity_KindEditor_data(<%= @memo.id%>,null,"87%");
});
function del_confirm(){
if(confirm('确认删除么?')){
$("#del_link").click();
}else{
}
}
</script>
<div class="postRightContainer">
<div class="postThemeContainer">
@ -43,24 +51,25 @@
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li><a href="<%= edit_forum_memo_path(@memo.forum,@memo)%>" class="postOptionLink">编辑</a></li>
<li><a href="<%= forum_memo_path(@memo.forum,@memo) %>" data-method="delete" class="postOptionLink">删除</a></li>
<li><a href="javascript:void(0);" class="postOptionLink" onclick="del_confirm();">删除</a></li>
<li style="display: none"><a href="<%= forum_memo_path(@memo.forum,@memo) %>" data-method="delete" id="del_link" ></a></li>
</ul>
</li>
</ul>
</div>
<%end%>
<div class="postDetailTitle"><a href="javascript:void(0);" class="f14 linkGrey4 fb">主题: <%= @memo.subject%></a></div>
<div class="postDetailTitle"><a href="javascript:void(0);" class="f14 linkGrey4 fb" style="word-break: break-all; word-wrap:break-word;white-space:pre-wrap;">主题: <%= @memo.subject%></a></div>
<div class="postDetailCreater"><a href="javascript:void(0);" class="linkBlue2" target="_blank"><%= @memo.author.name%></a></div>
<div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div>
<span id="praise_tread" style="float: right">
<%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
</span>
<div class="cl"></div>
<div class="memo-content" >
<div class="memo-content" style="word-break: break-all; word-wrap:break-word;white-space:pre-wrap;margin-bottom: 0px !important;" >
<%= @memo.content.html_safe%>
</div>
<div class="cl"></div>
<div class="mt10 fl">
<div class=" fl">
<% if @memo.attachments.any?%>
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
<%= render :partial => 'attachments_links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>

View File

@ -1,3 +1,4 @@
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
<div class="resources mt10">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
@ -45,18 +46,29 @@
<div class="homepagePostIntro break_word upload_img list_style" id="activity_description_<%= user_activity_id%>">
<%= activity.description.html_safe %>
</div>
<div class="homepagePostSetting" style="visibility: hidden" id="act-<%=user_activity_id %>">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
<% if is_teacher%>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to l(:button_edit),edit_homework_common_path(activity,:is_in_course => 0), :class => "postOptionLink"%>
</li>
<li>
<%= link_to(l(:label_bid_respond_delete), homework_common_path(activity,:is_in_course => 0),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
</li>
<li>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
</li>
<li>
<%= homework_anonymous_comment activity %>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<% end%>
</div>
</div>
<div class="cl"></div>
</div>
</div>

View File

@ -13,11 +13,11 @@
<% course=Course.find(activity.jour_id) %>
<%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word">
<div class="homepagePostTitle break_word list_style upload_img">
<% if activity.m_parent_id.nil? %>
<%= link_to activity.notes.to_s, course_feedback_path(course), :class => "postGrey" %>
<%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
<% else %>
<%= link_to activity.parent.notes.to_s, course_feedback_path(course), :class => "postGrey" %>
<%= link_to activity.parent.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
<% end %>
</div>
<div class="homepagePostDate">
@ -62,7 +62,7 @@
<% end %>
<%= format_time(comment.created_on) %>
</div>
<div class="homepagePostReplyContent break_word list_style"><%= comment.notes.html_safe %></div>
<div class="homepagePostReplyContent break_word list_style upload_img"><%= 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 +83,7 @@
<% end %>
<%= format_time reply.created_on %>
</div>
<div class="homepagePostReplyContent break_word list_style"><%= reply.notes.html_safe %></div>
<div class="homepagePostReplyContent break_word list_style upload_img"><%= 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">
<div class="homepagePostReplyContent break_word list_style upload_img">
<%= reply.content.html_safe %>
</div>
</div>

View File

@ -60,7 +60,7 @@
<% end %>
<%= format_time(comment.created_on) %>
</div>
<div class="homepagePostReplyContent break_word list_style"><%= comment.comments.html_safe %></div>
<div class="homepagePostReplyContent break_word list_style upload_img"><%= 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">
<div class="homepagePostReplyContent break_word list_style upload_img">
<% if reply.details.any? %>
<% details_to_strings(reply.details).each do |string| %>
<p><%= string %></p>

View File

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

View File

@ -51,7 +51,7 @@
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">Trustie平台</span><span class="homepageNewsType fl">发布新消息:</span>
</li>
<span style="color: red;float: left">【系统消息】</span><li class="homepageSystenMessageContent fl" id="content_<%= usm.id %>">
<span style="color: red;float: left">【系统消息】</span>
<li class="homepageSystenMessageContent fl">
<%= link_to usm.subject.blank? ? (usm.content.nil? ? usm.description.html_safe : usm.content.html_safe) : usm.subject, user_system_messages_path(User.current),
@ -191,26 +191,26 @@
请同学们抓紧时间提交自己的作品,谢谢!
</p>
<% else %>
<p><%= User.current.lastname + User.current.firstname %>您好!
<p><%= User.current.lastname + User.current.firstname %>老师您好!
<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>
老师发布的作业截止日期快到了:</p>
<p><strong>课程名称:</strong><%= ma.course_message.course.name %>
<p>课程名称:<%= ma.course_message.course.name %>
(<%= ma.course_message.course.term %>)</p>
<p><strong>作业标题:</strong><%= ma.course_message.name %></p>
<p>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></p>
<p><strong>提交截止:</strong><%= ma.course_message.end_time %>@nbsp;@nbsp;24点</p>
<p>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %>@nbsp;@nbsp;24点</span></p>
<p><strong>匿评开始:</strong><%= ma.course_message.homework_detail_manual.evaluation_start %>
@nbsp;@nbsp;24点</p>
<p>匿评开始:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_start %>
@nbsp;@nbsp;24点</span></p>
<p><strong>匿评关闭:</strong><%= ma.course_message.homework_detail_manual.evaluation_end %>
@nbsp;@nbsp;24点</p>
<p>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>
@nbsp;@nbsp;24点</span></p>
<p><strong>迟交扣分:</strong><%= ma.course_message.late_penalty %>分</p>
<p>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></p>
<p><strong>缺评扣分:</strong><%= ma.course_message.homework_detail_manual.absence_penalty %>分
<p>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span>
</p>
<p>
@ -239,14 +239,15 @@
:onmouseout => "message_titile_hide($(this))" %>
</li>
<div style="display: none" class="message_title_red system_message_style">
<p>您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师开启了匿评,作业详情如下:</p>
<p><strong>课程:</strong><%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p>
<p><strong>作业标题:</strong><%= ma.course_message.name %></p>
<% unless ma.course_message.description.blank? %>
<div class="fl"><strong>作业内容:</strong></div>
<div class="ml60"><%= ma.course_message.description.html_safe %></div>
<% end %>
<p><strong>匿评自动关闭日期:</strong><%= ma.course_message.homework_detail_manual.evaluation_end %>
<p>
<%= User.current.lastname + User.current.firstname %><%= User.current.members.where("course_id=?", ma.course.id).first.roles.first.name == 'Student' ? '同学' : '老师' %>
您好!<%= 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.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;24点</span>
</p>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
@ -265,8 +266,10 @@
:onmouseout => "message_titile_hide($(this))"%>
</li>
<div style="display: none" class="message_title_red system_message_style">
<p>您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师关闭了匿评,作业详情如下:</p>
<p><strong>课程:</strong><%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p>
<p>
<%= User.current.lastname + User.current.firstname %><%= User.current.members.where("course_id=?", ma.course.id).first.roles.first.name == 'Student' ? '同学':'老师'%>您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师关闭了匿评,作业详情如下:
</p>
<p>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p>
<p><strong>作业标题:</strong><%= ma.course_message.name %></p>
<% unless ma.course_message.description.blank? %>
<div class="fl"><strong>作业内容:</strong></div>
@ -515,7 +518,7 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派了问题给你:</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%></span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",

View File

@ -0,0 +1,53 @@
class AlterActivities < ActiveRecord::Migration
def up
UserActivity.all.each do |activity|
if activity.act_type == 'JournalsForMessage'
if activity.act
unless activity.act.m_parent_id.nil?
parent_act = UserActivity.where("act_id = #{activity.act.parent.id} and act_type='JournalsForMessage' and container_type='Course'").first
if parent_act
parent_act.created_at = activity.act.parent.children.maximum("created_on")
parent_act.save
activity.destroy
end
end
else
activity.destroy
end
end
end
CourseActivity.all.each do |activity|
if activity.course_act_type == 'JournalsForMessage'
if activity.course_act
unless activity.course_act.m_parent_id.nil?
parent_act = CourseActivity.where("course_act_id = #{activity.course_act.parent.id} and course_act_type='JournalsForMessage'").first
if parent_act
parent_act.created_at = activity.course_act.parent.children.maximum("created_on")
parent_act.save
activity.destroy
end
end
else
activity.destroy
end
elsif activity.course_act_type == 'Message'
if activity.course_act
unless activity.course_act.parent_id.nil?
parent_act = CourseActivity.where("course_act_id = #{activity.course_act.parent.id} and course_act_type='Message'").first
if parent_act
parent_act.created_at = activity.course_act.parent.children.maximum("created_on")
parent_act.save
activity.destroy
end
end
else
activity.destroy
end
end
end
end
def down
end
end

View File

@ -0,0 +1,16 @@
class UpdateCourseActivitiesUpdatedAt < ActiveRecord::Migration
def up
count = CourseActivity.all.count / 30 + 2
transaction do
for i in 1 ... count do i
CourseActivity.page(i).per(30).each do |activity|
activity.updated_at = activity.created_at
activity.save
end
end
end
end
def down
end
end

File diff suppressed because it is too large Load Diff

View File

@ -98,7 +98,7 @@ a.homepagePostTypeForum {background:url(../images/homepage_icon.png) -10px -310p
a.homepagePostTypeQuiz {background:url(../images/homepage_icon.png) -90px -124px no-repeat; padding-left:23px;}
a.homepagePostTypeQuestion {background:url(../images/homepage_icon.png) -10px -273px no-repeat; padding-left:23px;}
a.homepagePostTypeMine {background:url(../images/homepage_icon.png) -187px -277px no-repeat; padding-left:23px;}
a.homepagePostTypeAll {background:url(../images/homepage_icon.png) -185px -308px no-repeat; padding-left:23px;}
a.homepagePostTypeAll {background:url(../images/homepage_icon.png) -189px -308px no-repeat; padding-left:23px;}
a.postTypeGrey {color:#888888;}
a.postTypeGrey:hover {color:#269ac9;}
.homepagePostBrief {width:710px; margin:0px auto; position:relative;}

View File

@ -553,7 +553,7 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
.homepageNewsPubType {width:230px; font-size:12px; color:#888888; display: block;}
.homepageNewsPubTypeHomework {width:270px; font-size:12px; color:#888888; display: block; white-space:nowrap;}
.homepageNewsContent {width:355px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
.homepageSystenMessageContent {width:291px; max-width:291px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden;text-overflow:ellipsis;max-height: 49px; }
.homepageSystenMessageContent {width:281px; max-width:291px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden;text-overflow:ellipsis;max-height: 49px; }
.homepageHomeworkContentWarn {width:110px; max-width:365px; margin-right:10px; font-size:12px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
.homepageHomeworkContent {width:235px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }