diff --git a/app/views/shared/_answerbox.html.haml b/app/views/shared/_answerbox.html.haml new file mode 100644 index 00000000..083b12d0 --- /dev/null +++ b/app/views/shared/_answerbox.html.haml @@ -0,0 +1,11 @@ +.panel.panel-default.answer-box{'data-id' => a.id} + .panel-body + %p + %strong= a.question.content + %small= user_screen_name a.question.user, a.question.author_is_anonymous + %hr/ + %p= a.content + %br/ + - if privileged? + %button.btn.btn-danger{name: 'ab-destroy', 'data-a-id' => a.id} + Delete \ No newline at end of file diff --git a/app/views/user/show.html.haml b/app/views/user/show.html.haml index b7a55725..3e3400b8 100644 --- a/app/views/user/show.html.haml +++ b/app/views/user/show.html.haml @@ -27,11 +27,5 @@ .col-md-9.col-xs-12.col-sm-9 = render 'shared/questionbox' - @answers.each do |a| - .panel.panel-default - .panel-body - %p - %strong= a.question.content - %small= user_screen_name a.question.user, a.question.author_is_anonymous - %hr/ - %p= a.content + = render 'shared/answerbox', a: a .visible-xs= render 'shared/links'