Add show and collapse text on comments tree
This commit is contained in:
@@ -86,7 +86,9 @@
|
|||||||
<%= link_to "", class: "js-toggle-children relative", data: {"id": "#{dom_id(comment)}"} do %>
|
<%= link_to "", class: "js-toggle-children relative", data: {"id": "#{dom_id(comment)}"} do %>
|
||||||
<span class="show-for-sr js-child-toggle" style="display: none;"><%= t("shared.show") %></span>
|
<span class="show-for-sr js-child-toggle" style="display: none;"><%= t("shared.show") %></span>
|
||||||
<span class="show-for-sr js-child-toggle"><%= t("shared.hide") %></span>
|
<span class="show-for-sr js-child-toggle"><%= t("shared.hide") %></span>
|
||||||
<span id="<%= dom_id(comment) %>_children_arrow" class="icon-arrow-down"></span> <%= t("comments.comment.responses", count: comment.children.size) %>
|
<span id="<%= dom_id(comment) %>_children_arrow" class="icon-arrow-down"></span>
|
||||||
|
<span class="js-child-toggle" style="display: none;"><%= t("comments.comment.responses_show", count: comment.children.size) %></span>
|
||||||
|
<span class="js-child-toggle"><%= t("comments.comment.responses_collapse", count: comment.children.size) %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= t("comments.comment.responses", count: 0) %>
|
<%= t("comments.comment.responses", count: 0) %>
|
||||||
|
|||||||
@@ -51,6 +51,14 @@ en:
|
|||||||
one: 1 response
|
one: 1 response
|
||||||
other: "%{count} responses"
|
other: "%{count} responses"
|
||||||
zero: No responses
|
zero: No responses
|
||||||
|
responses_show:
|
||||||
|
one: "1 response (show)"
|
||||||
|
other: "%{count} responses (show)"
|
||||||
|
zero: No responses
|
||||||
|
responses_collapse:
|
||||||
|
one: "1 response (collapse)"
|
||||||
|
other: "%{count} responses (collapse)"
|
||||||
|
zero: No responses
|
||||||
user_deleted: User deleted
|
user_deleted: User deleted
|
||||||
votes:
|
votes:
|
||||||
one: 1 vote
|
one: 1 vote
|
||||||
|
|||||||
@@ -49,8 +49,16 @@ es:
|
|||||||
moderator: Moderador
|
moderator: Moderador
|
||||||
responses:
|
responses:
|
||||||
zero: Sin respuestas
|
zero: Sin respuestas
|
||||||
one: 1 Respuesta
|
one: 1 respuesta
|
||||||
other: "%{count} Respuestas"
|
other: "%{count} respuestas"
|
||||||
|
responses_show:
|
||||||
|
one: "1 respuesta (mostrar)"
|
||||||
|
other: "%{count} respuestas (mostrar)"
|
||||||
|
zero: Sin respuestas
|
||||||
|
responses_collapse:
|
||||||
|
one: "1 respuesta (colapsar)"
|
||||||
|
other: "%{count} respuestas (colapsar)"
|
||||||
|
zero: Sin respuestas
|
||||||
user_deleted: Usuario eliminado
|
user_deleted: Usuario eliminado
|
||||||
votes:
|
votes:
|
||||||
zero: Sin votos
|
zero: Sin votos
|
||||||
|
|||||||
@@ -67,20 +67,25 @@ describe "Commenting Budget::Investments" do
|
|||||||
visit budget_investment_path(investment.budget, investment)
|
visit budget_investment_path(investment.budget, investment)
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 2)
|
expect(page).to have_css(".comment", count: 2)
|
||||||
|
expect(page).to have_content("1 response (collapse)")
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
expect(page).to have_content grandchild_comment.body
|
expect(page).to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{parent_comment.id}_children_arrow").click
|
find("#comment_#{parent_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 1)
|
expect(page).to have_css(".comment", count: 1)
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content child_comment.body
|
expect(page).not_to have_content child_comment.body
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -74,20 +74,25 @@ describe "Internal valuation comments on Budget::Investments" do
|
|||||||
visit valuation_budget_budget_investment_path(budget, investment)
|
visit valuation_budget_budget_investment_path(budget, investment)
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 2)
|
expect(page).to have_css(".comment", count: 2)
|
||||||
|
expect(page).to have_content("1 response (collapse)")
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
expect(page).to have_content grandchild_comment.body
|
expect(page).to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{parent_comment.id}_children_arrow").click
|
find("#comment_#{parent_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 1)
|
expect(page).to have_css(".comment", count: 1)
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content child_comment.body
|
expect(page).not_to have_content child_comment.body
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -62,20 +62,25 @@ describe "Commenting debates" do
|
|||||||
visit debate_path(debate)
|
visit debate_path(debate)
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 2)
|
expect(page).to have_css(".comment", count: 2)
|
||||||
|
expect(page).to have_content("1 response (collapse)")
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
expect(page).to have_content grandchild_comment.body
|
expect(page).to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{parent_comment.id}_children_arrow").click
|
find("#comment_#{parent_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 1)
|
expect(page).to have_css(".comment", count: 1)
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content child_comment.body
|
expect(page).not_to have_content child_comment.body
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -70,20 +70,25 @@ describe "Commenting legislation questions" do
|
|||||||
legislation_annotation)
|
legislation_annotation)
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 2)
|
expect(page).to have_css(".comment", count: 2)
|
||||||
|
expect(page).to have_content("1 response (collapse)")
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
expect(page).to have_content grandchild_comment.body
|
expect(page).to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{parent_comment.id}_children_arrow").click
|
find("#comment_#{parent_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 1)
|
expect(page).to have_css(".comment", count: 1)
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content child_comment.body
|
expect(page).not_to have_content child_comment.body
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -69,20 +69,25 @@ describe "Commenting legislation questions" do
|
|||||||
visit legislation_process_question_path(legislation_question.process, legislation_question)
|
visit legislation_process_question_path(legislation_question.process, legislation_question)
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 2)
|
expect(page).to have_css(".comment", count: 2)
|
||||||
|
expect(page).to have_content("1 response (collapse)")
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
expect(page).to have_content grandchild_comment.body
|
expect(page).to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{parent_comment.id}_children_arrow").click
|
find("#comment_#{parent_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 1)
|
expect(page).to have_css(".comment", count: 1)
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content child_comment.body
|
expect(page).not_to have_content child_comment.body
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -63,20 +63,25 @@ describe "Commenting polls" do
|
|||||||
visit poll_path(poll)
|
visit poll_path(poll)
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 2)
|
expect(page).to have_css(".comment", count: 2)
|
||||||
|
expect(page).to have_content("1 response (collapse)")
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
expect(page).to have_content grandchild_comment.body
|
expect(page).to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{parent_comment.id}_children_arrow").click
|
find("#comment_#{parent_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 1)
|
expect(page).to have_css(".comment", count: 1)
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content child_comment.body
|
expect(page).not_to have_content child_comment.body
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -61,20 +61,25 @@ describe "Commenting proposals" do
|
|||||||
visit proposal_path(proposal)
|
visit proposal_path(proposal)
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 2)
|
expect(page).to have_css(".comment", count: 2)
|
||||||
|
expect(page).to have_content("1 response (collapse)")
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
expect(page).to have_content grandchild_comment.body
|
expect(page).to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{parent_comment.id}_children_arrow").click
|
find("#comment_#{parent_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 1)
|
expect(page).to have_css(".comment", count: 1)
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content child_comment.body
|
expect(page).not_to have_content child_comment.body
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -66,20 +66,25 @@ describe "Commenting topics from proposals" do
|
|||||||
visit community_topic_path(community, topic)
|
visit community_topic_path(community, topic)
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 2)
|
expect(page).to have_css(".comment", count: 2)
|
||||||
|
expect(page).to have_content("1 response (collapse)")
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{child_comment.id}_children_arrow").click
|
find("#comment_#{child_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css(".comment", count: 3)
|
||||||
|
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||||
expect(page).to have_content grandchild_comment.body
|
expect(page).to have_content grandchild_comment.body
|
||||||
|
|
||||||
find("#comment_#{parent_comment.id}_children_arrow").click
|
find("#comment_#{parent_comment.id}_children_arrow").click
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 1)
|
expect(page).to have_css(".comment", count: 1)
|
||||||
|
expect(page).to have_content("1 response (show)")
|
||||||
expect(page).not_to have_content child_comment.body
|
expect(page).not_to have_content child_comment.body
|
||||||
expect(page).not_to have_content grandchild_comment.body
|
expect(page).not_to have_content grandchild_comment.body
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user