Merge pull request #106 from Retrospring/feature/haml-lint

This commit is contained in:
Andreas Nedbal 2020-05-13 21:10:41 +02:00 committed by GitHub
commit 224fdfaaaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
141 changed files with 1173 additions and 942 deletions

View File

@ -67,6 +67,8 @@ jobs:
env:
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
REDIS_URL: "redis://localhost:${{ job.services.redis.ports[6379] }}"
- name: Lint HAML templates
run: bundle exec haml-lint app/views
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

130
.haml-lint.yml Normal file
View File

@ -0,0 +1,130 @@
skip_frontmatter: false
linters:
AlignmentTabs:
enabled: true
AltText:
enabled: false
ClassAttributeWithStaticValue:
enabled: true
ClassesBeforeIds:
enabled: true
ConsecutiveComments:
enabled: true
max_consecutive: 1
ConsecutiveSilentScripts:
enabled: true
max_consecutive: 2
EmptyObjectReference:
enabled: true
EmptyScript:
enabled: true
FinalNewline:
enabled: true
present: true
HtmlAttributes:
enabled: true
IdNames:
enabled: true
style: lisp_case
ImplicitDiv:
enabled: true
Indentation:
enabled: true
character: space # or tab
width: 2 # ignored if character == tab
InlineStyles:
enabled: false
InstanceVariables:
enabled: true
file_types: partials
matchers:
all: .*
partials: \A_.*\.haml\z
LeadingCommentSpace:
enabled: true
LineLength:
enabled: true
max: 160
MultilinePipe:
enabled: true
MultilineScript:
enabled: true
ObjectReferenceAttributes:
enabled: true
RepeatedId:
enabled: true
severity: error
RuboCop:
enabled: true
# These cops are incredibly noisy when it comes to HAML templates, so we
# ignore them.
ignored_cops:
- Lint/BlockAlignment
- Lint/EndAlignment
- Lint/Void
- Layout/AlignParameters
- Layout/EmptyLineAfterGuardClause
- Layout/IndentationWidth
- Layout/TrailingEmptyLines
- Layout/TrailingWhitespace
- Metrics/BlockLength
- Metrics/BlockNesting
- Metrics/LineLength
- Style/BlockNesting
- Style/ElseAlignment
- Style/EndOfLine
- Style/FileName
- Style/FinalNewline
- Style/FrozenStringLiteralComment
- Style/IdenticalConditionalBranches
- Style/IfUnlessModifier
- Style/Next
- Style/WhileUntilModifier
RubyComments:
enabled: true
SpaceBeforeScript:
enabled: true
SpaceInsideHashAttributes:
enabled: true
style: space
TagName:
enabled: true
TrailingWhitespace:
enabled: true
UnnecessaryInterpolation:
enabled: true
UnnecessaryStringOutput:
enabled: true
ViewLength:
enabled: true
max: 200

View File

@ -1,6 +1,5 @@
AllCops:
Rails:
Enabled: true
NewCops: enable
Exclude:
- 'vendor/**/*'
- 'db/schema.rb'

View File

@ -106,4 +106,5 @@ group :development, :test do
gem 'guard-brakeman'
gem 'timecop'
gem 'rails-controller-testing'
gem 'haml_lint', require: false
end

View File

@ -68,6 +68,7 @@ GEM
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
arel (9.0.0)
ast (2.4.0)
autoprefixer-rails (9.7.6)
execjs
bcrypt (3.1.13)
@ -197,6 +198,11 @@ GEM
haml (5.1.2)
temple (>= 0.8.0)
tilt
haml_lint (0.35.0)
haml (>= 4.0, < 5.2)
rainbow
rubocop (>= 0.50.0)
sysexits (~> 1.1)
hashie (4.1.0)
http (4.4.1)
addressable (~> 2.3)
@ -217,6 +223,7 @@ GEM
i18n-js (3.0.0.rc10)
i18n (~> 0.6)
ipaddress (0.8.3)
jaro_winkler (1.5.4)
jbuilder (2.10.0)
activesupport (>= 5.0.0)
jquery-minicolors-rails (2.2.6.2)
@ -310,6 +317,9 @@ GEM
mime-types
mimemagic (~> 0.3.0)
terrapin (~> 0.6.0)
parallel (1.19.1)
parser (2.7.1.2)
ast (~> 2.4.0)
pg (1.2.3)
pghero (2.4.2)
activerecord (>= 5)
@ -378,6 +388,7 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
raindrops (0.19.1)
rake (13.0.1)
rb-fsevent (0.10.3)
@ -390,6 +401,7 @@ GEM
responders (3.0.0)
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.4)
rolify (5.2.0)
rspec-core (3.9.1)
rspec-support (~> 3.9.1)
@ -414,6 +426,14 @@ GEM
rspec-core (~> 3.0, >= 3.0.0)
sidekiq (>= 2.4.0)
rspec-support (3.9.2)
rubocop (0.82.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
rexml
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
ruby-progressbar (1.10.1)
sanitize (5.1.0)
crass (~> 1.0.2)
@ -464,6 +484,7 @@ GEM
sprockets (>= 3.0.0)
sweetalert-rails (1.1.3)
railties (>= 3.1.0)
sysexits (1.2.0)
temple (0.8.2)
terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0)
@ -493,6 +514,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
unicorn (5.5.4)
kgio (~> 2.6)
raindrops (~> 0.7)
@ -539,6 +561,7 @@ DEPENDENCIES
foreman
guard-brakeman
haml (~> 5.0)
haml_lint
httparty
i18n-js (= 3.0.0.rc10)
jbuilder (~> 2.10)

View File

@ -22,7 +22,7 @@
btn.button "reset"
($ document).on "click", "button#ib-author", ->
$('#author_form').submit ->
$('#author-form').submit ->
query = $('#author').val()
window.location.href = '/inbox/' + query
false

View File

@ -1,15 +1,15 @@
$(document).on "keydown", "textarea#q-answer", (evt) ->
$(document).on "keydown", "textarea#q-answer-text", (evt) ->
qid = $(this)[0].dataset.id
if evt.keyCode == 13 and evt.ctrlKey
# trigger warning:
$("button#q-answer").trigger 'click'
$("button#q-answer-btn").trigger 'click'
$(document).on "click", "button#q-answer", ->
$(document).on "click", "button#q-answer-btn", ->
btn = $(this)
btn.button "loading"
qid = btn[0].dataset.qId
$("textarea#q-answer").attr "readonly", "readonly"
$("textarea#q-answer-text").attr "readonly", "readonly"
shareTo = []
($ "input[type=checkbox][name=share][data-q-id=#{qid}]:checked").each (i, share) ->
@ -21,7 +21,7 @@ $(document).on "click", "button#q-answer", ->
dataType: 'json'
data:
id: qid
answer: $("textarea#q-answer[data-id=#{qid}]").val()
answer: $("textarea#q-answer-text[data-id=#{qid}]").val()
share: JSON.stringify shareTo
inbox: false
success: (data, status, jqxhr) ->
@ -34,4 +34,4 @@ $(document).on "click", "button#q-answer", ->
showNotification translate('frontend.error.message'), false
complete: (jqxhr, status) ->
btn.button "reset"
$("textarea#q-answer").removeAttr "readonly"
$("textarea#q-answer-text").removeAttr "readonly"

View File

@ -0,0 +1,37 @@
- provide(:title, generate_title('Edit announcement'))
.container.container--main
.card
.card-body
= bootstrap_form_for(@announcement, url: { action: 'update' }, method: 'PATCH') do |f|
- if @announcement.errors.any?
.row
.col-md-12
.alert.alert-danger
%strong
= pluralize(@announcement.errors.count, 'error')
prohibited this announcement from being saved:
%ul
- @announcement.errors.full_messages.each do |err|
%li= err
.row
.col-md-12
= f.text_area :content, label: 'Content'
.row
.col-md-6
= f.url_field :link_href, label: 'Link URL'
.col-md-6
= f.text_field :link_text, label: 'Link text'
.row
.col-md-6
= f.datetime_field :starts_at,
label: 'Start time',
class: 'datetimepicker-input',
data: { toggle: 'datetimepicker', target: '#announcement_starts_at', 'date-format': 'YYYY-MM-DD hh:mm A' }
.col-md-6
= f.datetime_field :ends_at,
label: 'End time',
class: 'datetimepicker-input',
data: { toggle: 'datetimepicker', target: '#announcement_ends_at', 'date-format': 'YYYY-MM-DD hh:mm A' }
.row
.col-md-12.text-right
= f.submit class: 'btn btn-primary'

View File

@ -1,31 +0,0 @@
- provide(:title, generate_title("Edit announcement"))
.container.container--main
.card
.card-body
= bootstrap_form_for(@announcement, url: {action: "update"}, method: "PATCH") do |f|
- if @announcement.errors.any?
.row
.col-md-12
.alert.alert-danger
%strong
= pluralize(@announcement.errors.count, "error")
prohibited this announcement from being saved:
%ul
- @announcement.errors.full_messages.each do |err|
%li= err
.row
.col-md-12
= f.text_area :content, label: "Content"
.row
.col-md-6
= f.url_field :link_href, label: "Link URL"
.col-md-6
= f.text_field :link_text, label: "Link text"
.row
.col-md-6
= f.datetime_field :starts_at, label: "Start time", class: "datetimepicker-input", data: { toggle: "datetimepicker", target: "#announcement_starts_at", "date-format": "YYYY-MM-DD hh:mm A" }
.col-md-6
= f.datetime_field :ends_at, label: "End time", class: "datetimepicker-input", data: { toggle: "datetimepicker", target: "#announcement_ends_at", "date-format": "YYYY-MM-DD hh:mm A" }
.row
.col-md-12.text-right
= f.submit class: "btn btn-primary"

View File

@ -0,0 +1,20 @@
- provide(:title, generate_title('Announcements'))
.container.container--main
- @announcements.each do |announcement|
.card
.card-body
.d-flex.w-100.justify-content-between
%p.mb-3= announcement.content
%small.text-muted= announcement.starts_at
.d-flex.w-100
= link_to 'Edit', announcement_edit_path(id: announcement.id), class: 'btn btn-link text-primary'
= button_to 'Delete',
announcement_destroy_path(id: announcement.id),
method: :delete,
class: 'btn btn-link text-danger',
confirm: 'Are you sure you want to delete this announcement?'
.row
.col-md-12
= link_to 'Add new', :announcement_new, class: 'btn btn-primary'

View File

@ -1,16 +0,0 @@
- provide(:title, generate_title("Announcements"))
.container.container--main
- @announcements.each do |announcement|
.card
.card-body
.d-flex.w-100.justify-content-between
%p.mb-3= announcement.content
%small.text-muted= announcement.starts_at
.d-flex.w-100
= link_to "Edit", announcement_edit_path(id: announcement.id), class: 'btn btn-link text-primary'
= button_to "Delete", announcement_destroy_path(id: announcement.id), method: :delete, class: 'btn btn-link text-danger', confirm: 'Are you sure you want to delete this announcement?'
.row
.col-md-12
= link_to "Add new", :announcement_new, class: "btn btn-primary"

View File

@ -0,0 +1,37 @@
- provide(:title, generate_title('Add new announcement'))
.container.container--main
.card
.card-body
= bootstrap_form_for(@announcement, url: { action: 'create' }) do |f|
- if @announcement.errors.any?
.row
.col-md-12
.alert.alert-danger
%strong
= pluralize(@announcement.errors.count, 'error')
prohibited this announcement from being saved:
%ul
- @announcement.errors.full_messages.each do |err|
%li= err
.row
.col-md-12
= f.text_area :content, label: 'Content'
.row
.col-md-6
= f.url_field :link_href, label: 'Link URL'
.col-md-6
= f.text_field :link_text, label: 'Link text'
.row
.col-md-6
= f.datetime_field :starts_at,
label: 'Start time',
class: 'datetimepicker-input',
data: { toggle: 'datetimepicker', target: '#announcement_starts_at', 'date-format': 'YYYY-MM-DD hh:mm A' }
.col-md-6
= f.datetime_field :ends_at,
label: 'End time',
class: 'datetimepicker-input',
data: { toggle: 'datetimepicker', target: '#announcement_ends_at', 'date-format': 'YYYY-MM-DD hh:mm A' }
.row
.col-md-12.text-right
= f.submit class: 'btn btn-primary'

View File

