2014-06-19 15:50:42 +08:00
|
|
|
<style type="text/css">
|
|
|
|
.lz {
|
|
|
|
position: relative;
|
|
|
|
min-height: 200px;
|
|
|
|
margin: 10px 2px;
|
|
|
|
border-radius: 5px;
|
|
|
|
box-shadow: 1px 1px 6px #97EBF4;
|
|
|
|
}
|
|
|
|
.lz-left {
|
|
|
|
float: left;
|
|
|
|
margin: 2%;
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
.memo-section {
|
|
|
|
width: auto;
|
|
|
|
margin-left: 15%;
|
|
|
|
padding-top: 1%;
|
|
|
|
border-left: 2px dotted #EEE;/*#8BE9F3;*/
|
|
|
|
}
|
|
|
|
.memo-title {
|
|
|
|
margin: 1em 0;
|
|
|
|
padding-left: 1%;
|
|
|
|
padding-bottom: 1%;
|
|
|
|
font-weight: bold;
|
|
|
|
border-bottom: 1px dashed rgb(204, 204, 204);
|
|
|
|
}
|
|
|
|
.memo-content {
|
2014-08-18 17:44:37 +08:00
|
|
|
width: 82%;
|
2014-06-19 15:50:42 +08:00
|
|
|
padding: 1%;
|
|
|
|
margin: 1%;
|
|
|
|
margin-bottom: 40px;
|
|
|
|
background-color: #F6F6F6;
|
|
|
|
white-space: normal;
|
2014-08-18 17:44:37 +08:00
|
|
|
word-break: break-all;
|
2014-08-28 17:30:08 +08:00
|
|
|
word-wrap: break-word;
|
2014-08-18 17:44:37 +08:00
|
|
|
/*word-wrap: break-word;*/
|
2014-06-19 15:50:42 +08:00
|
|
|
}
|
|
|
|
.memo-timestamp {
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0px;
|
|
|
|
/*right: 0;*/
|
|
|
|
left: 0;
|
|
|
|
margin: 20px;
|
|
|
|
}
|
|
|
|
.replies {
|
|
|
|
float: right;
|
|
|
|
/*max-width: 90%;*/
|
|
|
|
}
|
|
|
|
.reply-box {
|
|
|
|
float: right;
|
|
|
|
width: 640px;
|
|
|
|
padding: 3%;
|
|
|
|
/*border: 2px solid #C6F3F9;*/
|
|
|
|
border-top: 2px double #C6F3F9;
|
|
|
|
/*border-radius: 10px;*/
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<div class="lz">
|
|
|
|
<!-- 在这里添加赞和踩-->
|
2014-10-27 14:20:59 +08:00
|
|
|
<span id="praise_tread" style="float: right">
|
|
|
|
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @topic,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
|
|
|
|
</span>
|
2014-06-19 15:50:42 +08:00
|
|
|
<div class="contextual">
|
|
|
|
<%= watcher_link(@topic, User.current) %>
|
|
|
|
<%= link_to(
|
|
|
|
l(:button_quote),
|
|
|
|
{:action => 'quote', :id => @topic},
|
|
|
|
:remote => true,
|
|
|
|
:method => 'get',
|
|
|
|
:class => 'icon icon-comment',
|
|
|
|
:remote => true) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
<%= link_to(
|
|
|
|
l(:button_edit),
|
|
|
|
{:action => 'edit', :id => @topic},
|
|
|
|
:class => 'icon icon-edit'
|
|
|
|
) if @message.editable_by?(User.current) %>
|
|
|
|
<%= link_to(
|
|
|
|
l(:button_delete),
|
|
|
|
{:action => 'destroy', :id => @topic},
|
|
|
|
:method => :post,
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
:class => 'icon icon-del'
|
|
|
|
) if @message.destroyable_by?(User.current) %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="lz-left">
|
|
|
|
<div class="">
|
|
|
|
<%= link_to image_tag(url_to_avatar(@topic.author), :class => "avatar"), user_path(@topic.author) %>
|
|
|
|
</div>
|
|
|
|
<p class="">
|
|
|
|
<%= link_to @topic.author, user_path(@topic.author) %>
|
|
|
|
</p>
|
|
|
|
</div>
|
2014-08-28 17:30:08 +08:00
|
|
|
<div class="memo-section" style="width: 100%;word-break: break-all;word-wrap: break-word;">
|
2014-10-09 09:07:31 +08:00
|
|
|
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>" style="width: 53%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
|
2014-06-19 15:50:42 +08:00
|
|
|
<% if @project %>
|
2014-10-27 14:20:59 +08:00
|
|
|
<%= label_tag l(:field_subject) %>:
|
|
|
|
<%= link_to @topic.subject, project_boards_path(@topic.project),title: @topic.subject.to_s %>
|
2014-06-19 15:50:42 +08:00
|
|
|
<% elsif @course %>
|
2014-10-27 14:20:59 +08:00
|
|
|
<%= label_tag l(:field_subject) %>:
|
|
|
|
<%= link_to @topic.subject, course_boards_path(@topic.course),title: @topic.subject.to_s %>
|
2014-06-19 15:50:42 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<div class="memo-content">
|
|
|
|
<%= textilizable(@topic, :content) %>
|
|
|
|
<%= link_to_attachments @topic, :author => false %>
|
|
|
|
</div>
|
|
|
|
<div class="memo-timestamp">
|
2014-10-27 14:20:59 +08:00
|
|
|
<div style="float: left">
|
|
|
|
<%= authoring @topic.created_on, @topic.author %>
|
|
|
|
</div>
|
|
|
|
<div style="float: right">
|
2014-11-01 16:57:20 +08:00
|
|
|
<% if User.current.logged? %>
|
|
|
|
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
|
|
|
|
<% else %>
|
|
|
|
<%= link_to l(:button_reply), signin_path %>
|
|
|
|
<% end %>
|
2014-10-27 14:20:59 +08:00
|
|
|
</div>
|
2014-06-19 15:50:42 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<br />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<% unless @replies.empty? %>
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<h3 class="comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3>
|
|
|
|
<% reply_count = 0 %>
|
|
|
|
<% @replies.each do |message| %>
|
|
|
|
<div class="message reply" id="<%= "message-#{message.id}" %>">
|
|
|
|
<table class="borad-text-list">
|
|
|
|
<tr>
|
2014-10-27 14:20:59 +08:00
|
|
|
<td rowspan="3" valign="top" width="60px">
|
|
|
|
<%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %>
|
|
|
|
</td>
|
2014-06-19 15:50:42 +08:00
|
|
|
<td>
|
|
|
|
<div class="contextual-borad">
|
|
|
|
<%= link_to(
|
|
|
|
"引用",
|
|
|
|
{:action => 'quote', :id => message},
|
|
|
|
:remote => true,
|
|
|
|
:method => 'get',
|
|
|
|
:title => l(:button_quote)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
<%= link_to(
|
|
|
|
#image_tag('edit.png'),
|
|
|
|
"编辑",
|
|
|
|
{:action => 'edit', :id => message},
|
|
|
|
:title => l(:button_edit)
|
|
|
|
) if message.editable_by?(User.current) %>
|
|
|
|
<%= link_to(
|
|
|
|
#image_tag('delete.png'),
|
|
|
|
"删除",
|
|
|
|
{:action => 'destroy', :id => message},
|
|
|
|
:method => :post,
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
:title => l(:button_delete)
|
|
|
|
) if message.destroyable_by?(User.current) %>
|
2014-08-20 11:39:41 +08:00
|
|
|
</div>
|
|
|
|
</td>
|
2014-06-19 15:50:42 +08:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="comments">
|
2014-08-28 17:30:08 +08:00
|
|
|
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
|
2014-09-03 16:13:50 +08:00
|
|
|
<%= textilizable message,:content,:attachments => message.attachments %>
|
2014-06-19 15:50:42 +08:00
|
|
|
</div>
|
2014-10-27 14:20:59 +08:00
|
|
|
<%= link_to_attachments message, :author => false %>
|
|
|
|
</td>
|
2014-06-19 15:50:42 +08:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2014-10-27 14:20:59 +08:00
|
|
|
<td class="font_lighter" style="float: left">
|
|
|
|
<%= authoring message.created_on, message.author %>
|
|
|
|
</td>
|
2014-06-19 15:50:42 +08:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<div class="pagination">
|
|
|
|
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
<div id="reply" style="display:none;">
|
|
|
|
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
|
|
|
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
|
2014-10-27 14:29:49 +08:00
|
|
|
<input type="button" class="enterprise" value="<%=l(:button_submit) %>" onclick="submit_message_replay();" >
|
2014-06-19 15:50:42 +08:00
|
|
|
<% end %>
|
|
|
|
<div id="preview" class="wiki"></div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% html_title @topic.subject %>
|
|
|
|
<script type="text/javascript">
|
2014-10-27 14:29:49 +08:00
|
|
|
var flag = false;
|
2014-06-19 15:50:42 +08:00
|
|
|
jQuery(document).ready(function($) {
|
|
|
|
transpotUrl('#content');
|
|
|
|
});
|
2014-10-27 14:29:49 +08:00
|
|
|
function submit_message_replay()
|
|
|
|
{
|
|
|
|
if(flag)
|
|
|
|
{
|
|
|
|
$("#message-form").submit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function regexContent()
|
|
|
|
{
|
|
|
|
var content = $.trim($("#message_content").val());
|
|
|
|
if(content.length ==0)
|
|
|
|
{
|
|
|
|
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
|
|
|
|
$("#message_content_span").css('color','#ff0000');
|
|
|
|
flag = false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$("#message_content_span").text("<%= l(:label_field_correct) %>");
|
|
|
|
$("#message_content_span").css('color','#008000');
|
|
|
|
flag = true;
|
|
|
|
}
|
|
|
|
}
|
2014-06-19 15:50:42 +08:00
|
|
|
</script>
|