2014-10-27 14:20:59 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
function submitCoursesBoard()
|
|
|
|
{
|
2014-12-18 15:58:33 +08:00
|
|
|
if(regexSubject()&®exContent()){$("#message-form").submit();}
|
2014-10-27 14:20:59 +08:00
|
|
|
}
|
|
|
|
</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), course_board_path(@course, @board) %> »
|
|
|
|
<%= l(:label_message_new) %>
|
|
|
|
</h3>
|
2014-06-12 10:03:01 +08:00
|
|
|
<div class="add_frame_header" >
|
|
|
|
<%= l(:label_message_new) %>
|
|
|
|
</div>
|
2014-11-06 19:34:31 +08:00
|
|
|
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %>
|
2015-03-26 15:55:07 +08:00
|
|
|
<%= render :partial => 'messages/form_course', :locals => {:f => f} %>
|
2014-10-27 14:20:59 +08:00
|
|
|
<p>
|
2014-11-28 09:27:43 +08:00
|
|
|
<!--<input type="button" onclick="submitCoursesBoard();" class = "ButtonColor m3p10 h30" value="<%#= l(:button_submit)%>">-->
|
2014-11-27 16:33:17 +08:00
|
|
|
<a href="#" onclick="submitCoursesBoard();"class="ButtonColor m3p10"><%= l(:button_submit)%></a>
|
2014-11-21 15:49:21 +08:00
|
|
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'ButtonColor m3p10' %>
|
2014-10-27 14:20:59 +08:00
|
|
|
</p>
|
2014-06-12 10:03:01 +08:00
|
|
|
<% end %>
|
|
|
|
<div id="preview" class="wiki"></div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!--display the board-->
|
2015-03-24 17:12:51 +08:00
|
|
|
<div class="project_r_h">
|
|
|
|
<h2 class="project_h2"><%= l(:label_board_plural) %></h2>
|
2014-10-27 14:20:59 +08:00
|
|
|
</div>
|
2014-06-12 10:03:01 +08:00
|
|
|
|
2015-03-24 17:12:51 +08:00
|
|
|
|
2014-06-12 10:03:01 +08:00
|
|
|
<% if !User.current.logged?%>
|
|
|
|
<div style="font-size: 14px;margin:20px;">
|
|
|
|
<%= l(:label_user_login_course_board) %>
|
|
|
|
<%= link_to l(:label_user_login_new), signin_path %>
|
|
|
|
<hr/>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2015-03-24 17:12:51 +08:00
|
|
|
<div class="talk_top ml15">
|
|
|
|
<p class="fl"><%= l(:label_totle) %><span><%= @topic_count %></span><%= l(:label_course_momes_count) %></p>
|
|
|
|
<%= link_to l(:label_message_new),
|
|
|
|
new_board_message_path(@board),
|
|
|
|
:class => 'problem_new_btn fl c_dorange' if User.current.logged? %>
|
|
|
|
<div class="cl"></div>
|
2014-06-12 10:03:01 +08:00
|
|
|
</div>
|
|
|
|
<% if @topics.any? %>
|
|
|
|
<% @topics.each do |topic| %>
|
2015-03-24 17:12:51 +08:00
|
|
|
<div class="problem_main">
|
|
|
|
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"32",:height=>"32"), user_path(topic.author),:class => 'problem_pic talk_pic fl' %>
|
|
|
|
<div class="talk_txt fl">
|
|
|
|
<%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s,:class => "problem_tit fl fb c_dblue" %>
|
2015-03-27 15:39:59 +08:00
|
|
|
<% if topic.sticky? %>
|
|
|
|
<a href="#" class="talk_up fl c_red">置顶</a>
|
|
|
|
<% end %>
|
|
|
|
<br/>
|
2015-03-24 17:12:51 +08:00
|
|
|
<p>由<%= link_to topic.author,user_path(topic.author),:class => "problem_name" %>添加于<%= format_time(topic.created_on) %></p>
|
|
|
|
</div>
|
|
|
|
<%=link_to (l(:label_reply) + topic.replies_count.to_s), board_message_path(@board, topic),:class => "talk_btn fr c_white" %>
|
|
|
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div><!--讨论主类容 end-->
|
2014-06-12 10:03:01 +08:00
|
|
|
<% end %>
|
|
|
|
<% else %>
|
2014-10-27 14:20:59 +08:00
|
|
|
<p class="nodata">
|
|
|
|
<%= l(:label_no_data) %>
|
|
|
|
</p>
|
2014-06-12 10:03:01 +08:00
|
|
|
<% end %>
|
2015-03-24 17:12:51 +08:00
|
|
|
<ul class="wlist">
|
|
|
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
|
|
|
</ul>
|
2015-03-27 16:59:52 +08:00
|
|
|
<%# other_formats_links do |f| %>
|
|
|
|
<%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
|
|
|
|
<%# end %>
|
2014-06-12 10:03:01 +08:00
|
|
|
|
|
|
|
<% html_title @board.name %>
|
|
|
|
|
|
|
|
<% content_for :header_tags do %>
|
|
|
|
<%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@course}: #{@board}") %>
|
|
|
|
<% end %>
|