Fix lints in app/views/shared

This commit is contained in:
Andreas Nedbal 2020-05-10 10:02:04 +02:00
parent ab21a4ded3
commit fe70717510
10 changed files with 51 additions and 51 deletions

View File

@ -2,8 +2,8 @@
- @active_announcements.each do |announcement| - @active_announcements.each do |announcement|
.alert.announcement.alert-info.alert-dismissable.d-none{ data: { 'announcement-id': announcement.id } } .alert.announcement.alert-info.alert-dismissable.d-none{ data: { 'announcement-id': announcement.id } }
.container .container
%button.close{ type: "button", "data-dismiss" => "alert" } %button.close{ type: 'button', 'data-dismiss' => 'alert' }
%span{ "aria-hidden" => "true" } × %span{ 'aria-hidden' => 'true' } ×
%p %p
= announcement.content = announcement.content
- if announcement.link_present? - if announcement.link_present?

View File

@ -1,11 +1,11 @@
-# this renders a pagination html to keep compatibility with the current pagination js -# this renders a pagination html to keep compatibility with the current pagination js
-# it _should_ be replaced with something else entirely later on. it _should_ be replaced with something else entirely later on.
- permitted_params ||= [] - permitted_params ||= []
#pagination #pagination
%ul.pagination %ul.pagination
%li.next{class: more_data_available ? nil : "disabled"} %li.next{ class: more_data_available ? nil : 'disabled' }
- if more_data_available - if more_data_available
%a{rel: :next, href: url_for(params.permit(*permitted_params).merge(last_id: last_id))} %a{ rel: :next, href: url_for(params.permit(*permitted_params).merge(last_id: last_id)) }
Next page Next page
- else - else
Next page Next page

View File

@ -5,7 +5,7 @@
· ·
= link_to t('views.general.about'), about_path = link_to t('views.general.about'), about_path
· ·
= link_to "GitHub", 'https://github.com/Retrospring/retrospring' = link_to 'GitHub', 'https://github.com/Retrospring/retrospring'
· ·
= link_to t('views.general.terms'), terms_path = link_to t('views.general.terms'), terms_path
· ·

View File

@ -1,12 +1,12 @@
.container .container
.locales .locales
%span %span
%a{href: '#', id: 'locale-switch'} %a{ href: '#', id: 'locale-switch' }
%i.fa.fa-globe %i.fa.fa-globe
= t('views.locale.languages') = t('views.locale.languages')
#locales-panel.locales__panel .locales__panel#locales-panel
%ul %ul
- APP_LOCALES.each do |key, value| - APP_LOCALES.each do |key, value|
%li %li
.flag{class: "flag-#{value[1]}"} .flag{ class: "flag-#{value[1]}" }
%a{href: "?hl=#{key}"}= value[0] %a{ href: "?hl=#{key}" }= value[0]

View File

@ -0,0 +1,31 @@
- type ||= nil
.card{ data: { id: q.id } }
.card-body
.media
- if type == 'discover'
.pull-left
%a{ href: user_screen_name(q.user, link_only: true) }
%img.avatar-md.mr-2{ src: q.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 } }
%span.caret
.dropdown-menu.dropdown-menu-right{ role: :menu }
- if current_user.mod? || q.user == current_user
%a.dropdown-item.text-danger{ href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: q.id } }
%i.fa.fa-trash-o
= t 'views.actions.delete'
- unless q.user == current_user
%a.dropdown-item{ href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: q.id } }
%i.fa.fa-exclamation-triangle
= t 'views.actions.report'
%h6.media-heading.text-muted.answerbox__question-user
= raw t('views.answerbox.asked', user: user_screen_name(q.user), time: time_tooltip(q))
- if q.answer_count > 1
·
%a{ href: show_user_question_path(q.user.screen_name, q.id) }
= pluralize(q.answer_count, t('views.general.answer'))
%p.answerbox__question-text
= q.content

