Skip to content

Commit 5390999

Browse files
committed
Lint: Use parentheses for button_to calls in views
1 parent 70ff90b commit 5390999

File tree

18 files changed

+50
-50
lines changed

18 files changed

+50
-50
lines changed

app/views/account_links/show.html.slim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
.table-list
3131
= shared_user.email
3232
.btn-group.float-end
33-
= button_to remove_shared_user_user_account_link_path, method: :post, params: {shared_user: shared_user.id}, data: {confirm: t('common.sure')}, class: 'btn btn-light btn-sm', remote: true, form_class: 'remove-account-link-form' do
33+
= button_to(remove_shared_user_user_account_link_path, method: :post, params: {shared_user: shared_user.id}, data: {confirm: t('common.sure')}, class: 'btn btn-light btn-sm', remote: true, form_class: 'remove-account-link-form') do
3434
i.fa-solid.fa-trash-can
3535
=< t('common.button.remove')
3636

@@ -39,7 +39,7 @@
3939
= link_to edit_user_account_link_path(@user, @account_link), class: 'btn btn-important' do
4040
i.fa-solid.fa-pen-to-square
4141
=< t('common.button.edit')
42-
= button_to user_account_link_path(@user, @account_link), class: 'btn btn-important h-100', method: :delete, data: {confirm: t('common.sure')} do
42+
= button_to(user_account_link_path(@user, @account_link), class: 'btn btn-important h-100', method: :delete, data: {confirm: t('common.sure')}) do
4343
i.fa-solid.fa-trash-can.text-danger
4444
=< t('common.button.delete')
4545
= link_to t('common.button.back'), user_path(@user), class: 'btn btn-important'

app/views/application/_session.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- if current_user.unread_messages_count != '0'
1515
span.menu-number
1616
= current_user.unread_messages_count
17-
li.nav-item = button_to t('.button.log_out'), destroy_user_session_path, method: :delete, class: 'nav-link px-3', data: {turbo: false}
17+
li.nav-item = button_to(t('.button.log_out'), destroy_user_session_path, method: :delete, class: 'nav-link px-3', data: {turbo: false})
1818
- else
1919
= render('navigation_collection_link', target: :new_user_registration_path, text: t('common.button.sign_up'), icon: 'fa-user', cached: true)
2020
= render('navigation_collection_link', target: :new_user_session_path, text: t('common.button.log_in'), icon: 'fa-right-to-bracket', cached: true)

app/views/collections/_collections.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
- else
3535
= render_markdown(collection.description)
3636
.more-btn-wrapper
37-
= button_to collection, class: 'more-btn' do
37+
= button_to(collection, class: 'more-btn') do
3838
.more-tag
3939
= t('common.button.show_more')
4040
span.fa-solid.fa-caret-down.ms-1

app/views/collections/_form.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
i.fa-solid.fa-folder-open
5353
=< t('.button.save')
5454
- if @collection.tasks.present?
55-
= button_to remove_all_collection_path(@collection), method: :patch, data: {confirm: t('common.sure')}, class: 'btn btn-important h-100' do
55+
= button_to(remove_all_collection_path(@collection), method: :patch, data: {confirm: t('common.sure')}, class: 'btn btn-important h-100') do
5656
i.fa-solid.fa-xmark.text-danger
5757
=< t('.button.remove_all')
5858
= link_to :back, class: 'btn btn-important' do

app/views/collections/show.html.slim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
- else
3737
= render_markdown(@collection.description)
3838
.more-btn-wrapper
39-
= button_to @collection, class: 'more-btn' do
39+
= button_to(@collection, class: 'more-btn') do
4040
.more-tag
4141
= t('common.button.show_more')
4242
span.fa-solid.fa-caret-down.ms-1
@@ -74,7 +74,7 @@
7474
.col-md-12.mb-4
7575
.actions.btn-group role='group'
7676
- if action_name == 'view_shared'
77-
= button_to t('.button.collaborate'), save_shared_collection_path(@collection), method: :post, class: 'btn btn-important h-100'
77+
= button_to(t('.button.collaborate'), save_shared_collection_path(@collection), method: :post, class: 'btn btn-important h-100')
7878
= link_to t('common.button.back'), user_messages_path(current_user), class: 'btn btn-important'
7979
- else
8080
- if policy(@collection).edit?
@@ -120,9 +120,9 @@
120120
i.fa-solid.fa-pen-to-square
121121
=< t('common.button.edit')
122122
- if @collection.users.include? current_user
123-
= button_to leave_collection_path(@collection), class: 'btn btn-important h-100', method: :post, data: {confirm: @collection.users.size == 1 ? t('.leave.deletion_warning') : t('common.sure')} do
123+
= button_to(leave_collection_path(@collection), class: 'btn btn-important h-100', method: :post, data: {confirm: @collection.users.size == 1 ? t('.leave.deletion_warning') : t('common.sure')}) do
124124
= @collection.users.size == 1 ? t('.button.delete') : t('.button.leave')
125-
= button_to toggle_favorite_collection_path(@collection), class: 'btn btn-important h-100', method: :post do
125+
= button_to(toggle_favorite_collection_path(@collection), class: 'btn btn-important h-100', method: :post) do
126126
- if current_user.favorite_collections.include?(@collection)
127127
i.fa-regular.fa-star
128128
=< t('.button.unfavorite')

