<% content_for :title, "Ask a Question" %>

<h1>Ask a Question</h1>

<div class="notice">
  <i class="fas fa-info-circle"></i> You're asking a new question on the <strong>main site</strong>, which is
  for questions on the topic of the site. If you want to post feedback or start a discussion about the site itself,
  you'll need to <%= link_to 'ask a Meta question instead', new_meta_question_path %>.
</div>

<% if @question.errors.any? %>
  <div class="notice is-danger">
    <p>The following <%= "error".pluralize(@question.errors.count) %> prevented the question from being posted:</p>
    <ul>
      <% @question.errors.full_messages.each do |e| %>
        <li><%= e %></li>
      <% end %>
    </ul>
  </div>
<% end %>

<%= render 'form' %>

<% if SiteSetting['AskingGuidance'] %>
  <% content_for :sidebar do %>
    <div class="widget has-margin-4">
      <h4 class="widget--header has-margin-0">Hints and Tips</h4>
      <div class="widget--body">
        <%= raw(sanitize(render_markdown(SiteSetting['AskingGuidance']), scrubber: scrubber)) %>
      </div>
    </div>
  <% end %>
<% end %>
