You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
154 lines
7.4 KiB
154 lines
7.4 KiB
<div class="project_r_h">
|
|
<h2 class="project_h2">
|
|
<% if User.current.language == "zh"%>
|
|
<%= h @board.name %>
|
|
<% else %>
|
|
<%= l(:project_module_boards) %>
|
|
<% end %>
|
|
</h2>
|
|
</div>
|
|
|
|
<!--display the board-->
|
|
<% if !User.current.logged? %>
|
|
<div class="c_grey f14">
|
|
<%= l(:label_user_login_project_board) %>
|
|
<%= link_to l(:label_user_login_new), signin_path, :class => "c_blue ml5" %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<!-- 内容显示部分 -->
|
|
<div class="talk_top">
|
|
<div class="fl"><span><%= l(:label_project_board_count , :count => @topic_count)%></span></div>
|
|
<% if @project.enabled_modules.where("name = 'boards'").count > 0 && User.current.member_of?(@project) %>
|
|
<span><%= link_to l(:project_module_boards_post), new_board_message_path(@board),
|
|
:class => 'problem_new_btn fl c_dorange',
|
|
: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">
|
|
<%= 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), board_message_path(@board, topic), title:topic.subject.to_s, :class =>"problem_tit fl" %>
|
|
<% if topic.sticky? %>
|
|
<a href="javascript:void(0)" class="talk_up fr c_red"><%= l(:label_board_sticky)%></a>
|
|
<% end %>
|
|
|
|
<br/>
|
|
<%= link_to topic.author, user_path(topic.author), :class =>"problem_name" %>
|
|
<%= format_time topic.created_on %>
|
|
<br/>
|
|
|
|
<p class="problem_tit fl fb" style="word-break:break-all;" >
|
|
<%= topic.content %></p>
|
|
</div>
|
|
<%= link_to (l(:label_short_reply) + " "+topic.replies_count.to_s), board_message_path(@board, topic), :class => "talk_btn fr c_white" %>
|
|
|
|
<div class="cl"></div>
|
|
</div><!--讨论主类容 end-->
|
|
<% replies = topic.children.
|
|
includes(:author, :attachments, {:board => :project}).
|
|
reorder("#{Message.table_name}.created_on DESC").
|
|
limit(2).
|
|
all %>
|
|
<% unless replies.empty? %>
|
|
<% reply_count = 0 %>
|
|
<% replies.each do |message| %>
|
|
<div class="ping_C mb10" style="padding-left: 50px;" id="<%= "message-#{message.id}" %>">
|
|
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(message.author), :width => '46',:height => '46'), user_path(message.author) %></div>
|
|
<div class="ping_discon">
|
|
<div class="ping_distop upload_img break_word">
|
|
<%= link_to_user_header message.author,false,:class => 'c_blue fb fl mb10 ' %>
|
|
<span class="c_grey fr"><%= format_time(message.created_on) %></span>
|
|
<div class="cl"></div>
|
|
<p class="break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
|
|
</div>
|
|
<div class="ping_disfoot">
|
|
<%= link_to(
|
|
l(:button_quote),
|
|
{:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id},
|
|
:remote => true,
|
|
:method => 'get',
|
|
:title => l(:button_quote)) if !topic.locked? && authorize_for('messages', 'reply') %>
|
|
<%= link_to(
|
|
#image_tag('edit.png'),
|
|
l(:button_edit),
|
|
{:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id},
|
|
:title => l(:button_edit)
|
|
) if message.course_editable_by?(User.current) %>
|
|
<%= link_to(
|
|
#image_tag('delete.png'),
|
|
l(:button_delete),
|
|
{:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id},
|
|
:method => :post,
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
:title => l(:button_delete)
|
|
) if message.course_destroyable_by?(User.current) %>
|
|
</div>
|
|
<div class="cl"></div>
|
|
</div>
|
|
<div class="cl"></div>
|
|
</div><!---留言内容-->
|
|
<% end %>
|
|
<% end %>
|
|
<% reply = Message.new(:subject => "RE: #{@message.subject}")%>
|
|
<% if !topic.locked? && authorize_for('messages', 'reply') %>
|
|
<div id="reply" style="display:none;">
|
|
<%= 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'} do |f| %>
|
|
<p class="talk_top"><%= l(:label_message_reply) %></p>
|
|
<%= render :partial => 'messages/form_project', :locals => {:f => f, :replying => true} %>
|
|
<a href="#" onclick="submit_message_replay();"class="blue_btn fl c_white ml5" style="margin-left: 50px;"><%= l(:button_submit)%></a>
|
|
<% end %>
|
|
<div id="preview" class="wiki"></div>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
<% else %>
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
|
<% end %>
|
|
<ul class="wlist">
|
|
<%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => false, :flag => true %>
|
|
</ul>
|
|
<!--讨论主类容 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 %>
|
|
<script type="text/javascript">
|
|
// var flag = false;
|
|
// jQuery(document).ready(function($) {
|
|
// transpotUrl('#content');
|
|
// });
|
|
function submit_message_replay()
|
|
{
|
|
if(flag)
|
|
{
|
|
$("#message_form").submit();
|
|
}
|
|
}
|
|
function regexContent()
|
|
{
|
|
var content = $.trim($("#message_content").val());
|
|
if(content.length ==0)
|
|
{
|
|
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
|
|
$("#message_content_span").css('color','#ff0000');
|
|
flag = false;
|
|
}
|
|
else
|
|
{
|
|
$("#message_content_span").text("<%= l(:label_field_correct) %>");
|
|
$("#message_content_span").css('color','#008000');
|
|
flag = true;
|
|
}
|
|
}
|
|
</script> |