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

166 lines
5.5 KiB
Plaintext
Raw Normal View History

2013-11-25 21:42:59 +08:00
<!-- <%= board_breadcrumb(@message) %>
2013-08-01 10:33:49 +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'
2013-10-14 08:56:08 +08:00
) if @message.destroyable_by?(User.current) %>
2013-11-25 21:42:59 +08:00
</div> -->
2013-08-01 10:33:49 +08:00
2013-11-25 21:42:59 +08:00
<!-- <div class="borad-title"><%= avatar(@topic.author, :size => "24") %><%=h @topic.subject %></div>
2013-08-01 10:33:49 +08:00
2013-11-25 15:07:34 +08:00
<div class="borad-topic-count-message">
2013-08-01 10:33:49 +08:00
<%= textilizable(@topic, :content) %>
2013-11-25 15:07:34 +08:00
<%= authoring @topic.created_on, @topic.author %>
2013-08-01 10:33:49 +08:00
<%= link_to_attachments @topic, :author => false %>
</div>
2013-11-25 21:42:59 +08:00
<br /> -->
<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%;
2013-11-26 16:27:56 +08:00
padding-bottom: 1%;
font-weight: bold;
border-bottom: 1px dashed rgb(204, 204, 204);
2013-11-25 21:42:59 +08:00
}
.memo-content{
padding: 1%;
margin: 1%;
margin-bottom: 40px;
background-color: #F6F6F6;
}
.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="lz-left">
<div class=""><%= link_to image_tag(url_to_avatar(@topic.author), :class => "avatar"), user_path(@topic.author) %></div>
2013-11-26 16:27:56 +08:00
<p class=""><%=link_to @topic.author, user_path(@topic.author) %></p>
2013-11-25 21:42:59 +08:00
</div>
<div class="memo-section">
2013-11-26 16:27:56 +08:00
<div class="memo-title"><%= label_tag l(:field_subject) %>: <%=link_to @topic.subject, project_boards_path(@topic.project) %></div>
2013-11-25 21:42:59 +08:00
<div class="memo-content"><%= textilizable(@topic, :content) %></div>
<div class="memo-timestamp"> <%= authoring @topic.created_on, @topic.author %></div>
</div>
<br />
</div>
2013-08-01 10:33:49 +08:00
<% unless @replies.empty? %>
<h3 class="comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3>
2013-11-25 21:42:59 +08:00
<% reply_count = 0 %>
2013-08-01 10:33:49 +08:00
<% @replies.each do |message| %>
<div class="message reply" id="<%= "message-#{message.id}" %>">
2013-11-25 15:07:34 +08:00
<div class="contextual-borad">
2013-08-01 10:33:49 +08:00
<%= 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>
2013-11-25 15:07:34 +08:00
<table class="borad-text-list">
2013-11-25 21:42:59 +08:00
<tr><td class="font_lighter"><%= reply_count += 1 %>楼 </td></tr>
2013-11-25 15:07:34 +08:00
<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 %>
2013-11-25 21:42:59 +08:00
</td></tr>
<tr><td class="font_lighter" style="float: right"><%= authoring message.created_on, message.author %></td></tr>
2013-11-25 15:07:34 +08:00
</table>
2013-11-25 21:42:59 +08:00
</div>
2013-11-25 15:07:34 +08:00
<!-- <h4>
2013-08-01 10:33:49 +08:00
<%= avatar(message.author, :size => "24") %>
<%= link_to h(message.subject), { :controller => 'messages', :action => 'show', :board_id => @board, :id => @topic, :r => message, :anchor => "message-#{message.id}" } %>
-
<%= authoring message.created_on, message.author %>
</h4>
<div class="wiki"><%= textilizable message, :content, :attachments => message.attachments %></div>
2013-11-25 15:07:34 +08:00
<%= link_to_attachments message, :author => false %> -->
2013-11-25 21:42:59 +08:00
2013-08-01 10:33:49 +08:00
<% end %>
2013-08-22 22:30:24 +08:00
<div class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></div>
2013-08-01 10:33:49 +08:00
<% end %>
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
<p><%= 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 %>