diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index ae47166a1..7efc0f1e8 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -486,6 +486,7 @@ .debate, .proposal, .budget-investment, +.budget-investment-show, .legislation, .communities-show { margin: $line-height / 4 0; diff --git a/app/components/budgets/investments/info_component.html.erb b/app/components/budgets/investments/info_component.html.erb index 91e757cd0..e4f8922d3 100644 --- a/app/components/budgets/investments/info_component.html.erb +++ b/app/components/budgets/investments/info_component.html.erb @@ -1,5 +1,10 @@
<%= l investment.created_at.to_date %> + • + + + <%= link_to t("shared.comments", count: investment.comments_count), + budget_investment_path(investment.budget, investment, anchor: "comments") %> <% if investment.author.hidden? || investment.author.erased? %> • diff --git a/app/views/budgets/investments/_investment_detail.erb b/app/views/budgets/investments/_investment_detail.erb index 28b8e8996..987dd3174 100644 --- a/app/views/budgets/investments/_investment_detail.erb +++ b/app/views/budgets/investments/_investment_detail.erb @@ -5,6 +5,9 @@ • <%= l investment.created_at.to_date %> • + + <%= link_to t("shared.comments", count: investment.comments_count), "#comments" %> + • <%= investment.heading.name %> • <% if local_assigns[:preview].nil? %> diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index 20c977dc7..db573e42b 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -763,6 +763,10 @@ en: other: "%{count} languages in use" optional: "Optional fields" required: "Required fields" + comments: + one: "1 comment" + other: "%{count} comments" + zero: "No comments" social: facebook: "%{org} Facebook" twitter: "%{org} Twitter" diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index 8dc487a97..82ea3bbd7 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -763,6 +763,10 @@ es: other: "%{count} idiomas en uso" optional: "Campos opcionales" required: "Campos obligatorios" + comments: + one: "1 comentario" + other: "%{count} comentarios" + zero: "Sin comentarios" social: facebook: "Facebook de %{org}" twitter: "Twitter de %{org}" diff --git a/spec/system/budgets/investments_spec.rb b/spec/system/budgets/investments_spec.rb index b1dd24db1..2395be61c 100644 --- a/spec/system/budgets/investments_spec.rb +++ b/spec/system/budgets/investments_spec.rb @@ -62,7 +62,11 @@ describe "Budget Investments" do investments.each do |investment| within("#budget-investments") do 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) end end @@ -849,6 +853,7 @@ describe "Budget Investments" do expect(page).to have_content(investment.title) expect(page).to have_content(investment.description) expect(page).to have_content(investment.author.name) + expect(page).to have_content(investment.comments_count) expect(page).to have_content(investment.heading.name) within("#investment_code") do expect(page).to have_content(investment.id)