From 416bf19132573c138836095f0a5f21068bbc5d0c Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 16:06:09 +0200 Subject: [PATCH] Fix HAML codestyle in views --- app/views/question/show.haml | 12 ++++++------ app/views/shared/_sidebar.haml | 2 +- app/views/tabs/_feed.haml | 6 +++--- app/views/user/_profile.haml | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/views/question/show.haml b/app/views/question/show.haml index 3107b7e0..6ece7de6 100644 --- a/app/views/question/show.haml +++ b/app/views/question/show.haml @@ -1,12 +1,12 @@ - provide(:title, question_title(@question)) -= render 'question', question: @question, hidden: false -= render 'question', question: @question, hidden: true += render "question", question: @question, hidden: false += render "question", question: @question, hidden: true .container.question-page #answers - @answers.each do |a| - = render 'answerbox', a: a, show_question: false + = render "answerbox", a: a, show_question: false - = render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @answers_last_id + = render "shared/cursored_pagination_dummy", more_data_available: @more_data_available, last_id: @answers_last_id - if @more_data_available .d-flex.justify-content-center.justify-content-sm-start @@ -15,7 +15,7 @@ - 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('.questionbox.title') + .card-header= t(".questionbox.title") .card-body %textarea.form-control#q-answer-text{ placeholder: t("inbox.entry.placeholder"), data: { id: @question.id } } %br/ @@ -23,5 +23,5 @@ = t("voc.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("inbox.entry.sharing.post_to", service: service.provider.capitalize) diff --git a/app/views/shared/_sidebar.haml b/app/views/shared/_sidebar.haml index 7b36b281..3ea4cf8a 100644 --- a/app/views/shared/_sidebar.haml +++ b/app/views/shared/_sidebar.haml @@ -18,4 +18,4 @@ %a{ href: user_path(member.user), title: member.user.screen_name, data: { toggle: :tooltip, placement: :top } } %img.avatar-xs{ src: member.user.profile_picture.url(:medium) } -= render 'shared/links' += render "shared/links" diff --git a/app/views/tabs/_feed.haml b/app/views/tabs/_feed.haml index 9bd586ea..d1da004d 100644 --- a/app/views/tabs/_feed.haml +++ b/app/views/tabs/_feed.haml @@ -1,9 +1,9 @@ .card .list-group.list-group-horizontal-sm.text-center - = list_group_item t('.timeline'), timeline_path + = list_group_item t(".timeline"), timeline_path - if APP_CONFIG.dig(:features, :public, :enabled) - = list_group_item t('.public'), public_timeline_path - %a.list-group-item.list-group-item-action.dropdown.dropdown-toggle{ class: list ? 'active' : '', + = list_group_item t(".public"), public_timeline_path + %a.list-group-item.list-group-item-action.dropdown.dropdown-toggle{ class: list ? "active" : "", type: :button, data: { toggle: :dropdown }, aria: { haspopup: true, expanded: false } } - if list = list.display_name diff --git a/app/views/user/_profile.haml b/app/views/user/_profile.haml index ff31cde4..8f94c83a 100644 --- a/app/views/user/_profile.haml +++ b/app/views/user/_profile.haml @@ -13,28 +13,28 @@ - if user.banned? %span.badge.badge-dark %i.fa.fa-fw.fa-ban - = t('.badge.banned') + = t(".badge.banned") - if user.following? current_user .badge.badge-light - = t('.badge.follows_you') + = t(".badge.follows_you") - if user_signed_in? && current_user.has_role?(:administrator) - if user.has_role?(:administrator) %span.badge.badge-danger %i.fa.fa-fw.fa-flask - = t('.badge.admin') + = t(".badge.admin") - if user.has_role?(:moderator) %span.badge.badge-success %i.fa.fa-fw.fa-users - = t('.badge.moderator') + = t(".badge.moderator") - unless user.profile.description.blank? .profile__biography = markdown user.profile.description - unless user.profile.website.blank? .profile__website %i.fa.fa-fw.fa-globe - %a{ href: user.profile.website, target: '_blank', rel: 'nofollow' }= user.profile.display_website + %a{ href: user.profile.website, target: "_blank", rel: "nofollow" }= user.profile.display_website - unless user.profile.location.blank? .profile__location %i.fa.fa-fw.fa-location-arrow = user.profile.location - = render 'user/actions', user: user, type: :follower + = render "user/actions", user: user, type: :follower