Fix lints in app/views/answerbox
This commit is contained in:
parent
ed6528c948
commit
7b63efed6f
|
@ -1,41 +1,41 @@
|
||||||
%span.d-none.d-sm-inline.text-muted
|
%span.d-none.d-sm-inline.text-muted
|
||||||
- unless user_signed_in?
|
- unless user_signed_in?
|
||||||
- if a.smile_count > 0
|
- if a.smile_count.positive?
|
||||||
%button.btn.btn-info.btn-sm{name: 'ab-smile', disabled: true}
|
%button.btn.btn-info.btn-sm{ name: 'ab-smile', disabled: true }
|
||||||
%i.fa.fa-smile-o
|
%i.fa.fa-smile-o
|
||||||
%span{id: "ab-smile-count-#{a.id}"}= a.smile_count
|
%span{ id: "ab-smile-count-#{a.id}" }= a.smile_count
|
||||||
- if user_signed_in?
|
- if user_signed_in?
|
||||||
- if current_user.smiled? a
|
- if current_user.smiled? a
|
||||||
%button.btn.btn-link.answerbox__action{type: :button, name: 'ab-smile', data: { a_id: a.id, action: :unsmile }}
|
%button.btn.btn-link.answerbox__action{ type: :button, name: 'ab-smile', data: { a_id: a.id, action: :unsmile } }
|
||||||
%i.fa.fa-fw.fa-frown-o
|
%i.fa.fa-fw.fa-frown-o
|
||||||
%span{id: "ab-smile-count-#{a.id}"}= a.smile_count
|
%span{ id: "ab-smile-count-#{a.id}" }= a.smile_count
|
||||||
- else
|
- else
|
||||||
%button.btn.btn-link.answerbox__action{type: :button, name: 'ab-smile', data: { a_id: a.id, action: :smile }}
|
%button.btn.btn-link.answerbox__action{ type: :button, name: 'ab-smile', data: { a_id: a.id, action: :smile } }
|
||||||
%i.fa.fa-fw.fa-smile-o
|
%i.fa.fa-fw.fa-smile-o
|
||||||
%span{id: "ab-smile-count-#{a.id}"}= a.smile_count
|
%span{ id: "ab-smile-count-#{a.id}" }= a.smile_count
|
||||||
- unless @display_all
|
- unless display_all
|
||||||
%button.btn.btn-link.answerbox__action{type: :button, name: 'ab-comments', data: { a_id: a.id, state: :hidden }}
|
%button.btn.btn-link.answerbox__action{ type: :button, name: 'ab-comments', data: { a_id: a.id, state: :hidden } }
|
||||||
%i.fa.fa-fw.fa-comments
|
%i.fa.fa-fw.fa-comments
|
||||||
%span{id: "ab-comment-count-#{a.id}"}= a.comment_count
|
%span{ id: "ab-comment-count-#{a.id}" }= a.comment_count
|
||||||
- if user_signed_in?
|
- if user_signed_in?
|
||||||
.btn-group
|
.btn-group
|
||||||
%button.btn.btn-default.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }}
|
%button.btn.btn-default.btn-sm.dropdown-toggle{ data: { toggle: :dropdown }, aria: { expanded: false } }
|
||||||
%span.caret
|
%span.caret
|
||||||
.dropdown-menu.dropdown-menu-right{role: :menu}
|
.dropdown-menu.dropdown-menu-right{ role: :menu }
|
||||||
- if Subscription.is_subscribed(current_user, a)
|
- if Subscription.is_subscribed(current_user, a)
|
||||||
-# fun joke should subscribe?
|
-# fun joke should subscribe?
|
||||||
%a.dropdown-item{href: '#', data: { a_id: a.id, action: 'ab-submarine', torpedo: "no" }}
|
%a.dropdown-item{ href: '#', data: { a_id: a.id, action: 'ab-submarine', torpedo: 'no' } }
|
||||||
%i.fa.fa-anchor
|
%i.fa.fa-anchor
|
||||||
= t 'views.actions.unsubscribe'
|
= t 'views.actions.unsubscribe'
|
||||||
- else
|
- else
|
||||||
%a.dropdown-item{href: '#', data: { a_id: a.id, action: 'ab-submarine', torpedo: "yes" }}
|
%a.dropdown-item{ href: '#', data: { a_id: a.id, action: 'ab-submarine', torpedo: 'yes' } }
|
||||||
%i.fa.fa-anchor
|
%i.fa.fa-anchor
|
||||||
= t 'views.actions.subscribe'
|
= t 'views.actions.subscribe'
|
||||||
- if privileged? a.user
|
- if privileged? a.user
|
||||||
%a.dropdown-item.text-danger{href: '#', data: { a_id: a.id, action: 'ab-destroy' }}
|
%a.dropdown-item.text-danger{ href: '#', data: { a_id: a.id, action: 'ab-destroy' } }
|
||||||
%i.fa.fa-trash-o
|
%i.fa.fa-trash-o
|
||||||
= t 'views.actions.return'
|
= t 'views.actions.return'
|
||||||
- unless a.user == current_user
|
- unless a.user == current_user
|
||||||
%a.dropdown-item{href: '#', data: { a_id: a.id, action: 'ab-report' }}
|
%a.dropdown-item{ href: '#', data: { a_id: a.id, action: 'ab-report' } }
|
||||||
%i.fa.fa-exclamation-triangle
|
%i.fa.fa-exclamation-triangle
|
||||||
= t 'views.actions.report'
|
= t 'views.actions.report'
|
|
@ -1,52 +1,53 @@
|
||||||
- if a.comments.all.count == 0
|
- if a.comments.all.count.zero?
|
||||||
= t 'views.answerbox.no_comment'
|
= t 'views.answerbox.no_comment'
|
||||||
- else
|
- else
|
||||||
%ul.comment__container
|
%ul.comment__container
|
||||||
- a.comments.order(:created_at).each do |comment|
|
- a.comments.order(:created_at).each do |comment|
|
||||||
%li.comment{data: { comment_id: comment.id }}
|
%li.comment{ data: { comment_id: comment.id } }
|
||||||
%div{class: "ab-comment-smile-list", style: "height: 0; width: 0"}= render "modal/comment_smiles", comment: comment
|
%div{ style: 'height: 0; width: 0' }= render 'modal/comment_smiles', comment: comment
|
||||||
.media
|
.media
|
||||||
.pull-left
|
.pull-left
|
||||||
%img.comment__user-avatar.avatar-sm{src: comment.user.profile_picture.url(:medium)}
|
%img.comment__user-avatar.avatar-sm{ src: comment.user.profile_picture.url(:medium) }
|
||||||
.media-body
|
.media-body
|
||||||
%h6.media-heading.comment__user
|
%h6.media-heading.comment__user
|
||||||
= user_screen_name comment.user
|
= user_screen_name comment.user
|
||||||
%span.text-muted{title: comment.created_at, data: { toggle: :tooltip, placement: :right }}
|
%span.text-muted{ title: comment.created_at, data: { toggle: :tooltip, placement: :right } }
|
||||||
= "#{time_ago_in_words(comment.created_at)} ago"
|
= time_ago_in_words(comment.created_at)
|
||||||
|
ago
|
||||||
.comment__content
|
.comment__content
|
||||||
= markdown comment.content
|
= markdown comment.content
|
||||||
.pull-right
|
.pull-right
|
||||||
%span.d-none.d-sm-inline.text-muted
|
%span.d-none.d-sm-inline.text-muted
|
||||||
- unless user_signed_in?
|
- unless user_signed_in?
|
||||||
- if comment.smile_count > 0
|
- if comment.smile_count.positive?
|
||||||
%button.btn.btn-link.answerbox__action{name: 'ab-smile-comment', disabled: true}
|
%button.btn.btn-link.answerbox__action{ name: 'ab-smile-comment', disabled: true }
|
||||||
%i.fa.fa-smile-o
|
%i.fa.fa-smile-o
|
||||||
%span{id: "ab-comment-smile-count-#{comment.id}"}= comment.smile_count
|
%span{ id: "ab-comment-smile-count-#{comment.id}" }= comment.smile_count
|
||||||
- if user_signed_in?
|
- if user_signed_in?
|
||||||
- if current_user.smiled_comment? comment
|
- if current_user.smiled_comment? comment
|
||||||
%button.btn.btn-link.answerbox__action{type: :button, name: 'ab-smile-comment', data: { c_id: comment.id, action: :unsmile }}
|
%button.btn.btn-link.answerbox__action{ type: :button, name: 'ab-smile-comment', data: { c_id: comment.id, action: :unsmile } }
|
||||||
%i.fa.fa-fw.fa-frown-o
|
%i.fa.fa-fw.fa-frown-o
|
||||||
%span{id: "ab-comment-smile-count-#{comment.id}"}= comment.smile_count
|
%span{ id: "ab-comment-smile-count-#{comment.id}" }= comment.smile_count
|
||||||
- else
|
- else
|
||||||
%button.btn.btn-link.answerbox__action{type: :button, name: 'ab-smile-comment', data: { c_id: comment.id, action: :smile }}
|
%button.btn.btn-link.answerbox__action{ type: :button, name: 'ab-smile-comment', data: { c_id: comment.id, action: :smile } }
|
||||||
%i.fa.fa-fw.fa-smile-o
|
%i.fa.fa-fw.fa-smile-o
|
||||||
%span{id: "ab-comment-smile-count-#{comment.id}"}= comment.smile_count
|
%span{ id: "ab-comment-smile-count-#{comment.id}" }= comment.smile_count
|
||||||
.btn-group
|
.btn-group
|
||||||
%button.btn.btn-link.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }}
|
%button.btn.btn-link.btn-sm.dropdown-toggle{ data: { toggle: :dropdown }, aria: { expanded: false } }
|
||||||
%span.caret
|
%span.caret
|
||||||
.dropdown-menu.dropdown-menu-right{role: :menu}
|
.dropdown-menu.dropdown-menu-right{ role: :menu }
|
||||||
%a.dropdown-item{href: '#', type: :button, data: { target: "#modal-view-comment#{comment.id}-smiles", toggle: :modal}}
|
%a.dropdown-item{ href: '#', type: :button, data: { target: "#modal-view-comment#{comment.id}-smiles", toggle: :modal } }
|
||||||
%i.fa.fa-smile-o
|
%i.fa.fa-smile-o
|
||||||
= t 'views.actions.view'
|
= t 'views.actions.view'
|
||||||
- if privileged?(comment.user) or privileged?(a.user)
|
- if privileged?(comment.user) || privileged?(a.user)
|
||||||
%a.dropdown-item.text-danger{href: '#', data: { action: 'ab-comment-destroy', c_id: comment.id }}
|
%a.dropdown-item.text-danger{ href: '#', data: { action: 'ab-comment-destroy', c_id: comment.id } }
|
||||||
%i.fa.fa-trash-o
|
%i.fa.fa-trash-o
|
||||||
= t 'views.actions.delete'
|
= t 'views.actions.delete'
|
||||||
- unless comment.user == current_user
|
- unless comment.user == current_user
|
||||||
%a.dropdown-item{href: '#', data: { action: 'ab-comment-report', c_id: comment.id }}
|
%a.dropdown-item{ href: '#', data: { action: 'ab-comment-report', c_id: comment.id } }
|
||||||
%i.fa.fa-exclamation-triangle
|
%i.fa.fa-exclamation-triangle
|
||||||
= t 'views.acions.report'
|
= t 'views.acions.report'
|
||||||
- if user_signed_in?
|
- if user_signed_in?
|
||||||
.form-group.has-feedback.comment__input-group{name: 'ab-comment-new-group', data: { a_id: a.id }}
|
.form-group.has-feedback.comment__input-group{ name: 'ab-comment-new-group', data: { a_id: a.id } }
|
||||||
%input.form-control.comment__input{type: :text, placeholder: t('views.placeholder.comment'), name: 'ab-comment-new', data: {a_id: a.id }}
|
%input.form-control.comment__input{ type: :text, placeholder: t('views.placeholder.comment'), name: 'ab-comment-new', data: { a_id: a.id } }
|
||||||
%span.text-muted.form-control-feedback.comment__character-count{id: "ab-comment-charcount-#{a.id}"} 160
|
%span.text-muted.form-control-feedback.comment__character-count{ id: "ab-comment-charcount-#{a.id}" } 160
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
.card-header
|
.card-header
|
||||||
.media
|
.media
|
||||||
- unless a.question.author_is_anonymous
|
- unless a.question.author_is_anonymous
|
||||||
%a.pull-left{href: show_user_profile_path(a.question.user.screen_name)}
|
%a.pull-left{ href: show_user_profile_path(a.question.user.screen_name) }
|
||||||
%img.answerbox__question-user-avatar.avatar-md{src: a.question.user.profile_picture.url(:medium)}
|
%img.answerbox__question-user-avatar.avatar-md{ src: a.question.user.profile_picture.url(:medium) }
|
||||||
.media-body
|
.media-body
|
||||||
- if user_signed_in?
|
- if user_signed_in?
|
||||||
.pull-right
|
.pull-right
|
||||||
.btn-group
|
.btn-group
|
||||||
%button.btn.btn-link.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }}
|
%button.btn.btn-link.btn-sm.dropdown-toggle{ data: { toggle: :dropdown }, aria: { expanded: false } }
|
||||||
%span.caret
|
%span.caret
|
||||||
.dropdown-menu.dropdown-menu-right{role: :menu}
|
.dropdown-menu.dropdown-menu-right{ role: :menu }
|
||||||
- if current_user.mod? or a.question.user == current_user
|
- if current_user.mod? || a.question.user == current_user
|
||||||
%a.dropdown-item.text-danger{href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: a.question.id }}
|
%a.dropdown-item.text-danger{ href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: a.question.id } }
|
||||||
%i.fa.fa-trash-o
|
%i.fa.fa-trash-o
|
||||||
= t 'views.actions.delete'
|
= t 'views.actions.delete'
|
||||||
- unless a.question.user == current_user
|
- unless a.question.user == current_user
|
||||||
%a.dropdown-item{href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: a.question.id }}
|
%a.dropdown-item{ href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: a.question.id } }
|
||||||
%i.fa.fa-exclamation-triangle
|
%i.fa.fa-exclamation-triangle
|
||||||
= t 'views.actions.report'
|
= t 'views.actions.report'
|
||||||
%h6.text-muted.media-heading.answerbox__question-user
|
%h6.text-muted.media-heading.answerbox__question-user
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
- unless a.question.author_is_anonymous
|
- unless a.question.author_is_anonymous
|
||||||
- if a.question.answer_count > 1
|
- if a.question.answer_count > 1
|
||||||
·
|
·
|
||||||
%a{href: show_user_question_path(a.question.user.screen_name, a.question.id)}
|
%a{ href: show_user_question_path(a.question.user.screen_name, a.question.id) }
|
||||||
= pluralize(a.question.answer_count, t('views.general.answer'))
|
= pluralize(a.question.answer_count, t('views.general.answer'))
|
||||||
.answerbox__question-text
|
.answerbox__question-text
|
||||||
= a.question.content
|
= a.question.content
|
|
@ -2,9 +2,11 @@
|
||||||
.pull-left
|
.pull-left
|
||||||
%i.fa.fa-smile-o
|
%i.fa.fa-smile-o
|
||||||
.media-body
|
.media-body
|
||||||
- if a.smiles.all.count == 0
|
- if a.smiles.all.count.zero?
|
||||||
= t 'views.answerbox.no_smile'
|
= t 'views.answerbox.no_smile'
|
||||||
- else
|
- else
|
||||||
- a.smiles.all.each do |smile|
|
- a.smiles.all.each do |smile|
|
||||||
%a{href: show_user_profile_path(smile.user.screen_name), title: smile.user.screen_name, data: { toggle: :tooltip, placement: :top, smile_id: smile.id }}
|
%a{ href: show_user_profile_path(smile.user.screen_name),
|
||||||
%img.avatar-xs{src: smile.user.profile_picture.url(:medium)}
|
title: smile.user.screen_name,
|
||||||
|
data: { toggle: :tooltip, placement: :top, smile_id: smile.id } }
|
||||||
|
%img.avatar-xs{ src: smile.user.profile_picture.url(:medium) }
|
||||||
|
|
Loading…
Reference in New Issue