<commit_before><h3>
  Spørsmål
  <small class="pull-right <%= alert_class_for_status(@question.status) %>"><%= @question.status_text %></small>
</h3>

<%= form_for(@question, url: admin_question_url(@question)) do |f| %>
  <div class="form-actions">
    <%= f.submit t('app.save'), class: 'btn btn-primary' %>
    <%= link_to t('app.back'), admin_questions_path, class: 'btn' %>
  </div>

  <div class="row-fluid">
    <dl class="span6">
      <dt><%= Question.human_attribute_name :created_at %></dt>
      <dd><%= l @question.created_at.localtime %></dd>

      <dt><%= Question.human_attribute_name :representative %></dt>
      <dd><%= link_to @question.representative.name, @question.representative %></dd>

      <dt><%= Question.human_attribute_name :from_name %></dt>
      <dd><%= @question.from_name %></dd>

      <dt><%= Question.human_attribute_name :from_email %></dt>
      <dd><%= @question.from_email %></dd>

      <dt><%= Question.human_attribute_name :show_sender %></dt>
      <dd><%= @question.show_sender? ? t('app.yes') : t('app.no') %></dd>

      <dt><%= Question.human_attribute_name :body %></dt>
      <dd class="well">
        <%= f.text_area :body, rows: 5, style: 'width: 100%;' %>
        <small class="muted">Suπerforsiktig, superadmin...</small>
      </dd>

      <dt><%= Question.human_attribute_name :internal_comment %></dt>
      <dd><%= f.text_area :internal_comment, rows:  5, style: 'width: 100%' %></dd>
    </dl>

    <dl class="span6">
      <dt><%= Question.human_attribute_name :status %></dt>
      <dd><%= f.select :status, question_status_options %></dd>

      <dt><%= Question.human_attribute_name :issues %></dt>
      <dd><%= f.select :issues, question_issue_options, {}, multiple: true, data: {placeholder: 'Velg saker'} %></dd>
    </dl>
  </div>

  <hr class="soften">

  <div class="row-fluid">
    <h3>
      Svar

      <% if @answer %>
        <small>fra <%= @answer.representative.full_name %></small>
        <small class="pull-right <%= alert_class_for_status(@answer.status) %>"><%= @answer.status_text %></small>
      <% end %>
    </h3>

    <div class="row-fluid">
      <% if @answer.nil? %>
        Ingen svar foreløπig.
      <% else %>
        <dl class="span6">
          <dt><%= Answer.human_attribute_name :created_at %></dt>
          <dd><%= l @answer.created_at.localtime %></dd>

          <dt><%= Answer.human_attribute_name :body %></dt>
          <dd class="well">
            <%= f.text_area :answer_body, rows: 5, style: 'width: 100%;' %>
            <small class="muted">Suπerforsiktig, superadmin...</small>
          </dd>
        </dl>

        <dl class="span6">
          <dt><%= Question.human_attribute_name :status %></dt>
          <dd><%= select_tag 'question[answer][status]', answer_status_options %></dd>
        </dl>
      <% end %>
    </div>

    <hr class="soften">

  <h3>E-poster</h3>
  <div class="row-fluid">
    <div class="span5<%= @question.approved? ? '' : ' muted' %>">
      <h4>Ved godkjent spørsmål</h4>
      <% if @question.approved? %>
        <div class="row-fluid"><%= link_to 'Send e-post til bruker', question_approved_email_user_admin_question_path(@question), class: 'btn', disabled: !@question.approved? %></div>
        <div class="row-fluid"><%= link_to 'Send e-post til representant', question_approved_email_rep_admin_question_path(@question), class: 'btn', disabled: !@question.approved? %></div>
      <% else %>
        <div class="row-fluid"><div class="btn disabled">Send e-post til bruker</div></div>
        <div class="row-fluid"><div class="btn disabled">Send e-post til representant</div></div>
      <% end %>
    </div>
    <div class="span5<%= @question.answer && @question.answer.approved? ? '' : ' muted' %>">
      <h4>Ved godkjent svar</h4>
      <% if @question.has_approved_answer? %>
        <div class="row-fluid"><%= link_to 'Send e-post til bruker', answer_approved_email_user_admin_question_path(@question), class: 'btn' %></div>
      <% else %>
        <div class="row-fluid"><div class="btn disabled">Send e-post til bruker</div></div>
      <% end %>
    </div><commit_msg>Add confirmation popup to send email buttons in edit quetions.<commit_after><h3>
  Spørsmål
  <small class="pull-right <%= alert_class_for_status(@question.status) %>"><%= @question.status_text %></small>
</h3>

