Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slim-lintのルール「Layout/LineLength」を適用する #7345

Merged
merged 5 commits into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/views/activity_mailer/assigned_as_checker.html.slim
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
= render '/notification_mailer/notification_mailer_template', title: "#{@product.user.login_name}さんの提出物#{@product.title}の担当になりました。", link_url: @link_url, link_text: 'この提出物へ' do
= render '/notification_mailer/notification_mailer_template',
title: "#{@product.user.login_name}さんの提出物#{@product.title}の担当になりました。",
link_url: @link_url, link_text: 'この提出物へ' do
= md2html @product.description
4 changes: 3 additions & 1 deletion app/views/activity_mailer/came_answer.html.slim
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
= render '/notification_mailer/notification_mailer_template', title: "質問「#{@answer.question.title}」に#{@answer.user.login_name}さんが回答しました。", link_url: @link_url, link_text: '回答へ' do
= render '/notification_mailer/notification_mailer_template',
title: "質問「#{@answer.question.title}」に#{@answer.user.login_name}さんが回答しました。",
link_url: @link_url, link_text: '回答へ' do
= md2html(@answer.description)
4 changes: 3 additions & 1 deletion app/views/activity_mailer/consecutive_sad_report.html.slim
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
= render '/notification_mailer/notification_mailer_template', title: "#{@report.user.login_name}さんが#{User::DEPRESSED_SIZE}回連続でsadアイコンの日報を提出しました。", link_url: @link_url, link_text: 'この日報へ' do
= render '/notification_mailer/notification_mailer_template',
title: "#{@report.user.login_name}さんが#{User::DEPRESSED_SIZE}回連続でsadアイコンの日報を提出しました。",
link_url: @link_url, link_text: 'この日報へ' do
p #{@report.user.login_name}さんが#{User::DEPRESSED_SIZE}回連続でsadアイコンの日報を提出しました。メンターのみなさんはフォローいただけると幸いです。
div(style='border-top: solid 1px #ccc; height: 0;')
= md2html(@report.description)
4 changes: 3 additions & 1 deletion app/views/activity_mailer/create_page.html.slim
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
= render '/notification_mailer/notification_mailer_template', title: "#{@page.user.login_name}さんがDocsに#{@page.title}を投稿しました。", link_url: @link_url, link_text: 'このDocsへ' do
= render '/notification_mailer/notification_mailer_template',
title: "#{@page.user.login_name}さんがDocsに#{@page.title}を投稿しました。",
link_url: @link_url, link_text: 'このDocsへ' do
= md2html(@page.body)
4 changes: 3 additions & 1 deletion app/views/activity_mailer/hibernated.html.slim
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
= render '/notification_mailer/notification_mailer_template', title: "#{@sender.login_name}さんが休会しました。", link_url: @link_url, link_text: "#{@sender.login_name}さんのページへ" do
= render '/notification_mailer/notification_mailer_template',
title: "#{@sender.login_name}さんが休会しました。",
link_url: @link_url, link_text: "#{@sender.login_name}さんのページへ" do
4 changes: 3 additions & 1 deletion app/views/activity_mailer/mentioned.html.slim
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
= render '/notification_mailer/notification_mailer_template', title: "#{@mentionable.user.login_name}さんからメンションがありました", link_url: @link_url, link_text: 'このメンションへ' do
= render '/notification_mailer/notification_mailer_template',
title: "#{@mentionable.user.login_name}さんからメンションがありました",
link_url: @link_url, link_text: 'このメンションへ' do
= md2html @mentionable.body
4 changes: 3 additions & 1 deletion app/views/activity_mailer/no_correct_answer.html.slim
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
= render '/notification_mailer/notification_mailer_template', title: "#{@user.login_name}さんの質問【 #{@question.title} 】のベストアンサーがまだ選ばれていません。", link_url: @link_url, link_text: "#{@user.login_name}さんの質問へ"
= render '/notification_mailer/notification_mailer_template',
title: "#{@user.login_name}さんの質問【 #{@question.title} 】のベストアンサーがまだ選ばれていません。",
link_url: @link_url, link_text: "#{@user.login_name}さんの質問へ"
4 changes: 3 additions & 1 deletion app/views/activity_mailer/product_update.html.slim
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
= render '/notification_mailer/notification_mailer_template', title: "#{@product.user.login_name}さんが#{@product.title}を更新しました。", link_url: @link_url, link_text: '提出物へ' do
= render '/notification_mailer/notification_mailer_template',
title: "#{@product.user.login_name}さんが#{@product.title}を更新しました。",
link_url: @link_url, link_text: '提出物へ' do
= md2html(@product.body)
4 changes: 3 additions & 1 deletion app/views/activity_mailer/submitted.html.slim
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
= render '/notification_mailer/notification_mailer_template', title: "#{@product.user.login_name}さんが#{@product.title}を提出しました。", link_url: @link_url, link_text: '提出物へ' do
= render '/notification_mailer/notification_mailer_template',
title: "#{@product.user.login_name}さんが#{@product.title}を提出しました。",
link_url: @link_url, link_text: '提出物へ' do
= md2html(@product.body)
3 changes: 2 additions & 1 deletion app/views/application/_required_field.html.slim
Original file line number Diff line number Diff line change
@@ -21,4 +21,5 @@
.card-list-item__row
.card-list-item-title
h3.card-list-item-title__title.is-sm
= link_to error.message, edit_current_user_path(anchor: anchor_to_required_field(error.attribute)), class: "card-list-item-title__link a-text-link is-#{error.attribute}"
= link_to error.message, edit_current_user_path(anchor: anchor_to_required_field(error.attribute)),
class: "card-list-item-title__link a-text-link is-#{error.attribute}"
4 changes: 3 additions & 1 deletion app/views/application/_tags_input.slim
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
= react_component('Tags/TagsInput', { tagsInitialValue: taggable.tag_list.join(',').to_s, tagsParamName: "#{taggable.class.to_s.tableize.singularize}[tag_list]", taggableType: taggable.class.to_s.capitalize.to_s })
= react_component('Tags/TagsInput', { tagsInitialValue: taggable.tag_list.join(',').to_s,
tagsParamName: "#{taggable.class.to_s.tableize.singularize}[tag_list]",
taggableType: taggable.class.to_s.capitalize.to_s })
4 changes: 3 additions & 1 deletion app/views/articles/_recent_articles.html.slim
Original file line number Diff line number Diff line change
@@ -11,7 +11,9 @@
.card-list-item__thumbnail
.card-list-item__thumbnail-inner
- if recent_article.thumbnail.attached?
= image_tag recent_article.thumbnail.variant(resize_to_limit: [200, 105]).processed.url, class: 'card-list-item__thumbnail-image', alt: "ブログ記事「#{recent_article.title}」のアイキャッチ画像"
= image_tag recent_article.thumbnail.variant(resize_to_limit: [200, 105]).processed.url, \
class: 'card-list-item__thumbnail-image', \
alt: "ブログ記事「#{recent_article.title}」のアイキャッチ画像"
- else
= image_tag 'work-blank.svg', class: 'card-list-item__thumbnail-image', alt: 'ブログ記事のブランクアイキャッチ画像'
.card-list-item__rows
9 changes: 6 additions & 3 deletions app/views/events/_participation.html.slim
Original file line number Diff line number Diff line change
@@ -14,7 +14,8 @@
| 参加登録しています。
ul.event-main-actions__items
li.event-main-actions__item
= link_to event_participation_path(event_id: event), method: :delete, data: { confirm: '特別イベントの参加をキャンセルします。よろしいですか?' }, class: 'event-main-actions__item-cancel' do
= link_to event_participation_path(event_id: event), method: :delete,
data: { confirm: '特別イベントの参加をキャンセルします。よろしいですか?' }, class: 'event-main-actions__item-cancel' do
| 参加を取り消す
- elsif event.opening?
.event-main-actions.is-unparticipationed(class="#{event.capacity > event.participants.count ? 'is-available' : 'is-capacity-over'}")
@@ -30,8 +31,10 @@
li.event-main-actions__item
- if event.capacity > event.participants.count
// TODO helprtにしてわかりやすくしたい↑
= link_to event_participations_path(event_id: event), method: :post, data: { confirm: '特別イベント参加申込をします。よろしいですか?' }, class: 'a-button is-primary is-md is-block' do
= link_to event_participations_path(event_id: event), method: :post,
data: { confirm: '特別イベント参加申込をします。よろしいですか?' }, class: 'a-button is-primary is-md is-block' do
| 参加申込
- else
= link_to event_participations_path(event_id: event), method: :post, data: { confirm: '補欠として特別イベント参加申込をします。よろしいですか?' }, class: 'a-button is-warning is-md is-block' do
= link_to event_participations_path(event_id: event), method: :post,
data: { confirm: '補欠として特別イベント参加申込をします。よろしいですか?' }, class: 'a-button is-warning is-md is-block' do
| 補欠登録
4 changes: 3 additions & 1 deletion app/views/notification_mailer/trainee_report.html.slim
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
= render 'notification_mailer_template', title: "#{@report.user.login_name}さんが日報【 #{@report.title} 】を書きました!", link_url: notification_url(@notification), link_text: 'この日報へ!!!' do
= render 'notification_mailer_template',
title: "#{@report.user.login_name}さんが日報【 #{@report.title} 】を書きました!",
link_url: notification_url(@notification), link_text: 'この日報へ!!!' do
= md2html(@report.description)
6 changes: 5 additions & 1 deletion app/views/pages/_doc_header.html.slim
Original file line number Diff line number Diff line change
@@ -76,4 +76,8 @@ header.page-content-header