app/views/comments/_edit.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
= button_tag type: 'submit', class: 'btn btn-light btn-sm' do
88
i.fa-solid.fa-floppy-disk
99
=< t('common.button.save')
10-
= button_to task_comment_path(@task, @comment), class: 'btn btn-light btn-sm', method: :delete, remote: true, data: {confirm: t('common.sure')}
10+
= button_to(task_comment_path(@task, @comment), class: 'btn btn-light btn-sm', method: :delete, remote: true, data: {confirm: t('common.sure')})
1111
i.fa-solid.fa-trash-can
1212
=< t('common.button.delete')

app/views/comments/_task_comments.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
= link_to edit_task_comment_path(@task, comment), class: 'btn btn-light btn-sm', remote: true do
2121
i.fa-solid.fa-pen-to-square
2222
=< t('common.button.edit')
23-
= button_to task_comment_path(@task, comment), class: 'btn btn-light btn-sm', method: :delete, remote: true, data: {confirm: t('common.sure')}
23+
= button_to(task_comment_path(@task, comment), class: 'btn btn-light btn-sm', method: :delete, remote: true, data: {confirm: t('common.sure')})
2424
i.fa-solid.fa-trash-can
2525
=< t('common.button.delete')
2626
.more-btn-wrapper

app/views/groups/_groups.html.slim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
- if policy(group).edit?
3535
= link_to edit_group_path(group), class: 'btn btn-light', data: {bs_toggle: 'tooltip', bs_placement: 'top', bs_title: t('common.button.edit')} do
3636
i.fas.fa-edit aria-hidden="true"
37-
= button_to group, class: 'btn btn-light', method: :delete, data: {bs_toggle: 'tooltip', bs_placement: 'top', bs_title: t('common.button.delete')} do
37+
= button_to(group, class: 'btn btn-light', method: :delete, data: {bs_toggle: 'tooltip', bs_placement: 'top', bs_title: t('common.button.delete')}) do
3838
i.fas.fa-trash-alt aria-hidden="true"
3939

4040
- elsif group.applicants.include?(current_user)
4141
= t('.wait_to_get_accepted')
4242
- else
43-
= button_to t('groups.shared.button.request_membership'), request_access_group_path(group), method: :post, class: 'btn btn-light'
43+
= button_to(t('groups.shared.button.request_membership'), request_access_group_path(group), method: :post, class: 'btn btn-light')
4444
= render('shared/pagination', collection: @groups)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
- if shared_user.shared_account_links.include?(account_link)
2-
= button_to remove_shared_user_user_account_link_path(current_user, account_link), method: :post, params: {shared_user: shared_user.id}, form_class: 'share-account-link-form', class: 'dropdown-item account-link-share', remote: true, title: t('.unshare_tooltip', account_link: account_link.name, user: shared_user.email) do
2+
= button_to(remove_shared_user_user_account_link_path(current_user, account_link), method: :post, params: {shared_user: shared_user.id}, form_class: 'share-account-link-form', class: 'dropdown-item account-link-share', remote: true, title: t('.unshare_tooltip', account_link: account_link.name, user: shared_user.email)) do
33
i.fa-solid.fa-square-check
44
=< account_link.name
55
- else
6-
= button_to add_shared_user_user_account_link_path(current_user, account_link), method: :post, params: {shared_user: shared_user.id}, form_class: 'share-account-link-form', class: 'dropdown-item account-link-share', remote: true, title: t('.share_tooltip', account_link: account_link.name, user: shared_user.email) do
6+
= button_to(add_shared_user_user_account_link_path(current_user, account_link), method: :post, params: {shared_user: shared_user.id}, form_class: 'share-account-link-form', class: 'dropdown-item account-link-share', remote: true, title: t('.share_tooltip', account_link: account_link.name, user: shared_user.email)) do
77
i.fa-solid.fa-square
88
=< account_link.name