@ -1,31 +0,0 @@
- provide(:title, generate_title("Add new announcement"))
.container.container--main
.card
.card-body
= bootstrap_form_for(@announcement, url: {action: "create"}) do |f|
- if @announcement.errors.any?
.row
.col-md-12
.alert.alert-danger
%strong
= pluralize(@announcement.errors.count, "error")
prohibited this announcement from being saved:
%ul
- @announcement.errors.full_messages.each do |err|
%li= err
.row
.col-md-12
= f.text_area :content, label: "Content"
.row
.col-md-6
= f.url_field :link_href, label: "Link URL"
.col-md-6
= f.text_field :link_text, label: "Link text"
.row
.col-md-6
= f.datetime_field :starts_at, label: "Start time", class: "datetimepicker-input", data: { toggle: "datetimepicker", target: "#announcement_starts_at", "date-format": "YYYY-MM-DD hh:mm A" }
.col-md-6
= f.datetime_field :ends_at, label: "End time", class: "datetimepicker-input", data: { toggle: "datetimepicker", target: "#announcement_ends_at", "date-format": "YYYY-MM-DD hh:mm A" }
.row
.col-md-12.text-right
= f.submit class: "btn btn-primary"

View File

@ -1,3 +1,3 @@
- provide(:title, answer_title(@answer))
.container.container--main
= render 'answerbox', a: @answer
= render 'answerbox', a: @answer, display_all: @display_all

View File

@ -1,41 +1,41 @@
%span.d-none.d-sm-inline.text-muted
- unless user_signed_in?
- if a.smile_count > 0
%button.btn.btn-info.btn-sm{name: 'ab-smile', disabled: true}
- if a.smile_count.positive?
%button.btn.btn-info.btn-sm{ name: 'ab-smile', disabled: true }
%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 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
%span{id: "ab-smile-count-#{a.id}"}= a.smile_count
%span{ id: "ab-smile-count-#{a.id}" }= a.smile_count
- 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
%span{id: "ab-smile-count-#{a.id}"}= a.smile_count
- unless @display_all
%button.btn.btn-link.answerbox__action{type: :button, name: 'ab-comments', data: { a_id: a.id, state: :hidden }}
%span{ id: "ab-smile-count-#{a.id}" }= a.smile_count
- unless display_all
%button.btn.btn-link.answerbox__action{ type: :button, name: 'ab-comments', data: { a_id: a.id, state: :hidden } }
%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?
.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
.dropdown-menu.dropdown-menu-right{role: :menu}
.dropdown-menu.dropdown-menu-right{ role: :menu }
- if Subscription.is_subscribed(current_user, a)
-# 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
= t 'views.actions.unsubscribe'
- 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
= t 'views.actions.subscribe'
- 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
= t 'views.actions.return'
- 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
= t 'views.actions.report'
= t 'views.actions.report'

View File

@ -1,52 +1,53 @@
- if a.comments.all.count == 0
- if a.comments.all.count.zero?
= t 'views.answerbox.no_comment'
- else
%ul.comment__container
- a.comments.order(:created_at).each do |comment|
%li.comment{data: { comment_id: comment.id }}
%div{class: "ab-comment-smile-list", style: "height: 0; width: 0"}= render "modal/comment_smiles", comment: comment
%li.comment{ data: { comment_id: comment.id } }
%div{ style: 'height: 0; width: 0' }= render 'modal/comment_smiles', comment: comment
.media
.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
%h6.media-heading.comment__user
= user_screen_name comment.user
%span.text-muted{title: comment.created_at, data: { toggle: :tooltip, placement: :right }}
= "#{time_ago_in_words(comment.created_at)} ago"
%span.text-muted{ title: comment.created_at, data: { toggle: :tooltip, placement: :right } }
= time_ago_in_words(comment.created_at)
ago
.comment__content
= markdown comment.content
.pull-right
%span.d-none.d-sm-inline.text-muted
- unless user_signed_in?
- if comment.smile_count > 0
%button.btn.btn-link.answerbox__action{name: 'ab-smile-comment', disabled: true}
- if comment.smile_count.positive?
%button.btn.btn-link.answerbox__action{ name: 'ab-smile-comment', disabled: true }
%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 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
%span{id: "ab-comment-smile-count-#{comment.id}"}= comment.smile_count
%span{ id: "ab-comment-smile-count-#{comment.id}" }= comment.smile_count
- 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
%span{id: "ab-comment-smile-count-#{comment.id}"}= comment.smile_count
%span{ id: "ab-comment-smile-count-#{comment.id}" }= comment.smile_count
.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
.dropdown-menu.dropdown-menu-right{role: :menu}
%a.dropdown-item{href: '#', type: :button, data: { target: "#modal-view-comment#{comment.id}-smiles", toggle: :modal}}
.dropdown-menu.dropdown-menu-right{ role: :menu }
%a.dropdown-item{ href: '#', type: :button, data: { target: "#modal-view-comment#{comment.id}-smiles", toggle: :modal } }
%i.fa.fa-smile-o
= t 'views.actions.view'
- if privileged?(comment.user) or privileged?(a.user)
%a.dropdown-item.text-danger{href: '#', data: { action: 'ab-comment-destroy', c_id: comment.id }}
- if privileged?(comment.user) || privileged?(a.user)
%a.dropdown-item.text-danger{ href: '#', data: { action: 'ab-comment-destroy', c_id: comment.id } }
%i.fa.fa-trash-o
= t 'views.actions.delete'
- 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
= t 'views.acions.report'
- if user_signed_in?
.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 }}
%span.text-muted.form-control-feedback.comment__character-count{id: "ab-comment-charcount-#{a.id}"} 160
.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 } }
%span.text-muted.form-control-feedback.comment__character-count{ id: "ab-comment-charcount-#{a.id}" } 160

View File

@ -1,21 +1,21 @@
.card-header
.media
- unless a.question.author_is_anonymous
%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)}
%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) }
.media-body
- if user_signed_in?
.pull-right
.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
.dropdown-menu.dropdown-menu-right{role: :menu}
- if current_user.mod? or a.question.user == current_user
%a.dropdown-item.text-danger{href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: a.question.id }}
.dropdown-menu.dropdown-menu-right{ role: :menu }
- 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 } }
%i.fa.fa-trash-o
= t 'views.actions.delete'
- 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
= t 'views.actions.report'
%h6.text-muted.media-heading.answerbox__question-user
@ -23,7 +23,7 @@
- unless a.question.author_is_anonymous
- 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'))
.answerbox__question-text
= a.question.content
= a.question.content

View File

@ -2,9 +2,11 @@
.pull-left
%i.fa.fa-smile-o
.media-body
- if a.smiles.all.count == 0
- if a.smiles.all.count.zero?
= t 'views.answerbox.no_smile'
- else
- 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 }}
%img.avatar-xs{src: smile.user.profile_picture.url(:medium)}
%a{ href: show_user_profile_path(smile.user.screen_name),
title: smile.user.screen_name,
data: { toggle: :tooltip, placement: :top, smile_id: smile.id } }
%img.avatar-xs{ src: smile.user.profile_picture.url(:medium) }

View File

@ -1,14 +1,15 @@
.card.answerbox{data: { id: a.id, q_id: a.question.id }}
- display_all ||= nil
.card.answerbox{ data: { id: a.id, q_id: a.question.id } }
- if @question.nil?
= render "answerbox/header", a: a
= render 'answerbox/header', a: a
.card-body
- if @display_all.nil?
- if display_all.nil?
.answerbox__answer-text
= markdown a.content[0..255]
- if a.content.length > 255
[...]
%p
%a.btn.btn-primary{href: show_user_answer_path(a.user.screen_name, a.id)}
%a.btn.btn-primary{ href: show_user_answer_path(a.user.screen_name, a.id) }
= t 'views.answerbox.read'
- else
.answerbox__answer-text
@ -18,15 +19,15 @@
.col.col-sm-4.col-md-6.text-left.text-muted
.media
.pull-left
%a{href: show_user_profile_path(a.user.screen_name)}
%img.answerbox__answer-user-avatar.avatar-sm{src: a.user.profile_picture.url(:medium)}
%a{ href: show_user_profile_path(a.user.screen_name) }
%img.answerbox__answer-user-avatar.avatar-sm{ src: a.user.profile_picture.url(:medium) }
.media-body
%h6.media-heading.answerbox__answer-user
= raw t('views.answerbox.answered', hide: hidespan(t('views.answerbox.hide'), "d-none d-sm-inline"), user: user_screen_name(a.user))
= raw t('views.answerbox.answered', hide: hidespan(t('views.answerbox.hide'), 'd-none d-sm-inline'), user: user_screen_name(a.user))
.answerbox__answer-date
= link_to(raw(t('views.answerbox.time', time: time_tooltip(a))), show_user_answer_path(a.user.screen_name, a.id))
.col.col-sm-8.col-md-6.text-right
= render 'answerbox/actions', a: a
= render 'answerbox/actions', a: a, display_all: display_all
- else
.row
.col-4.col-sm-4.col-md-6.text-left.text-muted
@ -34,6 +35,6 @@
= link_to(raw(t('views.answerbox.time', time: time_tooltip(a))), show_user_answer_path(a.user.screen_name, a.id))
.col-8.col-sm-8.col-md-6.text-right
= render 'answerbox/actions', a: a
.card-footer{id: "ab-comments-section-#{a.id}", style: @display_all.nil? ? 'display: none' : nil }
%div{id: "ab-smiles-#{a.id}"}= render 'answerbox/smiles', a: a
%div{id: "ab-comments-#{a.id}"}= render 'answerbox/comments', a: a
.card-footer{ id: "ab-comments-section-#{a.id}", style: display_all.nil? ? 'display: none' : nil }
%div{ id: "ab-smiles-#{a.id}" }= render 'answerbox/smiles', a: a
%div{ id: "ab-comments-#{a.id}" }= render 'answerbox/comments', a: a

View File

@ -1,43 +1,46 @@
.card
.card-header
- if @user.motivation_header.blank?
- if user.motivation_header.blank?
= t 'views.questionbox.title'
- else
= @user.motivation_header
= user.motivation_header
.card-body
- if @user.banned?
- if user.banned?
.text-center
%strong= t 'views.questionbox.banned'
- else
- if user_signed_in? or @user.privacy_allow_anonymous_questions?
- if user_signed_in? || user.privacy_allow_anonymous_questions?
#question-box
%textarea.form-control{:name => "qb-question", :placeholder => t('views.placeholder.question')}
.row{:style => "padding-top: 5px; padding-left: 5px; padding-right: 5px;"}
%textarea.form-control{ name: 'qb-question', placeholder: t('views.placeholder.question') }
.row{ style: 'padding-top: 5px; padding-left: 5px; padding-right: 5px;' }
.col-6
- if user_signed_in?
- if @user.privacy_allow_anonymous_questions?
%input{:name => "qb-anonymous", :type => "checkbox"}/
- if user.privacy_allow_anonymous_questions?
%input{ name: 'qb-anonymous', type: :checkbox }/
= t 'views.actions.anonymous'
%br/
- else
%input{:name => "qb-anonymous", :type => "hidden", :value => "false"}/
%input{ name: 'qb-anonymous', type: :hidden, value: false }/
.col-6
%p.pull-right
%input{name: 'qb-to', type: 'hidden', :value => @user.id}/
%button.btn.btn-primary{name: 'qb-ask', :type => "button", data: {loading_text: t('views.questionbox.load'), promote: user_signed_in? ? "false" : "true" }} Ask
%input{ name: 'qb-to', type: 'hidden', value: user.id }/
%button.btn.btn-primary{ name: 'qb-ask',
type: :button,
data: { loading_text: t('views.questionbox.load'), promote: user_signed_in? ? 'false' : 'true' } }
Ask
- unless user_signed_in?
- if @user.privacy_allow_anonymous_questions?
#question-box-promote{:style => "display: none;"}
- if user.privacy_allow_anonymous_questions?
#question-box-promote{ style: 'display: none;' }
.row
.col-12.text-center
%strong= t 'views.questionbox.promote.message'
.row
.col-sm-5.offset-sm-1
%button#create-account.btn.btn-block.btn-primary= t 'views.questionbox.promote.create'
%button.btn.btn-block.btn-primary#create-account= t 'views.questionbox.promote.create'
.col-sm-5
%button#new-question.btn.btn-block.btn-default= t 'views.questionbox.promote.another'
%button.btn.btn-block.btn-default#new-question= t 'views.questionbox.promote.another'
.row
.col-xs-12.col-sm-10.offset-sm-1.text-center
%small= t('views.questionbox.promote.join', app_title: APP_CONFIG['site_name'])
- else
%p= raw t 'views.questionbox.required', signup: link_to(t('views.sessions.new'),new_user_registration_path)
%p= raw t 'views.questionbox.required', signup: link_to(t('views.sessions.new'), new_user_registration_path)

View File

@ -1,4 +1,4 @@
- provide(:title, generate_title("Resend confirmation instructions"))
- provide(:title, generate_title('Resend confirmation instructions'))
.container
.row
.col-sm-8.offset-sm-2
@ -8,8 +8,8 @@
= bootstrap_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
= devise_error_messages!
= f.text_field :screen_name, autofocus: true, label: "User name"
= f.submit "Resend confirmation instructions", class: "btn btn-primary mb-3"
= f.text_field :screen_name, autofocus: true, label: 'User name'
= f.submit 'Resend confirmation instructions', class: 'btn btn-primary mb-3'
= render "devise/shared/links"
= render "shared/links"
= render 'devise/shared/links'
= render 'shared/links'