.page-content-header__row
.page-content-header__tags
= react_component('Tags/Tags', { tagsInitialValue: page.tag_list.join(',').to_s, tagsParamName: 'page[tag_list]', tagsInputId: 'page_tag_list', tagsType: 'Page', tagsTypeId: page.id.to_s })
= react_component('Tags/Tags', { tagsInitialValue: page.tag_list.join(',').to_s,
tagsParamName: 'page[tag_list]',
tagsInputId: 'page_tag_list',
tagsType: 'Page',
tagsTypeId: page.id.to_s })
9 changes: 6 additions & 3 deletions app/views/practices/questions/index.html.slim
Original file line number Diff line number Diff line change
@@ -9,11 +9,14 @@ nav.tab-nav
.container
ul.tab-nav__items
li.tab-nav__item
= link_to '全ての質問', practice_questions_path(@practice), class: "tab-nav__item-link #{params[:target] == 'not_solved' || params[:target] == 'solved' ? '' : 'is-active'}"
= link_to '全ての質問', practice_questions_path(@practice),
class: "tab-nav__item-link #{params[:target] == 'not_solved' || params[:target] == 'solved' ? '' : 'is-active'}"
li.tab-nav__item
= link_to '解決済み', practice_questions_path(@practice, target: 'solved'), class: "tab-nav__item-link #{params[:target] == 'solved' ? 'is-active' : ''}"
= link_to '解決済み', practice_questions_path(@practice, target: 'solved'),
class: "tab-nav__item-link #{params[:target] == 'solved' ? 'is-active' : ''}"
li.tab-nav__item
= link_to '未解決', practice_questions_path(@practice, target: 'not_solved'), class: "tab-nav__item-link #{params[:target] == 'not_solved' ? 'is-active' : ''}"
= link_to '未解決', practice_questions_path(@practice, target: 'not_solved'),
class: "tab-nav__item-link #{params[:target] == 'not_solved' ? 'is-active' : ''}"

