socialforge/app/views/messages/show.html.erb

153 lines
4.9 KiB
Plaintext

<style type="text/css">
/** {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-box-sizing: border-box;
}*/
.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{
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;
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">
<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>
<div class="memo-section">
<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>
</div>
<br />
</div>
<% unless @replies.empty? %>
<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}" %>">
<div class="contextual-borad">
<%= link_to(
image_tag('comment.png'),
{: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>
<table class="borad-text-list">
<tr><td class="font_lighter"><%= reply_count += 1 %>楼 </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: right"><%= authoring message.created_on, message.author %></td></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') %>
<p style="float: right;"><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></p>
<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} %>
<%= submit_tag l(:button_submit) %>
<%= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %>
<% end %>
<div id="preview" class="wiki"></div>
</div>
<% end %>
<% html_title @topic.subject %>