2015-05-07 17:38:08 +08:00
|
|
|
|
<div class="project_r_h" xmlns="http://www.w3.org/1999/html">
|
2015-05-07 09:53:34 +08:00
|
|
|
|
<h2 class="project_h2 fl">
|
2015-04-16 11:07:37 +08:00
|
|
|
|
<% if User.current.language == "zh"%>
|
|
|
|
|
<%= h @board.name %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= l(:project_module_boards) %>
|
|
|
|
|
<% end %>
|
2015-05-07 09:53:34 +08:00
|
|
|
|
|
2015-04-16 11:07:37 +08:00
|
|
|
|
</h2>
|
2015-05-07 09:53:34 +08:00
|
|
|
|
<a href="javascript:void(0)" class="green_btn fr newtalk " onclick="show_newtalk();"><%= l(:label_message_new) %></a>
|
|
|
|
|
<div class="cl"></div>
|
2015-04-07 17:45:00 +08:00
|
|
|
|
</div>
|
2014-06-12 10:03:01 +08:00
|
|
|
|
|
|
|
|
|
<!--display the board-->
|
2014-07-18 10:54:22 +08:00
|
|
|
|
<% if !User.current.logged? %>
|
2015-04-22 13:56:36 +08:00
|
|
|
|
<div class="c_grey f14">
|
|
|
|
|
<%= l(:label_user_login_project_board) %>
|
|
|
|
|
<%= link_to l(:label_user_login_new), signin_path, :class => "c_blue ml5" %>
|
2014-06-12 10:03:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
2015-03-17 17:02:32 +08:00
|
|
|
|
|
2015-05-07 09:53:34 +08:00
|
|
|
|
<!-- 发布新帖部分 -->
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class=" talklist_box" >
|
2015-05-08 10:56:02 +08:00
|
|
|
|
<div class="talk_new ml15 mb10" id="about_newtalk" style="display:<%= !@flag.nil? && @flag=='true' ? 'block' : 'none' %>;">
|
2015-05-07 09:53:34 +08:00
|
|
|
|
<ul>
|
|
|
|
|
<%= render :partial => 'project_new_topic' %>
|
|
|
|
|
</ul>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
</div><!--talknew end-->
|
2015-05-07 09:53:34 +08:00
|
|
|
|
|
2015-03-17 17:02:32 +08:00
|
|
|
|
<!-- 帖子内容显示 -->
|
2015-05-08 13:04:25 +08:00
|
|
|
|
<p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p>
|
2015-04-16 11:17:44 +08:00
|
|
|
|
<% if @topics.any? %>
|
2015-04-07 12:48:47 +08:00
|
|
|
|
<% @topics.each do |topic| %>
|
2015-05-13 17:25:31 +08:00
|
|
|
|
|
2015-05-14 15:11:20 +08:00
|
|
|
|
<div class="talkmain_box" id="topic<%= topic.id %>" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;">
|
2015-05-07 09:53:34 +08:00
|
|
|
|
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
|
|
|
|
|
<div class="talkmain_txt fl mt5">
|
2015-05-07 17:38:08 +08:00
|
|
|
|
<% author = topic.author.to_s + ":" %>
|
2015-05-07 09:53:34 +08:00
|
|
|
|
<%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %>
|
2015-05-08 13:33:18 +08:00
|
|
|
|
|
|
|
|
|
<p class="talkmain_tit fl fb break_word"> <%= h(topic.subject) %></p>
|
|
|
|
|
<% if topic.editable_by?(User.current) %>
|
2015-05-13 14:31:54 +08:00
|
|
|
|
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: right;
|
|
|
|
|
margin-right: 10px;"><%= l(:button_edit) %></a>
|
2015-05-08 13:04:25 +08:00
|
|
|
|
<% end %>
|
2015-05-13 14:31:54 +08:00
|
|
|
|
|
2015-05-08 13:33:18 +08:00
|
|
|
|
<%= link_to(
|
2015-05-08 10:24:26 +08:00
|
|
|
|
l(:button_delete),
|
2015-05-08 13:04:25 +08:00
|
|
|
|
{:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'},
|
2015-05-08 10:24:26 +08:00
|
|
|
|
:method => :post,
|
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
2015-05-08 13:33:18 +08:00
|
|
|
|
:class => 'talk_edit fr',
|
|
|
|
|
:style => ' margin-right: 10px;'
|
2015-05-08 13:04:25 +08:00
|
|
|
|
) if topic.destroyable_by?(User.current) %>
|
2015-05-08 13:33:18 +08:00
|
|
|
|
|
2015-05-13 14:31:54 +08:00
|
|
|
|
<% if topic.sticky? %>
|
|
|
|
|
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
|
|
|
|
|
<% end %>
|
2015-05-07 17:38:08 +08:00
|
|
|
|
<div class="cl"></div>
|
2015-05-13 17:25:31 +08:00
|
|
|
|
<script>
|
|
|
|
|
$(function(){if($("#contentmessage<%=topic.id %>").height()>55){$("#project_show_<%= topic.id%>").show();}});
|
|
|
|
|
</script>
|
|
|
|
|
<div class="project_board_content break_word" id="content_<%=topic.id%>">
|
|
|
|
|
<div id="contentmessage<%=topic.id %>" class="upload_img">
|
|
|
|
|
<%= topic.content %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2015-05-07 17:38:08 +08:00
|
|
|
|
|
2015-05-13 17:25:31 +08:00
|
|
|
|
<p style="display: none" id="project_show_<%= topic.id%>">
|
|
|
|
|
<label id="expend_more_information<%= topic.id%>" onclick="show_more_reply('#content_<%=topic.id%>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</label>
|
2015-05-07 17:38:08 +08:00
|
|
|
|
<span class="g-arr-down">
|
|
|
|
|
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
|
|
|
|
|
</span>
|
2015-05-07 09:53:34 +08:00
|
|
|
|
|
2015-05-07 17:38:08 +08:00
|
|
|
|
</p>
|
2015-05-13 17:25:31 +08:00
|
|
|
|
|
2015-05-11 16:23:15 +08:00
|
|
|
|
<%= link_to_attachments_course topic, :author => false %>
|
2015-05-04 17:44:03 +08:00
|
|
|
|
|
2015-05-07 16:10:07 +08:00
|
|
|
|
<%= l(:label_activity_time)%>: <%= format_time topic.created_on %>
|
2015-05-11 16:23:15 +08:00
|
|
|
|
|
2015-03-18 20:04:59 +08:00
|
|
|
|
</div>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
<%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %>
|
2015-05-04 17:44:03 +08:00
|
|
|
|
|
2015-03-17 17:02:32 +08:00
|
|
|
|
<div class="cl"></div>
|
2015-05-11 16:23:15 +08:00
|
|
|
|
|
|
|
|
|
|
2015-03-17 17:02:32 +08:00
|
|
|
|
</div><!--讨论主类容 end-->
|
2015-05-08 13:04:25 +08:00
|
|
|
|
|
2015-05-11 16:45:03 +08:00
|
|
|
|
<div class="talk_new ml15 mb10" id="about_newtalk<%=topic.id%>" style="display: none">
|
2015-05-08 13:04:25 +08:00
|
|
|
|
<ul>
|
|
|
|
|
<%= render :partial => 'edit',locals: {:topic => topic} %>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
<div class="talkWrapBox">
|
|
|
|
|
<% reply = Message.new(:subject => "RE: #{@message.subject}")%>
|
|
|
|
|
<% if !topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
<em class="talkWrapArrow"></em>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class="talkConIpt ml15 mb10" style="display: none" id="reply<%= topic.id %>">
|
|
|
|
|
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s} do |f| %>
|
|
|
|
|
|
|
|
|
|
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
|
2015-05-13 14:31:54 +08:00
|
|
|
|
<%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %>
|
|
|
|
|
<a href="#" onclick="$('#message_form<%= topic.id%>').submit();" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a>
|
|
|
|
|
|
|
|
|
|
|
2015-05-07 16:10:07 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% replies_all = topic.children.
|
2015-05-04 17:44:03 +08:00
|
|
|
|
includes(:author, :attachments, {:board => :project}).
|
2015-05-07 16:10:07 +08:00
|
|
|
|
reorder("#{Message.table_name}.created_on DESC").offset(2).
|
2015-05-04 17:44:03 +08:00
|
|
|
|
all %>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
<% replies_show = topic.children.
|
|
|
|
|
includes(:author, :attachments, {:board => :project}).
|
|
|
|
|
reorder("#{Message.table_name}.created_on DESC").limit(2).
|
|
|
|
|
all %>
|
|
|
|
|
<% unless replies_show.empty? %>
|
2015-05-04 17:44:03 +08:00
|
|
|
|
<% reply_count = 0 %>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
<div class="talkWrapMsg">
|
|
|
|
|
<ul>
|
|
|
|
|
<% replies_show.each do |message| %>
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
|
|
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
|
|
|
|
|
<div class="Msg_txt">
|
|
|
|
|
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
|
|
|
|
|
<br/>
|
2015-05-08 10:10:35 +08:00
|
|
|
|
<p class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
<span class=" c_grey fl"><%= format_time(message.created_on) %></span>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
|
|
|
|
|
l(:button_delete),
|
|
|
|
|
{:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
|
|
|
|
|
:method => :post,
|
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
|
:title => l(:button_delete),
|
|
|
|
|
:class => ' c_dblue fr'
|
|
|
|
|
) if message.course_destroyable_by?(User.current) %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
|
|
|
|
|
</li><!---留言内容-->
|
|
|
|
|
<% end %>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="talkWrapMsg" id="talkWrapMsg<%= topic.id %>" style="display: none">
|
|
|
|
|
<ul>
|
|
|
|
|
<% replies_all.each do |message| %>
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
|
|
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
|
|
|
|
|
<div class="Msg_txt">
|
|
|
|
|
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
|
|
|
|
|
<br/>
|
2015-05-08 10:10:35 +08:00
|
|
|
|
<p class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
<span class=" c_grey fl"><%= format_time(message.created_on) %></span>
|
2015-05-04 17:44:03 +08:00
|
|
|
|
<%= link_to(
|
2015-05-07 16:10:07 +08:00
|
|
|
|
|
2015-05-04 17:44:03 +08:00
|
|
|
|
l(:button_delete),
|
2015-05-07 16:10:07 +08:00
|
|
|
|
{:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
|
2015-05-04 17:44:03 +08:00
|
|
|
|
:method => :post,
|
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
2015-05-07 16:10:07 +08:00
|
|
|
|
:title => l(:button_delete),
|
|
|
|
|
:class => ' c_dblue fr'
|
2015-05-04 17:44:03 +08:00
|
|
|
|
) if message.course_destroyable_by?(User.current) %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
|
|
|
|
|
</li><!---留言内容-->
|
2015-05-04 17:44:03 +08:00
|
|
|
|
<% end %>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2015-05-08 10:09:01 +08:00
|
|
|
|
<%if replies_all.first %>
|
2015-05-08 13:04:25 +08:00
|
|
|
|
<div class="talkWrapMsg"><a class=" c_blue ml258" id="showgithelp<%= topic.id%>" value="show_help" onclick ="showhelpAndScrollToMessage('talkWrapMsg<%= topic.id %>','#showgithelp<%= topic.id%>','<%=topic.replies_count%>'); " class="c_dblue lh23">展开回复(<%= topic.replies_count.to_s%>)</a></div>
|
2015-05-08 10:09:01 +08:00
|
|
|
|
<% end %>
|
2015-05-04 17:44:03 +08:00
|
|
|
|
<% end %>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
</div>
|
2015-05-13 17:25:31 +08:00
|
|
|
|
|
2015-05-04 17:44:03 +08:00
|
|
|
|
<% end %>
|
2014-06-12 10:03:01 +08:00
|
|
|
|
<% else %>
|
|
|
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
|
|
|
|
<% end %>
|
2015-04-16 11:17:44 +08:00
|
|
|
|
<ul class="wlist">
|
2015-04-07 12:48:47 +08:00
|
|
|
|
<%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => false, :flag => true %>
|
|
|
|
|
</ul>
|
|
|
|
|
<!--讨论主类容 end-->
|
2014-06-12 10:03:01 +08:00
|
|
|
|
|
2015-04-15 00:30:33 +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 => "#{@project}: #{@board}") %>
|
|
|
|
|
<% end %>
|
2015-05-07 17:38:08 +08:00
|
|
|
|
</div>
|
2015-05-05 14:32:40 +08:00
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
// var flag = false;
|
|
|
|
|
// jQuery(document).ready(function($) {
|
|
|
|
|
// transpotUrl('#content');
|
|
|
|
|
// });
|
|
|
|
|
function submit_message_replay()
|
|
|
|
|
{
|
|
|
|
|
if(flag)
|
|
|
|
|
{
|
|
|
|
|
$("#message_form").submit();
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-05-14 15:11:20 +08:00
|
|
|
|
|
2015-05-05 14:32:40 +08:00
|
|
|
|
</script>
|