.page-body
.container.is-md
3 changes: 2 additions & 1 deletion app/views/products/unchecked/index.html.slim
Original file line number Diff line number Diff line change
@@ -15,7 +15,8 @@ header.page-header
.form__items
.form-item.is-inline-md-up
= label_tag :checker_id, '担当メンター', class: 'a-form-label'
= select_tag :checker_id, options_from_collection_for_select(User.mentor.order(:login_name), :id, :login_name, selected: params[:checker_id]), include_blank: '全ての提出物を表示', onchange: 'this.form.submit()', id: 'js-choices-single-select'
= select_tag :checker_id, options_from_collection_for_select(User.mentor.order(:login_name), :id, :login_name, selected: params[:checker_id]),
include_blank: '全ての提出物を表示', onchange: 'this.form.submit()', id: 'js-choices-single-select'
hr.a-border
.page-body
.container.is-md
4 changes: 3 additions & 1 deletion app/views/questions/_question_body.html.slim
Original file line number Diff line number Diff line change
@@ -14,7 +14,9 @@
i#new.fa-solid.fa-pen
| 内容修正
li.card-main-actions__item.is-sub.is-only-mentor class=(current_user.mentor ? '' : 'is-hidden')
=link_to '削除する', question_path(question), data: { confirm: '本当に削除しますか?質問はなるべく消さず、もし質問者が自己解決した場合も、質問者自身で解決した手段や手順を回答に記入し、それをベストアンサーにしてこの質問を解決することを即すようにしてください。' }, method: :delete, class: 'card-main-actions__muted-action'
=link_to '削除する', question_path(question),
data: { confirm: '本当に削除しますか?質問はなるべく消さず、もし質問者が自己解決した場合も、質問者自身で解決した手段や手順を回答に記入し、それをベストアンサーにしてこの質問を解決することを即すようにしてください。' }, method: :delete,
class: 'card-main-actions__muted-action'
li.card-main-actions__item.is-sub class=(current_user.mentor ? 'is-hidden' : '')
label.card-main-actions__muted-action for='modal-delete-request'
| 削除申請
6 changes: 5 additions & 1 deletion app/views/questions/_question_header.html.slim
Original file line number Diff line number Diff line change
@@ -65,4 +65,8 @@ header.page-content-header