View File

@ -0,0 +1,10 @@
%p{ style: 'margin:0px;padding:0px' }
Welcome to
= succeed ',' do
= APP_CONFIG['site_name']
= succeed '!' do
= @resource.screen_name
%p &nbsp;
%p{ style: 'margin:0px;padding:0px' } You can confirm your account email through the link below:
%p{ style: 'margin:0px;padding:0px' }
= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http))

View File

@ -1,9 +0,0 @@
%p{style: "margin:0px;padding:0px"}
Welcome to
= succeed ',' do
= APP_CONFIG['site_name']
= succeed '!' do
= @resource.screen_name
%p &nbsp;
%p{style: "margin:0px;padding:0px"} You can confirm your account email through the link below:
%p{style: "margin:0px;padding:0px"}= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http))

View File

@ -0,0 +1,11 @@
%p{ style: 'margin:0px;padding:0px' }
Hello
= succeed '!' do
= @resource.screen_name
%p &nbsp;
%p{ style: 'margin:0px;padding:0px' } Someone (hopefully you) has requested a link to change your password. You can do this through the link below.
%p{ style: 'margin:0px;padding:0px' }
= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http))
%p &nbsp;
%p{ style: 'margin:0px;padding:0px' } If you didn't request this, please ignore this email.
%p{ style: 'margin:0px;padding:0px' } Your password won't change until you access the link above and create a new one.

View File

@ -1,10 +0,0 @@
%p{style: "margin:0px;padding:0px"}
Hello
= succeed '!' do
= @resource.screen_name
%p &nbsp;
%p{style: "margin:0px;padding:0px"} Someone (hopefully you) has requested a link to change your password. You can do this through the link below.
%p{style: "margin:0px;padding:0px"}= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http))
%p &nbsp;
%p{style: "margin:0px;padding:0px"} If you didn't request this, please ignore this email.
%p{style: "margin:0px;padding:0px"} Your password won't change until you access the link above and create a new one.

View File

@ -0,0 +1,9 @@
%p{ style: 'margin:0px;padding:0px' }
Hello
= succeed '!' do
= @resource.screen_name
%p &nbsp;
%p{ style: 'margin:0px;padding:0px' } Your account has been locked due to an excessive number of unsuccessful sign in attempts.
%p{ style: 'margin:0px;padding:0px' } Click the link below to unlock your account:
%p{ style: 'margin:0px;padding:0px' }
= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http))

View File

@ -1,8 +0,0 @@
%p{style: "margin:0px;padding:0px"}
Hello
= succeed '!' do
= @resource.screen_name
%p &nbsp;
%p{style: "margin:0px;padding:0px"} Your account has been locked due to an excessive number of unsuccessful sign in attempts.
%p{style: "margin:0px;padding:0px"} Click the link below to unlock your account:
%p{style: "margin:0px;padding:0px"}= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token, protocol: (APP_CONFIG['https'] ? :https : :http))

View File

@ -1,4 +1,4 @@
- provide(:title, generate_title("Reset Password"))
- provide(:title, generate_title('Reset Password'))
.container
.row
.col-sm-4.offset-sm-4
@ -10,10 +10,10 @@
= f.hidden_field :reset_password_token
= f.password_field :password, autofocus: true, autocomplete: "off", label: "New password"
= f.password_field :password_confirmation, autocomplete: "off", label: "Confirm new password"
= f.password_field :password, autofocus: true, autocomplete: :off, label: 'New password'
= f.password_field :password_confirmation, autocomplete: :off, label: 'Confirm new password'
= f.submit "Change my password"
= f.submit 'Change my password'
= render "devise/shared/links"
= render "shared/links"
= render 'devise/shared/links'
= render 'shared/links'

View File

@ -0,0 +1,15 @@
- provide(:title, generate_title('Forgot your Password?'))
.container
.row
.col-sm-8.offset-sm-2
.card.mt-3
.card-body
%h1 Forgot your password?
= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
= devise_error_messages!
= f.email_field :email, autofocus: true, label: 'Email address'
= f.submit 'Send me password reset instructions', class: 'btn btn-primary mb-3'
= render 'devise/shared/links'
= render 'shared/links'

View File

@ -1,15 +0,0 @@
- provide(:title, generate_title("Forgot your Password?"))
.container
.row
.col-sm-8.offset-sm-2
.card.mt-3
.card-body
%h1 Forgot your password?
= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
= devise_error_messages!
= f.email_field :email, autofocus: true, label: "Email address"
= f.submit "Send me password reset instructions", class: "btn btn-primary mb-3"
= render "devise/shared/links"
= render "shared/links"

View File

@ -0,0 +1,4 @@
= render 'settings/account'
- provide(:title, generate_title('Account Settings'))
- parent_layout 'user/settings'

View File

@ -1,4 +0,0 @@
= render "settings/account"
- provide(:title, generate_title("Account Settings"))
- parent_layout "user/settings"

View File

@ -1,4 +1,4 @@
- provide(:title, generate_title("Sign Up"))
- provide(:title, generate_title('Sign Up'))
.container
.row
.col-sm-8.offset-sm-2
@ -11,11 +11,11 @@
= f.text_field :screen_name, autofocus: true, label: t('views.settings.account.username')
= f.email_field :email, autofocus: false, label: t('views.settings.account.email')
= f.password_field :password, autocomplete: "off", label: t('views.settings.account.password')
= f.password_field :password_confirmation, autocomplete: "off", label: t('views.settings.account.password_confirm')
= f.password_field :password, autocomplete: :off, label: t('views.settings.account.password')
= f.password_field :password_confirmation, autocomplete: :off, label: t('views.settings.account.password_confirm')
%p= raw t('views.sessions.info', terms: link_to(t('views.general.terms'), terms_path))
= f.submit "Sign up", class: "btn btn-primary mb-3"
= f.submit 'Sign up', class: 'btn btn-primary mb-3'
= render "devise/shared/links"
= render 'devise/shared/links'
= render 'shared/links'

View File

@ -1,4 +1,4 @@
- provide(:title, generate_title("Sign In"))
- provide(:title, generate_title('Sign In'))
.container
.row
.col-sm-4.offset-sm-4
@ -9,12 +9,12 @@
= bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
= f.text_field :login, autofocus: true, label: t('views.settings.account.username')
= f.password_field :password, autocomplete: "off", label: t('views.settings.account.password')
= f.password_field :password, autocomplete: :off, label: t('views.settings.account.password')
- if devise_mapping.rememberable?
= f.check_box :remember_me
= f.submit t('views.sessions.create'), class: "btn btn-primary mt-3 mb-3"
= f.submit t('views.sessions.create'), class: 'btn btn-primary mt-3 mb-3'
= render "devise/shared/links"
= render "shared/links"
= render 'devise/shared/links'
= render 'shared/links'

View File

@ -1,13 +1,13 @@
- if controller_name != 'sessions'
= link_to "Sign in", new_session_path(resource_name)
= link_to 'Sign in', new_session_path(resource_name)
%br/
- if devise_mapping.registerable? && controller_name != 'registrations'
= link_to "Sign up", new_registration_path(resource_name)
= link_to 'Sign up', new_registration_path(resource_name)
%br/
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
= link_to "Forgot your password?", new_password_path(resource_name)
= link_to 'Forgot your password?', new_password_path(resource_name)
%br/
- if devise_mapping.confirmable? && controller_name != 'confirmations'
@ -21,4 +21,4 @@
- if devise_mapping.omniauthable?
- resource_class.omniauth_providers.each do |provider|
= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider)
%br/
%br/

View File

@ -1,4 +1,4 @@
- provide(:title, generate_title("Unlock"))
- provide(:title, generate_title('Unlock'))
.container
%h1 Resend unlock instructions
= render 'layouts/messages'
@ -6,9 +6,9 @@
= bootstrap_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f|
= devise_error_messages!
= f.email_field :email, autofocus: true, label: "Email address"
= f.email_field :email, autofocus: true, label: 'Email address'
= f.submit "Resend unlock instructions"
= f.submit 'Resend unlock instructions'
= render "devise/shared/links"
= render "shared/links"
= render 'devise/shared/links'
= render 'shared/links'

View File

@ -0,0 +1,3 @@
.tab-pane.active.fade.show{ role: :tabpanel, id: 'answers' }
- answers.each do |a|
= render 'answerbox', a: a

View File

@ -1,3 +0,0 @@
.tab-pane.active.fade.show{role: "tabpanel", id: "answers"}
- answers.each do |a|
= render 'answerbox', a: a

View File

@ -0,0 +1,3 @@
.tab-pane.fade{ role: :tabpanel, id: 'asked' }
- asked.each do |user|
= render 'discover/userbox', u: user.user, type: 'asked', q: user.question_count

View File

@ -1,3 +0,0 @@
.tab-pane.fade{role: "tabpanel", id: "asked"}
- asked.each do |user|
= render 'discover/userbox', u: user.user, type: "asked", q: user.question_count

View File

@ -1,3 +1,3 @@
.tab-pane.fade{role: "tabpanel", id: "comments"}
.tab-pane.fade{ role: :tabpanel, id: 'comments' }
- comments.each do |a|
= render 'answerbox', a: a

View File

@ -0,0 +1,3 @@
.tab-pane.fade{ role: :tabpanel, id: 'answered' }
- answered.each do |user|
= render 'discover/userbox', u: user.user, type: 'most', a: user.answer_count

View File

@ -1,3 +0,0 @@
.tab-pane.fade{role: "tabpanel", id: "answered"}
- answered.each do |user|
= render 'discover/userbox', u: user.user, type: "most", a: user.answer_count

View File

@ -0,0 +1,3 @@
.tab-pane.active.fade.show{ role: :tabpanel, id: 'new' }
- new.each do |user|
= render 'discover/userbox', u: user, type: 'new'

View File

@ -1,3 +0,0 @@
.tab-pane.active.fade.show{role: "tabpanel", id: "new"}
- new.each do |user|
= render 'discover/userbox', u: user, type: "new"

View File

@ -0,0 +1,3 @@
.tab-pane.fade{ role: :tabpanel, id: 'questions' }
- questions.each do |q|
= render 'shared/question', q: q, type: 'discover'

View File

@ -1,3 +0,0 @@
.tab-pane.fade{role: "tabpanel", id: "questions"}
- questions.each do |q|
= render 'shared/question', q: q, type: "discover"

View File

@ -1,22 +1,22 @@
.card{data: { id: u.id }}
.card{ data: { id: u.id } }
.card-body
.media
.pull-left
%a{href: show_user_profile_path(u.screen_name)}
%img.avatar-md.mr-2{src: u.profile_picture.url(:medium)}
%a{ href: show_user_profile_path(u.screen_name) }
%img.avatar-md.mr-2{ src: u.profile_picture.url(:medium) }
.media-body
%h6.media-heading.answerbox__question-user
- if u.display_name.blank?
%a{href: show_user_profile_path(u.screen_name)}
%span= "@#{u.screen_name}"
%a{ href: show_user_profile_path(u.screen_name) }
= u.screen_name
- else
%a{href: show_user_profile_path(u.screen_name)}
%span= u.display_name
%span.text-muted= "@#{u.screen_name}"
%a{ href: show_user_profile_path(u.screen_name) }
= u.display_name
%span.text-muted= u.screen_name
%p.answerbox__question-text
- if type == "new"
- if type == 'new'
= t('views.discover.userbox.new', time: time_ago_in_words(u.created_at))
- elsif type == "most"
- elsif type == 'most'
= t('views.discover.userbox.answers', questions: pluralize(a, t('views.general.question')))
- else
= t('views.discover.userbox.questions', questions: pluralize(q, t('views.general.question')))

View File

