<!--Descriptive page name, messages and instructions-->
<%= error_messages_for :feedback %>

<h2 class="heading"><%= t(".heading.page_title") %></h2>
<!--/descriptions-->

<!--subnav-->
<h4 class="landmark heading"><%= t(".heading.landmark.reference") %></h4>
<ul class="navigation actions" role="navigation">
  <li><%= link_to t(".navigation.faqs"), archive_faqs_path %></li>
  <li><%= link_to t(".navigation.release_notes"), admin_posts_path(:tag => 1) %></li>
  <li><%= link_to t(".navigation.known_issues"), known_issues_path %></li>
</ul>
<!--/subnav-->

<!--main content-->
<% if @admin_setting.disable_support_form %>
  <div class="userstuff">
    <%= raw sanitize_field(@admin_setting, :disabled_support_form_text) %>
  </div>
<% else %>
  <h3 class="heading"><%= t(".heading.instructions") %></h3>
  <div class="userstuff">
    <p><%= t(".status.current", twitter_link: link_to(t(".status.twitter"), "https://twitter.com/AO3_Status"), tumblr_link: link_to(t(".status.tumblr"), "https://ao3org.tumblr.com")).html_safe %></p>
    <p><%= t(".abuse.reports", contact_link: link_to(t(".abuse.contact"), new_abuse_report_path)).html_safe %></p>
    <p><%= t(".reportable.intro") %></p>
    <ul>
      <li><%= t(".reportable.fnok.concerning_html", fnok_link: link_to(t(".reportable.fnok.fnok"), tos_faq_path(anchor: "next_of_kin"))) %></li>
      <li><%= t(".reportable.bugs") %></li>
      <li><%= t(".reportable.site_questions") %></li>
      <li><%= t(".reportable.account_creation") %></li>
      <li><%= t(".reportable.lost_access") %></li>
      <li><%= t(".reportable.tag_changes") %></li>
      <li><%= t(".reportable.new_features") %></li>
      <li><%= t(".reportable.orphaned_works") %></li>
      <li><%= t(".reportable.work_problems") %></li>
      <li><%= t(".reportable.policy_questions") %></li>
    </ul>
    <p><%= t(".do_not_spam_html") %></p>
    <p><%= t(".languages_html", list: @support_languages.map { |language| tag.span(language.name, lang: language.short) }.to_sentence.html_safe) %></p>
  </div>
  <%= form_for(@feedback, html: {class: "post feedback"}) do |f| %>
    <fieldset>
      <legend><%= t(".form.legend.contact_info") %></legend>
      <dl>
        <dt><%= f.label :username, t(".form.name.label") %></dt>
        <dd>
          <%= f.text_field :username %>
        </dd>
        <dt class="required"><%= f.label :email, t(".form.email.label") %></dt>
        <dd class="required">
          <%= f.text_field :email, size: 60 %>
        </dd>
      </dl>
    </fieldset>

    <fieldset>
      <legend><%= t(".form.legend.feedback") %></legend>
      <%= f.hidden_field :referer %>
      <dl>
        <dt class="required">
          <%= f.label :language, t(".form.language.label") %>
        </dt>
        <dd class="required">
          <%= f.select(:language, language_options_for_select(@support_languages, "name"),
                { selected: @feedback.language || Language.default.name }) %>
        </dd>
        <dt class="required">
          <%= f.label :summary, t(".form.summary.label") %>
        </dt>
        <dd class="required">
          <%= f.text_field :summary, size: 60, class: "observe_textlength" %>
          <%= generate_countdown_html("feedback_summary", ArchiveConfig.FEEDBACK_SUMMARY_MAX_DISPLAYED) %>
          <%= live_validation_for_field("feedback_summary",
                failureMessage: t(".form.summary.error")) %>
        </dd>
        <dt class="required">
          <%= f.label :comment, t(".form.comment.label") %>
        </dt>
        <dd class="required">
          <p id="comment-field-description">
            <%= t(".form.comment.description") %>
          </p>
          <%= f.text_area :comment, cols: 60, "aria-describedby" => "comment-field-description" %>
          <%= live_validation_for_field("feedback_comment",
                failureMessage: t(".form.comment.error")) %>
        </dd>
      </dl>
    </fieldset>

    <fieldset>
      <legend><%= t(".form.legend.send") %></legend>
      <p class="submit actions">
        <%= f.submit t(".form.submit.active"), data: { disable_with: t(".form.submit.disabled") } %>
      </p>
    </fieldset>
  <% end %>
<% end %>
<!--/content-->
