added comment text input box thing

This commit is contained in:
nilsding 2014-12-05 20:17:44 +01:00
parent 668b032a25
commit c276b6aacf
3 changed files with 13 additions and 5 deletions

View File

@ -98,3 +98,7 @@ body {
.panel-primary .answerbox-question-text { .panel-primary .answerbox-question-text {
color: #fff; color: #fff;
} }
.comment-count {
margin-top: -2em;
}

View File

@ -30,4 +30,4 @@
.col-md-6.col-md-offset-6.col-sm-8.col-sm-offset-4.col-xs-6.col-xs-offset-6.text-right .col-md-6.col-md-offset-6.col-sm-8.col-sm-offset-4.col-xs-6.col-xs-offset-6.text-right
= render 'shared/answerbox_buttons', a: a = render 'shared/answerbox_buttons', a: a
.panel-footer{id: "ab-comments-#{a.id}", style: 'display: none'} .panel-footer{id: "ab-comments-#{a.id}", style: 'display: none'}
= render 'shared/comments', comments: a.comments = render 'shared/comments', a: a

View File

@ -1,8 +1,12 @@
- if comments.all.count == 0 - if a.comments.all.count == 0
There are no comments yet. There are no comments yet.
- else # TODO: some design guy (i.e. pixeldesu) should make some black magic here - else # TODO: some design guy (i.e. pixeldesu) should make some black magic here
%ul %ul
- comments.all.each do |comment| - a.comments.all.each do |comment|
%li %li{'data-comment-id' => comment.id}
#{user_screen_name comment.user}: #{user_screen_name comment.user}:
= comment.content = comment.content
- if user_signed_in?
.form-group.has-feedback
%input.form-control{type: :text, placeholder: 'Comment...', id: "ab-comments-#{a.id}-new"}
%span.text-muted.form-control-feedback.comment-count{id: "ab-comments-#{a.id}-charcount"} 160