@ -0,0 +1,40 @@
- provide(:title, generate_title('Discover'))
.jumbotron.jumbotron--particles
.jumbotron__particles#particles
.jumbotron__content
%h1= t 'views.discover.title'
%p= t('views.discover.subtitle', app_title: APP_CONFIG['site_name'])
.container
.row
.col-md-7.col-sm-6
%h2= t 'views.discover.content.title'
%p= t 'views.discover.content.desc'
%div{ role: :tabpanel }
%ul.nav.nav-tabs{ role: :tablist }
%li.nav-item{ role: 'presentation' }
%a.nav-link.active{ href: '#answers', role: :tab, aria: { controls: 'answers' }, data: { toggle: :tab } }= t 'views.discover.content.tab.answers'
%li.nav-item{ role: 'presentation' }
%a.nav-link{ href: '#questions', role: :tab, aria: { controls: 'questions' }, data: { toggle: :tab } }= t 'views.discover.content.tab.questions'
%li.nav-item{ role: 'presentation' }
%a.nav-link{ href: '#comments', role: :tab, aria: { controls: 'comments' }, data: { toggle: :tab } }= t 'views.discover.content.tab.comments'
.tab-content.mt-3
= render 'discover/tab_answers', answers: @popular_answers
= render 'discover/tab_questions', questions: @popular_questions
= render 'discover/tab_discussed', comments: @most_discussed
.col-md-5.col-sm-6
%h2= t 'views.discover.people.title'
%p= t 'views.discover.people.desc'
%div{ role: :tabpanel }
%ul.nav.nav-tabs{ role: :tablist }
%li.nav-item{ role: 'presentation' }
%a.nav-link.active{ href: '#new', role: :tab, aria: { controls: 'new' }, data: { toggle: :tab } }= t 'views.discover.people.tab.new'
%li.nav-item{ role: 'presentation' }
%a.nav-link{ href: '#asked', role: :tab, aria: { controls: 'asked' }, data: { toggle: :tab } }= t 'views.discover.people.tab.questions'
%li.nav-item{ role: 'presentation' }
%a.nav-link{ href: '#answered', role: :tab, aria: { controls: 'answered' }, data: { toggle: :tab } }= t 'views.discover.people.tab.answers'
.tab-content.mt-3
= render 'discover/tab_new', new: @new_users
= render 'discover/tab_asked', asked: @users_with_most_questions
= render 'discover/tab_most', answered: @users_with_most_answers
= render 'shared/links'

View File

@ -1,39 +0,0 @@
- provide(:title, generate_title("Discover"))
.jumbotron.jumbotron--particles
#particles.jumbotron__particles
.jumbotron__content
%h1= t 'views.discover.title'
%p= t('views.discover.subtitle', app_title: APP_CONFIG['site_name'])
.container
.row
.col-md-7.col-sm-6
%h2= t 'views.discover.content.title'
%p= t 'views.discover.content.desc'
%div{role: "tabpanel"}
%ul.nav.nav-tabs{role: "tablist"}
%li.nav-item{role: "presentation"}
%a.nav-link.active{href: "#answers", role: "tab", aria: {controls: "answers"}, data: {toggle: "tab"}}= t 'views.discover.content.tab.answers'
%li.nav-item{role: "presentation"}
%a.nav-link{href: "#questions", role: "tab", aria: {controls: "questions"}, data: {toggle: "tab"}}= t 'views.discover.content.tab.questions'
%li.nav-item{role: "presentation"}
%a.nav-link{href: "#comments", role: "tab", aria: {controls: "comments"}, data: {toggle: "tab"}}= t 'views.discover.content.tab.comments'
.tab-content.mt-3
= render 'discover/tab_answers', answers: @popular_answers
= render 'discover/tab_questions', questions: @popular_questions
= render 'discover/tab_discussed', comments: @most_discussed
.col-md-5.col-sm-6
%h2= t 'views.discover.people.title'
%p= t 'views.discover.people.desc'
%div{role: "tabpanel"}
%ul.nav.nav-tabs{role: "tablist"}
%li.nav-item{role: "presentation"}
%a.nav-link.active{href: "#new", role: "tab", aria: {controls: "new"}, data: {toggle: "tab"}}= t 'views.discover.people.tab.new'
%li.nav-item{role: "presentation"}
%a.nav-link{href: "#asked", role: "tab", aria: {controls: "asked"}, data: {toggle: "tab"}}= t 'views.discover.people.tab.questions'
%li.nav-item{role: "presentation"}
%a.nav-link{href: "#answered", role: "tab", aria: {controls: "answered"}, data: {toggle: "tab"}}= t 'views.discover.people.tab.answers'
.tab-content.mt-3
= render 'discover/tab_new', new: @new_users
= render 'discover/tab_asked', asked: @users_with_most_questions
= render 'discover/tab_most', answered: @users_with_most_answers
= render 'shared/links'

View File

@ -5,8 +5,8 @@
= render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @timeline_last_id
- if @more_data_available
%button#load-more-btn.btn.btn-default{type: :button, data: { last_id: @timeline_last_id }}
%button.btn.btn-default#load-more-btn{ type: :button, data: { last_id: @timeline_last_id } }
= t 'views.actions.load'
- provide(:title, group_title(@group))
- parent_layout "feed"
- parent_layout 'feed'

View File

@ -1,36 +1,36 @@
.card.inbox-entry{class: i.new? ? 'inbox-entry--new' : '', data: { id: i.id }}
.card.inbox-entry{ class: i.new? ? 'inbox-entry--new' : '', data: { id: i.id } }
.card-header
.media
- unless i.question.author_is_anonymous
%a.pull-left{href: show_user_profile_path(i.question.user.screen_name)}
%img.answerbox__question-user-avatar.avatar-md{src: i.question.user.profile_picture.url(:medium)}
%a.pull-left{ href: show_user_profile_path(i.question.user.screen_name) }
%img.answerbox__question-user-avatar.avatar-md{ src: i.question.user.profile_picture.url(:medium) }
.media-body
%h6.text-muted.media-heading.answerbox__question-user
= raw t('views.inbox.entry.asked', user: user_screen_name(i.question.user, anonymous: i.question.author_is_anonymous), time: time_tooltip(i.question))
- unless i.question.author_is_anonymous
- if i.question.answer_count > 0
- if i.question.answer_count.positive?
·
%a{href: show_user_question_path(i.question.user.screen_name, i.question.id)}
%a{ href: show_user_question_path(i.question.user.screen_name, i.question.id) }
= pluralize(i.question.answer_count, t('views.inbox.entry.response'))
%p.answerbox__question-text= i.question.content
.card-body
%textarea.form-control{name: 'ib-answer', placeholder: t('views.placeholder.inbox'), data: { id: i.id }}
%textarea.form-control{ name: 'ib-answer', placeholder: t('views.placeholder.inbox'), data: { id: i.id } }
%br/
%button.btn.btn-success{name: 'ib-answer', data: { ib_id: i.id }}
%button.btn.btn-success{ name: 'ib-answer', data: { ib_id: i.id } }
= t 'views.actions.answer'
%button.btn.btn-danger{name: 'ib-destroy', data: { ib_id: i.id }}
%button.btn.btn-danger{ name: 'ib-destroy', data: { ib_id: i.id } }
= t 'views.actions.delete'
%button.btn.btn-default{name: 'ib-options', data: { ib_id: i.id, state: :hidden }}
%button.btn.btn-default{ name: 'ib-options', data: { ib_id: i.id, state: :hidden } }
%i.fa.fa-cog
%span.sr-only= t 'views.actions.options'
.card-footer{id: "ib-options-#{i.id}", style: 'display: none'}
.card-footer{ id: "ib-options-#{i.id}", style: 'display: none' }
%h4= t 'views.inbox.entry.sharing.title'
- if current_user.services.count > 0
- if current_user.services.count.positive?
.row
- current_user.services.each do |service|
.col-md-3.col-sm-4.col-xs-6
%label
%input{type: 'checkbox', name: 'ib-share', checked: :checked, data: { ib_id: i.id, service: service.provider }}
%input{ type: 'checkbox', name: 'ib-share', checked: :checked, data: { ib_id: i.id, service: service.provider } }
= raw t('views.inbox.entry.sharing.post', service: service.provider.capitalize)
- else
%p= raw t('views.inbox.entry.sharing.none', settings: link_to(t('views.inbox.entry.sharing.settings'), services_path))

View File

@ -0,0 +1,27 @@
.card
.card-header= t 'views.inbox.sidebar.questions.title'
.card-body
%button.btn.btn-block.btn-info{ type: :button, id: 'ib-generate-question' }= t 'views.inbox.sidebar.questions.button'
.card
.card-header= t 'views.inbox.sidebar.share.title'
.card-body
%a.btn.btn-block.btn-primary{ target: '_blank',
href: "https://twitter.com/intent/tweet?text=Ask%20me%20anything%21&url=#{show_user_profile_url(current_user.screen_name)}" }
%i.fa.fa-fw.fa-twitter
= raw t('views.inbox.sidebar.share.button', service: 'Twitter')
%a.btn.btn-block.btn-primary{ target: '_blank',
href: "https://www.tumblr.com/share/link?url=#{show_user_profile_url(current_user.screen_name)}&name=Ask%20me%20anything%21" }
%i.fa.fa-fw.fa-tumblr
= raw t('views.inbox.sidebar.share.button', service: 'Tumblr')
.card
.card-header Show author
.card-body
%form#author-form
= bootstrap_form_tag url: inbox_path, method: :get do |f|
= f.text_field :author, value: params[:author], placeholder: 'username', prepend: '@', hide_label: true
= f.button 'Show', name: nil, class: 'btn btn-light btn-block btn-sm', id: 'ib-author'
.card
.card-header= t 'views.inbox.sidebar.actions.title'
.card-body
%button.btn.btn-block.btn-danger{ type: :button, id: delete_id, disabled: (disabled ? :disabled : nil), data: { ib_count: inbox_count } }
= t 'views.inbox.sidebar.actions.button'

View File

@ -1,25 +0,0 @@
.card.inbox--panel
.card-header= t 'views.inbox.sidebar.questions.title'
.card-body
%button.btn.btn-block.btn-info{type: :button, id: 'ib-generate-question'}= t 'views.inbox.sidebar.questions.button'
.card.inbox--panel
.card-header= t 'views.inbox.sidebar.share.title'
.card-body
%a.btn.btn-block.btn-primary{target: '_blank', href: "https://twitter.com/intent/tweet?text=Ask%20me%20anything%21&url=#{show_user_profile_url(current_user.screen_name)}"}
%i.fa.fa-fw.fa-twitter
= raw t('views.inbox.sidebar.share.button', service: "Twitter")
%a.btn.btn-block.btn-primary{target: '_blank', href: "https://www.tumblr.com/share/link?url=#{show_user_profile_url(current_user.screen_name)}&name=Ask%20me%20anything%21"}
%i.fa.fa-fw.fa-tumblr
= raw t('views.inbox.sidebar.share.button', service: "Tumblr")
.card.inbox--panel
.card-header Show author
.card-body
%form#author_form
= bootstrap_form_tag url: inbox_path, method: :get do |f|
= f.text_field :author, value: params[:author], placeholder: "username", prepend: "@" , hide_label: true
= f.button "Show", name: nil, class: "btn btn-light btn-block btn-sm", id: "ib-author"
.card.warning--panel
.card-header= t 'views.inbox.sidebar.actions.title'
.card-body
%button.btn.btn-block.btn-danger{type: :button, id: @delete_id , disabled: (@disabled ? 'disabled' : nil), data: { ib_count: @inbox_count }}= t 'views.inbox.sidebar.actions.button'

View File

@ -8,5 +8,5 @@
= render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @inbox_last_id
- if @more_data_available
%button#load-more-btn.btn.btn-default{type: :button, data: { last_id: @inbox_last_id }}
%button.btn.btn-default#load-more-btn{ type: :button, data: { last_id: @inbox_last_id } }
= t 'views.actions.load'

View File

@ -0,0 +1,10 @@
%noscript
.alert.alert-danger
= t 'messages.noscript'
- flash.each do |key, value|
.alert.alert-dismissible{ class: "alert-#{bootstrap_color key}", role: :alert }
%button.close{ type: :button, data: { dismiss: :alert } }
%span{ aria: { hidden: true } } &times;
%span.sr-only= t 'views.actions.close'
= value

View File

@ -1,10 +0,0 @@
%noscript
.alert.alert-danger
= t 'messages.noscript'
- flash.each do |key, value|
.alert.alert-dismissible{class: "alert-#{bootstrap_color key}", role: "alert"}
%button.close{type: "button", "data-dismiss" => "alert"}
%span{"aria-hidden" => "true"} &times;
%span.sr-only= t 'views.actions.close'
= value

View File

@ -1,3 +1,3 @@
= yield
- parent_layout "base"
- parent_layout 'base'

View File

