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

35 lines
1.4 KiB
Plaintext

.container.j2-page
= render 'layouts/messages'
- @inbox.each do |i|
.panel.inbox-box{class: "panel-#{i.new? ? 'primary' : 'default'}", data: { id: i.id }}
.panel-heading
.media
- unless i.question.author_is_anonymous
%a.pull-left{href: show_user_profile_path(i.question.user.screen_name)}
%img.img-rounded.img-answerbox{src: gravatar_url(i.question.user)}
.media-body
%h6.text-muted.media-heading.answerbox-question-user
= user_screen_name i.question.user, i.question.author_is_anonymous
asked
= time_ago_in_words(i.question.created_at)
ago
- unless i.question.author_is_anonymous
- if i.question.answer_count > 0
·
%a{href: show_user_question_path(i.question.user.screen_name, i.question.id)}
#{i.question.answer_count} response(s)
%p.answerbox-question-text= i.question.content
.panel-body
%textarea.form-control{name: 'ib-answer', data: { id: i.id }}
%br/
%button.btn.btn-success{name: 'ib-answer', data: { id: i.id }}
Answer
%button.btn.btn-danger{name: 'ib-destroy', data: { id: i.id }}
Delete
- if @inbox.empty?
Nothing to see here.
= render "shared/links"
- @inbox.update_all(new: false)