rosa-build/app/views/comments/_list.html.haml

35 lines
1.7 KiB
Plaintext

%a{ :name => "comments" }
.block#block-list
.content
%h2.title
= t("layout.issues.comments_header")
.inner
%ul.list
- list.each do |comment|
%li
.left
= link_to comment.user.uname, user_path(comment.user.uname)
.item
= comment.body
%br
%br
- if commentable.class == Issue
- edit_path = edit_project_issue_comment_path(project, commentable, comment)
- delete_path = project_issue_comment_path(project, commentable, comment)
- elsif commentable.class == Grit::Commit
- edit_path = edit_project_commit_comment_path(project, commentable, comment)
- delete_path = project_commit_comment_path(project, commentable, comment)
= link_to t("layout.edit"), edit_path if can? :update, comment
=# link_to image_tag("web-app-theme/icons/cross.png", :alt => t("layout.delete")) + " " + t("layout.delete"), delete_path, :method => "delete", :class => "button", :confirm => t("layout.comments.confirm_delete") if can? :delete, comment
= link_to t("layout.delete"), delete_path, :method => "delete", :confirm => t("layout.comments.confirm_delete") if can? :delete, comment
.block
.content
%h2.title
= t("layout.comments.new_header")
.inner
- new_path = project_issue_comments_path(project, commentable) if commentable.class == Issue
- new_path = project_commit_comments_path(project, commentable) if commentable.class == Grit::Commit
= form_for :comment, :url => new_path, :method => :post, :html => { :class => :form } do |f|
= render :partial => "comments/form", :locals => {:f => f}