<%= form_for(@question, url: admin_question_url(@question)) do |f| %>
  <div class="form-actions">
    <%= f.submit t('app.save'), class: 'btn btn-primary' %>
    <%= link_to t('app.back'), admin_questions_path, class: 'btn' %>
  </div>

  <div class="row-fluid">
    <dl class="span6">
      <dt><%= Question.human_attribute_name :created_at %></dt>
      <dd><%= l @question.created_at.localtime %></dd>

      <dt><%= Question.human_attribute_name :representative %></dt>
      <dd><%= link_to @question.representative.name, @question.representative %></dd>

      <dt><%= Question.human_attribute_name :from_name %></dt>
      <dd><%= @question.from_name %></dd>

      <dt><%= Question.human_attribute_name :from_email %></dt>
      <dd><%= @question.from_email %></dd>

      <dt><%= Question.human_attribute_name :show_sender %></dt>
      <dd><%= @question.show_sender? ? t('app.yes') : t('app.no') %></dd>

      <dt><%= Question.human_attribute_name :body %></dt>
      <dd class="well">
        <%= f.text_area :body, rows: 5, style: 'width: 100%;' %>
        <small class="muted">Suπerforsiktig, superadmin...</small>
      </dd>

      <dt><%= Question.human_attribute_name :internal_comment %></dt>
      <dd><%= f.text_area :internal_comment, rows:  5, style: 'width: 100%' %></dd>
    </dl>

    <dl class="span6">
      <dt><%= Question.human_attribute_name :status %></dt>
      <dd><%= f.select :status, question_status_options %></dd>

      <dt><%= Question.human_attribute_name :issues %></dt>
      <dd><%= f.select :issues, question_issue_options, {}, multiple: true, data: {placeholder: 'Velg saker'} %></dd>
    </dl>
  </div>

  <hr class="soften">

  <div class="row-fluid">
    <h3>
      Svar

      <% if @answer %>
        <small>fra <%= @answer.representative.full_name %></small>
        <small class="pull-right <%= alert_class_for_status(@answer.status) %>"><%= @answer.status_text %></small>
      <% end %>
    </h3>

    <div class="row-fluid">
      <% if @answer.nil? %>
        Ingen svar foreløπig.
      <% else %>
        <dl class="span6">
          <dt><%= Answer.human_attribute_name :created_at %></dt>
          <dd><%= l @answer.created_at.localtime %></dd>

          <dt><%= Answer.human_attribute_name :body %></dt>
          <dd class="well">
            <%= f.text_area :answer_body, rows: 5, style: 'width: 100%;' %>
            <small class="muted">Suπerforsiktig, superadmin...</small>
          </dd>
        </dl>

        <dl class="span6">
          <dt><%= Question.human_attribute_name :status %></dt>
          <dd><%= select_tag 'question[answer][status]', answer_status_options %></dd>
        </dl>
      <% end %>
    </div>

    <hr class="soften">

  <h3>E-poster</h3>
  <div class="row-fluid">
    <div class="span5<%= @question.approved? ? '' : ' muted' %>">
      <h4>Ved godkjent spørsmål</h4>
      <% if @question.approved? %>
        <div class="row-fluid">
          <%= link_to 'Send e-post til bruker', question_approved_email_user_admin_question_path(@question), class: 'btn', confirm: 'Er du sikker på at du vil sende e-post til brukeren?' %>
        </div>
        <div class="row-fluid">
          <%= link_to 'Send e-post til representant', question_approved_email_rep_admin_question_path(@question), class: 'btn', confirm: 'Er du sikker på at du vil sende e-post til representanten?'%>
        </div>
      <% else %>
        <div class="row-fluid"><div class="btn disabled">Send e-post til bruker</div></div>
        <div class="row-fluid"><div class="btn disabled">Send e-post til representant</div></div>
      <% end %>
    </div>
    <div class="span5<%= @question.answer && @question.answer.approved? ? '' : ' muted' %>">
      <h4>Ved godkjent svar</h4>
      <% if @question.has_approved_answer? %>
        <div class="row-fluid">
          <%= link_to 'Send e-post til bruker', answer_approved_email_user_admin_question_path(@question), class: 'btn', confirm: 'Er du sikker på at du vil sende e-post til brukeren?' %>
        </div>
      <% else %>
        <div class="row-fluid"><div class="btn disabled">Send e-post til bruker</div></div>
      <% end %>
    </div>
{'fraction_non_alphanumeric': 0.19967093665530614, 'fraction_numerical': 0.006581266893877071, 'mean_word_length': 3.153245485602733, 'pattern_counts': {'":': 0, '<': 315, '<?xml version=': 0, '>': 315, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3817806', 'n_tokens_mistral': 3125, 'n_tokens_neox': 2876, 'n_words': 610}