@ -1,21 +1,21 @@
!!! 5
%html{lang: 'en'}
%html{ lang: 'en' }
%head
%meta{charset: 'utf-8'}
%meta{'http-equiv' => 'X-UA-Compatible' ,content: 'IE=edge'}
%meta{name: 'viewport', content: 'width=device-width, initial-scale=1, user-scalable=no'}
%meta{name: 'theme-color', content: '#5e35b1'}
%link{rel: 'apple-touch-icon', href: '/apple-touch-icon-precomposed.png'}
%link{rel: 'icon', href: '/images/favicon/favicon-16.png', sizes: '16x16'}
%link{rel: 'icon', href: '/icon-152.png', sizes: '152x152'}
%link{rel: 'icon', href: '/images/favicon/favicon-32.png', sizes: '32x32'}
%meta{ charset: 'utf-8' }
%meta{ 'http-equiv': 'X-UA-Compatible', content: 'IE=edge' }
%meta{ name: 'viewport', content: 'width=device-width, initial-scale=1, user-scalable=no' }
%meta{ name: 'theme-color', content: '#5e35b1' }
%link{ rel: 'apple-touch-icon', href: '/apple-touch-icon-precomposed.png' }
%link{ rel: 'icon', href: '/images/favicon/favicon-16.png', sizes: '16x16' }
%link{ rel: 'icon', href: '/icon-152.png', sizes: '152x152' }
%link{ rel: 'icon', href: '/images/favicon/favicon-32.png', sizes: '32x32' }
%title= yield(:title)
= javascript_include_tag 'i18n', 'data-turbolinks-track' => true
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag 'application', 'data-turbolinks-track' => true
= javascript_include_tag 'i18n', data: { 'turbolinks-track': true }
= stylesheet_link_tag 'application', media: 'all', data: { 'turbolinks-track': true }
= javascript_include_tag 'application', data: { 'turbolinks-track': true }
- if user_signed_in?
- if current_user.mod?
= javascript_include_tag 'moderation', 'data-turbolinks-track' => true
= javascript_include_tag 'moderation', data: { 'turbolinks-track': true }
= csrf_meta_tags
%body
- if user_signed_in?

View File

@ -4,6 +4,6 @@
= render 'shared/sidebar'
.col-md-9.col-xs-12.col-sm-8
= render 'layouts/messages'
= render 'tabs/feed'
= render 'tabs/feed', group: @group
= yield
.d-block.d-sm-none= render 'shared/links'
.d-block.d-sm-none= render 'shared/links'

View File

@ -1,13 +1,14 @@
.container.container--main
.row
.col-md-3.col-xs-12.col-sm-4.order-2.order-sm-1
= render 'inbox/sidebar'
= render 'inbox/sidebar', delete_id: @delete_id, disabled: @disabled, inbox_count: @inbox_count
.col-md-9.col-xs-12.col-sm-8.order-1.order-sm-2
= render 'layouts/messages'
= yield
= render "shared/links"
= render 'shared/links'
- Inbox.where(id: @inbox.ids).update_all(new: false)
- provide(:title, generate_title("Inbox"))
- parent_layout "base"
:ruby
Inbox.where(id: @inbox.ids).update_all(new: false)
provide(:title, generate_title('Inbox'))
parent_layout 'base'

View File

@ -0,0 +1,28 @@
%html
%head
:css
body {
font-size: 16px;
margin-top: 0px;
margin-bottom: 0px;
font-family: Arial, sans-serif;
}
p {
margin: 0px;
padding: 0px;
}
%body
%table{ cellpadding: 0, cellspacing: 0, border: 5, bordercolor: '#5e35b1', bgcolor: '#5e35b1', style: 'font-size:0px;', align: 'center', width: '630' }
%tbody
%tr
%td{ style: 'padding:5px 10px;', align: 'center' }
%p{ style: 'margin:0px;padding:0px' }
%font{ color: '#ffffff', size: 6, face: 'Arial, sans-serif' }= APP_CONFIG['site_name']
%tr
%td{ bgcolor: '#ffffff', style: 'padding:10px' }
%font{ color: '#000000', size: 4, face: 'Arial, sans-serif' }= yield
%p{ style: 'margin:0px;padding:5px;', align: 'center' }
%font{ size: 2, color: '#797979', face: 'Arial, sans-serif' }
&copy;
= Time.zone.now.year
= APP_CONFIG['site_name']

View File

@ -1,28 +0,0 @@
%html
%head
:css
body {
font-size: 16px;
margin-top: 0px;
margin-bottom: 0px;
font-family: Arial, sans-serif;
}
p {
margin: 0px;
padding: 0px;
}
%body
%table{cellpadding: 0, cellspacing: 0, border: 5, bordercolor: "#5e35b1", bgcolor: "#5e35b1", style: "font-size:0px;", align: "center", width: "630"}
%tbody
%tr
%td{style: "padding:5px 10px;", align: "center"}
%p{style: "margin:0px;padding:0px"}
%font{color: "#ffffff", size: 6, face: "Arial, sans-serif"}= APP_CONFIG['site_name']
%tr
%td{bgcolor: "#ffffff", style: "padding:10px"}
%font{color: "#000000", size: 4, face: "Arial, sans-serif"}= yield
%p{style:"margin:0px;padding:5px;", align: "center"}
%font{size: 2, color: "#797979", face: "Arial, sans-serif"}
&copy;
= Time.zone.now.year
= APP_CONFIG['site_name']

View File

@ -6,5 +6,5 @@
.col-md-9.col-sm-8.col-xs-12
= yield
- provide(:title, generate_title("Moderation"))
- parent_layout "base"
- provide(:title, generate_title('Moderation'))
- parent_layout 'base'

View File

@ -6,6 +6,7 @@
.col-md-9.col-xs-12.col-sm-8
= yield
- Notification.for(current_user).update_all(new: false)
- provide(:title, generate_title("Notifications"))
- parent_layout "base"
:ruby
Notification.for(current_user).update_all(new: false)
provide(:title, generate_title('Notifications'))
parent_layout 'base'

View File

@ -1,16 +1,16 @@
.profile__header-container
%img.profile__header-image{src: @user.profile_header.url(:web)}
%img.profile__header-image{ src: @user.profile_header.url(:web) }
.container
.row
.col-md-3.col-xs-12.col-sm-4
= render 'user/profile'
= render 'user/profile', user: @user
.d-none.d-sm-block= render 'shared/links'
.col-md-9.col-xs-12.col-sm-8
= render "questionbox"
= render "tabs/profile"
= render 'questionbox', user: @user
= render 'tabs/profile', user: @user
= yield
- if user_signed_in?
= render 'modal/group'
- if current_user.mod? and @user != current_user
= render 'modal/privileges'
= render 'modal/ban'
= render 'modal/group', user: @user
- if current_user.mod? && @user != current_user
= render 'modal/privileges', user: @user
= render 'modal/ban', user: @user

View File

@ -4,4 +4,4 @@
= render 'tabs/settings'
.col-md-9.col-xs-12.col-sm-8
= render 'layouts/messages'
= yield
= yield

View File

@ -1,21 +1,21 @@
#modal-ask-followers.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-ask-followers-label", :role => "dialog", :tabindex => "-1"}
.modal.fade#modal-ask-followers{ aria: { hidden: true, labelledby: 'modal-ask-followers-label' }, role: :dialog, tabindex: -1 }
.modal-dialog
.modal-content
.modal-header
%h5#modal-ask-followers-label.modal-title= t 'views.modal.ask.title'
%button.close{"data-dismiss" => "modal", :type => "button"}
%span{"aria-hidden" => "true"} ×
%h5.modal-title#modal-ask-followers-label= t 'views.modal.ask.title'
%button.close{ data: { dismiss: :modal }, type: :button }
%span{ aria: { hidden: true } } ×
%span.sr-only= t 'views.actions.close'
.modal-body
%textarea.form-control{:name => "qb-all-question", :placeholder => t('views.placeholder.question')}
%textarea.form-control{ name: 'qb-all-question', placeholder: t('views.placeholder.question') }
.modal-footer
- if current_user.groups.count > 0
- if current_user.groups.count.positive?
%label
= t 'views.modal.ask.choose'
%select{name: 'qb-all-rcpt', class: 'form-control', autocomplete: 'off'}
%option{value: 'followers', selected: true}= t('views.general.follower').pluralize(2)
%optgroup{label: t('views.group.title').pluralize(2)}
%select.form-control{ name: 'qb-all-rcpt', autocomplete: :off }
%option{ value: 'followers', selected: true }= t('views.general.follower').pluralize(2)
%optgroup{ label: t('views.group.title').pluralize(2) }
- current_user.groups.each do |group|
%option{value: "grp:#{group.name}"}= group.display_name
%button.btn.btn-default{"data-dismiss" => "modal", :type => "button"}= t 'views.actions.cancel'
%button.btn.btn-primary{name: 'qb-all-ask', :type => "button", data: {loading_text: t('views.modal.ask.loading') }}= t 'views.actions.ask'
%option{ value: "grp:#{group.name}" }= group.display_name
%button.btn.btn-default{ type: :button, data: { dismiss: :modal } }= t 'views.actions.cancel'
%button.btn.btn-primary{ name: 'qb-all-ask', type: :button, data: { loading_text: t('views.modal.ask.loading') } }= t 'views.actions.ask'

View File

@ -1,21 +1,21 @@
#modal-ban.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-ban-label", :role => "dialog", :tabindex => "-1"}
.modal.fade#modal-ban{ aria: { hidden: true, labelledby: 'modal-ban-label' }, role: :dialog, tabindex: -1 }
.modal-dialog
.modal-content
.modal-header
%h5#modal-ban-label.modal-title
%h5.modal-title#modal-ban-label
= t 'views.modal.bancontrol.title'
%button.close{"data-dismiss" => "modal", :type => "button"}
%span{"aria-hidden" => "true"} ×
%button.close{ data: { dismiss: :modal }, type: :button }
%span{ aria: { hidden: true } } ×
%span.sr-only Close
= bootstrap_form_tag(url: '/mod/ban', html: { method: :post, novalidate: "novalidate" }) do |f|
= f.hidden_field :user, value: @user.screen_name
#ban-control-super.modal-body
= f.check_box :ban, label: t('views.modal.bancontrol.ban'), checked: @user.banned?
#ban-controls{style: "#{"display: none" unless @user.banned?}"}
= f.check_box :permaban, label: t('views.modal.bancontrol.permanent'), checked: @user.permanently_banned?
#ban-controls-time{style: "#{"display: none" unless not @user.permanently_banned?}"}
= f.text_field :until, label: "", required: true, value: (@user.banned_until || DateTime.current).strftime("%m/%d/%Y %I:%M %p")
= f.text_field :reason, placeholder: t('views.modal.bancontrol.reason'), value: @user.ban_reason
= bootstrap_form_tag(url: '/mod/ban', html: { method: :post, novalidate: :novalidate }) do |f|
= f.hidden_field :user, value: user.screen_name
.modal-body#ban-control-super
= f.check_box :ban, label: t('views.modal.bancontrol.ban'), checked: user.banned?
#ban-controls{ style: !user.banned? ? 'display: none' : '' }
= f.check_box :permaban, label: t('views.modal.bancontrol.permanent'), checked: user.permanently_banned?
#ban-controls-time{ style: user.permanently_banned? ? 'display: none' : '' }
= f.text_field :until, label: '', required: true, value: (user.banned_until || DateTime.current).strftime('%m/%d/%Y %I:%M %p')
= f.text_field :reason, placeholder: t('views.modal.bancontrol.reason'), value: user.ban_reason
.modal-footer
%button.btn.btn-default{name: 'stop-time', type: :button, data: { dismiss: :modal }}= t 'views.actions.close'
= f.submit t('views.modal.bancontrol.hammertime'), class: "btn btn-primary", name: 'hammer-time'
%button.btn.btn-default{ name: 'stop-time', type: :button, data: { dismiss: :modal } }= t 'views.actions.close'
= f.submit t('views.modal.bancontrol.hammertime'), class: 'btn btn-primary', name: 'hammer-time'

View File

@ -1,18 +1,18 @@
.modal.fade{"id" => "modal-view-comment#{comment.id}-smiles","aria-hidden" => "true", "aria-labelledby" => "modal-view-comment#{comment.id}-smiles-label", :role => "dialog", :tabindex => "-1"}
.modal.fade{ id: "modal-view-comment#{comment.id}-smiles", aria: { hidden: true, labelledby: 'modal-commentsmile-label' }, role: :dialog, tabindex: -1 }
.modal-dialog
.modal-content
.modal-header
%h5#modal-ask-followers-label.modal-title= t 'views.answerbox.commentsmile'
%button.close{"data-dismiss" => "modal", :type => "button"}
%span{"aria-hidden" => "true"} ×
%h5.modal-title#modal-commentsmile-label= t 'views.answerbox.commentsmile'
%button.close{ data: { dismiss: :modal }, type: :button }
%span{ aria: { hidden: true } } ×
%span.sr-only Close
.modal-body
- if comment.smiles.all.count == 0
- if comment.smiles.all.count.zero?
= t 'views.answerbox.no_smile'
- else
%ul.smiles__user-list
- comment.smiles.all.each do |smile|
%li.smiles__user-list-entry
%a{href: show_user_profile_path(smile.user.screen_name)}
%img{src: smile.user.profile_picture.url(:medium), alt: user_screen_name(smile.user, url: false)}
%a{ href: show_user_profile_path(smile.user.screen_name) }
%img{ src: smile.user.profile_picture.url(:medium), alt: user_screen_name(smile.user, url: false) }
%span= user_screen_name(smile.user, url: false)

