Retrospring/app/views/question/show.html.haml

58 lines
2.6 KiB
Plaintext
Raw Normal View History

2015-04-26 04:15:03 -07:00
.panel.panel-question
.panel-body
.media.question-media
- unless @question.author_is_anonymous
%a.pull-left{href: show_user_profile_path(@question.user.screen_name)}
%img.img-rounded.answerbox--img{src: gravatar_url(@question.user)}
.media-body.question-body
- if user_signed_in?
.pull-right
2015-04-25 17:46:37 -07:00
.btn-group
%button.btn.btn-link.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }}
%span.caret
%ul.dropdown-menu.dropdown-menu-right{role: :menu}
2015-04-25 18:36:25 -07:00
- if current_user.mod? or @question.user == current_user
%li.text-danger
%a{href: '#', data: { action: 'ab-question-destroy', q_id: @question.id, redirect: '/' }}
%i.fa.fa-trash-o
2015-04-25 18:36:25 -07:00
Delete Question
- unless @question.user == current_user
%li
%a{href: '#', data: { action: 'ab-question-report', q_id: @question.id }}
%i.fa.fa-exclamation-triangle
Report
2015-04-25 17:46:37 -07:00
%h6.text-muted.media-heading.answerbox--question-user
= user_screen_name @question.user, @question.author_is_anonymous
asked
%span{title: @question.created_at, data: { toggle: :tooltip, placement: :bottom }}
= time_ago_in_words(@question.created_at)
ago
%p.answerbox--question-text= @question.content
.container.question-page
2014-12-07 11:51:44 -08:00
/ TODO: make this pretty (it's currently C-c'd straight from shared/_answerbox)
2015-01-03 10:14:26 -08:00
#answers
- @answers.each do |a|
= render 'shared/answerbox', a: a, show_question: false
2015-01-03 10:02:06 -08:00
2015-01-03 10:24:51 -08:00
#pagination= will_paginate @answers, renderer: BootstrapPagination::Rails, page_links: false
- if @answers.next_page
%button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @answers.current_page }}
Load more
- if user_signed_in? and !current_user.answered? @question and current_user != @question.user and @question.user.privacy_allow_stranger_answers
2015-01-03 09:57:30 -08:00
.panel.panel-default#q-answer-box
.panel-heading
%h3.panel-title This question was not in your inbox? Answer it here!
.panel-body
%textarea#q-answer.form-control{placeholder: 'Write your answer here...', data: { id: @question.id }}
%br/
%button#q-answer.btn.btn-success{data: { q_id: @question.id }}
Answer
- current_user.services.each do |service|
%label
%input{type: 'checkbox', name: 'share', checked: :checked, data: { q_id: @question.id, service: service.provider }}
Post to
= service.provider.capitalize