2013-11-25 21:42:59 +08:00
|
|
|
<style type="text/css">
|
2014-01-23 15:13:38 +08:00
|
|
|
/** {
|
|
|
|
-webkit-box-sizing: border-box;
|
|
|
|
-moz-box-sizing: border-box;
|
|
|
|
-box-sizing: border-box;
|
|
|
|
}*/
|
|
|
|
.lz {
|
|
|
|
position: relative;
|
2013-11-25 21:42:59 +08:00
|
|
|
min-height: 200px;
|
|
|
|
margin: 10px 2px;
|
|
|
|
border-radius: 5px;
|
|
|
|
box-shadow: 1px 1px 6px #97EBF4;
|
2014-01-23 15:13:38 +08:00
|
|
|
}
|
|
|
|
.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 {
|
|
|
|
padding: 1%;
|
|
|
|
margin: 1%;
|
|
|
|
margin-bottom: 40px;
|
|
|
|
background-color: #F6F6F6;
|
|
|
|
white-space: normal;
|
|
|
|
/*word-break: break-all; */
|
|
|
|
word-wrap: break-word;
|
|
|
|
}
|
|
|
|
.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;*/
|
|
|
|
}
|
2013-11-25 21:42:59 +08:00
|
|
|
</style>
|
|
|
|
|
|
|
|
<div class="lz">
|
2014-01-23 15:13:38 +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>
|
2013-11-25 21:42:59 +08:00
|
|
|
</div>
|
|
|
|
<div class="memo-section">
|
2014-01-23 15:13:38 +08:00
|
|
|
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>">
|
|
|
|
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project) %>
|
|
|
|
</div>
|
|
|
|
<div class="memo-content">
|
|
|
|
<%= textilizable(@topic, :content) %>
|
|
|
|
<%= link_to_attachments @topic, :author => false %>
|
|
|
|
</div>
|
|
|
|
<div class="memo-timestamp">
|
|
|
|
<%= authoring @topic.created_on, @topic.author %>
|
|
|
|
</div>
|
|
|
|
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
<p style="float: right;">
|
|
|
|
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
|
|
|
|
</p>
|
2013-11-25 21:42:59 +08:00
|
|
|
</div>
|
|
|
|
<br />
|
|
|
|
</div>
|
2013-08-01 10:33:49 +08:00
|
|
|
|
|
|
|
<% unless @replies.empty? %>
|
2014-01-23 15:13:38 +08:00
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
2013-08-01 10:33:49 +08:00
|
|
|
<h3 class="comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3>
|
2014-01-23 15:13:38 +08:00
|
|
|
<% reply_count = 0 %>
|
2013-08-01 10:33:49 +08:00
|
|
|
<% @replies.each do |message| %>
|
2014-01-23 15:13:38 +08:00
|
|
|
<div class="message reply" id="<%= "message-#{message.id}" %>">
|
|
|
|
|
|
|
|
<table class="borad-text-list">
|
|
|
|
<tr>
|
|
|
|
<td class="font_lighter"><%= reply_count += 1 %>楼 </td>
|
|
|
|
<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) %>
|
|
|
|
</div></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td rowspan="3" valign="top" width="60px"><%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %></td>
|
|
|
|
<td class="comments">
|
|
|
|
<div class="wiki">
|
|
|
|
<%= textilizable message, :content, :attachments => message.attachments %>
|
|
|
|
</div> <%= link_to_attachments message, :author => false %> </td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="font_lighter" style="float: left"><%= authoring message.created_on, message.author %></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
2013-08-01 10:33:49 +08:00
|
|
|
<% end %>
|
2014-01-23 15:13:38 +08:00
|
|
|
<div class="pagination">
|
|
|
|
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %>
|
|
|
|
</div>
|
2013-12-17 20:00:57 +08:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
2014-01-23 15:13:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-01 10:33:49 +08:00
|
|
|
<div id="reply" style="display:none;">
|
2014-01-23 15:13:38 +08:00
|
|
|
<%= 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} %>
|
|
|
|
<%= submit_tag l(:button_submit) %>
|
|
|
|
<%= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %>
|
|
|
|
<% end %>
|
|
|
|
<div id="preview" class="wiki"></div>
|
2013-08-01 10:33:49 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% html_title @topic.subject %>
|