Fix lints in app/views/shared

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

View File

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

View File

@ -1,11 +1,11 @@
-# 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 ||= []
#pagination
%ul.pagination
%li.next{class: more_data_available ? nil : "disabled"}
%li.next{ class: more_data_available ? nil : 'disabled' }
- 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
- else
Next page

View File

@ -5,7 +5,7 @@
·
= 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
·

View File

@ -1,12 +1,12 @@
.container
.locales
%span
%a{href: '#', id: 'locale-switch'}
%a{ href: '#', id: 'locale-switch' }
%i.fa.fa-globe
= t('views.locale.languages')
#locales-panel.locales__panel
.locales__panel#locales-panel
%ul
- APP_LOCALES.each do |key, value|
%li
.flag{class: "flag-#{value[1]}"}
%a{href: "?hl=#{key}"}= value[0]
.flag{ class: "flag-#{value[1]}" }
%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
%img.userbox__header{src: current_user.profile_header.url(:mobile)}
%img.userbox__header{ src: current_user.profile_header.url(:mobile) }
.card-body
%img.userbox__avatar{src: current_user.profile_picture.url(:small)}
%img.userbox__avatar{ src: current_user.profile_picture.url(:small) }
.profile__name
- unless current_user.display_name.blank?
.profile__display-name
@ -15,7 +15,7 @@
- if @group.members.empty?
%p.text-muted No members yet!
- @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 }}
%img.avatar-xs{src: member.user.profile_picture.url(:medium)}
%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) }
= render 'shared/links'

View File

@ -1,9 +1,9 @@
- type ||= @type || :nil
- type ||= :nil
.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

View File

@ -1,7 +1,7 @@
.row.row-cols-1.row-cols-sm-2.row-cols-md-3#users
- @users.each do |user|
.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

View File

@ -1,5 +1,5 @@
$('#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 %>');
<% if @more_data_available %>
$('#pagination').html('<%= j render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @users_last_id %>');