<commit_before>-content_for :css do
  = stylesheet_link_tag 'compiled/components/show_question.css'

= error_messages_for :answer

-flag = Flag.new

#question
  .subtitle
    %h2
      = h @question.title
  #question-body
    #question_actions.right
      %div{:style => "text-align: center"}
        -if logged_in?
          -if @question.watch_for?(current_user)
            = link_to image_tag("layer-visible-on.png"), unwatch_question_path(current_category, @question)
          -else
            = link_to image_tag("layer-visible-off.png"), watch_question_path(current_category, @question), :title => t(".watch_tooltip")
      =vote_box(@question, question_path(current_category,@question))
      %div{:style => "text-align: center"}
        -if logged_in? && favorite = current_user.favorite(@question)
          -form_tag question_favorite_path(current_category, @question.id, favorite.id), :method => :delete, :id => "favorite_form" do |f|
            = image_submit_tag("favorites.png")
        -else
          - form_tag question_favorites_path(current_category, @question.id), :id => "favorite_form" do |f|
            = image_submit_tag("unfavorites.png")
        &= @question.favorites_count

      .buttons
        -if logged_in?
          -if current_user.can_modify?(@question)
            = link_to t('scaffold.edit'), edit_question_path(current_category, @question), :class => "button"
          -if current_user.mod_of?(@question.group)
            %br
            = link_to "ban", ban_path(:question_ids => [@question.id]), :class => "button", :confirm => "are you sure?"
    .markdown{:style => "width: 92%"}
      = markdown(@question.body)
    .tags-list
      -@question.tags.each do |tag|
        %span.tag
          = link_to h(tag), questions_path(:category => current_category, :tags => tag)
    %br.clear
    %span{:style => "width: 92%"}
      .answer_info.box.right{:style => "width: 25%"}
        = t('activerecord.attributes.question.asked_by')
        .gravatar.left{:style => "padding: 2px"}
          = gravatar(@question.user.email.to_s, :size => 32)
        = link_to h(@question.user.login), user_path(@question.user)
        %br
        = t("time.ago", :time => time_ago_in_words(@question.created_at))
        = t("global.from", :site => @question.user.country_name)
        = country_flag(@question.user.country_code, @question.user.country_name)
      .flag_question
        .actions
          -if current_user != @question.user
            .left.internal
              = link_to t(".flag"), flag_question_path(current_category, @question), :class => "flag-link", :rel => 'nofollow'
          -if current_user.admin?
            .left.internal
              = link_to "move question", move_question_path(current_category, @question), :rel => 'nofollow'
        .clear
        .flag_form.hidden
          -flag.flaggeable = @question
          = render :partial => "flags/form", :locals => {:flag => flag, :source => question_path(current_category, @question) }
    .clear

%a{:name=>"answers"}
#answers
  -if @question.answered
    %h2
      = t(".solution", :scope => "")
    =render :partial=> "answer", :locals=> {:question => @question, :answer => @question.answer, :solution => true, :comment => @answer}
    -@answers.delete(@question.answer)
    %hr
    .subtitle#question_answers{:class => @active_subtab}<commit_msg>check that the user is logged in to show the flag and move question links<commit_after>-content_for :css do
  = stylesheet_link_tag 'compiled/components/show_question.css'

= error_messages_for :answer

-flag = Flag.new

#question
  .subtitle
    %h2
      = h @question.title
  #question-body
    #question_actions.right
      %div{:style => "text-align: center"}
        -if logged_in?
          -if @question.watch_for?(current_user)
            = link_to image_tag("layer-visible-on.png"), unwatch_question_path(current_category, @question)
          -else
            = link_to image_tag("layer-visible-off.png"), watch_question_path(current_category, @question), :title => t(".watch_tooltip")
      =vote_box(@question, question_path(current_category,@question))
      %div{:style => "text-align: center"}
        -if logged_in? && favorite = current_user.favorite(@question)
          -form_tag question_favorite_path(current_category, @question.id, favorite.id), :method => :delete, :id => "favorite_form" do |f|
            = image_submit_tag("favorites.png")
        -else
          - form_tag question_favorites_path(current_category, @question.id), :id => "favorite_form" do |f|
            = image_submit_tag("unfavorites.png")
        &= @question.favorites_count

      .buttons
        -if logged_in?
          -if current_user.can_modify?(@question)
            = link_to t('scaffold.edit'), edit_question_path(current_category, @question), :class => "button"
          -if current_user.mod_of?(@question.group)
            %br
            = link_to "ban", ban_path(:question_ids => [@question.id]), :class => "button", :confirm => "are you sure?"
    .markdown{:style => "width: 92%"}
      = markdown(@question.body)
    .tags-list
      -@question.tags.each do |tag|
        %span.tag
          = link_to h(tag), questions_path(:category => current_category, :tags => tag)
    %br.clear
    %span{:style => "width: 92%"}
      .answer_info.box.right{:style => "width: 25%"}
        = t('activerecord.attributes.question.asked_by')
        .gravatar.left{:style => "padding: 2px"}
          = gravatar(@question.user.email.to_s, :size => 32)
        = link_to h(@question.user.login), user_path(@question.user)
        %br
        = t("time.ago", :time => time_ago_in_words(@question.created_at))
        = t("global.from", :site => @question.user.country_name)
        = country_flag(@question.user.country_code, @question.user.country_name)
      -if logged_in?
        .flag_question
          .actions
            -if current_user != @question.user
              .left.internal
                = link_to t(".flag"), flag_question_path(current_category, @question), :class => "flag-link", :rel => 'nofollow'
            -if current_user.admin?
              .left.internal
                = link_to "move question", move_question_path(current_category, @question), :rel => 'nofollow'
          .clear
          .flag_form.hidden
            -flag.flaggeable = @question
            = render :partial => "flags/form", :locals => {:flag => flag, :source => question_path(current_category, @question) }
    .clear

%a{:name=>"answers"}
#answers
  -if @question.answered
    %h2
      = t(".solution", :scope => "")
    =render :partial=> "answer", :locals=> {:question => @question, :answer => @question.answer, :solution => true, :comment => @answer}
    -@answers.delete(@question.answer)
    %hr
    .subtitle#question_answers{:class => @active_subtab}
{'fraction_non_alphanumeric': 0.15110331725851234, 'fraction_numerical': 0.0032149641969896245, 'mean_word_length': 2.879818594104308, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 73, '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': '3498613', 'n_tokens_mistral': 2199, 'n_tokens_neox': 2139, 'n_words': 395}