app/views/groups/show.html.slim

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
.table-list
1717
=> admin.email
1818
- if policy(@group).demote_admin? && @group.admins.length > 1
19-
= button_to demote_admin_group_path(group: @group, user: admin), method: :post, form_class: 'd-inline-block', class: 'btn btn-light btn-sm', data: {confirm: admin == current_user ? t('.demote_yourself.confirm') : t('.demote_admin.confirm')} do
19+
= button_to(demote_admin_group_path(group: @group, user: admin), method: :post, form_class: 'd-inline-block', class: 'btn btn-light btn-sm', data: {confirm: admin == current_user ? t('.demote_yourself.confirm') : t('.demote_admin.confirm')}) do
2020
i.fa-solid.fa-arrow-down
2121
=< (admin == current_user ? t('.button.demote_yourself') : t('.button.demote_admin'))
2222

@@ -30,10 +30,10 @@
3030
=> member.email
3131
- if policy(@group).edit?
3232
- if @group.group_membership_for(member).role_confirmed_member?
33-
= button_to make_admin_group_path(group: @group, user: member), method: :post, form_class: 'd-inline-block', class: 'btn btn-light btn-sm' do
33+
= button_to(make_admin_group_path(group: @group, user: member), method: :post, form_class: 'd-inline-block', class: 'btn btn-light btn-sm') do
3434
i.fa-solid.fa-plus
3535
=< t('.button.make_admin')
36-
= button_to delete_from_group_group_path(group: @group, user: member), method: :patch, form_class: 'd-inline-block', class: 'btn btn-light btn-sm' do
36+
= button_to(delete_from_group_group_path(group: @group, user: member), method: :patch, form_class: 'd-inline-block', class: 'btn btn-light btn-sm') do
3737
i.fa-solid.fa-xmark
3838
=< t('common.button.remove')
3939
- else
@@ -50,10 +50,10 @@
5050
.table-list
5151
=> user.email
5252
.btn-group.float-end
53-
= button_to grant_access_group_path(group: @group, user:), method: :post, form_class: 'd-inline-block', class: 'btn btn-light btn-sm' do
53+
= button_to(grant_access_group_path(group: @group, user:), method: :post, form_class: 'd-inline-block', class: 'btn btn-light btn-sm') do
5454
i.fa-solid.fa-plus
5555
=< t('.button.grant_access')
56-
= button_to deny_access_group_path(group: @group, user:), method: :post, form_class: 'd-inline-block', class: 'btn btn-light btn-sm' do
56+
= button_to(deny_access_group_path(group: @group, user:), method: :post, form_class: 'd-inline-block', class: 'btn btn-light btn-sm') do
5757
i.fa-solid.fa-xmark
5858
=< t('.button.deny_access')
5959
- else
@@ -67,7 +67,7 @@
6767
.btn-group
6868
= link_to task.title, task_path(task), class: 'btn btn-light'
6969
- if policy(@group).remove_task?
70-
= button_to remove_task_group_path(task:), method: :patch, form_class: 'd-inline-block', class: 'btn btn-light' do
70+
= button_to(remove_task_group_path(task:), method: :patch, form_class: 'd-inline-block', class: 'btn btn-light') do
7171
i.fa-solid.fa-xmark.text-secondary
7272
- else
7373
= t('.has_no_tasks')
@@ -76,14 +76,14 @@
7676
.col-md-12.mb-4
7777
.actions.btn-group role='group'
7878
- if policy(@group).request_access?
79-
= button_to t('groups.shared.button.request_membership'), request_access_group_path(@group), method: :post, class: 'btn btn-important h-100'
79+
= button_to(t('groups.shared.button.request_membership'), request_access_group_path(@group), method: :post, class: 'btn btn-important h-100')
8080
- if policy(@group).edit?
8181
= link_to edit_group_path(@group), class: 'btn btn-important' do
8282
i.fa-solid.fa-pen-to-square
8383
=< t('common.button.edit')
84-
= button_to group_path(@group), class: 'btn btn-important h-100', method: :delete, data: {confirm: t('common.sure')} do
84+
= button_to(group_path(@group), class: 'btn btn-important h-100', method: :delete, data: {confirm: t('common.sure')}) do
8585
i.fa-solid.fa-trash-can.text-danger
8686
=< t('.button.delete_group')
8787
- if policy(@group).leave?
88-
= button_to t('.button.leave'), leave_group_path(@group), method: :post, class: "leave-btn btn btn-important h-100 #{'disabled' if @group.last_admin?(current_user)}", data: {confirm: t('common.sure')}
88+
= button_to(t('.button.leave'), leave_group_path(@group), method: :post, class: "leave-btn btn btn-important h-100 #{'disabled' if @group.last_admin?(current_user)}", data: {confirm: t('common.sure')})
8989
= link_to t('common.button.back'), :back, class: 'btn btn-important'

0 commit comments

Comments
 (0)