Add comments count on budget investments
This commit is contained in:
@@ -486,6 +486,7 @@
|
|||||||
.debate,
|
.debate,
|
||||||
.proposal,
|
.proposal,
|
||||||
.budget-investment,
|
.budget-investment,
|
||||||
|
.budget-investment-show,
|
||||||
.legislation,
|
.legislation,
|
||||||
.communities-show {
|
.communities-show {
|
||||||
margin: $line-height / 4 0;
|
margin: $line-height / 4 0;
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
<p class="investment-project-info">
|
<p class="investment-project-info">
|
||||||
<%= l investment.created_at.to_date %>
|
<%= l investment.created_at.to_date %>
|
||||||
|
<span class="bullet"> • </span>
|
||||||
|
|
||||||
|
<span class="icon-comments"></span>
|
||||||
|
<%= link_to t("shared.comments", count: investment.comments_count),
|
||||||
|
budget_investment_path(investment.budget, investment, anchor: "comments") %>
|
||||||
|
|
||||||
<% if investment.author.hidden? || investment.author.erased? %>
|
<% if investment.author.hidden? || investment.author.erased? %>
|
||||||
<span class="bullet"> • </span>
|
<span class="bullet"> • </span>
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
<span class="bullet"> • </span>
|
<span class="bullet"> • </span>
|
||||||
<%= l investment.created_at.to_date %>
|
<%= l investment.created_at.to_date %>
|
||||||
<span class="bullet"> • </span>
|
<span class="bullet"> • </span>
|
||||||
|
<span class="icon-comments"></span>
|
||||||
|
<%= link_to t("shared.comments", count: investment.comments_count), "#comments" %>
|
||||||
|
<span class="bullet"> • </span>
|
||||||
<%= investment.heading.name %>
|
<%= investment.heading.name %>
|
||||||
<span class="bullet"> • </span>
|
<span class="bullet"> • </span>
|
||||||
<% if local_assigns[:preview].nil? %>
|
<% if local_assigns[:preview].nil? %>
|
||||||
|
|||||||
@@ -763,6 +763,10 @@ en:
|
|||||||
other: "%{count} languages in use"
|
other: "%{count} languages in use"
|
||||||
optional: "Optional fields"
|
optional: "Optional fields"
|
||||||
required: "Required fields"
|
required: "Required fields"
|
||||||
|
comments:
|
||||||
|
one: "1 comment"
|
||||||
|
other: "%{count} comments"
|
||||||
|
zero: "No comments"
|
||||||
social:
|
social:
|
||||||
facebook: "%{org} Facebook"
|
facebook: "%{org} Facebook"
|
||||||
twitter: "%{org} Twitter"
|
twitter: "%{org} Twitter"
|
||||||
|
|||||||
@@ -763,6 +763,10 @@ es:
|
|||||||
other: "%{count} idiomas en uso"
|
other: "%{count} idiomas en uso"
|
||||||
optional: "Campos opcionales"
|
optional: "Campos opcionales"
|
||||||
required: "Campos obligatorios"
|
required: "Campos obligatorios"
|
||||||
|
comments:
|
||||||
|
one: "1 comentario"
|
||||||
|
other: "%{count} comentarios"
|
||||||
|
zero: "Sin comentarios"
|
||||||
social:
|
social:
|
||||||
facebook: "Facebook de %{org}"
|
facebook: "Facebook de %{org}"
|
||||||
twitter: "Twitter de %{org}"
|
twitter: "Twitter de %{org}"
|
||||||
|
|||||||
@@ -62,7 +62,11 @@ describe "Budget Investments" do
|
|||||||
investments.each do |investment|
|
investments.each do |investment|
|
||||||
within("#budget-investments") do
|
within("#budget-investments") do
|
||||||
expect(page).to have_content investment.title
|
expect(page).to have_content investment.title
|
||||||
expect(page).to have_css("a[href='#{budget_investment_path(budget, id: investment.id)}']", text: investment.title)
|
expect(page).to have_content investment.comments_count
|
||||||
|
expect(page).to have_link "No comments", href: budget_investment_path(budget, id: investment.id,
|
||||||
|
anchor: "comments")
|
||||||
|
expect(page).to have_link investment.title, href: budget_investment_path(budget, id: investment.id)
|
||||||
|
|
||||||
expect(page).not_to have_content(unfeasible_investment.title)
|
expect(page).not_to have_content(unfeasible_investment.title)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -849,6 +853,7 @@ describe "Budget Investments" do
|
|||||||
expect(page).to have_content(investment.title)
|
expect(page).to have_content(investment.title)
|
||||||
expect(page).to have_content(investment.description)
|
expect(page).to have_content(investment.description)
|
||||||
expect(page).to have_content(investment.author.name)
|
expect(page).to have_content(investment.author.name)
|
||||||
|
expect(page).to have_content(investment.comments_count)
|
||||||
expect(page).to have_content(investment.heading.name)
|
expect(page).to have_content(investment.heading.name)
|
||||||
within("#investment_code") do
|
within("#investment_code") do
|
||||||
expect(page).to have_content(investment.id)
|
expect(page).to have_content(investment.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user