View File

@ -1,28 +1,28 @@
#modal-group-memberships.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-group-memberships-label", :role => "dialog", :tabindex => "-1"}
.modal.fade#modal-group-memberships{ aria: { hidden: true, labelledby: 'modal-group-memberships-label' }, role: :dialog, tabindex: -1 }
.modal-dialog
.modal-content
.modal-header
%h5#modal-group-memberships-label.modal-title= t 'views.modal.group.title'
%button.close{"data-dismiss" => "modal", :type => "button"}
%span{"aria-hidden" => "true"} ×
%h5.modal-title#modal-group-memberships-label= t 'views.modal.group.title'
%button.close{ data: { dismiss: :modal }, type: :button }
%span{ aria: { hidden: true } } ×
%span.sr-only= t 'views.actions.close'
%div{role: "tabpanel"}
%ul.nav.nav-tabs.mt-1{role: "tablist"}
%li.nav-item{role: "presentation"}
%a.nav-link.active{href: "#grouplist", aria: {controls: "grouplist"}, data: {toggle: "tab"}, role: "tab"}
%div{ role: :tabpanel }
%ul.nav.nav-tabs.mt-1{ role: :tablist }
%li.nav-item{ role: 'presentation' }
%a.nav-link.active{ href: '#grouplist', aria: { controls: 'grouplist' }, data: { toggle: :tab }, role: :tab }
= t 'views.modal.group.tabs.main'
%li.nav-item{role: "presentation"}
%a.nav-link{href: "#create", aria: {controls: "create"}, data: {toggle: "tab"}, role: "tab"}
%li.nav-item{ role: 'presentation' }
%a.nav-link{ href: '#create', aria: { controls: 'create' }, data: { toggle: :tab }, role: :tab }
= t 'views.modal.group.tabs.create'
.tab-content
.tab-pane.active{role:"tabpanel", id: "grouplist"}
.tab-pane.active{ role: :tabpanel, id: 'grouplist' }
%ul.list-group
- current_user.groups.each do |group|
= render 'modal/group/item', group: group, user: @user
.tab-pane{role:"tabpanel", id: "create"}
= render 'modal/group/item', group: group, user: user
.tab-pane{ role: :tabpanel, id: 'create' }
.modal-body
%input#new-group-name.form-control{type: :text, placeholder: t('views.modal.group.name')}
%button#create-group.btn.btn-primary{type: :button, data: { user: @user.screen_name }}= t('views.modal.group.create')
%input.form-control#new-group-name{ type: :text, placeholder: t('views.modal.group.name') }
%button.btn.btn-primary#create-group{ type: :button, data: { user: user.screen_name } }= t('views.modal.group.create')
.modal-footer
%button.btn.btn-primary{name: 'gm-save', type: :button, data: { dismiss: :modal }}= t 'views.actions.done'
%button.btn.btn-primary{ name: 'gm-save', type: :button, data: { dismiss: :modal } }= t 'views.actions.done'

View File

@ -1,13 +1,16 @@
#modal-passwd.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-passwd-label", :role => "dialog", :tabindex => "-1"}
.modal.fade#modal-passwd{ aria: { hidden: true, labelledby: 'modal-passwd-label' }, role: :dialog, tabindex: -1 }
.modal-dialog
.modal-content
.modal-header
%h5#modal-passwd-label.modal-title= t 'views.settings.account.modal.title'
%button.close{"data-dismiss" => "modal", :type => "button"}
%span{"aria-hidden" => "true"} ×
%h5.modal-title#modal-passwd-label= t 'views.settings.account.modal.title'
%button.close{ data: { dismiss: :modal }, type: :button }
%span{ aria: { hidden: true } } ×
%span.sr-only= t 'views.actions.close'
.modal-body
= f.password_field :current_password, autocomplete: "off", label: t('views.settings.account.password_current'), help: t('views.settings.account.password_current_help')
= f.password_field :current_password,
autocomplete: :off,
label: t('views.settings.account.password_current'),
help: t('views.settings.account.password_current_help')
.modal-footer
%button.btn.btn-default{"data-dismiss" => "modal", :type => "button"}= t 'views.actions.cancel'
%button.btn.btn-primary{:type => "submit"}= t 'views.actions.save'
%button.btn.btn-default{ data: { dismiss: :modal }, type: :button }= t 'views.actions.cancel'
%button.btn.btn-primary{ type: :submit }= t 'views.actions.save'

View File

@ -1,15 +1,15 @@
#modal-privileges.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-privileges-label", :role => "dialog", :tabindex => "-1"}
.modal.fade#modal-privileges{ aria: { hidden: true, labelledby: 'modal-privileges-label' }, role: :dialog, tabindex: -1 }
.modal-dialog
.modal-content
.modal-header
%h5#modal-privileges-label.modal-title
= raw t('views.actions.privilege', user: @user.screen_name)
%button.close{"data-dismiss" => "modal", :type => "button"}
%span{"aria-hidden" => "true"} ×
%h5.modal-title#modal-privileges-label
= raw t('views.actions.privilege', user: user.screen_name)
%button.close{ data: { dismiss: :modal }, type: :button }
%span{ aria: { hidden: true } } ×
%span.sr-only= t 'views.actions.close'
%ul.list-group.groups--list
- if current_user.has_role?(:administrator)
= render 'modal/privileges/item', privilege: 'moderator', description: t('views.modal.privilege.moderator'),user: @user
= render 'modal/privileges/item', privilege: 'admin', description: t('views.modal.privilege.admin'), user: @user
= render 'modal/privileges/item', privilege: 'moderator', description: t('views.modal.privilege.moderator'), user: user
= render 'modal/privileges/item', privilege: 'admin', description: t('views.modal.privilege.admin'), user: user
.modal-footer
%button.btn.btn-primary{name: 'checked-privileges', type: :button, data: { dismiss: :modal }}= t 'views.actions.done'
%button.btn.btn-primary{ name: 'checked-privileges', type: :button, data: { dismiss: :modal } }= t 'views.actions.done'

View File

@ -1,15 +1,18 @@
%li.list-group-item{id: "group-#{group.name}"}
%li.list-group-item{ id: "group-#{group.name}" }
.media
.pull-left
.custom-control.custom-checkbox
%input.custom-control-input{type: :checkbox, id: "groupCheck#{group.id}", name: 'gm-group-check', data: { group: group.name, user: user.screen_name }, checked: user.member_of?(group), autocomplete: 'off'}
%label.custom-control-label{for: "groupCheck#{group.id}"}
%input.custom-control-input{ type: :checkbox,
id: "groupCheck#{group.id}",
name: 'gm-group-check',
data: { group: group.name, user: user.screen_name }, checked: user.member_of?(group), autocomplete: :off }
%label.custom-control-label{ for: "groupCheck#{group.id}" }
.media-body
.list-group-item-heading= group.display_name
.list-group-item-text.text-muted
%span{id: "#{group.name}-members"}= group.members.count
%span{ id: "#{group.name}-members" }= group.members.count
= t 'views.modal.group.members'
·
%a.text-danger#delete-group{href: "#", data: { group: group.name }}
%a.text-danger#delete-group{ href: '#', data: { group: group.name } }
%i.fa.fa-close
= t 'views.actions.delete'

View File

@ -1,11 +1,12 @@
- description ||= ''
- role_mapping = {"admin" => "administrator"}
- requires_role = %w[admin moderator].include?(privilege)
- checked = requires_role ? user.has_role?(role_mapping.fetch(privilege, privilege).to_sym) : user.public_send("#{privilege}?")
%li.list-group-item{id: "privilege-#{privilege}"}
:ruby
description ||= ''
role_mapping = { admin: 'administrator' }
requires_role = %w[admin moderator].include?(privilege)
checked = requires_role ? user.has_role?(role_mapping.fetch(privilege, privilege).to_sym) : user.public_send("#{privilege}?")
%li.list-group-item{ id: "privilege-#{privilege}" }
.media
.pull-left
%input{type: :checkbox, name: 'check-your-privileges', data: { type: privilege, user: user.screen_name }, checked: checked, autocomplete: 'off'}
%input{ type: :checkbox, name: 'check-your-privileges', data: { type: privilege, user: user.screen_name }, checked: checked, autocomplete: :off }
.media-body
.list-group-item-heading= privilege.capitalize
- unless description.blank?

View File

@ -0,0 +1,4 @@
%a.btn.btn-default.btn-block{ href: moderation_priority_path(user.id) }
View reports relating to user
%a.btn.btn-default.btn-block{ href: moderation_ip_path(user.id) }
View users with same IP

View File

@ -1,4 +0,0 @@
%a.btn.btn-default.btn-block{href: moderation_priority_path(user.id)}
View reports relating to user
%a.btn.btn-default.btn-block{href: moderation_ip_path(user.id)}
View users with same IP

View File

@ -0,0 +1,29 @@
- if report.moderation_comments.all.count.zero?
= t 'views.answerbox.no_comment'
- else
%ul.comment__container
- report.moderation_comments.order(:created_at).each do |comment|
%li.comment{ data: { comment_id: comment.id } }
.media
.pull-left
%img.comment__user-avatar.avatar-sm{ src: comment.user.profile_picture.url(:medium) }
.media-body
%h6.media-heading.comment__user
= user_screen_name comment.user
%span.text-muted{ title: comment.created_at, data: { toggle: :tooltip, placement: :right } }
= time_ago_in_words(comment.created_at)
ago
- if comment.user == current_user
.pull-right
.btn-group
%button.btn.btn-link.btn-sm.dropdown-toggle{ data: { toggle: :dropdown }, aria: { expanded: false } }
%span.caret
.dropdown-menu.dropdown-menu-right{ role: :menu }
%a.dropdown-item.text-danger{ href: '#', tabindex: -1, data: { action: 'mod-comment-destroy', id: comment.id } }
%i.fa.fa-trash-o
= t 'views.actions.delete'
.comment__content
= comment.content
.form-group.has-feedback{ name: 'mod-comment-new-group', data: { id: report.id } }
%input.form-control.comments--box{ type: :text, placeholder: t('views.placeholder.comment'), name: 'mod-comment-new', data: { id: report.id } }
%span.text-muted.form-control-feedback.comments--count{ id: "mod-comment-charcount-#{report.id}" } 160

View File

@ -1,28 +0,0 @@
- if report.moderation_comments.all.count == 0
= t 'views.answerbox.no_comment'
- else
%ul.comment__container
- report.moderation_comments.order(:created_at).each do |comment|
%li.comment{data: { comment_id: comment.id }}
.media
.pull-left
%img.comment__user-avatar.avatar-sm{src: comment.user.profile_picture.url(:medium)}
.media-body
%h6.media-heading.comment__user
= user_screen_name comment.user
%span.text-muted{title: comment.created_at, data: { toggle: :tooltip, placement: :right }}
= "#{time_ago_in_words(comment.created_at)} ago"
- if comment.user == current_user
.pull-right
.btn-group
%button.btn.btn-link.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }}
%span.caret
.dropdown-menu.dropdown-menu-right{role: :menu}
%a.dropdown-item.text-danger{href: '#', tabindex: -1, data: { action: 'mod-comment-destroy', id: comment.id }}
%i.fa.fa-trash-o
= t 'views.actions.delete'
.comment__content
= comment.content
.form-group.has-feedback{name: 'mod-comment-new-group', data: { id: report.id }}
%input.form-control.comments--box{type: :text, placeholder: t('views.placeholder.comment'), name: 'mod-comment-new', data: { id: report.id }}
%span.text-muted.form-control-feedback.comments--count{id: "mod-comment-charcount-#{report.id}"} 160

View File

