95 lines
4.0 KiB
Plaintext
95 lines
4.0 KiB
Plaintext
<script type="text/javascript">
|
|
function submitProjectBoard()
|
|
{
|
|
if(regexSubject()&®exContent())
|
|
{
|
|
$("#message-form").submit();
|
|
}
|
|
}
|
|
</script>
|
|
<div id="add-message" class="add_frame" style="display:<%= !@flag.nil?&&@flag=='true' ? '' : 'none' %>;">
|
|
<% if User.current.logged? %>
|
|
<div class="project_r_h">
|
|
<h2 class="project_h2"><%= l(:label_message_new) %></h2>
|
|
</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} %>
|
|
<p>
|
|
<a herf="#" onclick="submitProjectBoard();" class="ButtonColor m3p10"><%= l(:button_submit)%></a>
|
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'ButtonColor m3p10' %>
|
|
</p>
|
|
<% end %>
|
|
<div id="preview" class="wiki"></div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<!--display the board-->
|
|
<% if !User.current.logged? %>
|
|
<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="project_right">
|
|
<div class="project_r_h">
|
|
<h2 class="project_h2"><%= h @board.name %></h2>
|
|
</div>
|
|
<div class="talk_top">
|
|
<div class="fl">项目讨论区共有<span><%= @topic_count %></span>个帖子 </div>
|
|
<% if @project.enabled_modules.where("name = 'boards'").count > 0 && User.current.member_of?(@project) %>
|
|
<span id = 'tttttttt'><%= link_to l(:label_message_new), new_board_message_path(@board),
|
|
:class => 'problem_new_btn fl',
|
|
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %></span>
|
|
<% end %>
|
|
<div class="cl"></div>
|
|
</div>
|
|
<!-- 帖子内容显示 -->
|
|
<% if @topics.any? %>
|
|
<% @topics.each do |topic| %>
|
|
<div class="problem_main">
|
|
<a>
|
|
<%= link_to image_tag(url_to_avatar(topic.author), :class => "problem_pic talk_pic fl"), user_path(topic.author) %>
|
|
</a>
|
|
<div class="talk_txt fl">
|
|
<div>
|
|
<span><%= link_to h(topic.subject), board_message_path(@board, topic), title:topic.subject.to_s, :class =>"problem_tit fl" %></span>
|
|
<% if topic.sticky? %>
|
|
<span class="talk_up">置顶</span>
|
|
<% end %>
|
|
</div>
|
|
<div class="problem_line">
|
|
<span>由<%= link_to topic.author, user_path(topic.author), :class =>"problem_name" %></span>
|
|
<span>添加于<%= format_time topic.created_on %></span>
|
|
</div>
|
|
</div>
|
|
<span class="talk_btn fr">回复<%= link_to (topic.replies_count), board_message_path(@board, topic), :style =>"color:#fff;" %></span>
|
|
<div class="cl"></div>
|
|
</div><!--讨论主类容 end-->
|
|
<% end %>
|
|
<ul class="wlist">
|
|
<%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => false, :flag => true %>
|
|
</ul>
|
|
<% else %>
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
|
<% end %>
|
|
<!--讨论主类容 end-->
|
|
<div class="cl"></div>
|
|
</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 %>
|