<commit_before>.question-hdr
  %h5.h5= "#{t("QUESTION")} ##{embeddable.question_index}"
.question-bd
  .question-txt
    != embeddable.drawing_prompt
    %div{:id => "image_question_main_form_#{embeddable.id}"}
      = form_for embeddable, :remote => true, :html => {:'data-type' => 'json', :class=> 'live_submit'} do |f|
        -# The src of this thumbnail image will be rewritten by javascript
        %img.snapshot_thumbnail{:src => embeddable.annotated_image_url, :width => '100%'}
        %br
        - if embeddable.prompt
          .text_prompt
            != embeddable.prompt
          -# this 'formatting' is duplicated in image_question_answers_controller
          .answer_text{ :data => { :raw => embeddable.answer_text } }
            = simple_format h(truncate(embeddable.answer_text, length:140))
        - if embeddable.is_shutterbug?
          %button.image_question.button.image_snapshot_button.take_snapshot{:type => 'button'}
            %i.fa.fa-camera
            %span.take_snapshot_label
              =t("TAKE_SNAPSHOT")
          %button.image_question.button.image_snapshot_button.replace_snapshot{:type => 'button'}
            %i.fa.fa-camera
            %span.replace_snapshot_label
              =t("REPLACE_SNAPSHOT")
        - elsif embeddable.is_drawing?
          %button.image_question.button.image_drawing_button.drawing_button{:type => 'button'}
            %i.fa.fa-pencil
            %span.make_drawing_label
              =t("MAKE_DRAWING")
        %button.image_question.button.image_snapshot_button.edit_answer{:type => 'button'}
          =t("EDIT")
        - if embeddable.require_image_url
          = f.hidden_field 'image_url'
        = f.hidden_field 'annotated_image_url'
        = f.hidden_field 'annotation'
        - unless embeddable.prompt.blank?
          = f.hidden_field 'answer_text'
        = prediction_button(embeddable, f)

.image-question-dialog{:id => "image_question_dialog_#{embeddable.id}", :style => "display: none"}
  .drawing-area
    %div{:id => "drawing-tool-container_for_#{embeddable.id}"}
  .question-area
    .drawing-prompt!= embeddable.drawing_prompt
    - unless embeddable.prompt.blank?
      %hr
      .question-prompt!= embeddable.prompt
      %textarea{:class => 'answer', :placeholder => 'Type answer here'}
        = embeddable.answer_text
      .wait-message
    .buttons-row
      %button.button.image_cancel_button{ :type => 'button' }
        %i.fa.fa-cancel.btn
          =t("CANCEL")
      %button.button.image_done_button{ :type => 'button' }
        %i.fa.fa-check.btn
          =t("DONE")

- content_for :extra_javascript do
  :javascript
    $(document).ready(function() {
      new ImageQuestionDrawingTool(#{embeddable.id});
    });<commit_msg>Simple fix for: [#82068910] - Snapshot "Please wait" spinner inconsistent.<commit_after>.question-hdr
  %h5.h5= "#{t("QUESTION")} ##{embeddable.question_index}"
.question-bd
  .question-txt
    != embeddable.drawing_prompt
    %div{:id => "image_question_main_form_#{embeddable.id}"}
      = form_for embeddable, :remote => true, :html => {:'data-type' => 'json', :class=> 'live_submit'} do |f|
        -# The src of this thumbnail image will be rewritten by javascript
        %img.snapshot_thumbnail{:src => embeddable.annotated_image_url, :width => '100%'}
        %br
        - if embeddable.prompt
          .text_prompt
            != embeddable.prompt
          -# this 'formatting' is duplicated in image_question_answers_controller
          .answer_text{ :data => { :raw => embeddable.answer_text } }
            = simple_format h(truncate(embeddable.answer_text, length:140))
        - if embeddable.is_shutterbug?
          %button.image_question.button.image_snapshot_button.take_snapshot{:type => 'button'}
            %i.fa.fa-camera
            %span.take_snapshot_label
              =t("TAKE_SNAPSHOT")
          %button.image_question.button.image_snapshot_button.replace_snapshot{:type => 'button'}
            %i.fa.fa-camera
            %span.replace_snapshot_label
              =t("REPLACE_SNAPSHOT")
        - elsif embeddable.is_drawing?
          %button.image_question.button.image_drawing_button.drawing_button{:type => 'button'}
            %i.fa.fa-pencil
            %span.make_drawing_label
              =t("MAKE_DRAWING")
        %button.image_question.button.image_snapshot_button.edit_answer{:type => 'button'}
          =t("EDIT")
        - if embeddable.require_image_url
          = f.hidden_field 'image_url'
        = f.hidden_field 'annotated_image_url'
        = f.hidden_field 'annotation'
        - unless embeddable.prompt.blank?
          = f.hidden_field 'answer_text'
        = prediction_button(embeddable, f)

.image-question-dialog{:id => "image_question_dialog_#{embeddable.id}", :style => "display: none"}
  .drawing-area
    %div{:id => "drawing-tool-container_for_#{embeddable.id}"}
  .question-area
    .drawing-prompt!= embeddable.drawing_prompt
    - unless embeddable.prompt.blank?
      %hr
      .question-prompt!= embeddable.prompt
      %textarea{:class => 'answer', :placeholder => 'Type answer here'}
        = embeddable.answer_text
    .wait-message
    .buttons-row
      %button.button.image_cancel_button{ :type => 'button' }
        %i.fa.fa-cancel.btn
          =t("CANCEL")
      %button.button.image_done_button{ :type => 'button' }
        %i.fa.fa-check.btn
          =t("DONE")

- content_for :extra_javascript do
  :javascript
    $(document).ready(function() {
      new ImageQuestionDrawingTool(#{embeddable.id});
    });
{'fraction_non_alphanumeric': 0.13448711014963044, 'fraction_numerical': 0.004326663061114116, 'mean_word_length': 2.733512786002692, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 43, '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': '3439611', 'n_tokens_mistral': 1838, 'n_tokens_neox': 1812, 'n_words': 270}