Replace link with button in relationable scores
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user