<div id="afterword">
  <h2 class="toc-heading"><%= t(".afterword") %></h2>

  <% unless @work.endnotes.blank? && @work.approved_children.blank? %>
    <div class="meta">
      <% unless @work.endnotes.blank? %>
        <div id="endnotes">
          <p><%= t(".end_notes") %></p>
          <blockquote class="userstuff"><%= raw sanitize_field(@work, :endnotes) %></blockquote>
        </div>
      <% end %>

      <%# i18n-tasks-use t("downloads.download_afterword.inspired_by.restricted_html") %>
      <%# i18n-tasks-use t("downloads.download_afterword.inspired_by.revealed_html") %>
      <%# i18n-tasks-use t("downloads.download_afterword.inspired_by.unrevealed") %>
      <% if @work.approved_children.present? %>
        <dl>
          <dt><%= t(".inspired_by.title") %></dt>
          <% for child_work in @work.approved_related_works %>
            <% next if child_work.translation %>

            <dd>
              <%= related_work_note(child_work.work, "inspired_by", download: true) %>
            </dd>
          <% end %>
        </dl>
      <% end %>
    </div>
  <% end %>

  <p class="message"><%= t(".please_comment_html", comment_link: link_to(t(".comment"), new_work_comment_url(@work))) %></p>
</div>
