Move links to check all/none on RTL languages

Since we don't usually style HTML classes starting with `js-`, we're
renaming it, so it's consistent with the `CheckAllNone` name used in the
`check_all_none.js` file.
This commit is contained in:
Javi Martín
2024-04-12 02:27:44 +02:00
parent 6ee5c0fcb8
commit fdf1fd5f5f
8 changed files with 15 additions and 11 deletions

View File

@@ -27,6 +27,7 @@
@import "autocomplete_overrides";
@import "avatar";
@import "banner";
@import "check_all_none";
@import "comments_count";
@import "datepicker_overrides";
@import "layout";

View File

@@ -0,0 +1,3 @@
.check-all-none {
float: $global-left;
}

View File

@@ -9,7 +9,7 @@
<% end %>
<%= form_tag form_path, method: :put do %>
<p class="float-left js-check">
<p class="check-all-none">
<%= t("shared.check") %>:
<%= link_to t("shared.check_all"), "#", data: { check_all: field_name } %>
|

View File

@@ -112,11 +112,11 @@ describe "Moderate budget investments" do
expect(page).to have_field type: :checkbox, count: 3
within(".js-check") { click_link "All" }
within(".check-all-none") { click_link "All" }
expect(all(:checkbox)).to all(be_checked)
within(".js-check") { click_link "None" }
within(".check-all-none") { click_link "None" }
all(:checkbox).each { |checkbox| expect(checkbox).not_to be_checked }
end

View File

@@ -132,11 +132,11 @@ describe "Moderate comments" do
expect(page).to have_field type: :checkbox, count: 2
within(".js-check") { click_link "All" }
within(".check-all-none") { click_link "All" }
expect(all(:checkbox)).to all(be_checked)
within(".js-check") { click_link "None" }
within(".check-all-none") { click_link "None" }
all(:checkbox).each { |checkbox| expect(checkbox).not_to be_checked }
end

View File

@@ -101,11 +101,11 @@ describe "Moderate debates" do
expect(page).to have_field type: :checkbox, count: 2
within(".js-check") { click_link "All" }
within(".check-all-none") { click_link "All" }
expect(all(:checkbox)).to all(be_checked)
within(".js-check") { click_link "None" }
within(".check-all-none") { click_link "None" }
all(:checkbox).each { |checkbox| expect(checkbox).not_to be_checked }
end

View File

@@ -112,11 +112,11 @@ describe "Moderate proposal notifications" do
expect(page).to have_field type: :checkbox, count: 2
within(".js-check") { click_link "All" }
within(".check-all-none") { click_link "All" }
expect(all(:checkbox)).to all(be_checked)
within(".js-check") { click_link "None" }
within(".check-all-none") { click_link "None" }
all(:checkbox).each { |checkbox| expect(checkbox).not_to be_checked }
end

View File

@@ -100,11 +100,11 @@ describe "Moderate proposals" do
expect(page).to have_field type: :checkbox, count: 3
within(".js-check") { click_link "All" }
within(".check-all-none") { click_link "All" }
expect(all(:checkbox)).to all(be_checked)
within(".js-check") { click_link "None" }
within(".check-all-none") { click_link "None" }
all(:checkbox).each { |checkbox| expect(checkbox).not_to be_checked }
end