1 %meta{"data-js"=> 'show'}
4 - question_body = find_and_preserve(shapado_auto_link(markdown(@question.body.present? ? @question.body : @question.title)))
7 %meta{name: "keywords", content: clean_seo_keywords(@question.tags.dup, @question.title)}
8 %meta{name: "description", content: question_body.gsub(/<\/?[^>]*>/, "")[0, 255] }
9 %link{rel: "canonical", href: question_url(@question) }
11 -cache_for(:question, @question.id, @question.user == current_user ? "owner" : "" ) do
12 %section{class: "main-question #{@question.id}", id: "question-#{@question.id}", item_scope: '', itemtype: "http://schema.org/Article"}
17 =" [#{t("closed", scope: "activerecord.attributes.question").upcase}]"
21 = t('activerecord.attributes.question.asked_by')
22 = render "users/user_mini", user: @question.user, author: true
23 %time{datetime: @question.created_at.iso8601, itemprop: "datePublished"}
24 = t("time.ago", time: time_ago_in_words(@question.created_at))
25 - if @question.updated_by
27 = t('global.edited_by')
28 = render "users/user_mini", user: @question.updated_by
30 %time{datetime: @question.updated_at.iso8601, itemprop: "dateModified"}
31 = link_to t("time.ago", time: time_ago_in_words(@question.updated_at)), history_question_path(@question), title: "#{t("questions.show.history")} (#{@question.versions_count})"
33 .description.markdown.clearfix
34 %div{itemprop: "articleBody"}
36 = render "reward_info"
37 = render "attachments", question: @question, attachments: @question.attachments, editing: false
41 - @question.tags.each do |tag|
44 - if logged_in? && (current_user.can_modify?(@question) || current_user.can_retag_others_questions_on?(current_group))
46 = link_to t('.retag'), retag_question_path(@question), class: 'retag-link'
48 %meta{itemprop: "keywords", content: @question.tags.join(",")}
49 %meta{itemprop: "inLanguage", content: @question.language}
50 %meta{itemprop: "interactionCount", content: "UserComments:#{@question.answers_count}"}
51 %meta{itemprop: "interactionCount", content: "UserPageVisits:#{@question.views_count}"}
56 =link_to "#{content_tag(:span, "NN", class: "counter")} comments".html_safe, "#", class: "toggle_comments"
57 -@question.comments.each do |comment|
58 -read = (@last_read_at && @last_read_at > comment.created_at && comment.votes_average < 2)
59 = render "comments/comment", comment: comment, source: question_path(@question), mini: true, read: read
62 = form_for [@question, @comment ||= Comment.new], remote: true, html: {class: "question_comment_form", data: {commentable: @question.id, editor: current_group.wysiwyg_editor ? 'wysiwyg_editor' : 'markdown_editor', "login-required" => true}} do |f|
64 = render "comments/form", f: f, commentable: @question, source: question_url(@question)
66 = f.submit t("comments.shared.comment_submit"), data: {"disable-with" => "Saving..."}
68 = link_to t('scaffold.cancel'), '', :class => 'cancel cancel_comment'
72 - source = question_path(@question)
73 = error_messages_for 'answer'
75 - if @question.closed && @question.close_reason.present?
78 = t(@question.close_reason.reason, scope: "close_requests.form")
79 - if !@question.close_reason.comment.empty?
82 =find_and_preserve(shapado_auto_link(@question.close_reason.comment))
83 - if !@answers.empty? || @question.accepted
84 -cache_for(:question_answers, @question.id) do
86 = t("questions.question.has_answers", count: @question.answers_count)
89 %ul.menubar{class: @active_subtab.to_s}
91 %label=t('global.sort_by')
93 = link_to t("questions.index.newest"), question_path(@question, sort: "newest", anchor: "answers"), rel: "nofollow", class: "pjax", data: {layout: "question"}
95 = link_to t("questions.index.votes"), question_path(@question, sort: "votes", anchor: "answers"), rel: "nofollow", class: "pjax", data: {layout: "question"}
97 = link_to t("questions.index.oldest"), question_path(@question, sort: "oldest", anchor: "answers"), rel: "nofollow", class: "pjax", data: {layout: "question"}
99 = link_to t('.solution')
101 -if @question.follow_up
104 = t("questions.show.follow_up_of")
105 = link_to @question.follow_up.original_question.title, question_path(@question.follow_up.original_question, anchor: @question.follow_up.original_answer_id), rel: 'nofollow'
107 -if @question.followed_up_by.limit(1).count > 0
108 %h1= t('global.followed_by')
110 -@question.followed_up_by.all.each do |child|
112 = link_to child.title, question_path(child)
114 - if !@answers.empty? || @question.accepted
116 - if @question.accepted
117 - solution = @question.answer
118 = render "answer", question: @question, answer: solution unless solution.nil?
120 - @answers.each do |answer|
121 - next if answer.id == @question.answer_id
122 = render "answer", {:question => @question, :answer => answer}
126 -if !@question.closed || !(logged_in? && current_user.can_answer_on?(current_group))
128 -if logged_in? && @question.answers.where(user_id: current_user.id).count > 0
133 = link_to "Add another answer", "#", id: "add_another_answer"
139 = render "answers/form", markdown: true, question: @question