2015-04-07 12:48:47 +08:00
|
|
|
|
<div class="project_r_h">
|
|
|
|
|
<h2 class="project_h2"><%= h @board.name %></h2>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="problem_main">
|
|
|
|
|
<div class="ping_dispic">
|
|
|
|
|
<%=link_to image_tag(url_to_avatar(@topic.author), :width => "46", :height => "46"), user_path(@topic.author) %>
|
2014-06-19 15:50:42 +08:00
|
|
|
|
</div>
|
2015-04-07 12:48:47 +08:00
|
|
|
|
<div class="talk_txt fl">
|
2015-04-15 00:30:33 +08:00
|
|
|
|
<p class="problem_tit fl fb" style="word-break:break-all;" >
|
2015-04-07 17:45:00 +08:00
|
|
|
|
<%= @topic.subject %></p>
|
2015-04-07 12:48:47 +08:00
|
|
|
|
<br/>
|
|
|
|
|
<p>由<%= link_to_user_header @topic.author,false,:class=> 'problem_name c_orange' %> 添加于<%= format_time(@topic.created_on) %></p>
|
2014-06-19 15:50:42 +08:00
|
|
|
|
</div>
|
2015-04-07 12:48:47 +08:00
|
|
|
|
<!-- <a class="talk_edit fr">删除</a><a class="talk_edit fr">编辑</a><a class="talk_edit fr">置顶</a> -->
|
|
|
|
|
<%#= watcher_link(@topic, User.current) %>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_edit),
|
|
|
|
|
{:action => 'edit', :id => @topic},
|
|
|
|
|
:class => 'talk_edit fr'
|
|
|
|
|
) if @message.editable_by?(User.current) %>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_delete),
|
|
|
|
|
{:action => 'destroy', :id => @topic},
|
|
|
|
|
:method => :post,
|
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
|
:class => 'talk_edit fr'
|
|
|
|
|
) if @message.destroyable_by?(User.current) %>
|
|
|
|
|
<div class="cl"></div>
|
2015-04-15 00:30:33 +08:00
|
|
|
|
<div class="talk_info mb10" style="word-break:break-all;"><%= textilizable(@topic, :content) %></div>
|
2015-04-07 12:48:47 +08:00
|
|
|
|
<div class="talk_info mb10"><%= link_to_attachment_project @topic, :author => false %></div>
|
|
|
|
|
<!-- <a href="#" class=" link_file ml60">附件:爱覅俄方if.zip(27.5kB)</a>-->
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<% if User.current.logged? %>
|
|
|
|
|
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content',:class => 'talk_edit fr' %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= link_to l(:button_reply), signin_path,:class => 'talk_edit fr' %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_quote),
|
|
|
|
|
{:action => 'quote', :id => @topic},
|
|
|
|
|
:remote => true,
|
|
|
|
|
:method => 'get',
|
|
|
|
|
:class => 'talk_edit fr',
|
|
|
|
|
:remote => true) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div><!--讨论主类容 end-->
|
2014-06-19 15:50:42 +08:00
|
|
|
|
<% unless @replies.empty? %>
|
|
|
|
|
<% reply_count = 0 %>
|
|
|
|
|
<% @replies.each do |message| %>
|
2015-04-07 12:48:47 +08:00
|
|
|
|
<div class="ping_C mb10" 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">
|
|
|
|
|
<%= 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><%= textilizable message,:content,:attachments => message.attachments %></p>
|
2015-04-14 23:58:27 +08:00
|
|
|
|
<%= link_to_attachment_project message, :author => false %>
|
2015-04-07 12:48:47 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="ping_disfoot">
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_quote),
|
|
|
|
|
{:action => 'quote', :id => message},
|
|
|
|
|
:remote => true,
|
|
|
|
|
:method => 'get',
|
|
|
|
|
:title => l(:button_quote)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
#image_tag('edit.png'),
|
|
|
|
|
l(:button_edit),
|
|
|
|
|
{:action => 'edit', :id => message},
|
|
|
|
|
:title => l(:button_edit)
|
|
|
|
|
) if message.course_editable_by?(User.current) %>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
#image_tag('delete.png'),
|
|
|
|
|
l(:button_delete),
|
|
|
|
|
{:action => 'destroy', :id => message},
|
|
|
|
|
: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><!---留言内容-->
|
2014-06-19 15:50:42 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
<div id="reply" style="display:none;">
|
2015-04-07 12:48:47 +08:00
|
|
|
|
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
|
2015-04-07 17:45:00 +08:00
|
|
|
|
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
|
2015-04-07 12:48:47 +08:00
|
|
|
|
<a href="#" onclick="submit_message_replay();"class="blue_btn fl c_white" style="margin-left: 50px;"><%= l(:button_submit)%></a>
|
2014-06-19 15:50:42 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
<div id="preview" class="wiki"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
2015-04-07 12:48:47 +08:00
|
|
|
|
<ul class="wlist">
|
|
|
|
|
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false, :remote => false, :flag => true%>
|
|
|
|
|
</ul>
|
2014-06-19 15:50:42 +08:00
|
|
|
|
<% html_title @topic.subject %>
|
2015-04-07 12:48:47 +08:00
|
|
|
|
|
2014-06-19 15:50:42 +08:00
|
|
|
|
<script type="text/javascript">
|
2015-04-07 12:48:47 +08:00
|
|
|
|
// var flag = false;
|
|
|
|
|
// jQuery(document).ready(function($) {
|
|
|
|
|
// transpotUrl('#content');
|
|
|
|
|
// });
|
2014-10-27 14:29:49 +08:00
|
|
|
|
function submit_message_replay()
|
|
|
|
|
{
|
|
|
|
|
if(flag)
|
|
|
|
|
{
|
2015-04-07 12:48:47 +08:00
|
|
|
|
$("#message_form").submit();
|
2014-10-27 14:29:49 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-06-19 15:50:42 +08:00
|
|
|
|
</script>
|