|
- <div class="pd15box">
- <div class="clear mb30">
- <%= 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" class="pullreques_reply_textarea" style="padding-left: 0px;"></textarea>
- <span id ="pr_comment_tip" class="fontGrey2 c_red" style="display: none">内容不能为空</span>
- <% if User.current.member_of?(@project) %>
- <a href="javascript:void(0);" class="btn btn-blue fr" onclick="pull_request_commit()">留言</a>
- <% else %>
- <a class="btn btn-grey fr" >留言</a>
- <% end %>
- <% end %>
- </div>
- <ul class="pullreques_reply_list">
- <% @comments.each do |comment| %>
- <li>
- <%= link_to image_tag(url_to_avatar(get_user_by_login_and(comment.author.try(:username))), :width => "43", :height => "43", :class => "pullreques_reply_user_img fl mr15"), user_path(get_user_by_login_and(comment.author.try(:username))), :alt => "用户头像", :target => "_blank", :class => "fl" %>
- <div class="sy_teachers_txt fl ">
- <p class="clear mb5">
- <%= link_to_user_login(comment.author.try(:username), "pullreques_reply_name fl") %>
- </p>
- <p class="pullreques_reply_txt"><%= comment.note %></p>
- </div>
- <div class="cl"></div>
- </li>
- <% end %>
- </ul>
- </div>
-
- <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>
|