49 lines
1.8 KiB
Plaintext
49 lines
1.8 KiB
Plaintext
<div class="merge-discussion-input">
|
|
<%= form_tag(url_for(:controller => 'pull_requests', :action => 'create_pull_request_comment', :project_id => @project.id), :id => 'pull_request_comment_form', :method => "post", :remote => true) do %>
|
|
<textarea id="pull_request_comment" name="pull_request_comment"></textarea>
|
|
<span id ="pr_comment_tip" class="fontGrey2 c_red" style="display: none">内容不能为空</span>
|
|
<a href="javascript:void(0);" class="BlueCirBtn mt10" onclick="pull_request_commit()">留言</a>
|
|
<% end %>
|
|
</div>
|
|
<% @comments.each do |comment| %>
|
|
<div class="merge-discussion-content merge-discussion-automatic">
|
|
<%= link_to comment.author.try(:username), user_path(get_user_by_login_and(comment.author.try(:username))), :class => "link-blue mr15 fl" %>
|
|
<span class="fl fontGrey2"><%= time_tag(comment.created_at) %>前</span>
|
|
<div class="cl"></div>
|
|
<div class="merge-discussion-detail"><%= comment.note %></div>
|
|
</div>
|
|
<% end %>
|
|
<div style="text-align:center;">
|
|
<div class="pages" style="width:auto; display:inline-block;">
|
|
<ul id="homework_pository_ref_pages">
|
|
<%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
|
</ul>
|
|
<div class="cl"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function regex_pr_comment()
|
|
{
|
|
var comment = $.trim($("#pull_request_comment").val());
|
|
if(comment.length == 0)
|
|
{
|
|
$("#pr_comment_tip").show();
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
$("#pr_comment_tip").hide();
|
|
return true;
|
|
}
|
|
}
|
|
|
|
//提交pull request_comment
|
|
function pull_request_commit()
|
|
{
|
|
if(regex_pr_comment())
|
|
{
|
|
$("#pull_request_comment_form").submit();
|
|
}
|
|
}
|
|
</script> |