项目讨论区界面更改

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2015-05-04 17:44:03 +08:00
parent 41939bf7d2
commit a5760afa68
1 changed files with 56 additions and 5 deletions

View File

@ -36,14 +36,65 @@
<% if topic.sticky? %>
<a href="javascript:void(0)" class="talk_up fr c_red"><%= l(:label_board_sticky)%></a>
<% end %>
<br/>
<%= l(:label_post_by)%><%= link_to topic.author, user_path(topic.author), :class =>"problem_name" %>
&nbsp;<%= l(:label_post_by_time)%><%= format_time topic.created_on %>
<br/>
<%= link_to topic.author, user_path(topic.author), :class =>"problem_name" %>
&nbsp;&nbsp;&nbsp;&nbsp;<%= format_time topic.created_on %>
<br/>
<p class="problem_tit fl fb" style="word-break:break-all;" >
<%= topic.content %></p>
</div>
<%= link_to (l(:label_short_reply) + " "+topic.replies_count.to_s), board_message_path(@board, topic), :class => "talk_btn fr c_white" %>
<div class="cl"></div>
</div><!--讨论主类容 end-->
<% end %>
<% replies = topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC").
limit(2).
all %>
<% unless replies.empty? %>
<% reply_count = 0 %>
<% replies.each do |message| %>
<div class="ping_C mb10" style="padding-left: 50px;" id="<%= "message-#{message.id}" %>">
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(message.author), :width => '46',:height => '46'), user_path(message.author) %></div>
<div class="ping_discon">
<div class="ping_distop upload_img break_word">
<%= link_to_user_header message.author,false,:class => 'c_blue fb fl mb10 ' %>
<span class="c_grey fr"><%= format_time(message.created_on) %></span>
<div class="cl"></div>
<p class="break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
</div>
<div class="ping_disfoot">
<%= link_to(
l(:button_quote),
{:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id},
:remote => true,
:method => 'get',
:title => l(:button_quote)) if !topic.locked? && authorize_for('messages', 'reply') %>
<%= link_to(
#image_tag('edit.png'),
l(:button_edit),
{:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id},
:title => l(:button_edit)
) if message.course_editable_by?(User.current) %>
<%= link_to(
#image_tag('delete.png'),
l(:button_delete),
{:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if message.course_destroyable_by?(User.current) %>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div><!---留言内容-->
<% end %>
<% end %>
<% end %>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>