• <% if params[:edit_comment_id] && params[:edit_comment_id] == single_comment.id.to_s && can_edit_comment?(single_comment) %> <%= render 'comments/comment_form', :comment => single_comment, :commentable => single_comment.commentable, :button_name => ts('Update') %> <% else %> <% if single_comment.is_deleted %>

    <%= ts("(Previous comment deleted.)") %>

    <% elsif !can_see_hidden_comment?(single_comment) %>

    <%= ts("(This comment is under review by an admin and is currently unavailable.)") %>

    <% else %> <%# FRONT END, update this if a.user comes in %>

    <% cache([single_comment, single_comment.comment_owner, "heading"], expires_in: 1.week) do %> <% if single_comment.by_anonymous_creator? %> <%= ts("Anonymous Creator") %> <% else %> <%= get_commenter_pseud_or_name(single_comment) %> <% end %> <% if single_comment.parent.is_a?(Chapter) && single_comment.ultimate_parent.chaptered? %> <%= t(".on_chapter_html", commentable_link: chapter_description_link(single_comment)) %> <% end %> <% if single_comment.unreviewed? %> <%= ts("(Unreviewed)") %> <% end %> <% end %> <%= time_in_zone(single_comment.created_at) %>

    <% cache([single_comment, single_comment.comment_owner, "body", image_safety_mode_cache_key(single_comment)], expires_in: 1.week) do %>
    <% if !single_comment.pseud.nil? %> <% if single_comment.by_anonymous_creator? %> <% else %> <%= icon_display(single_comment.pseud.user, single_comment.pseud) %> <% end %> <% else %> <% end %>
    <% unless single_comment.approved? %>

    <%= ts("This comment has been marked as spam.") %>

    <% end %> <% if single_comment.hidden_by_admin? %>

    <%= ts("This comment has been hidden by an admin.") %>

    <% end %>
    <%= raw single_comment.sanitized_content %>
    <% end %> <% if single_comment.edited_at.present? %>

    <%= ts("Last Edited") %> <%= time_in_zone(single_comment.edited_at) %>

    <% end %> <% if policy(single_comment).show_email? && single_comment.email.present? %>

    <%= ts("Email: %{email}", email: single_comment.email) %>

    <% end %> <% if policy(:user_creation).show_ip_address? %>

    <%= ts("IP Address: %{ip_address}", ip_address: single_comment.ip_address.blank? ? "No address recorded" : single_comment.ip_address) %>

    <% end %> <%= render "comments/comment_actions", comment: single_comment %> <% end %> <% end %>