@ -0,0 +1,55 @@
- unless report.nil? || report.target.nil? || report.user.nil? || report.type.nil?
.card.moderationbox{ data: { id: report.id } }
.card-header
%img.avatar-sm{ src: report.user.profile_picture.url(:medium) }
= raw t('views.moderation.moderationbox.reported',
user: user_screen_name(report.user),
content: report.type.sub('Reports::', ''),
time: time_tooltip(report))
.card-body
%p
- if report.type == 'Reports::User'
= user_screen_name report.target
- else
= report.target.content
%p
%b= t 'views.moderation.moderationbox.reason'
%br
- if report.reason.nil? || report.reason.strip.blank?
No reason provided
- else
- report.reason.lines.each do |reason|
- next if reason.strip.blank?
= reason.strip
.row
.col-md-8.col-sm-8.col-xs-8.text-left
%a.btn.btn-primary{ href: content_url(report) }
= t('views.moderation.moderationbox.view', content: report.type.sub('Reports::', ''))
- if report.target.respond_to?(:user) && report.target.user
%a.btn.btn-primary{ href: show_user_profile_path(report.target.user.screen_name) }
= t('views.moderation.moderationbox.view', content: t('views.general.user'))
%a.btn.btn-primary{ href: moderation_priority_path(report.target.user.id) }
Reports
%a.btn.btn-primary{ href: moderation_ip_path(report.target.user.id) }
IP
.col-md-4.col-sm-4.col-xs-4.text-right
%span.mod-count{ id: "mod-count-#{report.id}" }
= report.votes
.btn-group
%button.btn.btn-success.btn-sm{ type: :button,
name: 'mod-vote',
disabled: current_user.report_x_voted?(report, true) ? :disabled : nil,
data: { id: report.id, action: current_user.report_voted?(report) ? 'unvote' : 'vote', vote_type: 'upvote' } }
%i.fa.fa-thumbs-up
%button.btn.btn-danger.btn-sm{ type: :button,
name: 'mod-vote',
disabled: current_user.report_x_voted?(report, false) ? :disabled : nil,
data: { id: report.id, action: current_user.report_voted?(report) ? 'unvote' : 'vote', vote_type: 'downvote' } }
%i.fa.fa-thumbs-down
%button.btn.btn-primary.btn-sm{ type: :button, name: 'mod-comments', data: { id: report.id, state: :hidden } }
%i.fa.fa-comments
%span{ id: "mod-comment-count-#{report.id}" }= report.moderation_comments.all.count
%button.btn.btn-default.btn-sm{ type: :button, name: 'mod-delete-report', data: { id: report.id } }
%i.fa.fa-trash-o
.card-footer{ id: "mod-comments-section-#{report.id}", style: 'display: none' }
%div{ id: "mod-comments-#{report.id}" }= render 'moderation/discussion', report: report

View File

@ -1,46 +0,0 @@
- unless report.nil? or report.target.nil? or report.user.nil? or report.type.nil?
.card.moderationbox{data: { id: report.id }}
.card-header
%img.avatar-sm{src: report.user.profile_picture.url(:medium)}
= raw t('views.moderation.moderationbox.reported', user: user_screen_name(report.user), content: report.type.sub('Reports::', ''), time: time_tooltip(report))
.card-body
%p
- if report.type == 'Reports::User'
= user_screen_name report.target
- else
= report.target.content
%p
%b= t 'views.moderation.moderationbox.reason'
%br
- if report.reason.nil? or report.reason.strip.blank?
No reason provided
- else
- report.reason.lines.each do |reason|
- next if reason.strip.blank?
= reason.strip
.row
.col-md-8.col-sm-8.col-xs-8.text-left
%a.btn.btn-primary{href: content_url(report)}
= t('views.moderation.moderationbox.view', content: report.type.sub('Reports::', ''))
- if report.target.respond_to? :user and not report.target.user.nil?
%a.btn.btn-primary{href: show_user_profile_path(report.target.user.screen_name)}
= t('views.moderation.moderationbox.view', content: t('views.general.user'))
%a.btn.btn-primary{href: moderation_priority_path(report.target.user.id)}
Reports
%a.btn.btn-primary{href: moderation_ip_path(report.target.user.id)}
IP
.col-md-4.col-sm-4.col-xs-4.text-right
%span.mod-count{id: "mod-count-#{report.id}"}
= report.votes
.btn-group
%button.btn.btn-success.btn-sm{type: :button, name: "mod-vote", disabled: current_user.report_x_voted?(report, true) ? 'disabled' : nil, data: { id: report.id, action: current_user.report_voted?(report) ? 'unvote' : 'vote', vote_type: 'upvote' }}
%i.fa.fa-thumbs-up
%button.btn.btn-danger.btn-sm{type: :button, name: "mod-vote", disabled: current_user.report_x_voted?(report, false) ? 'disabled' : nil, data: { id: report.id, action: current_user.report_voted?(report) ? 'unvote' : 'vote', vote_type: 'downvote' }}
%i.fa.fa-thumbs-down
%button.btn.btn-primary.btn-sm{type: :button, name: 'mod-comments', data: { id: report.id, state: :hidden }}
%i.fa.fa-comments
%span{id: "mod-comment-count-#{report.id}"}= report.moderation_comments.all.count
%button.btn.btn-default.btn-sm{type: :button, name: "mod-delete-report", data: { id: report.id }}
%i.fa.fa-trash-o
.card-footer{id: "mod-comments-section-#{report.id}", style: 'display: none'}
%div{id: "mod-comments-#{report.id}"}= render 'moderation/discussion', report: report

View File

@ -1,14 +1,16 @@
.card.h-100.userbox
%img.userbox__header{src: user.profile_header.url(:mobile)}
%img.userbox__header{ src: user.profile_header.url(:mobile) }
.card-body
%img.userbox__avatar{src: user.profile_picture.url(:small)}
%a.profile__name{href: show_user_profile_path(user.screen_name)}
%img.userbox__avatar{ src: user.profile_picture.url(:small) }
%a.profile__name{ href: show_user_profile_path(user.screen_name) }
- unless user.display_name.blank?
.profile__display-name
= user.display_name
.profile__screen-name
= user.screen_name
.row
.col-md-12.col-sm-12.col-xs-12
- unless count.nil?
- if count.positive?
%h4.entry-text.text-center#asked-count
= count
= 'Report'.pluralize(count)

View File

@ -1,10 +0,0 @@
%nav.navbar.navbar-light.navbar-static-top.j2-navbar.d-flex.d-sm-none.bg-white{role: "navigation"}
%a.navbar-brand{href: "/"} Timelines
%button.navbar-toggler{"data-target" => "#j2-tl-navbar-collapse", "data-toggle" => "collapse", type: "button"}
%span.sr-only Toggle navigation
%span.navbar-toggler-icon
#j2-tl-navbar-collapse.collapse.navbar-collapse
%ul.nav.navbar-nav
= nav_entry "Public", public_timeline_path
- current_user.groups.each do |group|
= nav_entry group.display_name, group_timeline_path(group.name)

View File

@ -1,10 +1,10 @@
%nav.navbar.navbar-dark.navbar-expand-lg.bg-primary.fixed-top{role: "navigation"}
.container{class: ios_web_app? ? "ios-web-app" : ''}
%a.navbar-brand{href: "/"}= APP_CONFIG['site_name']
%button.navbar-toggler{"data-target" => "#j2-main-navbar-collapse", "data-toggle" => "collapse", type: "button"}
%nav.navbar.navbar-dark.navbar-expand-lg.bg-primary.fixed-top{ role: :navigation }
.container{ class: ios_web_app? ? 'ios-web-app' : '' }
%a.navbar-brand{ href: '/' }= APP_CONFIG['site_name']
%button.navbar-toggler{ data: { target: '#j2-main-navbar-collapse', toggle: :collapse }, type: :button }
%span.sr-only Toggle navigation
%span.navbar-toggler-icon
#j2-main-navbar-collapse.collapse.navbar-collapse
.collapse.navbar-collapse#j2-main-navbar-collapse
%ul.nav.navbar-nav.ml-auto
= nav_entry t('views.sessions.create'), new_user_session_path
= nav_entry t('views.sessions.new'), new_user_registration_path
= nav_entry t('views.sessions.new'), new_user_registration_path

View File

@ -1,28 +1,28 @@
%nav.navbar.navbar-themed.navbar-expand-lg.bg-primary.fixed-top{role: "navigation"}
.container{class: ios_web_app? ? "ios-web-app" : ''}
%a.navbar-brand{href: "/"}= APP_CONFIG['site_name']
%button.navbar-toggler{"data-target" => "#j2-main-navbar-collapse", "data-toggle" => "collapse", type: "button"}
%nav.navbar.navbar-themed.navbar-expand-lg.bg-primary.fixed-top{ role: :navigation }
.container{ class: ios_web_app? ? 'ios-web-app' : '' }
%a.navbar-brand{ href: '/' }= APP_CONFIG['site_name']
%button.navbar-toggler{ data: { target: '#j2-main-navbar-collapse', toggle: :collapse }, type: :button }
%span.sr-only Toggle navigation
%span.navbar-toggler-icon
#j2-main-navbar-collapse.collapse.navbar-collapse
.collapse.navbar-collapse#j2-main-navbar-collapse
%ul.nav.navbar-nav.mr-auto
= nav_entry t('views.navigation.timeline'), root_path
= nav_entry t('views.navigation.inbox'), "/inbox", badge: inbox_count
= nav_entry t('views.navigation.inbox'), '/inbox', badge: inbox_count
- if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod?
= nav_entry t('views.navigation.discover'), discover_path
%ul.nav.navbar-nav
- unless @user.nil?
- unless @user == current_user
%li.nav-item.d-none.d-sm-block{"data-toggle" => "tooltip", "data-placement" => "bottom", title: t('views.actions.group')}
%a.nav-link{href: '#', data: { target: "#modal-group-memberships", toggle: :modal }}
%li.nav-item.d-none.d-sm-block{ data: { toggle: 'tooltip', placement: 'bottom' }, title: t('views.actions.group') }
%a.nav-link{ href: '#', data: { target: '#modal-group-memberships', toggle: :modal } }
%i.fa.fa-users.hidden-xs
%span.d-none.d-sm-inline.d-md-none= t('views.actions.group')
= render "navigation/main/notifications"
%li.nav-item.d-none.d-sm-block{"data-toggle" => "tooltip", "data-placement" => "bottom", title: t('views.actions.ask_question')}
%a.nav-link{href: "#", name: "toggle-all-ask", "data-target" => "#modal-ask-followers", "data-toggle" => "modal"}
= render 'navigation/main/notifications'
%li.nav-item.d-none.d-sm-block{ data: { toggle: 'tooltip', placement: 'bottom' }, title: t('views.actions.ask_question') }
%a.nav-link{ href: '#', name: 'toggle-all-ask', data: { target: '#modal-ask-followers', toggle: :modal } }
%i.fa.fa-pencil-square-o
= render "navigation/main/profile"
= render 'navigation/main/profile'
= render 'modal/ask'
%button.btn.btn-primary.btn-fab.d-block.d-sm-none{"data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"}
%i.fa.fa-pencil-square-o
%button.btn.btn-primary.btn-fab.d-block.d-sm-none{ data: { target: '#modal-ask-followers', toggle: :modal }, type: 'button' }
%i.fa.fa-pencil-square-o

View File

@ -1,13 +1,13 @@
%nav.navbar.navbar-light.bg-light.navbar-static-top.j2-navbar.d-flex.d-sm-none{role: "navigation"}
%a.navbar-brand{href: moderation_path} Moderation
%button.navbar-toggler{"data-target" => "#j2-tl-navbar-collapse", "data-toggle" => "collapse", type: "button"}
%nav.navbar.navbar-light.bg-light.navbar-static-top.j2-navbar.d-flex.d-sm-none{ role: :navigation }
%a.navbar-brand{ href: moderation_path } Moderation
%button.navbar-toggler{ data: { target: '#j2-tl-navbar-collapse', toggle: :collapse }, type: :button }
%span.sr-only Toggle navigation
%span.navbar-toggler-icon
#j2-tl-navbar-collapse.collapse.navbar-collapse
.collapse.navbar-collapse#j2-tl-navbar-collapse
%ul.nav.navbar-nav
= nav_entry t('views.moderation.tabs.all'), moderation_path
= nav_entry t('views.general.answer').pluralize(2) , moderation_path('answer')
= nav_entry t('views.general.comment').pluralize(2), moderation_path('comment')
= nav_entry t('views.general.user').pluralize(2) , moderation_path('user')
= nav_entry t('views.general.question').pluralize(2), moderation_path('question')
= nav_entry 'Priority', moderation_priority_path
= nav_entry t('views.general.answer').pluralize(2), moderation_path('answer')
= nav_entry t('views.general.comment').pluralize(2), moderation_path('comment')
= nav_entry t('views.general.user').pluralize(2), moderation_path('user')
= nav_entry t('views.general.question').pluralize(2), moderation_path('question')
= nav_entry 'Priority', moderation_priority_path

View File

@ -1,12 +1,12 @@
%nav.navbar.navbar-light.bg-white.navbar-static-top.j2-navbar.d-flex.d-sm-none{role: "navigation"}
%a.navbar-brand{href: notifications_path} Notifications
%button.navbar-toggler{"data-target" => "#j2-tl-navbar-collapse", "data-toggle" => "collapse", type: "button"}
%nav.navbar.navbar-light.bg-white.navbar-static-top.d-flex.d-sm-none{ role: :navigation }
%a.navbar-brand{ href: notifications_path } Notifications
%button.navbar-toggler{ data: { target: '#j2-tl-navbar-collapse', toggle: :collapse }, type: :button }
%span.sr-only Toggle navigation
%span.navbar-toggler-icon
#j2-tl-navbar-collapse.collapse.navbar-collapse
.collapse.navbar-collapse#j2-tl-navbar-collapse
%ul.nav.navbar-nav
= nav_entry "New Notifications", notifications_path
= nav_entry "All Notifications", notifications_path('all')
= nav_entry 'New Notifications', notifications_path
= nav_entry 'All Notifications', notifications_path('all')
= nav_entry t('views.notifications.tabs.answer'), notifications_path('answer')
= nav_entry t('views.notifications.tabs.smile'), notifications_path('smile')
= nav_entry t('views.notifications.tabs.comment'), notifications_path('comment')

