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

91 lines
3.7 KiB
Plaintext
Raw Normal View History

2013-08-01 10:33:49 +08:00
<%= board_breadcrumb(@board) %>
2013-11-21 09:38:03 +08:00
<!--new and follow-->
<div class="content-title-top">
2013-08-01 10:33:49 +08:00
<%= link_to l(:label_message_new),
new_board_message_path(@board),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %>
2013-11-21 09:38:03 +08:00
<!-- <%= watcher_link(@board, User.current) %> -->
2013-08-01 10:33:49 +08:00
</div>
<div id="add-message" style="display:none;">
<% if User.current.logged? %>
2013-08-01 10:33:49 +08:00
<h3><%= link_to h(@board.name), project_board_path(@project, @board) %> &#187; <%= l(:label_message_new) %></h3>
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %>
<p><%= submit_tag l(:button_create) %>
<%= preview_link(preview_board_message_path(@board), 'message-form') %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' %></p>
<% end %>
<div id="preview" class="wiki"></div>
<% end %>
</div>
2013-11-21 09:38:03 +08:00
<!--display the board-->
<div class="borad-title"><%=h @board.name %></div>
2013-11-25 15:07:34 +08:00
<!-- <div class="borad-description"><%=h @board.description %></div> -->
2013-11-21 09:38:03 +08:00
<div class="borad-topic-count">共有 <%=link_to @topics.count %> 个贴子</div>
2013-11-25 15:07:34 +08:00
<div style="padding-top: 10px">
2013-08-01 10:33:49 +08:00
<% if @topics.any? %>
2013-11-21 09:38:03 +08:00
<!-- <table class="list messages">
2013-08-01 10:33:49 +08:00
<thead><tr>
<th><%= l(:field_subject) %></th>
<th><%= l(:field_author) %></th>
<%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
<%= sort_header_tag('replies', :caption => l(:label_reply_plural)) %>
<%= sort_header_tag('updated_on', :caption => l(:label_message_last)) %>
</tr></thead>
2013-11-21 09:38:03 +08:00
<tbody> -->
2013-08-01 10:33:49 +08:00
<% @topics.each do |topic| %>
2013-11-21 09:38:03 +08:00
<table class="content-text-list">
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %></td>
<td>
2013-11-25 15:07:34 +08:00
<table width="650px" border="0">
2013-11-21 09:38:03 +08:00
<tr>
<td valign="top" width="500px"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td>
<td align="right" rowspan="3"><table class="borad-count"><tr><td align="center" class="borad-count-digit"><%=link_to (topic.replies_count), board_message_path(@board, topic) %></td></tr>
<tr><td align="center">回答</td></tr>
</table></td>
</tr>
<tr>
<td colspan="2" ><span class="font_description">标签</span></td>
</tr>
2013-11-25 15:07:34 +08:00
<tr>
<td align="left" colspan="2" ><span class="font_lighter"><%= authoring topic.created_on, topic.author %><br /></span></td>
2013-11-21 09:38:03 +08:00
</tr>
</table></td>
</tr>
</table>
<!-- <tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
2013-08-01 10:33:49 +08:00
<td class="subject"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td>
<td class="author"><%= link_to_user(topic.author) %></td>
<td class="created_on"><%= format_time(topic.created_on) %></td>
<td class="reply-count"><%= topic.replies_count %></td>
<td class="last_message">
<% if topic.last_reply %>
<%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
<%= link_to_message topic.last_reply %>
<% end %>
</td>
2013-11-21 09:38:03 +08:00
</tr> -->
2013-08-01 10:33:49 +08:00
<% end %>
2013-11-25 15:07:34 +08:00
</div>
2013-11-21 09:38:03 +08:00
<!-- </tbody>
</table> -->
2013-08-22 22:30:24 +08:00
<div class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></div>
2013-08-01 10:33:49 +08:00
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
<% end %>
<% html_title @board.name %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %>
<% end %>