Replace link with button in relationable scores

This commit is contained in:
cyrillefr
2025-04-17 15:39:44 +02:00
parent d4b7939d2c
commit a6046155a2
3 changed files with 27 additions and 19 deletions

View File

@@ -2134,7 +2134,7 @@ table {
text-align: center;
}
a {
button {
font-weight: bold;
margin-right: $line-height;
text-decoration: none;
@@ -2152,6 +2152,14 @@ table {
&::before {
margin-right: $font-icon-margin;
}
&:hover {
cursor: pointer;
}
}
form {
display: inline;
}
}

View File

@@ -1,15 +1,15 @@
<small><%= t("related_content.is_related") %></small>
<span class="relate-content-score">
<%= link_to t("related_content.score_positive"),
<div class="relate-content-score">
<%= button_to t("related_content.score_positive"),
score_positive_related_content_path(related),
method: :put,
remote: true,
class: "score-positive" %>
<%= link_to t("related_content.score_negative"),
<%= button_to t("related_content.score_negative"),
score_negative_related_content_path(related),
method: :put,
remote: true,
class: "score-negative" %>
</span>
</div>

View File

@@ -146,10 +146,10 @@ shared_examples "relationable" do |relationable_model_name|
visit polymorphic_path(relationable)
within("#related-content-list") do
click_link "Yes"
click_button "Yes"
expect(page).not_to have_link "Yes"
expect(page).not_to have_link "No"
expect(page).not_to have_button "Yes"
expect(page).not_to have_button "No"
end
end
@@ -163,10 +163,10 @@ shared_examples "relationable" do |relationable_model_name|
visit polymorphic_path(relationable)
within("#related-content-list") do
click_link "No"
click_button "No"
expect(page).not_to have_link "Yes"
expect(page).not_to have_link "No"
expect(page).not_to have_button "Yes"
expect(page).not_to have_button "No"
end
end