<%= ts("Actions") %>

<%= flash_div :kudos_error, :kudos_notice %> <% if @work && (@chapter.blank? || @chapter.posted?) %> <%= render "kudos/kudos", :kudos => @kudos, :guest_kudos_count => @work.guest_kudos_count, :commentable => @work %> <% end %>

<%= ts("Comments") %>

<%= flash_div :comment_error, :comment_notice %> <% commentable_parent = find_parent(commentable) %> <% if AdminSetting.current.guest_comments_off? && guest? %>

<%= t(".guest_comments_disabled") %>

<% elsif commentable_parent.is_a?(AdminPost) && commentable_parent.disable_all_comments? %>

<%= t(".permissions.admin_post.disable_all") %>

<% elsif commentable_parent.is_a?(AdminPost) && commentable_parent.disable_anon_comments? && !logged_in? %>

<%= t(".permissions.admin_post.disable_anon") %> <%= t(".permissions.admin_post.alt_action", support_link: link_to(t(".permissions.admin_post.support_link"), new_feedback_report_path)).html_safe %>

<% elsif commentable_parent.is_a?(Work) && commentable_parent.disable_all_comments? %>

<%= t(".permissions.work.disable_all") %>

<% elsif commentable_parent.is_a?(Work) && commentable_parent.disable_anon_comments? && !logged_in? %>

<%= t(".permissions.work.disable_anon") %> <%= t(".permissions.work.alt_action") %>

<% elsif commentable_parent.is_a?(Work) && commentable_parent.hidden_by_admin? %>

<%= t(".permissions.work.hidden") %>

<% elsif commentable_parent.is_a?(Work) && commentable_parent.in_unrevealed_collection %>

<%= t(".permissions.work.unrevealed") %>

<% elsif commentable_parent.is_a?(Work) && blocked_by?(commentable_parent) %>

<%= t(".blocked") %>

<% elsif logged_in_as_admin? %>

<%= t(".logged_as_admin") %>

<% else %>
<%= render 'comments/comment_form', {:comment => Comment.new, :commentable => commentable, :button_name => t(".actions.comment")} %>
<% end %>
style="display:none;"<% end %>> <% if params[:show_comments] || params[:tag_id] %> <% @comments = CommentDecorator.for_commentable(commentable, page: params[:page]) %> <%= will_paginate @comments, params: { anchor: :comments } %> <%= render 'comments/comment_thread', { :depth => 0, :comments => @comments } %> <%= will_paginate @comments, params: { anchor: :comments } %> <% end %>
<% if logged_in? && @work %> <% if is_maintainer? && (@work.allow_collection_invitation? || current_user.archivist) %>
<%= render "collection_items/collection_item_form", :item => @work, :in_page => true %>
<% end %>
<% @bookmark ||= bookmark_if_exists(commentable) %> <% bookmarkable = (commentable.respond_to?(:work) ? commentable.work : commentable) %> <% if @bookmark %> <%= render "bookmarks/bookmark_form", :bookmarkable => bookmarkable, :bookmark => @bookmark, :button_name => ts("Update"), :action => :update, :in_page => true %> <% else %> <%= render "bookmarks/bookmark_form", :bookmarkable => bookmarkable, :bookmark => Bookmark.new, :button_name => ts("Create"), :action => :create, :in_page => true %> <% end %>
<% end %>