2012-02-29 15:04:33 +00:00
|
|
|
#open-comment.comment.view
|
2012-10-05 09:16:07 +01:00
|
|
|
=render 'projects/comments/button_md_help'
|
2012-02-29 15:04:33 +00:00
|
|
|
%h3.tmargin0= t("layout.comments.new_header")
|
2012-04-04 22:43:06 +01:00
|
|
|
- if Comment.issue_comment?(commentable.class)
|
2012-03-01 18:35:18 +00:00
|
|
|
- new_path = project_issue_comments_path(project, commentable)
|
2014-01-21 04:51:49 +00:00
|
|
|
- is_subscribed = commentable.subscribes.exists?(user_id: current_user.id)
|
2012-03-01 18:35:18 +00:00
|
|
|
- subscribe_path = is_subscribed ? project_issue_subscribe_path(project, commentable, current_user.id) : project_issue_subscribes_path(project, commentable)
|
2012-04-04 22:43:06 +01:00
|
|
|
- else Comment.commit_comment?(commentable.class)
|
2012-03-01 18:35:18 +00:00
|
|
|
- new_path = project_commit_comments_path(project, commentable)
|
|
|
|
- is_subscribed = Subscribe.subscribed_to_commit?(project, current_user, commentable)
|
|
|
|
- subscribe_path = is_subscribed ? unsubscribe_commit_path(project, commentable) : subscribe_commit_path(project, commentable)
|
|
|
|
|
2014-01-21 04:51:49 +00:00
|
|
|
= form_for :comment, url: new_path, method: :post, html: { class: :form } do |f|
|
|
|
|
= render "projects/comments/form", f: f, id: 'new'
|
2012-02-29 15:04:33 +00:00
|
|
|
.comment-left
|
2012-02-29 16:27:32 +00:00
|
|
|
= t("layout.comments.notifications_are")
|
2012-02-29 15:04:33 +00:00
|
|
|
%span.bold
|
2012-03-01 18:35:18 +00:00
|
|
|
- if is_subscribed
|
2012-02-29 16:27:32 +00:00
|
|
|
= t("layout.turned_on")\
|
2012-02-29 15:04:33 +00:00
|
|
|
- else
|
2012-02-29 16:27:32 +00:00
|
|
|
= t("layout.turned_off")\
|
2012-02-29 15:04:33 +00:00
|
|
|
\.
|
|
|
|
|
2012-03-01 18:35:18 +00:00
|
|
|
- if is_subscribed
|
2014-01-21 04:51:49 +00:00
|
|
|
= link_to t('layout.commits.unsubscribe_btn'), subscribe_path, method: :delete
|
2012-02-29 15:04:33 +00:00
|
|
|
- else
|
2014-01-21 04:51:49 +00:00
|
|
|
= link_to t('layout.commits.subscribe_btn'), subscribe_path, method: :post
|
2012-02-29 15:04:33 +00:00
|
|
|
.both
|