.page-content-header__row
.page-content-header__tags
= react_component('Tags/Tags', { tagsInitialValue: question.tag_list.join(','), tagsParamName: 'question[tag_list]', tagsInputId: 'question_tag_list', tagsType: 'Question', tagsTypeId: question.id.to_s })
= react_component('Tags/Tags', { tagsInitialValue: question.tag_list.join(','),
tagsParamName: 'question[tag_list]',
tagsInputId: 'question_tag_list',
tagsType: 'Question',
tagsTypeId: question.id.to_s })
9 changes: 6 additions & 3 deletions app/views/questions/_tabs.html.slim
Original file line number Diff line number Diff line change
@@ -2,13 +2,16 @@
.container
ul.page-tabs__items
li.page-tabs__item
= link_to questions_path(target: 'not_solved', practice_id: params[:practice_id]), class: "page-tabs__item-link #{params[:target] == 'not_solved' ? 'is-active' : ''}" do
= link_to questions_path(target: 'not_solved', practice_id: params[:practice_id]),
class: "page-tabs__item-link #{params[:target] == 'not_solved' ? 'is-active' : ''}" do
| 未解決
- if Question.not_solved.not_wip.size.positive? && current_user.admin_or_mentor?
.page-tabs__item-count.a-notification-count
#not-solved-count
= params[:practice_id].present? ? Question.not_solved.not_wip.where(practice_id: params[:practice_id]).size : Question.not_solved.not_wip.size
li.page-tabs__item
= link_to '解決済み', questions_path(target: 'solved', practice_id: params[:practice_id]), class: "page-tabs__item-link #{params[:target] == 'solved' ? 'is-active' : ''}"
= link_to '解決済み', questions_path(target: 'solved', practice_id: params[:practice_id]),
class: "page-tabs__item-link #{params[:target] == 'solved' ? 'is-active' : ''}"
li.page-tabs__item
= link_to '全て', questions_path(practice_id: params[:practice_id], title: params[:title]), class: "page-tabs__item-link #{params[:target] == 'not_solved' || params[:target] == 'solved' ? '' : 'is-active'}"
= link_to '全て', questions_path(practice_id: params[:practice_id], title: params[:title]),
class: "page-tabs__item-link #{params[:target] == 'not_solved' || params[:target] == 'solved' ? '' : 'is-active'}"
6 changes: 4 additions & 2 deletions app/views/regular_events/_participation.html.slim
Original file line number Diff line number Diff line change
@@ -5,11 +5,13 @@
| 参加登録しています。
ul.event-main-actions__items
li.event-main-actions__item
= link_to regular_event_participation_path(regular_event_id: regular_event), method: :delete, data: { confirm: 'イベントの参加をキャンセルします。よろしいですか?' }, class: 'event-main-actions__item-cancel' do
= link_to regular_event_participation_path(regular_event_id: regular_event), method: :delete,
data: { confirm: 'イベントの参加をキャンセルします。よろしいですか?' }, class: 'event-main-actions__item-cancel' do
| 参加を取り消す
- else
.event-main-actions.is-unparticipationed.is-available
ul.event-main-actions__items
li.event-main-actions__item
= link_to regular_event_participations_path(regular_event_id: regular_event), method: :post, data: { confirm: 'イベント参加申込をします。よろしいですか?' }, class: 'a-button is-primary is-md is-block' do
= link_to regular_event_participations_path(regular_event_id: regular_event), method: :post,
data: { confirm: 'イベント参加申込をします。よろしいですか?' }, class: 'a-button is-primary is-md is-block' do
| 参加申込
3 changes: 2 additions & 1 deletion app/views/reports/_learning_time_fields.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.form-times
.nested-fields.form-times__inner
- tag = '</div></div><div class="form-selects__item"><div class="a-button is-md is-secondary is-select a-select is-block form-selects__item-select form-item__select">'
- tag = '</div></div>'\
'<div class="form-selects__item"><div class="a-button is-md is-secondary is-select a-select is-block form-selects__item-select form-item__select">'
.form-times__items.learning-time
.form-times__time
= f.label :started_at, class: 'form-times__time-label'
3 changes: 2 additions & 1 deletion app/views/survey_questions/edit.html.slim
Original file line number Diff line number Diff line change
@@ -24,4 +24,5 @@ header.page-header
hr.a-border
.page-body
.container.is-md
= render 'form', survey_question: @survey_question, linear_scale: @linear_scale, radio_button: @radio_button, check_box: @check_box, radio_button_choices: @radio_button_choices, check_box_choices: @check_box_choices
= render 'form', survey_question: @survey_question, linear_scale: @linear_scale, radio_button: @radio_button,
check_box: @check_box, radio_button_choices: @radio_button_choices, check_box_choices: @check_box_choices
3 changes: 2 additions & 1 deletion app/views/survey_questions/new.html.slim
Original file line number Diff line number Diff line change
@@ -24,4 +24,5 @@ header.page-header
hr.a-border
.page-body
.container.is-md
= render 'form', survey_question: @survey_question, linear_scale: @linear_scale, radio_button: @radio_button, check_box: @check_box, radio_button_choices: @radio_button_choices, check_box_choices: @check_box_choices
= render 'form', survey_question: @survey_question, linear_scale: @linear_scale, radio_button: @radio_button,
check_box: @check_box, radio_button_choices: @radio_button_choices, check_box_choices: @check_box_choices
6 changes: 4 additions & 2 deletions app/views/surveys/show.html.slim
Original file line number Diff line number Diff line change
@@ -99,13 +99,15 @@ header.page-header
- 10.times do |i|
- if survey_question.linear_scale.reason_for_choice_required
li.linear-scale__points-item
= f.radio_button survey_question.id, i + 1, id: "linear-scale-#{survey_question.id}-#{i}", class: 'a-toggle-checkbox js-questionnaire_choice js-answer_required_choice'
= f.radio_button survey_question.id, i + 1, id: "linear-scale-#{survey_question.id}-#{i}",
class: 'a-toggle-checkbox js-questionnaire_choice js-answer_required_choice'
label.linear-scale__point for="linear-scale-#{survey_question.id}-#{i}"
.linear-scale__point-number
= i + 1
- else
li.linear-scale__points-item
= f.radio_button survey_question.id, i + 1, id: "linear-scale-#{survey_question.id}-#{i}", class: 'a-toggle-checkbox js-questionnaire_choice'
= f.radio_button survey_question.id, i + 1, id: "linear-scale-#{survey_question.id}-#{i}",
class: 'a-toggle-checkbox js-questionnaire_choice'
label.linear-scale__point for="linear-scale-#{survey_question.id}-#{i}"
.linear-scale__point-number
= i + 1
Loading