2014-10-27 14:20:59 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
function submitProjectBoard()
|
|
|
|
{
|
|
|
|
if(regexSubject()&®exContent())
|
|
|
|
{
|
|
|
|
$("#message-form").submit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
2014-06-12 10:03:01 +08:00
|
|
|
<div id="add-message" class="add_frame" style="display:none;">
|
|
|
|
<% if User.current.logged? %>
|
2014-10-27 14:20:59 +08:00
|
|
|
<h3>
|
|
|
|
<%= link_to h(@board.name), project_board_path(@project, @board) %> » <%= l(:label_message_new) %>
|
|
|
|
</h3>
|
2014-07-18 10:54:22 +08:00
|
|
|
<div class="add_frame_header">
|
2014-06-12 10:03:01 +08:00
|
|
|
<%= l(:label_message_new) %>
|
|
|
|
</div>
|
|
|
|
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
|
|
|
<%= render :partial => 'messages/form', :locals => {:f => f} %>
|
2014-10-27 14:20:59 +08:00
|
|
|
<p>
|
2014-11-25 14:17:04 +08:00
|
|
|
<input type="button" onclick="submitProjectBoard();" class = "whiteButton m3p10 h30" value="<%= l(:button_submit)%>">
|
|
|
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'whiteButton m3p10' %></p>
|
2014-06-12 10:03:01 +08:00
|
|
|
<% end %>
|
|
|
|
<div id="preview" class="wiki"></div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!--display the board-->
|
2014-10-27 14:20:59 +08:00
|
|
|
<div class="borad-title">
|
|
|
|
<%= h @board.name %>
|
|
|
|
</div>
|
2014-06-12 10:03:01 +08:00
|
|
|
|
2014-07-18 10:54:22 +08:00
|
|
|
<% if !User.current.logged? %>
|
2014-06-12 10:03:01 +08:00
|
|
|
<div style="font-size: 14px;margin:20px;">
|
|
|
|
<% if @project.project_type == 1 %>
|
|
|
|
<%= l(:label_user_login_course_board) %>
|
|
|
|
<% else %>
|
|
|
|
<%= l(:label_user_login_project_board) %>
|
|
|
|
<% end %>
|
|
|
|
<%= link_to l(:label_user_login_new), signin_path %>
|
|
|
|
<hr/>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<div class="borad-setitle">
|
2014-10-27 14:20:59 +08:00
|
|
|
<span class="borad-topic-count">
|
|
|
|
共有
|
|
|
|
<%= link_to @topic_count,:controller => 'boards',:action => 'index' %>
|
|
|
|
个贴子
|
|
|
|
</span>
|
2014-07-18 10:54:22 +08:00
|
|
|
<% if @project.enabled_modules.where("name = 'boards'").count > 0 %>
|
|
|
|
<span>
|
|
|
|
<%= 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? %>
|
|
|
|
</span>
|
|
|
|
<% end %>
|
2014-06-12 10:03:01 +08:00
|
|
|
</div>
|
2014-08-28 17:30:08 +08:00
|
|
|
<div style="width: 100%;word-break: break-all;word-wrap: break-word;">
|
2014-06-12 10:03:01 +08:00
|
|
|
<% if @topics.any? %>
|
|
|
|
<% @topics.each do |topic| %>
|
|
|
|
<table class="content-text-list">
|
|
|
|
<tr>
|
2014-09-12 16:45:03 +08:00
|
|
|
<td colspan="2" valign="top" width="50">
|
|
|
|
<%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %>
|
|
|
|
</td>
|
2014-06-12 10:03:01 +08:00
|
|
|
<td>
|
|
|
|
<table width="640px" border="0">
|
|
|
|
<tr>
|
2014-08-22 09:18:45 +08:00
|
|
|
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %>
|
2014-09-12 16:45:03 +08:00
|
|
|
<%= topic.locked? ? 'locked' : '' %>">
|
|
|
|
<%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title:topic.subject.to_s %>
|
2014-08-22 09:18:45 +08:00
|
|
|
</td>
|
2014-07-18 10:54:22 +08:00
|
|
|
<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>
|
2014-06-12 10:03:01 +08:00
|
|
|
</tr>
|
2014-07-18 10:54:22 +08:00
|
|
|
<tr>
|
|
|
|
<td align="left" colspan="2">
|
|
|
|
<span class="font_lighter"><%= authoring topic.created_on, topic.author %><br/></span></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
2014-06-12 10:03:01 +08:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<% end %>
|
2014-10-27 14:20:59 +08:00
|
|
|
<div class="pagination">
|
|
|
|
<%= pagination_links_full @topic_pages, @topic_count %>
|
|
|
|
</div>
|
2014-06-12 10:03:01 +08:00
|
|
|
<% else %>
|
|
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<% 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 %>
|