View File

@ -1,7 +1,7 @@
= nav_entry t('views.navigation.notifications'), notifications_path, badge: notification_count, class: 'd-block d-sm-none'
- notifications = Notification.for(current_user).where(new: true).limit(4)
%li.nav-item.dropdown.d-none.d-sm-block
%a.nav-link.dropdown-toggle{href: "#", "data-toggle" => "dropdown"}
%a.nav-link.dropdown-toggle{ href: '#', data: { toggle: :dropdown } }
- if notification_count.nil?
%i.fa.fa-bell-o
- else
@ -9,11 +9,11 @@
%span.sr-only Notifications
%span.badge= notification_count
.dropdown-menu.dropdown-menu-right.notification-dropdown
- if notifications.count == 0
- if notifications.count.zero?
.dropdown-item.text-center.p-2
%i.fa.fa-bell-o.notification__bell-icon
%p No new notifications.
%a.dropdown-item.text-center{href: notifications_path('all')}
%a.dropdown-item.text-center{ href: notifications_path('all') }
%i.fa.fa-fw.fa-chevron-right
Show all notifications
- else
@ -21,6 +21,6 @@
.dropdown-item
= render "notifications/type/#{notification.target_type.downcase}", notification: notification
%a.dropdown-item.text-center{href: notifications_path}
%a.dropdown-item.text-center{ href: notifications_path }
%i.fa.fa-fw.fa-chevron-right
Show all new notifications

View File

@ -1,37 +1,37 @@
%li.nav-item.dropdown.profile--image-dropdown
%a.nav-link.dropdown-toggle.p-sm-0{href: "#", "data-toggle" => "dropdown"}
%img.avatar-md.d-none.d-sm-inline{src: current_user.profile_picture.url(:small)}
%a.nav-link.dropdown-toggle.p-sm-0{ href: '#', data: { toggle: :dropdown } }
%img.avatar-md.d-none.d-sm-inline{ src: current_user.profile_picture.url(:small) }
%span.d-inline.d-sm-none
= current_user.screen_name
%b.caret
.dropdown-menu
%h6.dropdown-header.d-none.d-sm-block= current_user.screen_name
%a.dropdown-item{href: show_user_profile_path(current_user.screen_name)}
%a.dropdown-item{ href: show_user_profile_path(current_user.screen_name) }
%i.fa.fa-fw.fa-user
= t('views.navigation.show')
%a.dropdown-item{href: edit_user_registration_path}
%a.dropdown-item{ href: edit_user_registration_path }
%i.fa.fa-fw.fa-cog
= t('views.navigation.settings')
.dropdown-divider
- if current_user.has_role?(:administrator)
%a.dropdown-item{href: rails_admin_path}
%a.dropdown-item{ href: rails_admin_path }
%i.fa.fa-fw.fa-cogs
= t('views.navigation.admin')
%a.dropdown-item{href: sidekiq_web_path}
%a.dropdown-item{ href: sidekiq_web_path }
%i.fa.fa-fw.fa-bar-chart
= t('views.navigation.sidekiq')
%a.dropdown-item{href: pghero_path}
%a.dropdown-item{ href: pghero_path }
%i.fa.fa-fw.fa-database
Database Monitor
%a.dropdown-item{href: announcement_index_path}
%a.dropdown-item{ href: announcement_index_path }
%i.fa.fa-fw.fa-info
Announcements
.dropdown-divider
- if current_user.mod?
%a.dropdown-item{href: moderation_path}
%a.dropdown-item{ href: moderation_path }
%i.fa.fa-fw.fa-gavel
= t('views.navigation.moderation')
.dropdown-divider
%a.dropdown-item{href: destroy_user_session_path, data: {method: :delete} }
%a.dropdown-item{ href: destroy_user_session_path, data: { method: :delete } }
%i.fa.fa-fw.fa-sign-out
= t 'views.sessions.destroy'

View File

@ -1,11 +1,11 @@
.card
%ul#notifications.list-group
- if @notifications.count == 0
%ul.list-group#notifications
- if @notifications.count.zero?
%li.list-group-item.text-center
.notifications--none
%i.fa.fa-bell-o.notification__bell-icon
%p
- if params[:type] != "all"
- if params[:type] != 'all'
No new notifications.
- else
No notifications.
@ -19,5 +19,5 @@
= render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @notifications_last_id, permitted_params: %i[type]
- if @more_data_available
%button#load-more-btn.btn.btn-default{type: :button, data: { last_id: @notifications_last_id }}
%button.btn.btn-default#load-more-btn{ type: :button, data: { last_id: @notifications_last_id } }
Load more

View File

@ -3,10 +3,10 @@
%i.fa.fa-2x.fa-fw.fa-exclamation
.media-body
.notification__heading
%img.avatar-xs{src: notification.target.user.profile_picture.url(:small)}
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small) }
= user_screen_name notification.target.user
answered
= link_to "your question", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id)
= link_to 'your question', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id)
= time_tooltip(notification.target)
ago
.list-group
@ -14,9 +14,9 @@
.media.question-media
.media-body
%h6.notification__list-heading question
= markdown notification.target.question.content[0..60] + "#{notification.target.question.content.length > 60 ? '[...]' : ''}"
= markdown notification.target.question.content[0..60] + (notification.target.question.content.length > 60 ? '[...]' : '')
.list-group-item
.media.question-media
.media-body
%h6.notification__list-heading answer
= markdown notification.target.content[0..60] + "#{notification.target.content.length > 60 ? '[...]' : ''}"
= markdown notification.target.content[0..60] + (notification.target.content.length > 60 ? '[...]' : '')

View File

@ -3,15 +3,16 @@
%i.fa.fa-2x.fa-fw.fa-comments
.media-body
.notification__heading
%img.avatar-xs{src: notification.target.user.profile_picture.url(:small)}
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small) }
= user_screen_name notification.target.user
commented on
- if notification.target.answer.user == current_user
= link_to "your answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
= link_to 'your answer', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
- elsif notification.target.user == notification.target.answer.user
= link_to "their answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
= link_to 'their answer', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
- else
= link_to "#{notification.target.answer.user.screen_name}'s answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
= link_to "#{notification.target.answer.user.screen_name}'s answer",
show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
= time_tooltip(notification.target)
ago
.list-group
@ -19,9 +20,9 @@
.media.question-media
.media-body
%h6.notification__list-heading answer
= markdown notification.target.answer.content[0..60] + "#{notification.target.answer.content.length > 60 ? '[...]' : ''}"
= markdown notification.target.answer.content[0..60] + (notification.target.answer.content.length > 60 ? '[...]' : '')
.list-group-item
.media.question-media
.media-body
%h6.notification__list-heading comment
= markdown notification.target.content[0..60] + "#{notification.target.content.length > 60 ? '[...]' : ''}"
= markdown notification.target.content[0..60] + (notification.target.content.length > 60 ? '[...]' : '')

View File

@ -3,10 +3,10 @@
%i.fa.fa-2x.fa-fw.fa-smile-o
.media-body
.notification__heading
%img.avatar-xs{src: notification.target.user.profile_picture.url(:small)}
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small) }
= user_screen_name notification.target.user
smiled
= link_to "your comment", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.comment.answer.id)
= link_to 'your comment', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.comment.answer.id)
= time_tooltip(notification.target)
ago
.list-group
@ -14,4 +14,4 @@
.media.question-media
.media-body
%h6.notification__list-heading comment
= markdown notification.target.comment.content[0..60] + "#{notification.target.comment.content.length > 60 ? '[...]' : ''}"
= markdown notification.target.comment.content[0..60] + (notification.target.comment.content.length > 60 ? '[...]' : '')

View File

@ -1,8 +1,8 @@
.media.notification
.notification__icon
%img.avatar-sm{src: notification.target.source.profile_picture.url(:small)}
%img.avatar-sm{ src: notification.target.source.profile_picture.url(:small) }
.media-body
%h6.media-heading.notification__user
= user_screen_name notification.target.source
.notification__text
= raw t('views.notifications.relationship.body', time: time_ago_in_words(notification.target.created_at))
= raw t('views.notifications.relationship.body', time: time_ago_in_words(notification.target.created_at))

View File

@ -3,10 +3,10 @@
%i.fa.fa-2x.fa-fw.fa-smile-o
.media-body
.notification__heading
%img.avatar-xs{src: notification.target.user.profile_picture.url(:small)}
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small) }
= user_screen_name notification.target.user
smiled
= link_to "your answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
= link_to 'your answer', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
= time_tooltip(notification.target)
ago
.list-group
@ -14,4 +14,4 @@
.media.question-media
.media-body
%h6.notification__list-heading answer
= markdown notification.target.answer.content[0..60] + "#{notification.target.answer.content.length > 60 ? '[...]' : ''}"
= markdown notification.target.answer.content[0..60] + (notification.target.answer.content.length > 60 ? '[...]' : '')

View File

@ -5,8 +5,8 @@
= render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @timeline_last_id
- if @more_data_available
%button#load-more-btn.btn.btn-default{type: :button, data: { last_id: @timeline_last_id }}
%button.btn.btn-default#load-more-btn{ type: :button, data: { last_id: @timeline_last_id } }
Load more
- provide(:title, generate_title("Public Timeline"))
- parent_layout "feed"
- provide(:title, generate_title('Public Timeline'))
- parent_layout 'feed'

View File

@ -1,24 +1,28 @@
.card.question--fixed{class: if hidden then 'question--hidden' end, tabindex: if hidden then '-1' end, aria: { hidden: if hidden then :true end }}
.card.question--fixed{ class: hidden ? 'question--hidden' : '', tabindex: hidden ? -1 : '', aria: { hidden: hidden } }
.container
.card-body
.media
- unless question.author_is_anonymous
%a.pull-left{href: unless hidden then show_user_profile_path(question.user.screen_name) end}
%img.answerbox__question-user-avatar.avatar-md{src: question.user.profile_picture.url(:medium)}
%a.pull-left{ href: unless hidden then show_user_profile_path(question.user.screen_name) end }
%img.answerbox__question-user-avatar.avatar-md{ src: question.user.profile_picture.url(:medium) }
.media-body
- if user_signed_in?
.pull-right
.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
- unless hidden
.dropdown-menu.dropdown-menu-right{role: :menu}
- if current_user.mod? or question.user == current_user
%a.dropdown-item.text-danger{href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: question.id, redirect: if question.author_is_anonymous? then "/" else show_user_questions_path(question.user.screen_name) end }}
.dropdown-menu.dropdown-menu-right{ role: :menu }
- if current_user.mod? || question.user == current_user
%a.dropdown-item.text-danger{ href: '#',
tabindex: -1,
data: { action: 'ab-question-destroy',
q_id: question.id,
redirect: question.author_is_anonymous? ? '/' : show_user_questions_path(question.user.screen_name) } }
%i.fa.fa-trash-o
= t 'views.actions.delete'
- unless question.user == current_user
%a.dropdown-item{href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: question.id }}
%a.dropdown-item{ href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: question.id } }
%i.fa.fa-exclamation-triangle
= t 'views.actions.report'
%h6.text-muted.media-heading.answerbox__question-user

View File

@ -9,18 +9,18 @@
= render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @answers_last_id
- if @more_data_available
%button#load-more-btn.btn.btn-default{type: :button, data: { last_id: @answers_last_id }}
%button.btn.btn-default#load-more-btn{ type: :button, data: { last_id: @answers_last_id } }
Load more
- if user_signed_in? && !current_user.answered?(@question) && current_user != @question.user && @question.user&.privacy_allow_stranger_answers
.card#q-answer-box
.card-header= t('views.question.title')
.card-body
%textarea#q-answer.form-control{placeholder: t('views.placeholder.inbox'), data: { id: @question.id }}
%textarea.form-control#q-answer-text{ placeholder: t('views.placeholder.inbox'), data: { id: @question.id } }
%br/
%button#q-answer.btn.btn-success{data: { q_id: @question.id }}
%button.btn.btn-success#q-answer-btn{ data: { q_id: @question.id } }
= t('views.actions.answer')
- current_user.services.each do |service|
%label
%input{type: 'checkbox', name: 'share', checked: :checked, data: { q_id: @question.id, service: service.provider }}
%input{ type: 'checkbox', name: 'share', checked: :checked, data: { q_id: @question.id, service: service.provider } }
= t('views.inbox.entry.sharing.post', service: service.provider.capitalize)

Some files were not shown because too many files have changed in this diff Show More