View File

@ -1,31 +0,0 @@
- type ||= nil
.card{data: { id: q.id }}
.card-body
.media
- if type == "discover"
.pull-left
%a{href: user_screen_name(q.user, link_only: true)}
%img.avatar-md.mr-2{src: q.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 }}
%span.caret
.dropdown-menu.dropdown-menu-right{role: :menu}
- if current_user.mod? or q.user == current_user
%a.dropdown-item.text-danger{href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: q.id }}
%i.fa.fa-trash-o
= t 'views.actions.delete'
- unless q.user == current_user
%a.dropdown-item{href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: q.id }}
%i.fa.fa-exclamation-triangle
= t 'views.actions.report'
%h6.media-heading.text-muted.answerbox__question-user
= raw t('views.answerbox.asked', user: user_screen_name(q.user), time: time_tooltip(q))
- if q.answer_count > 1
·
%a{href: show_user_question_path(q.user.screen_name, q.id)}
= pluralize(q.answer_count, t('views.general.answer'))
%p.answerbox__question-text
= q.content

View File

@ -1,7 +1,7 @@
.card.userbox .card.userbox
%img.userbox__header{src: current_user.profile_header.url(:mobile)} %img.userbox__header{ src: current_user.profile_header.url(:mobile) }
.card-body .card-body
%img.userbox__avatar{src: current_user.profile_picture.url(:small)} %img.userbox__avatar{ src: current_user.profile_picture.url(:small) }
.profile__name .profile__name
- unless current_user.display_name.blank? - unless current_user.display_name.blank?
.profile__display-name .profile__display-name
@ -15,7 +15,7 @@
- if @group.members.empty? - if @group.members.empty?
%p.text-muted No members yet! %p.text-muted No members yet!
- @group.members.each do |member| - @group.members.each do |member|
%a{href: show_user_profile_path(member.user.screen_name), title: member.user.screen_name, data: { toggle: :tooltip, placement: :top }} %a{ href: show_user_profile_path(member.user.screen_name), title: member.user.screen_name, data: { toggle: :tooltip, placement: :top } }
%img.avatar-xs{src: member.user.profile_picture.url(:medium)} %img.avatar-xs{ src: member.user.profile_picture.url(:medium) }
= render 'shared/links' = render 'shared/links'

View File

@ -1,9 +1,9 @@
- type ||= @type || :nil - type ||= :nil
.card.h-100.userbox .card.h-100.userbox
%img.userbox__header{src: user.profile_header.url(:mobile)} %img.userbox__header{ src: user.profile_header.url(:mobile) }
.card-body .card-body
%img.userbox__avatar{src: user.profile_picture.url(:small)} %img.userbox__avatar{ src: user.profile_picture.url(:small) }
%a.profile__name{href: show_user_profile_path(user.screen_name)} %a.profile__name{ href: show_user_profile_path(user.screen_name) }
- unless user.display_name.blank? - unless user.display_name.blank?
.profile__display-name .profile__display-name
= user.display_name = user.display_name

View File

@ -1,7 +1,7 @@
.row.row-cols-1.row-cols-sm-2.row-cols-md-3#users .row.row-cols-1.row-cols-sm-2.row-cols-md-3#users
- @users.each do |user| - @users.each do |user|
.col .col
= render 'shared/userbox', user: user = render 'shared/userbox', user: user, type: @type
= render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @users_last_id = render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @users_last_id

View File

@ -1,5 +1,5 @@
$('#users').append('<% @users.each do |user| $('#users').append('<% @users.each do |user|
%><div class="col"><%= j render 'shared/userbox', user: user %><div class="col"><%= j render 'shared/userbox', user: user, type: @type
%></div><% end %>'); %></div><% end %>');
<% if @more_data_available %> <% if @more_data_available %>
$('#pagination').html('<%= j render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @users_last_id %>'); $('#pagination').html('<%= j render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @users_last_id %>');