%ul.list-inline
  - if policy(comment).reply?
    %li.list-inline-item
      %button.btn.btn-outline-success.collapsed{ id: "reply_button_of_#{comment.id}",
      data: { 'bs-toggle': 'collapse', 'bs-target': "#reply_form_of_#{comment.id}" } }
        Reply
    - if policy(comment).update?
      %li.list-inline-item
        %button.btn.btn-outline-secondary.collapsed{ id: "edit_button_of_#{comment.id}",
         data: { 'bs-toggle': 'collapse', 'bs-target': "#edit_form_of_#{comment.id}" } }
          Edit
  - if policy(comment).destroy?
    %li.list-inline-item
      = render(partial: 'webui/comment/delete_dialog', locals: { comment: comment })
      = link_to('#', data: { 'bs-toggle': 'modal', 'bs-target': "#delete-comment-modal-#{comment.id}" },
                class: 'delete_link btn btn-outline-danger', title: 'Delete comment') do
        Delete
  - if Flipper.enabled?(:content_moderation, User.session)
    - if policy(comment).moderate?
      %li.list-inline-item
        = button_to(comment.moderated? ? 'Permit' : 'Moderate', moderate_comment_path(comment),
                    class: 'btn btn-outline-secondary', remote: true, form_class: 'moderate-form', params: { moderation_state: !comment.moderated? })
  - if policy(Report.new(reportable: comment)).create?
    %li.list-inline-item
      = link_to('#', class: 'btn btn-outline-warning', id: "js-comment-#{comment.id}",
            data: { 'bs-toggle': 'modal',
                    'bs-target': '#report-modal',
                    'modal-title': "Report comment from #{comment.user}",
                    'reportable-type': comment.class.name,
                    'reportable-id': comment.id }) do
        Report
- if policy(comment).reply?
  .collapse{ id: "reply_form_of_#{comment.id}" }
    = render(partial: 'webui/comment/comment_field', locals: { form_method: :post,
     comment: comment.children.new, commentable: commentable, element_suffix: "reply_for_#{comment.id}", has_cancel: true })
- if policy(comment).update?
  .collapse{ id: "edit_form_of_#{comment.id}" }
    = render(partial: 'webui/comment/comment_field', locals: { form_method: :put,
     comment: comment, commentable: commentable, element_suffix: "edit_#{comment.id}", has_cancel: true })
