diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index ed9fa9769..2b1e72b75 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -21,6 +21,8 @@ jobs: run: npx stylelint app/assets/stylesheets - name: Markdownlint run: bundle exec mdl *.md docs/ + - name: HTML Beautifier + run: find app/ -name "*.html.erb" -exec bundle exec htmlbeautifier --lint-only --keep-blank-lines 1 -e {} + name: ${{ matrix.name }} steps: - name: Checkout code diff --git a/Gemfile b/Gemfile index be82402ce..d206f2233 100644 --- a/Gemfile +++ b/Gemfile @@ -95,6 +95,7 @@ group :development do gem "capistrano3-puma", "~> 5.2.0" gem "erb_lint", "~> 0.9.0", require: false gem "faraday-retry", "~> 2.2.1", require: false + gem "htmlbeautifier", "~> 1.4.3", require: false gem "mdl", "~> 0.13.0", require: false gem "pronto", "~> 0.11.2", require: false gem "pronto-erb_lint", "~> 0.1.6", require: false diff --git a/Gemfile.lock b/Gemfile.lock index bf7816ac8..118f85a39 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -272,6 +272,7 @@ GEM hashery (2.1.2) hashie (5.0.0) highline (2.0.3) + htmlbeautifier (1.4.3) htmlentities (4.3.4) httparty (0.22.0) csv @@ -755,6 +756,7 @@ DEPENDENCIES graphiql-rails (~> 1.8.0) graphql (~> 2.3.18) groupdate (~> 6.5.1) + htmlbeautifier (~> 1.4.3) i18n-tasks (~> 0.9.37) image_processing (~> 1.13.0) invisible_captcha (~> 2.3.0) diff --git a/app/assets/stylesheets/legislation_process.scss b/app/assets/stylesheets/legislation_process.scss index 3bd4106e0..5e7f78fc7 100644 --- a/app/assets/stylesheets/legislation_process.scss +++ b/app/assets/stylesheets/legislation_process.scss @@ -812,7 +812,6 @@ .proposal h3 { font-size: rem-calc(20); - margin-top: 0; } } diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 911c9debb..c9f4cc37d 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -88,15 +88,6 @@ } } -.supports-container { - border-top: 1px solid $border; - - @include breakpoint(medium) { - border-left: 1px solid $border; - border-top: 0; - } -} - .participation-not-allowed { background: $warning-bg; color: $color-warning; @@ -394,41 +385,53 @@ @include breakpoint(medium) { min-height: $line-height * 15; - - .with-image > .row { - display: flex; - } } } -.budget-investments-list .budget-investment, -.proposals-list .proposal, -.legislation-proposals .proposal { +.debates-list, +.proposals-list, +.budget-investments-list, +.legislation-proposals { - @include breakpoint(medium) { + .panel { + column-gap: calc(rem-calc(map-get($grid-column-gutter, medium)) * 3 / 4); + display: flex; + flex-wrap: wrap; - .panel { + > * { + flex-grow: 1; + } - &.with-image { - padding: 0 calc($line-height / 2) 0 0; + &.with-image { + padding-bottom: 0; + padding-top: 0; + + .panel-image { + margin-#{$global-left}: rem-calc(-12); + text-align: center; + + ~ * { + padding-top: calc($line-height / 2); + } + } + + img { + height: 100%; } } - .column:first-child { - overflow: hidden; - } + .debate-content, + .budget-investment-content, + .proposal-content { + flex-basis: calc((35rem - 100%) * 999); + flex-grow: 1000; + max-width: 50rem; - .column:nth-child(2) { - float: left; - } - - .column:last-child:not(:first-child) { - padding-top: calc($line-height / 2); - } - - img { - height: 100%; - max-width: 12rem; + + * { + flex-basis: 22.5%; + flex-shrink: 0; + text-align: center; + } } } } @@ -592,27 +595,19 @@ .legislation-proposals { .votes { - border-top: 1px solid $border; margin-top: $line-height; padding: calc($line-height / 2) 0; position: relative; @include breakpoint(medium) { - border-left: 1px solid $border; - border-top: 0; margin-top: 0; text-align: center; } .total-votes { - float: right; + display: block; font-weight: bold; line-height: $line-height * 2; - - @include breakpoint(medium) { - display: block; - float: none; - } } } } @@ -624,12 +619,6 @@ } } -.proposal-show .votes, -.debate-show .votes { - border: 0; - padding: calc($line-height / 2) 0; -} - .proposal, .budget-investment { diff --git a/app/assets/stylesheets/shared/in_favor_against.scss b/app/assets/stylesheets/shared/in_favor_against.scss index c7a59f7cb..0aaa86104 100644 --- a/app/assets/stylesheets/shared/in_favor_against.scss +++ b/app/assets/stylesheets/shared/in_favor_against.scss @@ -1,9 +1,5 @@ .in-favor-against { - @include flex-with-gap($line-height * 0.25); - - @include breakpoint(medium) { - @include flex-with-gap($line-height * 0.75); - } + @include flex-with-gap($line-height * 0.75); &, .in-favor, @@ -77,16 +73,8 @@ } .percentage { - display: inline-block; + display: block; font-size: $small-font-size; - line-height: $line-height * 2; - padding-right: calc($line-height / 2); - vertical-align: top; - - @include breakpoint(medium) { - display: block; - line-height: $line-height; - padding-right: 0; - } + line-height: $line-height; } } diff --git a/app/components/admin/poll/shifts/form_component.html.erb b/app/components/admin/poll/shifts/form_component.html.erb index 74ac8105e..b5e74ba6a 100644 --- a/app/components/admin/poll/shifts/form_component.html.erb +++ b/app/components/admin/poll/shifts/form_component.html.erb @@ -8,7 +8,8 @@
<%= t("admin.poll_shifts.new.officer") %> -
<%= officer.name %> +
+ <%= officer.name %> <%= f.hidden_field :officer_id, value: officer.id %>
diff --git a/app/components/admin/site_customization/pages/index_component.html.erb b/app/components/admin/site_customization/pages/index_component.html.erb index fb81ae0a1..9a21de8b8 100644 --- a/app/components/admin/site_customization/pages/index_component.html.erb +++ b/app/components/admin/site_customization/pages/index_component.html.erb @@ -17,28 +17,28 @@ - <% pages.each do |page| %> - - <%= page.title %> - <%= page.slug %> - <%= I18n.l page.created_at, format: :long %> - <%= I18n.l page.updated_at, format: :long %> - <%= t("admin.site_customization.pages.page.status_#{page.status}") %> - - <%= render Admin::TableActionsComponent.new(page) do |actions| %> - <%= actions.action(:cards, - text: t("admin.site_customization.pages.page.see_cards"), - path: admin_site_customization_page_widget_cards_path(page)) %> + <% pages.each do |page| %> + + <%= page.title %> + <%= page.slug %> + <%= I18n.l page.created_at, format: :long %> + <%= I18n.l page.updated_at, format: :long %> + <%= t("admin.site_customization.pages.page.status_#{page.status}") %> + + <%= render Admin::TableActionsComponent.new(page) do |actions| %> + <%= actions.action(:cards, + text: t("admin.site_customization.pages.page.see_cards"), + path: admin_site_customization_page_widget_cards_path(page)) %> - <% if page.status == "published" %> - <%= actions.action(:show, - text: t("admin.site_customization.pages.index.see_page"), - path: page.url) %> + <% if page.status == "published" %> + <%= actions.action(:show, + text: t("admin.site_customization.pages.index.see_page"), + path: page.url) %> + <% end %> <% end %> - <% end %> - - - <% end %> + + + <% end %> diff --git a/app/components/admin/stats/budget_balloting_component.html.erb b/app/components/admin/stats/budget_balloting_component.html.erb index da66118f3..0dc515c21 100644 --- a/app/components/admin/stats/budget_balloting_component.html.erb +++ b/app/components/admin/stats/budget_balloting_component.html.erb @@ -30,7 +30,9 @@ - + + + @@ -49,7 +51,9 @@
<%= t("admin.stats.budget_balloting.votes_per_heading") %>
<%= t("admin.stats.budget_balloting.votes_per_heading") %>
- + + + diff --git a/app/components/admin/stats/stat_component.html.erb b/app/components/admin/stats/stat_component.html.erb index fa5b95999..41404061b 100644 --- a/app/components/admin/stats/stat_component.html.erb +++ b/app/components/admin/stats/stat_component.html.erb @@ -1,5 +1,6 @@
<%= tag.p(**options) do %> - <%= text %>
<%= amount %> + <%= text %>
+ <%= amount %> <% end %>
diff --git a/app/components/attachable/fields_component.html.erb b/app/components/attachable/fields_component.html.erb index d51997e53..45d9770ba 100644 --- a/app/components/attachable/fields_component.html.erb +++ b/app/components/attachable/fields_component.html.erb @@ -24,7 +24,9 @@
-
+
+
+

diff --git a/app/components/budgets/ballot/ballot_component.html.erb b/app/components/budgets/ballot/ballot_component.html.erb index 5945b7f2b..58f4f5c3e 100644 --- a/app/components/budgets/ballot/ballot_component.html.erb +++ b/app/components/budgets/ballot/ballot_component.html.erb @@ -9,7 +9,7 @@

<%= t("budgets.ballots.show.voted_info") %> -

+

<%= t("budgets.ballots.show.voted_info_2") %>

diff --git a/app/components/budgets/budget_component.html.erb b/app/components/budgets/budget_component.html.erb index 332920b2e..ef209f64e 100644 --- a/app/components/budgets/budget_component.html.erb +++ b/app/components/budgets/budget_component.html.erb @@ -1,9 +1,4 @@ -<% if budget.image.present? %> -
-<% else %> -
-<% end %> +
>
<%= t("budgets.index.title") %> diff --git a/app/components/budgets/budget_component.rb b/app/components/budgets/budget_component.rb index b21cf22e5..d0b11c010 100644 --- a/app/components/budgets/budget_component.rb +++ b/app/components/budgets/budget_component.rb @@ -5,4 +5,17 @@ class Budgets::BudgetComponent < ApplicationComponent def initialize(budget) @budget = budget end + + private + + def html_attributes + if budget.image.present? + { + class: "budget-header with-background-image", + style: attached_background_css(polymorphic_path(budget.image.variant(:large))) + } + else + { class: "budget-header" } + end + end end diff --git a/app/components/layout/admin_header_component.html.erb b/app/components/layout/admin_header_component.html.erb index 99d48e18a..41170c0ac 100644 --- a/app/components/layout/admin_header_component.html.erb +++ b/app/components/layout/admin_header_component.html.erb @@ -13,7 +13,8 @@

<%= link_to namespace_path do %> <%= setting["org_name"] %> -
<%= namespaced_header_title %> +
+ <%= namespaced_header_title %> <% end %>

diff --git a/app/components/layout/cookies_consent/management_component.html.erb b/app/components/layout/cookies_consent/management_component.html.erb index 4bff72dde..943e1bd72 100644 --- a/app/components/layout/cookies_consent/management_component.html.erb +++ b/app/components/layout/cookies_consent/management_component.html.erb @@ -9,7 +9,7 @@ -

<%= t("cookies_management.description") %>

+

<%= t("cookies_management.description") %>

<% if more_info_link.present? %>

<%= link_to t("cookies_consent.more_info_link"), more_info_link, target: "_blank" %>

<% end %> diff --git a/app/components/polls/questions/read_more_component.html.erb b/app/components/polls/questions/read_more_component.html.erb index 90d4e382e..655c2250a 100644 --- a/app/components/polls/questions/read_more_component.html.erb +++ b/app/components/polls/questions/read_more_component.html.erb @@ -47,9 +47,7 @@

<% option.videos.each do |video| %> - <%= link_to video.title, - video.url, - rel: "nofollow" %>
+ <%= link_to video.title, video.url, rel: "nofollow" %>
<% end %>
<% end %> diff --git a/app/components/sdg/goals/targets_component.html.erb b/app/components/sdg/goals/targets_component.html.erb index d114b15e3..cce74ead2 100644 --- a/app/components/sdg/goals/targets_component.html.erb +++ b/app/components/sdg/goals/targets_component.html.erb @@ -17,8 +17,8 @@ <% else %>
<% targets.sort.each do |target| %> -
<%= target.code %>
-
<%= target.long_title %>
+
<%= target.code %>
+
<%= target.long_title %>
<% end %>
<% end %> diff --git a/app/helpers/legislation_helper.rb b/app/helpers/legislation_helper.rb index a62111397..ee13e2d96 100644 --- a/app/helpers/legislation_helper.rb +++ b/app/helpers/legislation_helper.rb @@ -18,13 +18,13 @@ module LegislationHelper } end - def banner_color? - @process.background_color.present? && @process.font_color.present? + def banner_color?(process) + process.background_color.present? && process.font_color.present? end - def css_for_process_header - if banner_color? - "background: #{@process.background_color};color: #{@process.font_color};" + def css_for_process_header(process) + if banner_color?(process) + "background: #{process.background_color};color: #{process.font_color};" end end end diff --git a/app/helpers/proposals_helper.rb b/app/helpers/proposals_helper.rb index a497c7037..cfd9a79b0 100644 --- a/app/helpers/proposals_helper.rb +++ b/app/helpers/proposals_helper.rb @@ -64,22 +64,6 @@ module ProposalsHelper proposals_current_view == "default" ? "minimal" : "default" end - def css_for_proposal_info_row(proposal) - if proposal.image.present? - if params[:selected].present? - "small-12 medium-9 column" - else - "small-12 medium-6 large-7 column" - end - else - if params[:selected].present? - "small-12 column" - else - "small-12 medium-9 column" - end - end - end - def show_proposal_votes? params[:selected].blank? end diff --git a/app/views/admin/activity/show.html.erb b/app/views/admin/activity/show.html.erb index 878f69e3a..daf36c819 100644 --- a/app/views/admin/activity/show.html.erb +++ b/app/views/admin/activity/show.html.erb @@ -44,6 +44,7 @@
<%= sanitize(activity.actionable.description) %> <% end %> +
diff --git a/app/views/admin/admin_notifications/index.html.erb b/app/views/admin/admin_notifications/index.html.erb index de8b3f392..233d32f1b 100644 --- a/app/views/admin/admin_notifications/index.html.erb +++ b/app/views/admin/admin_notifications/index.html.erb @@ -14,34 +14,34 @@ - <% @admin_notifications.order(created_at: :desc).each do |admin_notification| %> - - - - - + + + + - - <% end %> + + + <% end %>
<%= t("admin.stats.budget_balloting.participants_per_district") %>
<%= t("admin.stats.budget_balloting.participants_per_district") %>
<%= activity.user.name %> (<%= activity.user.email %>)
- <%= admin_notification.title %> - - <%= segment_name(admin_notification.segment_recipient) %> - - <% if admin_notification.draft? %> - <%= t("admin.admin_notifications.index.draft") %> - <% else %> - <%= l admin_notification.sent_at.to_date %> - <% end %> - - <% if admin_notification.draft? %> - <%= render Admin::TableActionsComponent.new(admin_notification) do |actions| %> - <%= actions.action(:preview, text: t("admin.admin_notifications.index.preview")) %> + <% @admin_notifications.order(created_at: :desc).each do |admin_notification| %> +
+ <%= admin_notification.title %> + + <%= segment_name(admin_notification.segment_recipient) %> + + <% if admin_notification.draft? %> + <%= t("admin.admin_notifications.index.draft") %> + <% else %> + <%= l admin_notification.sent_at.to_date %> <% end %> - <% else %> - <%= render Admin::TableActionsComponent.new(admin_notification, actions: []) do |actions| %> - <%= actions.action(:show, text: t("admin.admin_notifications.index.view")) %> + + <% if admin_notification.draft? %> + <%= render Admin::TableActionsComponent.new(admin_notification) do |actions| %> + <%= actions.action(:preview, text: t("admin.admin_notifications.index.preview")) %> + <% end %> + <% else %> + <%= render Admin::TableActionsComponent.new(admin_notification, actions: []) do |actions| %> + <%= actions.action(:show, text: t("admin.admin_notifications.index.view")) %> + <% end %> <% end %> - <% end %> -
<% else %> diff --git a/app/views/admin/admin_notifications/show.html.erb b/app/views/admin/admin_notifications/show.html.erb index bf30a0aa3..6072864ca 100644 --- a/app/views/admin/admin_notifications/show.html.erb +++ b/app/views/admin/admin_notifications/show.html.erb @@ -28,7 +28,7 @@
- <%= t("admin.admin_notifications.show.segment_recipient") %>
+ <%= t("admin.admin_notifications.show.segment_recipient") %>
<%= segment_name(@admin_notification.segment_recipient) %> <% if @admin_notification.draft? %> <%= t("admin.admin_notifications.show.will_get_notified", diff --git a/app/views/admin/budget_investments/edit.html.erb b/app/views/admin/budget_investments/edit.html.erb index cd4f2f540..e28c3b9f7 100644 --- a/app/views/admin/budget_investments/edit.html.erb +++ b/app/views/admin/budget_investments/edit.html.erb @@ -11,7 +11,7 @@ <%= render "shared/errors", resource: @investment %> <% Budget::Investment.filter_params(params).to_h.each do |filter_name, filter_value| %> - <%= hidden_field_tag filter_name, filter_value %> + <%= hidden_field_tag filter_name, filter_value %> <% end %>
@@ -74,9 +74,9 @@
<%= f.label :valuator_ids %>
    - <%= f.collection_check_boxes :valuator_group_ids, @valuator_groups, :id, :name do |group| %> -
  • <%= group.label(title: group.object.name) { group.check_box + truncate(group.object.name, length: 60) } %>
  • - <% end %> + <%= f.collection_check_boxes :valuator_group_ids, @valuator_groups, :id, :name do |group| %> +
  • <%= group.label(title: group.object.name) { group.check_box + truncate(group.object.name, length: 60) } %>
  • + <% end %>
@@ -85,7 +85,7 @@ <%= f.label :valuator_ids, t("admin.budget_investments.edit.assigned_valuators") %>
@@ -93,11 +93,11 @@
<% if @investment.incompatible? || @investment.winner? %> -
-

<%= t("admin.budget_investments.edit.compatibility") %>

- <%= f.check_box :incompatible, - title: t("admin.budget_investments.edit.compatibility") %> -
+
+

<%= t("admin.budget_investments.edit.compatibility") %>

+ <%= f.check_box :incompatible, + title: t("admin.budget_investments.edit.compatibility") %> +
<% end %>

<%= t("admin.budget_investments.edit.selection") %>

diff --git a/app/views/admin/debates/show.html.erb b/app/views/admin/debates/show.html.erb index a9cd45d3e..c1475bddd 100644 --- a/app/views/admin/debates/show.html.erb +++ b/app/views/admin/debates/show.html.erb @@ -39,17 +39,17 @@
- <%= t("votes.agree") %> - + <%= t("votes.agree") %> + <%= votes_percentage("likes", @debate) %>
 • 
- - <%= t("votes.disagree") %> - + + <%= t("votes.disagree") %> + <%= votes_percentage("dislikes", @debate) %>
diff --git a/app/views/admin/hidden_budget_investments/index.html.erb b/app/views/admin/hidden_budget_investments/index.html.erb index 34c3201ea..f5c458eec 100644 --- a/app/views/admin/hidden_budget_investments/index.html.erb +++ b/app/views/admin/hidden_budget_investments/index.html.erb @@ -14,21 +14,21 @@ <%= t("admin.shared.actions") %> - <% @investments.each do |investment| %> - - - <%= investment.title %> - - -
- <%= wysiwyg(investment.description) %> -
- - - <%= render Admin::HiddenTableActionsComponent.new(investment) %> - - - <% end %> + <% @investments.each do |investment| %> + + + <%= investment.title %> + + +
+ <%= wysiwyg(investment.description) %> +
+ + + <%= render Admin::HiddenTableActionsComponent.new(investment) %> + + + <% end %> diff --git a/app/views/admin/hidden_comments/index.html.erb b/app/views/admin/hidden_comments/index.html.erb index 1cc84b84b..06aa5d583 100644 --- a/app/views/admin/hidden_comments/index.html.erb +++ b/app/views/admin/hidden_comments/index.html.erb @@ -13,21 +13,21 @@ <%= t("admin.shared.actions") %> - <% @comments.each do |comment| %> - - - <%= sanitize_and_auto_link comment.body %>
- <% if comment.commentable.hidden? %> - (<%= t("admin.hidden_comments.index.hidden_#{comment.commentable_type.downcase}") %>: <%= comment.commentable.title %>) - <% else %> - <%= link_to comment.commentable.title, commentable_path(comment) %> - <% end %> - - - <%= render Admin::HiddenTableActionsComponent.new(comment) %> - - - <% end %> + <% @comments.each do |comment| %> + + + <%= sanitize_and_auto_link comment.body %>
+ <% if comment.commentable.hidden? %> + (<%= t("admin.hidden_comments.index.hidden_#{comment.commentable_type.downcase}") %>: <%= comment.commentable.title %>) + <% else %> + <%= link_to comment.commentable.title, commentable_path(comment) %> + <% end %> + + + <%= render Admin::HiddenTableActionsComponent.new(comment) %> + + + <% end %> diff --git a/app/views/admin/hidden_debates/index.html.erb b/app/views/admin/hidden_debates/index.html.erb index 8c50d90aa..01a3989a1 100644 --- a/app/views/admin/hidden_debates/index.html.erb +++ b/app/views/admin/hidden_debates/index.html.erb @@ -14,21 +14,21 @@ <%= t("admin.shared.actions") %> - <% @debates.each do |debate| %> - - - <%= debate.title %> - - -
- <%= wysiwyg(debate.description) %> -
- - - <%= render Admin::HiddenTableActionsComponent.new(debate) %> - - - <% end %> + <% @debates.each do |debate| %> + + + <%= debate.title %> + + +
+ <%= wysiwyg(debate.description) %> +
+ + + <%= render Admin::HiddenTableActionsComponent.new(debate) %> + + + <% end %> diff --git a/app/views/admin/hidden_proposal_notifications/index.html.erb b/app/views/admin/hidden_proposal_notifications/index.html.erb index 227a38215..64da7faf1 100644 --- a/app/views/admin/hidden_proposal_notifications/index.html.erb +++ b/app/views/admin/hidden_proposal_notifications/index.html.erb @@ -14,21 +14,21 @@ <%= t("admin.shared.actions") %> - <% @proposal_notifications.each do |proposal_notification| %> - - - <%= proposal_notification.title %> - - -
- <%= proposal_notification.body %> -
- - - <%= render Admin::HiddenTableActionsComponent.new(proposal_notification) %> - - - <% end %> + <% @proposal_notifications.each do |proposal_notification| %> + + + <%= proposal_notification.title %> + + +
+ <%= proposal_notification.body %> +
+ + + <%= render Admin::HiddenTableActionsComponent.new(proposal_notification) %> + + + <% end %> diff --git a/app/views/admin/hidden_proposals/index.html.erb b/app/views/admin/hidden_proposals/index.html.erb index 83a36e329..261c17876 100644 --- a/app/views/admin/hidden_proposals/index.html.erb +++ b/app/views/admin/hidden_proposals/index.html.erb @@ -14,25 +14,25 @@ <%= t("admin.shared.actions") %> - <% @proposals.each do |proposal| %> - - - <%= proposal.title %> - - -
-

<%= proposal.summary %>

- <%= wysiwyg(proposal.description) %> - <% if proposal.video_url.present? %> -

<%= sanitize_and_auto_link proposal.video_url %>

- <% end %> -
- - - <%= render Admin::HiddenTableActionsComponent.new(proposal) %> - - - <% end %> + <% @proposals.each do |proposal| %> + + + <%= proposal.title %> + + +
+

<%= proposal.summary %>

+ <%= wysiwyg(proposal.description) %> + <% if proposal.video_url.present? %> +

<%= sanitize_and_auto_link proposal.video_url %>

+ <% end %> +
+ + + <%= render Admin::HiddenTableActionsComponent.new(proposal) %> + + + <% end %> diff --git a/app/views/admin/hidden_users/index.html.erb b/app/views/admin/hidden_users/index.html.erb index 9f31bdd7e..324e17082 100644 --- a/app/views/admin/hidden_users/index.html.erb +++ b/app/views/admin/hidden_users/index.html.erb @@ -13,23 +13,23 @@ <%= t("admin.shared.actions") %> - <% @users.each do |user| %> - - -

<%= link_to user.name, admin_hidden_user_path(user) %>

- + <% @users.each do |user| %> + + +

<%= link_to user.name, admin_hidden_user_path(user) %>

+ - - <%= render Admin::HiddenTableActionsComponent.new(user) %> - - - <% end %> + + <%= render Admin::HiddenTableActionsComponent.new(user) %> + + + <% end %> <%= paginate @users %> <% else %> -
+
<%= t("admin.hidden_users.index.no_hidden_users") %>
<% end %> diff --git a/app/views/admin/legislation/draft_versions/index.html.erb b/app/views/admin/legislation/draft_versions/index.html.erb index 3abd526d1..60812ef66 100644 --- a/app/views/admin/legislation/draft_versions/index.html.erb +++ b/app/views/admin/legislation/draft_versions/index.html.erb @@ -29,31 +29,31 @@ - <% @process.draft_versions.each do |draft_version| %> - - - <%= link_to draft_version.title, edit_admin_legislation_process_draft_version_path(@process, draft_version) %> - - <%= draft_version.created_at.to_date %> - - <% if draft_version.status == "draft" %> - <%= Legislation::DraftVersion.human_attribute_name(:status_draft) %> - <%= link_to "(#{t("admin.legislation.draft_versions.index.preview")})", - legislation_process_draft_version_path(@process, draft_version) %> - <% else %> - <%= Legislation::DraftVersion.human_attribute_name(:status_published) %> - <% end %> - - <%= draft_version.total_comments %> - - <% if draft_version.final_version %> - - <% else %> - - <% end %> - - - <% end %> + <% @process.draft_versions.each do |draft_version| %> + + + <%= link_to draft_version.title, edit_admin_legislation_process_draft_version_path(@process, draft_version) %> + + <%= draft_version.created_at.to_date %> + + <% if draft_version.status == "draft" %> + <%= Legislation::DraftVersion.human_attribute_name(:status_draft) %> + <%= link_to "(#{t("admin.legislation.draft_versions.index.preview")})", + legislation_process_draft_version_path(@process, draft_version) %> + <% else %> + <%= Legislation::DraftVersion.human_attribute_name(:status_published) %> + <% end %> + + <%= draft_version.total_comments %> + + <% if draft_version.final_version %> + + <% else %> + + <% end %> + + + <% end %> <% end %> diff --git a/app/views/admin/legislation/questions/index.html.erb b/app/views/admin/legislation/questions/index.html.erb index 7593750e7..213be8b6d 100644 --- a/app/views/admin/legislation/questions/index.html.erb +++ b/app/views/admin/legislation/questions/index.html.erb @@ -18,7 +18,7 @@ <% if @process.questions.any? %> - + @@ -27,22 +27,22 @@ - <% @process.questions.each do |question| %> - - - - - - - <% end %> + <% @process.questions.each do |question| %> + + + + + + + <% end %>
<%= t("admin.legislation.questions.table.title") %> <%= t("admin.legislation.questions.table.question_options") %>
- <%= link_to question.title, edit_admin_legislation_process_question_path(@process, question) %> - -
    - <% question.question_options.each do |question_option| %> -
  • <%= "#{question_option.value} (#{question_option.answers_count})" %>
  • - <% end %> -
-
<%= question.answers_count %><%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: "comments") %>
+ <%= link_to question.title, edit_admin_legislation_process_question_path(@process, question) %> + +
    + <% question.question_options.each do |question_option| %> +
  • <%= "#{question_option.value} (#{question_option.answers_count})" %>
  • + <% end %> +
+
<%= question.answers_count %><%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: "comments") %>
<% end %> diff --git a/app/views/admin/managers/search.html.erb b/app/views/admin/managers/search.html.erb index 3ceae0935..592d8b718 100644 --- a/app/views/admin/managers/search.html.erb +++ b/app/views/admin/managers/search.html.erb @@ -13,15 +13,15 @@ <%= t("admin.shared.actions") %> - <% @users.each do |user| %> - - <%= user.name %> - <%= user.email %> - - <%= render Admin::Roles::TableActionsComponent.new(user.manager || user.build_manager) %> - - - <% end %> + <% @users.each do |user| %> + + <%= user.name %> + <%= user.email %> + + <%= render Admin::Roles::TableActionsComponent.new(user.manager || user.build_manager) %> + + + <% end %> <% else %> diff --git a/app/views/admin/moderators/search.html.erb b/app/views/admin/moderators/search.html.erb index fee2c76a7..0a472b406 100644 --- a/app/views/admin/moderators/search.html.erb +++ b/app/views/admin/moderators/search.html.erb @@ -13,15 +13,16 @@ <%= t("admin.shared.actions") %> - <% @users.each do |user| %> - - <%= user.name %> - <%= user.email %> - - <%= render Admin::Roles::TableActionsComponent.new(user.moderator || user.build_moderator) %> - - - <% end %> + <% @users.each do |user| %> + + <%= user.name %> + <%= user.email %> + + <%= render Admin::Roles::TableActionsComponent.new(user.moderator || user.build_moderator) %> + + + <% end %> + <% else %>
diff --git a/app/views/admin/newsletters/index.html.erb b/app/views/admin/newsletters/index.html.erb index 0830c09d8..3c76276d2 100644 --- a/app/views/admin/newsletters/index.html.erb +++ b/app/views/admin/newsletters/index.html.erb @@ -14,28 +14,28 @@ - <% @newsletters.order(created_at: :desc).each do |newsletter| %> - - - <%= newsletter.subject %> - - - <%= segment_name(newsletter.segment_recipient) %> - - - <% if newsletter.draft? %> - <%= t("admin.newsletters.index.draft") %> - <% else %> - <%= l newsletter.sent_at.to_date %> - <% end %> - - - <%= render Admin::TableActionsComponent.new(newsletter) do |actions| %> - <%= actions.action :preview, text: t("admin.newsletters.index.preview") %> - <% end %> - - - <% end %> + <% @newsletters.order(created_at: :desc).each do |newsletter| %> + + + <%= newsletter.subject %> + + + <%= segment_name(newsletter.segment_recipient) %> + + + <% if newsletter.draft? %> + <%= t("admin.newsletters.index.draft") %> + <% else %> + <%= l newsletter.sent_at.to_date %> + <% end %> + + + <%= render Admin::TableActionsComponent.new(newsletter) do |actions| %> + <%= actions.action :preview, text: t("admin.newsletters.index.preview") %> + <% end %> + + + <% end %> <% else %> diff --git a/app/views/admin/officials/search.html.erb b/app/views/admin/officials/search.html.erb index 8c5d8d013..0313da4c9 100644 --- a/app/views/admin/officials/search.html.erb +++ b/app/views/admin/officials/search.html.erb @@ -8,10 +8,10 @@ - - - - + + + + <% @users.each do |user| %> diff --git a/app/views/admin/organizations/index.html.erb b/app/views/admin/organizations/index.html.erb index 7632445be..0406852e8 100644 --- a/app/views/admin/organizations/index.html.erb +++ b/app/views/admin/organizations/index.html.erb @@ -21,30 +21,30 @@ - <% @organizations.each do |organization| %> - <% hidden += 1 and next if organization.user.nil? %> - - - - - - - - - <% end %> + <% @organizations.each do |organization| %> + <% hidden += 1 and next if organization.user.nil? %> + + + + + + + + + <% end %>
<%= t("admin.officials.index.name") %><%= t("admin.officials.index.official_position") %><%= t("admin.officials.index.official_level") %><%= t("admin.shared.actions") %><%= t("admin.officials.index.name") %><%= t("admin.officials.index.official_position") %><%= t("admin.officials.index.official_level") %><%= t("admin.shared.actions") %>
<%= t("admin.shared.actions") %>
<%= organization.name %><%= organization.email %><%= organization.phone_number %><%= organization.responsible_name %> - <% if organization.verified? %> - - <%= t("admin.organizations.index.verified") %> - <% elsif organization.rejected? %> - - <%= t("admin.organizations.index.rejected") %> - <% else %> - - <%= t("admin.organizations.index.pending") %> - <% end %> - - <%= render Admin::Organizations::TableActionsComponent.new(organization) %> -
<%= organization.name %><%= organization.email %><%= organization.phone_number %><%= organization.responsible_name %> + <% if organization.verified? %> + + <%= t("admin.organizations.index.verified") %> + <% elsif organization.rejected? %> + + <%= t("admin.organizations.index.rejected") %> + <% else %> + + <%= t("admin.organizations.index.pending") %> + <% end %> + + <%= render Admin::Organizations::TableActionsComponent.new(organization) %> +
diff --git a/app/views/admin/organizations/search.html.erb b/app/views/admin/organizations/search.html.erb index f19ee42c6..73c476f92 100644 --- a/app/views/admin/organizations/search.html.erb +++ b/app/views/admin/organizations/search.html.erb @@ -16,29 +16,29 @@ <%= t("admin.shared.actions") %> - <% @organizations.each do |organization| %> - - <%= organization.name %> - <%= organization.email %> - <%= organization.phone_number %> - <%= organization.responsible_name %> - - <% if organization.verified? %> - - <%= t("admin.organizations.index.verified") %> - <% elsif organization.rejected? %> - - <%= t("admin.organizations.index.rejected") %> - <% else %> - - <%= t("admin.organizations.index.pending") %> - <% end %> - - - <%= render Admin::Organizations::TableActionsComponent.new(organization) %> - - - <% end %> + <% @organizations.each do |organization| %> + + <%= organization.name %> + <%= organization.email %> + <%= organization.phone_number %> + <%= organization.responsible_name %> + + <% if organization.verified? %> + + <%= t("admin.organizations.index.verified") %> + <% elsif organization.rejected? %> + + <%= t("admin.organizations.index.rejected") %> + <% else %> + + <%= t("admin.organizations.index.pending") %> + <% end %> + + + <%= render Admin::Organizations::TableActionsComponent.new(organization) %> + + + <% end %> diff --git a/app/views/admin/poll/booth_assignments/_search_booths_results.html.erb b/app/views/admin/poll/booth_assignments/_search_booths_results.html.erb index 5bed2f427..b0524fab1 100644 --- a/app/views/admin/poll/booth_assignments/_search_booths_results.html.erb +++ b/app/views/admin/poll/booth_assignments/_search_booths_results.html.erb @@ -16,14 +16,14 @@ <% @booths.each do |booth| %> - - - <%= booth.name %> - - - <%= booth.location %> - - + + + <%= booth.name %> + + + <%= booth.location %> + + <% end %> diff --git a/app/views/admin/poll/booth_assignments/manage.html.erb b/app/views/admin/poll/booth_assignments/manage.html.erb index 63ef6c49a..eac0dbbba 100644 --- a/app/views/admin/poll/booth_assignments/manage.html.erb +++ b/app/views/admin/poll/booth_assignments/manage.html.erb @@ -15,11 +15,11 @@ <%= t("admin.actions.actions") %> - <% @booths.each do |booth| %> - - <%= render "booth_assignment", booth: booth, booth_assignment: booth.assignment_on_poll(@poll) %> - - <% end %> + <% @booths.each do |booth| %> + + <%= render "booth_assignment", booth: booth, booth_assignment: booth.assignment_on_poll(@poll) %> + + <% end %> diff --git a/app/views/admin/poll/booths/index.html.erb b/app/views/admin/poll/booths/index.html.erb index 37937d89e..0d38726f7 100644 --- a/app/views/admin/poll/booths/index.html.erb +++ b/app/views/admin/poll/booths/index.html.erb @@ -21,9 +21,9 @@ <%= t("admin.actions.actions") %> - <% @booths.each do |booth| %> - <%= render "booth", booth: booth %> - <% end %> + <% @booths.each do |booth| %> + <%= render "booth", booth: booth %> + <% end %> diff --git a/app/views/admin/poll/officer_assignments/_search_officers_results.html.erb b/app/views/admin/poll/officer_assignments/_search_officers_results.html.erb index 67eddef60..15c1804f5 100644 --- a/app/views/admin/poll/officer_assignments/_search_officers_results.html.erb +++ b/app/views/admin/poll/officer_assignments/_search_officers_results.html.erb @@ -16,16 +16,16 @@ <% @officers.each do |user| %> - - - - <%= link_to user.name, by_officer_admin_poll_officer_assignments_path(@poll, officer_id: user.id) %> - - - - <%= user.email %> - - + + + + <%= link_to user.name, by_officer_admin_poll_officer_assignments_path(@poll, officer_id: user.id) %> + + + + <%= user.email %> + + <% end %> diff --git a/app/views/admin/poll/polls/_poll_header.html.erb b/app/views/admin/poll/polls/_poll_header.html.erb index fafabcbfc..155a8b901 100644 --- a/app/views/admin/poll/polls/_poll_header.html.erb +++ b/app/views/admin/poll/polls/_poll_header.html.erb @@ -19,8 +19,8 @@
<%= t("admin.polls.index.geozone_restricted") %>
- <%= @poll.geozones.pluck(:name).to_sentence %> -
+ <%= @poll.geozones.pluck(:name).to_sentence %> +
<% end %>
diff --git a/app/views/admin/poll/shifts/_search_officers_results.html.erb b/app/views/admin/poll/shifts/_search_officers_results.html.erb index 8e2eed699..927ffadcf 100644 --- a/app/views/admin/poll/shifts/_search_officers_results.html.erb +++ b/app/views/admin/poll/shifts/_search_officers_results.html.erb @@ -15,22 +15,22 @@ <% @officers.each do |user| %> - - - <%= user.name %> - - - <%= user.email %> - - - <%= render Admin::TableActionsComponent.new( + + + <%= user.name %> + + + <%= user.email %> + + + <%= render Admin::TableActionsComponent.new( user, actions: [:edit], edit_text: t("admin.poll_shifts.new.edit_shifts"), edit_path: new_admin_booth_shift_path(officer_id: user.poll_officer.id) ) %> - - + + <% end %> diff --git a/app/views/admin/site_customization/content_blocks/index.html.erb b/app/views/admin/site_customization/content_blocks/index.html.erb index 05cda15a7..9fa4bfd8e 100644 --- a/app/views/admin/site_customization/content_blocks/index.html.erb +++ b/app/views/admin/site_customization/content_blocks/index.html.erb @@ -32,28 +32,28 @@ - <% @content_blocks.each do |content_block| %> - - <%= "#{content_block.name} (#{content_block.locale})" %> - <%= raw content_block.body %> - - <%= render Admin::TableActionsComponent.new(content_block) %> - - - <% end %> - <% @headings_content_blocks.each do |content_block| %> - - <%= "#{content_block.name} (#{content_block.locale})" %> - <%= raw content_block.body %> - - <%= render Admin::TableActionsComponent.new( + <% @content_blocks.each do |content_block| %> + + <%= "#{content_block.name} (#{content_block.locale})" %> + <%= raw content_block.body %> + + <%= render Admin::TableActionsComponent.new(content_block) %> + + + <% end %> + <% @headings_content_blocks.each do |content_block| %> + + <%= "#{content_block.name} (#{content_block.locale})" %> + <%= raw content_block.body %> + + <%= render Admin::TableActionsComponent.new( content_block, edit_path: admin_site_customization_edit_heading_content_block_path(content_block), destroy_path: admin_site_customization_delete_heading_content_block_path(content_block) ) %> - - - <% end %> + + + <% end %> <% else %> diff --git a/app/views/admin/site_customization/documents/index.html.erb b/app/views/admin/site_customization/documents/index.html.erb index b3f4ca635..604f9d2a0 100644 --- a/app/views/admin/site_customization/documents/index.html.erb +++ b/app/views/admin/site_customization/documents/index.html.erb @@ -37,7 +37,7 @@ <% end %> - +
<% else %>
<%= t("admin.documents.index.no_documents") %> diff --git a/app/views/admin/stats/show.html.erb b/app/views/admin/stats/show.html.erb index 2879900aa..0c5224bd2 100644 --- a/app/views/admin/stats/show.html.erb +++ b/app/views/admin/stats/show.html.erb @@ -56,7 +56,9 @@

<%= t "admin.stats.show.summary.debate_votes" %>
diff --git a/app/views/admin/system_emails/index.html.erb b/app/views/admin/system_emails/index.html.erb index beddb8f7d..ea3545e30 100644 --- a/app/views/admin/system_emails/index.html.erb +++ b/app/views/admin/system_emails/index.html.erb @@ -9,41 +9,41 @@ - <% @system_emails.each do |system_email_title, system_email_actions| %> - - - <%= t("admin.system_emails.#{system_email_title}.title") %> - - - <%= t("admin.system_emails.#{system_email_title}.description") %> - - - <%= render Admin::TableActionsComponent.new(system_email_title, actions: []) do |actions| %> - <% if system_email_actions.include?("view") %> - <%= actions.action(:show, - text: t("admin.shared.view"), - path: admin_system_email_view_path(system_email_title)) %> - <% end %> + <% @system_emails.each do |system_email_title, system_email_actions| %> + + + <%= t("admin.system_emails.#{system_email_title}.title") %> + + + <%= t("admin.system_emails.#{system_email_title}.description") %> + + + <%= render Admin::TableActionsComponent.new(system_email_title, actions: []) do |actions| %> + <% if system_email_actions.include?("view") %> + <%= actions.action(:show, + text: t("admin.shared.view"), + path: admin_system_email_view_path(system_email_title)) %> + <% end %> - <% if system_email_actions.include?("preview_pending") %> - <%= actions.action(:preview_pending, - text: t("admin.system_emails.preview_pending.action"), - path: admin_system_email_preview_pending_path(system_email_title)) %> - <%= actions.action(:send_pending, - text: t("admin.system_emails.preview_pending.send_pending"), - path: admin_system_email_send_pending_path(system_email_title), - method: :put) %> - <% end %> + <% if system_email_actions.include?("preview_pending") %> + <%= actions.action(:preview_pending, + text: t("admin.system_emails.preview_pending.action"), + path: admin_system_email_preview_pending_path(system_email_title)) %> + <%= actions.action(:send_pending, + text: t("admin.system_emails.preview_pending.send_pending"), + path: admin_system_email_send_pending_path(system_email_title), + method: :put) %> + <% end %> - <% if system_email_actions.include?("edit_info") %> -

- <%= t("admin.system_emails.edit_info") %>
- <%= "app/views/mailer/#{system_email_title}.html.erb" %> -

+ <% if system_email_actions.include?("edit_info") %> +

+ <%= t("admin.system_emails.edit_info") %>
+ <%= "app/views/mailer/#{system_email_title}.html.erb" %> +

+ <% end %> <% end %> - <% end %> - - - <% end %> + + + <% end %> diff --git a/app/views/admin/tags/index.html.erb b/app/views/admin/tags/index.html.erb index 8c0262f08..9f4706bd3 100644 --- a/app/views/admin/tags/index.html.erb +++ b/app/views/admin/tags/index.html.erb @@ -18,22 +18,22 @@ <%= t("admin.actions.actions") %> - <% @tags.each do |tag| %> - - - <%= form_for(tag, - url: admin_tag_path(tag), - as: :tag, - html: { id: "edit_tag_#{tag.id}" }) do |f| %> + <% @tags.each do |tag| %> + + + <%= form_for(tag, + url: admin_tag_path(tag), + as: :tag, + html: { id: "edit_tag_#{tag.id}" }) do |f| %> - <%= tag.name %> - <% end %> - - - <%= render Admin::TableActionsComponent.new(tag, actions: [:destroy]) %> - - - <% end %> + <%= tag.name %> + <% end %> + + + <%= render Admin::TableActionsComponent.new(tag, actions: [:destroy]) %> + + + <% end %> diff --git a/app/views/budgets/executions/show.html.erb b/app/views/budgets/executions/show.html.erb index 4db70fb8f..0c3f4a08e 100644 --- a/app/views/budgets/executions/show.html.erb +++ b/app/views/budgets/executions/show.html.erb @@ -1,10 +1,10 @@ <% provide :title, t("budgets.executions.page_title", budget: @budget.name) %> <% content_for :meta_description do %><%= @budget.description_for_phase("finished") %><% end %> <% provide :social_media_meta_tags do %> -<%= render "shared/social_media_meta_tags", - social_url: budget_executions_url(@budget), - social_title: @budget.name, - social_description: @budget.description_for_phase("finished") %> + <%= render "shared/social_media_meta_tags", + social_url: budget_executions_url(@budget), + social_title: @budget.name, + social_description: @budget.description_for_phase("finished") %> <% end %> <% content_for :canonical do %> diff --git a/app/views/budgets/investments/_author_actions.html.erb b/app/views/budgets/investments/_author_actions.html.erb index 92a4aa863..cd65a6ca8 100644 --- a/app/views/budgets/investments/_author_actions.html.erb +++ b/app/views/budgets/investments/_author_actions.html.erb @@ -7,12 +7,12 @@ edit_budget_investment_path(investment.budget, investment), method: :get, class: "button hollow expanded" %> <% else %> - <%= link_to image_path(investment.image), - method: :delete, - class: "button hollow alert expanded" do %> - - <%= t("images.remove_image") %> - <% end %> + <%= link_to image_path(investment.image), + method: :delete, + class: "button hollow alert expanded" do %> + + <%= t("images.remove_image") %> + <% end %> <% end %>
<% end %> diff --git a/app/views/budgets/investments/_investment.html.erb b/app/views/budgets/investments/_investment.html.erb index 2f67a5a9a..c60a0a760 100644 --- a/app/views/budgets/investments/_investment.html.erb +++ b/app/views/budgets/investments/_investment.html.erb @@ -2,69 +2,55 @@
"> <% if feature?(:allow_images) && investment.image.present? %> -
- -
+
<%= image_tag investment.image.variant(:thumb), alt: investment.image.title.unicode_normalize %>
- -
- <% else %> -
-
<% end %> -
- <% cache [locale_and_user_status(investment), "index", investment, investment.author] do %> -

<%= link_to investment.title, namespaced_budget_investment_path(investment) %>

+
+ <% cache [locale_and_user_status(investment), "index", investment, investment.author] do %> +

<%= link_to investment.title, namespaced_budget_investment_path(investment) %>

- <%= render Budgets::Investments::InfoComponent.new(investment) %> + <%= render Budgets::Investments::InfoComponent.new(investment) %> -
- <%= wysiwyg(investment.description) %> -
-
- <%= render "shared/tags", taggable: investment, limit: 5 %> - <% end %> +
+ <%= wysiwyg(investment.description) %> +
-
- - <% unless investment.unfeasible? %> - - <% if investment.should_show_votes? %> -
- <%= render Budgets::Investments::VotesComponent.new(investment) %> -
- <% elsif investment.should_show_vote_count? %> -
-
- - <%= t("budgets.investments.investment.supports", - count: investment.total_votes) %> - -
-
- <% elsif investment.should_show_ballots? && !management_controller? %> -
- <%= render "/budgets/investments/ballot", - investment: investment, - investment_ids: investment_ids, - ballot: ballot %> -
- <% elsif investment.should_show_price? %> -
-
- - <%= investment.formatted_price %> - -
-
- <% end %> + <%= render "shared/tags", taggable: investment, limit: 5 %> <% end %>
+ + <% unless investment.unfeasible? %> + <% if investment.should_show_votes? %> +
+ <%= render Budgets::Investments::VotesComponent.new(investment) %> +
+ <% elsif investment.should_show_vote_count? %> +
+
+ + <%= t("budgets.investments.investment.supports", + count: investment.total_votes) %> + +
+
+ <% elsif investment.should_show_ballots? && !management_controller? %> +
+ <%= render "/budgets/investments/ballot", + investment: investment, + investment_ids: investment_ids, + ballot: ballot %> +
+ <% elsif investment.should_show_price? %> +
+
+ + <%= investment.formatted_price %> + +
+
+ <% end %> + <% end %>
diff --git a/app/views/budgets/investments/_investment_minimal.html.erb b/app/views/budgets/investments/_investment_minimal.html.erb index ca0b1f27f..20207d7b4 100644 --- a/app/views/budgets/investments/_investment_minimal.html.erb +++ b/app/views/budgets/investments/_investment_minimal.html.erb @@ -1,13 +1,9 @@
-
-
-
- <% cache [locale_and_user_status(investment), "index_minimal", investment, investment.author] do %> -

<%= link_to investment.title, namespaced_budget_investment_path(investment) %>

- <% end %> -
-
+
+ <% cache [locale_and_user_status(investment), "index_minimal", investment, investment.author] do %> +

<%= link_to investment.title, namespaced_budget_investment_path(investment) %>

+ <% end %>
diff --git a/app/views/budgets/investments/_investment_show.html.erb b/app/views/budgets/investments/_investment_show.html.erb index 10e1fd18c..b811c1ed8 100644 --- a/app/views/budgets/investments/_investment_show.html.erb +++ b/app/views/budgets/investments/_investment_show.html.erb @@ -1,10 +1,10 @@ <% provide :social_media_meta_tags do %> -<%= render "shared/social_media_meta_tags", - social_url: budget_investments_path(investment), - social_title: investment.title, - social_description: investment.description, - twitter_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil), - og_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil) %> + <%= render "shared/social_media_meta_tags", + social_url: budget_investments_path(investment), + social_title: investment.title, + social_description: investment.description, + twitter_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil), + og_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil) %> <% end %>
@@ -120,6 +120,6 @@ <%= render "communities/access_button", community: investment.community %> - +
diff --git a/app/views/budgets/results/_results_table.html.erb b/app/views/budgets/results/_results_table.html.erb index 75adcbe9f..9647c33d5 100644 --- a/app/views/budgets/results/_results_table.html.erb +++ b/app/views/budgets/results/_results_table.html.erb @@ -30,40 +30,40 @@ <% amount_available = heading_price %> <% investments.each do |investment| %> - " - style="<%= investment.winner? ? "" : "display: none" %>"> - - <% if investment.winner? %> - - - <%= t("budgets.results.accepted") %> - + " + style="<%= investment.winner? ? "" : "display: none" %>"> + + <% if investment.winner? %> + + + <%= t("budgets.results.accepted") %> - <% else %> - - - <%= t("budgets.results.discarded") %> - + + <% else %> + + + <%= t("budgets.results.discarded") %> - <% end %> - <%= link_to investment.title, budget_investment_path(@budget, investment) %> - - - <%= investment.ballot_lines_count %> - - <% if @budget.show_money? %> - - <%= @budget.formatted_amount(investment.price) %> - - <% if results_type == :compatible %> - - <%= @budget.formatted_amount(amount_available - investment.price) %> - <% amount_available -= investment.price if investment.winner? %> - - <% end %> + <% end %> + <%= link_to investment.title, budget_investment_path(@budget, investment) %> + + + <%= investment.ballot_lines_count %> + + <% if @budget.show_money? %> + + <%= @budget.formatted_amount(investment.price) %> + + <% if results_type == :compatible %> + + <%= @budget.formatted_amount(amount_available - investment.price) %> + <% amount_available -= investment.price if investment.winner? %> + + <% end %> + <% end %> <% end %> diff --git a/app/views/budgets/results/show.html.erb b/app/views/budgets/results/show.html.erb index 7ce618d88..8428a0f2e 100644 --- a/app/views/budgets/results/show.html.erb +++ b/app/views/budgets/results/show.html.erb @@ -1,10 +1,10 @@ <% provide :title, t("budgets.results.page_title", budget: @budget.name) %> <% content_for :meta_description do %><%= @budget.description_for_phase("finished") %><% end %> <% provide :social_media_meta_tags do %> -<%= render "shared/social_media_meta_tags", - social_url: budget_results_url(@budget), - social_title: @budget.name, - social_description: @budget.description_for_phase("finished") %> + <%= render "shared/social_media_meta_tags", + social_url: budget_results_url(@budget), + social_title: @budget.name, + social_description: @budget.description_for_phase("finished") %> <% end %> <% content_for :canonical do %> <%= render "shared/canonical", href: budget_results_url(@budget) %> diff --git a/app/views/budgets/stats/show.html.erb b/app/views/budgets/stats/show.html.erb index 03c6cd974..3174e0527 100644 --- a/app/views/budgets/stats/show.html.erb +++ b/app/views/budgets/stats/show.html.erb @@ -1,9 +1,9 @@ <% provide :title, t("stats.budgets.page_title", budget: @budget.name) %> <% provide :social_media_meta_tags do %> -<%= render "shared/social_media_meta_tags", - social_url: budget_stats_url(@budget), - social_title: @budget.name, - social_description: @budget.description_for_phase("finished") %> + <%= render "shared/social_media_meta_tags", + social_url: budget_stats_url(@budget), + social_title: @budget.name, + social_description: @budget.description_for_phase("finished") %> <% end %>
@@ -40,10 +40,10 @@

<% end %>

- <%= t("stats.budgets.participatory_disclaimer") %> + <%= t("stats.budgets.participatory_disclaimer") %>

- <%= t("stats.budgets.heading_disclaimer") %> + <%= t("stats.budgets.heading_disclaimer") %>

diff --git a/app/views/communities/_participant.html.erb b/app/views/communities/_participant.html.erb index 746ec42c7..8ee84598d 100644 --- a/app/views/communities/_participant.html.erb +++ b/app/views/communities/_participant.html.erb @@ -12,7 +12,7 @@ <% if author?(@community, participant) %>  •  - <%= t("comments.comment.author") %> + <%= t("comments.comment.author") %> <% end %> diff --git a/app/views/dashboard/poster/index.html.erb b/app/views/dashboard/poster/index.html.erb index e8e7112cd..3abc66590 100644 --- a/app/views/dashboard/poster/index.html.erb +++ b/app/views/dashboard/poster/index.html.erb @@ -25,9 +25,9 @@

<%= t("dashboard.poster.index.support") %>

- <%= image_tag "quote_before_blue.png", alt: "" %> -

<%= proposal.title %>

- <%= image_tag "quote_after_blue.png", alt: "" %> + <%= image_tag "quote_before_blue.png", alt: "" %> +

<%= proposal.title %>

+ <%= image_tag "quote_after_blue.png", alt: "" %> diff --git a/app/views/debates/_debate.html.erb b/app/views/debates/_debate.html.erb index 68de5a60d..27caa521e 100644 --- a/app/views/debates/_debate.html.erb +++ b/app/views/debates/_debate.html.erb @@ -1,57 +1,51 @@ <% cache [locale_and_user_status, debate, current_user&.voted_as_when_voted_for(debate)] do %>
-
+
+

<%= link_to debate.title, debate %>

+

+ <%= l debate.created_at.to_date %> +  •  + <%= render Shared::CommentsCountComponent.new( + debate.comments_count, + url: debate_path(debate, anchor: "comments") + ) %> -

-
-

<%= link_to debate.title, debate %>

-

- <%= l debate.created_at.to_date %> + <% if debate.author.hidden? || debate.author.erased? %> +  •  + + <%= t("debates.show.author_deleted") %> + + <% else %> +  •  + + <%= debate.author.name %> + + <% if debate.author.display_official_position_badge? %>  •  - <%= render Shared::CommentsCountComponent.new( - debate.comments_count, - url: debate_path(debate, anchor: "comments") - ) %> + + <%= debate.author.official_position %> + + <% end %> + <% end %> - <% if debate.author.hidden? || debate.author.erased? %> -  •  - - <%= t("debates.show.author_deleted") %> - - <% else %> -  •  - - <%= debate.author.name %> - - <% if debate.author.display_official_position_badge? %> -  •  - - <%= debate.author.official_position %> - - <% end %> - <% end %> + <% if debate.author.verified_organization? %> +  •  + + <%= t("shared.collective") %> + + <% end %> - <% if debate.author.verified_organization? %> -  •  - - <%= t("shared.collective") %> - - <% end %> - -

-
- <%= wysiwyg(debate.description) %> -
-
- <%= render "shared/tags", taggable: debate, limit: 5 %> -
-
- -
- <%= render Debates::VotesComponent.new(debate) %> +

+
+ <%= wysiwyg(debate.description) %> +
+ <%= render "shared/tags", taggable: debate, limit: 5 %> +
+
+ <%= render Debates::VotesComponent.new(debate) %>
diff --git a/app/views/debates/_debate_minimal.html.erb b/app/views/debates/_debate_minimal.html.erb index e0156d95a..18c757d38 100644 --- a/app/views/debates/_debate_minimal.html.erb +++ b/app/views/debates/_debate_minimal.html.erb @@ -1,14 +1,10 @@
-
-
-
- <% cache [locale_and_user_status, - "index_minimal", debate, current_user&.voted_as_when_voted_for(debate)] do %> -

<%= link_to debate.title, debate %>

- <% end %> -
-
+
+ <% cache [locale_and_user_status, + "index_minimal", debate, current_user&.voted_as_when_voted_for(debate)] do %> +

<%= link_to debate.title, debate %>

+ <% end %>
diff --git a/app/views/debates/index.html.erb b/app/views/debates/index.html.erb index 989ab508f..fd35a031c 100644 --- a/app/views/debates/index.html.erb +++ b/app/views/debates/index.html.erb @@ -69,7 +69,6 @@

<%= t("debates.index.section_footer.help_text_1") %>

<%= sanitize(t("debates.index.section_footer.help_text_2", org: link_to(setting["org_name"], new_user_registration_path))) %>

-

<% end %>
diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index 32750ef42..bd421620f 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -9,8 +9,8 @@ <%= f.email_field :email, autofocus: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> <% if @requires_password %> -

<%= f.password_field :password %>

-

<%= f.password_field :password_confirmation %>

+

<%= f.password_field :password %>

+

<%= f.password_field :password_confirmation %>

<% end %> <%= hidden_field_tag :confirmation_token, @confirmation_token %> diff --git a/app/views/devise/password_expired/show.html.erb b/app/views/devise/password_expired/show.html.erb index 8eb10f6b4..930563eac 100644 --- a/app/views/devise/password_expired/show.html.erb +++ b/app/views/devise/password_expired/show.html.erb @@ -2,9 +2,9 @@ <%= form_for(resource, as: resource_name, url: [resource_name, :password_expired], html: { method: :put }) do |f| %> - <%= f.password_field :current_password %>

- <%= f.password_field :password, label: t("devise.password_expired.new_password") %>

- <%= f.password_field :password_confirmation %>

+ <%= f.password_field :current_password %> + <%= f.password_field :password, label: t("devise.password_expired.new_password") %> + <%= f.password_field :password_confirmation %>

<%= f.submit t("devise.password_expired.change_password") %>

<% end %> diff --git a/app/views/devise/shared/_links.html.erb b/app/views/devise/shared/_links.html.erb index dadc44e4d..d4f343b14 100644 --- a/app/views/devise/shared/_links.html.erb +++ b/app/views/devise/shared/_links.html.erb @@ -3,20 +3,6 @@ <%= link_to t("devise_views.shared.links.login"), new_session_path(resource_name) %>
<% end -%> - <%#- if devise_mapping.registerable? && - controller_name != "registrations" || - controller_path != "users/registrations" %> - <%#= link_to t("devise_views.shared.links.signup"), new_user_registration_path %> - <%# end -%> - - <%#- if devise_mapping.registerable? && controller_name == "registrations" && controller_path != "organizations/registrations" %> - <%#= link_to t("devise_views.shared.links.organization_signup"), new_organization_registration_path %> - <%# end -%> - - <%#- if devise_mapping.recoverable? && controller_name != "passwords" && controller_name != "registrations" %> - <%#= link_to t("devise_views.shared.links.new_password"), new_password_path(resource_name) %> - <%# end -%> - <%- if devise_mapping.confirmable? && controller_name != "confirmations" %> <%= link_to t("devise_views.shared.links.new_confirmation"), new_confirmation_path(resource_name) %>
<% end -%> diff --git a/app/views/direct_uploads/_attachment.html.erb b/app/views/direct_uploads/_attachment.html.erb deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/views/layouts/dashboard/_proposal_totals.html.erb b/app/views/layouts/dashboard/_proposal_totals.html.erb index b8ffa94dd..b1f5b7a40 100644 --- a/app/views/layouts/dashboard/_proposal_totals.html.erb +++ b/app/views/layouts/dashboard/_proposal_totals.html.erb @@ -38,7 +38,7 @@
" aria-valuemax="100"> -
+
diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index c5dcf1fd6..6e94ee0ab 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -1,22 +1,22 @@ -> - - <%= t("mailers.title") %> - - - - + id="mailer_layout"> + + <%= t("mailers.title") %> + + + + - <%= render "layouts/mailer_header" %> + <%= render "layouts/mailer_header" %> - - - - <%= yield %> - - -
+ + + + <%= yield %> + + +
- <%= render "layouts/mailer_footer" %> - + <%= render "layouts/mailer_footer" %> + diff --git a/app/views/legislation/annotations/_comment_header.html.erb b/app/views/legislation/annotations/_comment_header.html.erb index eea52733b..f767cf7a3 100644 --- a/app/views/legislation/annotations/_comment_header.html.erb +++ b/app/views/legislation/annotations/_comment_header.html.erb @@ -2,4 +2,4 @@ <%= render "annotation_link", annotation: annotation %> - + diff --git a/app/views/legislation/annotations/_comments_box.html.erb b/app/views/legislation/annotations/_comments_box.html.erb index 8b06813d9..228394625 100644 --- a/app/views/legislation/annotations/_comments_box.html.erb +++ b/app/views/legislation/annotations/_comments_box.html.erb @@ -11,7 +11,7 @@ diff --git a/app/views/legislation/draft_versions/show.html.erb b/app/views/legislation/draft_versions/show.html.erb index a1ab873ab..f36e94fae 100644 --- a/app/views/legislation/draft_versions/show.html.erb +++ b/app/views/legislation/draft_versions/show.html.erb @@ -58,14 +58,14 @@
<%= t("legislation.draft_versions.show.text_body") %>
- <% if @draft_version.final_version? %> -
- <% else %> -
- <% end %> +
> <%= AdminLegislationSanitizer.new.sanitize(@draft_version.body_html) %>
diff --git a/app/views/legislation/processes/_header.html.erb b/app/views/legislation/processes/_header.html.erb index 0e38798d8..110fd77bc 100644 --- a/app/views/legislation/processes/_header.html.erb +++ b/app/views/legislation/processes/_header.html.erb @@ -1,8 +1,8 @@ -
+
- <% if banner_color? %> + <% if banner_color?(@process) %> <%= link_to t("shared.back"), legislation_processes_path, class: "icon-angle-left", diff --git a/app/views/legislation/processes/_header_full.html.erb b/app/views/legislation/processes/_header_full.html.erb index 2bed4ae2b..9d715b908 100644 --- a/app/views/legislation/processes/_header_full.html.erb +++ b/app/views/legislation/processes/_header_full.html.erb @@ -12,10 +12,7 @@ <%= markdown @process.additional_info if @process.additional_info %>
- <% end %> diff --git a/app/views/legislation/proposals/_proposal.html.erb b/app/views/legislation/proposals/_proposal.html.erb index a2a985f44..79646d3af 100644 --- a/app/views/legislation/proposals/_proposal.html.erb +++ b/app/views/legislation/proposals/_proposal.html.erb @@ -2,78 +2,74 @@ class="proposal clear <%= ("successful" if proposal.total_votes > Proposal.votes_needed_for_success) %>" data-type="proposal">
"> -
+ <% if proposal.total_votes > Proposal.votes_needed_for_success %> +
+ <% end %> <% if proposal.image.present? %> -
-
- <%= image_tag proposal.image.variant(:thumb), - alt: proposal.image.title.unicode_normalize %> -
-
- <% else %> -
-
+
+ <%= image_tag proposal.image.variant(:thumb), + alt: proposal.image.title.unicode_normalize %> +
<% end %> -
- <% cache [locale_and_user_status(proposal), "index", proposal, proposal.author] do %> -

<%= link_to proposal.title, legislation_process_proposal_path(proposal.legislation_process_id, proposal) %>

-

- <%= l proposal.created_at.to_date %> + +

+ <% cache [locale_and_user_status(proposal), "index", proposal, proposal.author] do %> +

<%= link_to proposal.title, legislation_process_proposal_path(proposal.legislation_process_id, proposal) %>

+

+ <%= l proposal.created_at.to_date %> +  •  + <%= render Shared::CommentsCountComponent.new( + proposal.comments_count, + url: legislation_process_proposal_path( + proposal.legislation_process_id, + proposal, + anchor: "comments" + ) + ) %> + + <% if proposal.author.hidden? || proposal.author.erased? %> +  •  + + <%= t("proposals.show.author_deleted") %> + + <% else %> +  •  + + <%= proposal.author.name %> + + <% if proposal.author.display_official_position_badge? %>  •  - <%= render Shared::CommentsCountComponent.new( - proposal.comments_count, - url: legislation_process_proposal_path( - proposal.legislation_process_id, - proposal, - anchor: "comments" - ) - ) %> - - <% if proposal.author.hidden? || proposal.author.erased? %> -  •  - - <%= t("proposals.show.author_deleted") %> - - <% else %> -  •  - - <%= proposal.author.name %> - - <% if proposal.author.display_official_position_badge? %> -  •  - - <%= proposal.author.official_position %> - - <% end %> - <% end %> - - <% if proposal.author.verified_organization? %> -  •  - - <%= t("shared.collective") %> - - <% end %> - - <% if Geozone.any? %> -  •  - - <%= link_to geozone_name(proposal), legislation_process_proposals_path(proposal.legislation_process_id, search: geozone_name(proposal)) %> - - <% end %> -

-
-

<%= proposal.summary %>

-
-
- <%= render "shared/tags", taggable: proposal, limit: 5 %> + + <%= proposal.author.official_position %> + + <% end %> <% end %> -
-
-
- <%= render Legislation::Proposals::VotesComponent.new(proposal) %> -
+ <% if proposal.author.verified_organization? %> +  •  + + <%= t("shared.collective") %> + + <% end %> + + <% if Geozone.any? %> +  •  + + <%= link_to geozone_name(proposal), legislation_process_proposals_path(proposal.legislation_process_id, search: geozone_name(proposal)) %> + + <% end %> +

+
+

<%= proposal.summary %>

+
+
+ <%= render "shared/tags", taggable: proposal, limit: 5 %> + <% end %> +
+ +
+ <%= render Legislation::Proposals::VotesComponent.new(proposal) %>
diff --git a/app/views/legislation/proposals/show.html.erb b/app/views/legislation/proposals/show.html.erb index 7ef241fac..f3e6fea5e 100644 --- a/app/views/legislation/proposals/show.html.erb +++ b/app/views/legislation/proposals/show.html.erb @@ -1,10 +1,10 @@ <% provide :title, @proposal.title %> <% content_for :meta_description do %><%= @proposal.summary %><% end %> <% provide :social_media_meta_tags do %> -<%= render "shared/social_media_meta_tags", - social_url: legislation_process_proposal_url(process_id: @process), - social_title: @proposal.title, - social_description: @proposal.summary %> + <%= render "shared/social_media_meta_tags", + social_url: legislation_process_proposal_url(process_id: @process), + social_title: @proposal.title, + social_description: @proposal.summary %> <% end %> <% content_for :canonical do %> <%= render "shared/canonical", href: legislation_process_proposal_url(process_id: @process) %> diff --git a/app/views/legislation/questions/show.html.erb b/app/views/legislation/questions/show.html.erb index 5a37e99d0..0f9a800a1 100644 --- a/app/views/legislation/questions/show.html.erb +++ b/app/views/legislation/questions/show.html.erb @@ -13,14 +13,14 @@ <%= link_to legislation_process_question_path(@process, @question.next_question_id), class: "quiz-next-link" do %>
<%= t("legislation.questions.show.next_question") %> -
<% end %> <% elsif @question.first_question_id %> <%= link_to legislation_process_question_path(@process, @question.first_question_id), class: "quiz-next-link" do %>
<%= t("legislation.questions.show.first_question") %> -
<% end %> <% end %> diff --git a/app/views/officing/polls/final.html.erb b/app/views/officing/polls/final.html.erb index 01f9f45fd..121ccf9b8 100644 --- a/app/views/officing/polls/final.html.erb +++ b/app/views/officing/polls/final.html.erb @@ -19,9 +19,9 @@ officing_poll_ballot_sheets_path(poll), class: "button" %> - <%= link_to t("officing.polls.final.add_results"), - new_officing_poll_ballot_sheet_path(poll), - class: "button hollow" %> + <%= link_to t("officing.polls.final.add_results"), + new_officing_poll_ballot_sheet_path(poll), + class: "button hollow" %> <% else %> <%= link_to t("officing.polls.final.add_results"), new_officing_poll_result_path(poll), diff --git a/app/views/officing/results/new.html.erb b/app/views/officing/results/new.html.erb index aba3e17da..c53ff92d5 100644 --- a/app/views/officing/results/new.html.erb +++ b/app/views/officing/results/new.html.erb @@ -81,7 +81,7 @@ <%= results_by_booth[booth_assignment].first.booth_assignment.booth.name %> - <%= link_to t("officing.results.new.see_results"), officing_poll_results_path(@poll, date: l(date), booth_assignment_id: booth_assignment) %> + <%= link_to t("officing.results.new.see_results"), officing_poll_results_path(@poll, date: l(date), booth_assignment_id: booth_assignment) %> <% end %> diff --git a/app/views/officing/voters/_can_vote.html.erb b/app/views/officing/voters/_can_vote.html.erb index c866b6562..8a76532bd 100644 --- a/app/views/officing/voters/_can_vote.html.erb +++ b/app/views/officing/voters/_can_vote.html.erb @@ -9,10 +9,10 @@ method: :post, remote: true, html: { id: "new_officing_voter" } do |f| %> - <%= f.hidden_field :poll_id, value: poll.id %> - <%= f.hidden_field :user_id, value: @user.id %> - <%= f.submit t("officing.voters.show.submit"), - class: "button success", - data: { disable_with: t("officing.voters.can_vote.submit_disable_with") } %> + <%= f.hidden_field :poll_id, value: poll.id %> + <%= f.hidden_field :user_id, value: @user.id %> + <%= f.submit t("officing.voters.show.submit"), + class: "button success", + data: { disable_with: t("officing.voters.can_vote.submit_disable_with") } %> <% end %> diff --git a/app/views/officing/voters/new.html.erb b/app/views/officing/voters/new.html.erb index e88e86d85..bbe35d74c 100644 --- a/app/views/officing/voters/new.html.erb +++ b/app/views/officing/voters/new.html.erb @@ -13,18 +13,18 @@ <% @polls.each do |poll| %> - - - <%= poll.name %> - - <% if poll.votable_by?(@user) %> - <%= render "can_vote", poll: poll %> - <% elsif poll.voted_by?(@user) || poll.user_has_an_online_ballot?(@user) %> - <%= render "already_voted" %> - <% else %> - <%= render "cannot_vote" %> - <% end %> - + + + <%= poll.name %> + + <% if poll.votable_by?(@user) %> + <%= render "can_vote", poll: poll %> + <% elsif poll.voted_by?(@user) || poll.user_has_an_online_ballot?(@user) %> + <%= render "already_voted" %> + <% else %> + <%= render "cannot_vote" %> + <% end %> + <% end %> diff --git a/app/views/organizations/registrations/new.html.erb b/app/views/organizations/registrations/new.html.erb index 2bcc9e938..a27c8c005 100644 --- a/app/views/organizations/registrations/new.html.erb +++ b/app/views/organizations/registrations/new.html.erb @@ -1,10 +1,10 @@ <% provide :title, t("devise_views.organizations.registrations.new.title") %>

<%= t("devise_views.organizations.registrations.new.title") %>

- <%= form_for(resource, as: :user, url: organization_registration_path) do |f| %> - <%= render "shared/errors", resource: resource %> -
-
+<%= form_for(resource, as: :user, url: organization_registration_path) do |f| %> + <%= render "shared/errors", resource: resource %> +
+
<%= f.fields_for :organization do |fo| %> <%= fo.text_field :name, autofocus: true, maxlength: Organization.name_max_length %> diff --git a/app/views/proposals/_proposal.html.erb b/app/views/proposals/_proposal.html.erb index 425d75537..3900b1448 100644 --- a/app/views/proposals/_proposal.html.erb +++ b/app/views/proposals/_proposal.html.erb @@ -1,94 +1,86 @@
Proposal.votes_needed_for_success) %>" + class="proposal clear <%= ("successful" if proposal.successful?) %>" data-type="proposal">
"> -
+ <% if proposal.successful? %> +
+ <% end %> <% if proposal.image.present? %> -
-
- <%= image_tag proposal.image.variant(:thumb), - alt: proposal.image.title.unicode_normalize %> -
- -
- <% else %> -
-
- <% end %> -
- <% cache [locale_and_user_status(proposal), "index", proposal, proposal.author] do %> -

<%= link_to proposal.title, namespaced_proposal_path(proposal) %>

-

- <%= l proposal.created_at.to_date %> -  •  - <%= render Shared::CommentsCountComponent.new( - proposal.comments_count, - url: namespaced_proposal_path(proposal, anchor: "comments") - ) %> - - <% if proposal.author.hidden? || proposal.author.erased? %> -  •  - - <%= t("proposals.show.author_deleted") %> - - <% else %> -  •  - - <%= proposal.author.name %> - - <% if proposal.author.display_official_position_badge? %> -  •  - - <%= proposal.author.official_position %> - - <% end %> - <% end %> - - <% if proposal.author.verified_organization? %> -  •  - - <%= t("shared.collective") %> - - <% end %> - - <% if Geozone.any? %> -  •  - - <%= link_to geozone_name(proposal), proposals_path(search: geozone_name(proposal)) %> - - <% end %> -

-
-

<%= proposal.summary %>

-
-
- <%= render "shared/tags", taggable: proposal, limit: 5 %> - <% end %> -
+
+ <%= image_tag proposal.image.variant(:thumb), + alt: proposal.image.title.unicode_normalize %>
+ <% end %> - <% if show_proposal_votes? %> -
- <% if proposal.successful? %> -
-
- <%= render "proposals/supports", proposal: proposal %> -
-
- <% elsif proposal.archived? %> -
- <%= t("proposals.proposal.supports", count: proposal.total_votes) %> -

<%= t("proposals.proposal.archived") %>

-
+
+ <% cache [locale_and_user_status(proposal), "index", proposal, proposal.author] do %> +

<%= link_to proposal.title, namespaced_proposal_path(proposal) %>

+

+ <%= l proposal.created_at.to_date %> +  •  + <%= render Shared::CommentsCountComponent.new( + proposal.comments_count, + url: namespaced_proposal_path(proposal, anchor: "comments") + ) %> + + <% if proposal.author.hidden? || proposal.author.erased? %> +  •  + + <%= t("proposals.show.author_deleted") %> + <% else %> - <%= render "votes", proposal: proposal %> +  •  + + <%= proposal.author.name %> + + <% if proposal.author.display_official_position_badge? %> +  •  + + <%= proposal.author.official_position %> + + <% end %> <% end %> -

- <% end %> + <% if proposal.author.verified_organization? %> +  •  + + <%= t("shared.collective") %> + + <% end %> + + <% if Geozone.any? %> +  •  + + <%= link_to geozone_name(proposal), proposals_path(search: geozone_name(proposal)) %> + + <% end %> +

+
+

<%= proposal.summary %>

+
+
+ <%= render "shared/tags", taggable: proposal, limit: 5 %> + <% end %>
+ + <% if show_proposal_votes? %> +
+ <% if proposal.successful? %> +
+
+ <%= render "proposals/supports", proposal: proposal %> +
+
+ <% elsif proposal.archived? %> +
+ <%= t("proposals.proposal.supports", count: proposal.total_votes) %> +

<%= t("proposals.proposal.archived") %>

+
+ <% else %> + <%= render "votes", proposal: proposal %> + <% end %> +
+ <% end %>
diff --git a/app/views/proposals/_proposal_minimal.html.erb b/app/views/proposals/_proposal_minimal.html.erb index 373622925..6041839c7 100644 --- a/app/views/proposals/_proposal_minimal.html.erb +++ b/app/views/proposals/_proposal_minimal.html.erb @@ -1,14 +1,10 @@
-
-
-
- <% cache [locale_and_user_status(proposal), - "index_minimal", proposal, proposal.author] do %> -

<%= link_to proposal.title, namespaced_proposal_path(proposal) %>

- <% end %> -
-
+
+ <% cache [locale_and_user_status(proposal), + "index_minimal", proposal, proposal.author] do %> +

<%= link_to proposal.title, namespaced_proposal_path(proposal) %>

+ <% end %>
diff --git a/app/views/proposals/index.html.erb b/app/views/proposals/index.html.erb index b54cd409b..c8be341e8 100644 --- a/app/views/proposals/index.html.erb +++ b/app/views/proposals/index.html.erb @@ -8,12 +8,7 @@ <%= render "shared/canonical", href: proposals_url %> <% end %> -<% if [ - @search_terms, - @advanced_search_terms, - params[:retired].present?, - params[:selected].present? - ].any? %> +<% if [@search_terms, @advanced_search_terms, params[:retired].present?, params[:selected].present?].any? %> <%= render Shared::SearchResultsSummaryComponent.new( results: @proposals, search_terms: @search_terms, diff --git a/app/views/proposals/retire_form.html.erb b/app/views/proposals/retire_form.html.erb index e22d80255..fef9e5c6d 100644 --- a/app/views/proposals/retire_form.html.erb +++ b/app/views/proposals/retire_form.html.erb @@ -7,7 +7,7 @@

<%= link_to @proposal.title, @proposal %>

- <%= t("proposals.retire_form.warning") %> + <%= t("proposals.retire_form.warning") %>
<%= render "shared/globalize_locales", resource: @proposal, manage_languages: false %> diff --git a/app/views/proposals/share.html.erb b/app/views/proposals/share.html.erb index 7a1a3bb64..d4556b84e 100644 --- a/app/views/proposals/share.html.erb +++ b/app/views/proposals/share.html.erb @@ -1,9 +1,9 @@ <% provide :title, @proposal.title %> <% provide :social_media_meta_tags do %> -<%= render "shared/social_media_meta_tags", - social_url: proposal_url(@proposal), - social_title: @proposal.title, - social_description: @proposal.summary %> + <%= render "shared/social_media_meta_tags", + social_url: proposal_url(@proposal), + social_title: @proposal.title, + social_description: @proposal.summary %> <% end %> <% content_for :canonical do %> <%= render "shared/canonical", href: proposal_url(@proposal) %> diff --git a/app/views/shared/_author_info.html.erb b/app/views/shared/_author_info.html.erb index 8b9f21b89..eea02a8a2 100644 --- a/app/views/shared/_author_info.html.erb +++ b/app/views/shared/_author_info.html.erb @@ -1,12 +1,12 @@ <% if resource.author.hidden? || resource.author.erased? %> - <%= t("shared.author_info.author_deleted") %> + <%= t("shared.author_info.author_deleted") %> <% else %> <%= render Shared::AvatarComponent.new(resource.author, size: 32, class: "author-photo") %> - <%= link_to resource.author.name, user_path(resource.author) %> + <%= link_to resource.author.name, user_path(resource.author) %> <% if resource.respond_to?(:association_name) && resource.association_name.present? %> diff --git a/app/views/shared/_filter_subnav.html.erb b/app/views/shared/_filter_subnav.html.erb index ab9161ef6..9140244a9 100644 --- a/app/views/shared/_filter_subnav.html.erb +++ b/app/views/shared/_filter_subnav.html.erb @@ -3,7 +3,9 @@ <% valid_filters.each do |filter| %> <% if current_filter == filter %> -
  • <%= t("#{i18n_namespace}.filters.#{filter}") %>

  • +
  • +

    <%= t("#{i18n_namespace}.filters.#{filter}") %>

    +
  • <% else %>
  • <%= link_to t("#{i18n_namespace}.filters.#{filter}"), current_path_with_query_params(filter: filter, page: 1) %>
  • diff --git a/app/views/valuation/budget_investments/_dossier.html.erb b/app/views/valuation/budget_investments/_dossier.html.erb index e1d5c351a..b17442b4d 100644 --- a/app/views/valuation/budget_investments/_dossier.html.erb +++ b/app/views/valuation/budget_investments/_dossier.html.erb @@ -2,12 +2,12 @@

    <%= t("valuation.budget_investments.show.price") %> - (<%= t("valuation.budget_investments.show.currency") %>): + (<%= t("valuation.budget_investments.show.currency") %>): <% if @investment.price.present? %> <%= @investment.price %> <% else %> - <%= t("valuation.budget_investments.show.undefined") %> + <%= t("valuation.budget_investments.show.undefined") %> <% end %>

    @@ -20,7 +20,7 @@ <% if @investment.price_first_year.present? %> <%= @investment.price_first_year %> <% else %> - <%= t("valuation.budget_investments.show.undefined") %> + <%= t("valuation.budget_investments.show.undefined") %> <% end %>

    <% end %> diff --git a/app/views/valuation/budget_investments/_dossier_form.html.erb b/app/views/valuation/budget_investments/_dossier_form.html.erb index 5f2f80f80..538b26c88 100644 --- a/app/views/valuation/budget_investments/_dossier_form.html.erb +++ b/app/views/valuation/budget_investments/_dossier_form.html.erb @@ -6,21 +6,21 @@
    <%= t("valuation.budget_investments.edit.feasibility") %>
    - - <%= f.radio_button :feasibility, "undecided" %> - + + <%= f.radio_button :feasibility, "undecided" %> +
    - - <%= f.radio_button :feasibility, "feasible" %> - + + <%= f.radio_button :feasibility, "feasible" %> +
    - - <%= f.radio_button :feasibility, "unfeasible" %> - + + <%= f.radio_button :feasibility, "unfeasible" %> +
    diff --git a/app/views/valuation/budget_investments/show.html.erb b/app/views/valuation/budget_investments/show.html.erb index 1ac2f68a9..9659470ec 100644 --- a/app/views/valuation/budget_investments/show.html.erb +++ b/app/views/valuation/budget_investments/show.html.erb @@ -17,11 +17,6 @@
    <%= render "/budgets/investments/investment_detail", investment: @investment, preview: true %> - - -<% if @investment.external_url.present? %> -

    <%= sanitize_and_auto_link @investment.external_url %>

    -<% end %>
    diff --git a/app/views/verification/residence/new.html.erb b/app/views/verification/residence/new.html.erb index 9909d41af..f8d97ee39 100644 --- a/app/views/verification/residence/new.html.erb +++ b/app/views/verification/residence/new.html.erb @@ -33,25 +33,25 @@
    - <%= f.select :document_type, document_types, prompt: "" %> + <%= f.select :document_type, document_types, prompt: "" %>
    -
    - <%= f.label :document_number, t("verification.residence.new.document_number") %> -
    +
    + <%= f.label :document_number, t("verification.residence.new.document_number") %> +
    - + - + - <%= f.text_field :document_number, label: false %> + <%= f.text_field :document_number, label: false %>
    diff --git a/app/views/verification/verified_user/show.html.erb b/app/views/verification/verified_user/show.html.erb index 13dc2924d..c215421fe 100644 --- a/app/views/verification/verified_user/show.html.erb +++ b/app/views/verification/verified_user/show.html.erb @@ -13,8 +13,8 @@ <% @verified_users.each do |verified_user| %> <% if verified_user.email.present? %>
  • - <%= mask_email(verified_user.email) %> - <%= render "form", url: email_path, verified_user: verified_user %> + <%= mask_email(verified_user.email) %> + <%= render "form", url: email_path, verified_user: verified_user %>
  • <% end %> <% end %> diff --git a/spec/components/admin/stats/sdg/goal_component_spec.rb b/spec/components/admin/stats/sdg/goal_component_spec.rb index c3af91bb4..68b129ede 100644 --- a/spec/components/admin/stats/sdg/goal_component_spec.rb +++ b/spec/components/admin/stats/sdg/goal_component_spec.rb @@ -15,15 +15,15 @@ describe Admin::Stats::SDG::GoalComponent do render_inline component - expect(page).to have_text "Proposals 3" - expect(page).to have_text "Polls 2" - expect(page).to have_text "Debates 1" + expect(page).to have_text "Proposals 3", normalize_ws: true + expect(page).to have_text "Polls 2", normalize_ws: true + expect(page).to have_text "Debates 1", normalize_ws: true expect("Current budget").to appear_before("Past year budget") - expect(page).to have_text "Investment projects sent 2" - expect(page).to have_text "Winner investment projects 0" - expect(page).to have_text "Approved amount $0" - expect(page).to have_text "Investment projects sent 1" - expect(page).to have_text "Winner investment projects 1" - expect(page).to have_text "Approved amount $1,000" + expect(page).to have_text "Investment projects sent 2", normalize_ws: true + expect(page).to have_text "Winner investment projects 0", normalize_ws: true + expect(page).to have_text "Approved amount $0", normalize_ws: true + expect(page).to have_text "Investment projects sent 1", normalize_ws: true + expect(page).to have_text "Winner investment projects 1", normalize_ws: true + expect(page).to have_text "Approved amount $1,000", normalize_ws: true end end diff --git a/spec/helpers/legislation_helper_spec.rb b/spec/helpers/legislation_helper_spec.rb index 74b61992a..bcf0a3abb 100644 --- a/spec/helpers/legislation_helper_spec.rb +++ b/spec/helpers/legislation_helper_spec.rb @@ -9,23 +9,23 @@ describe LegislationHelper do describe "banner colors presence" do it "background and font color exist" do - @process = build(:legislation_process, background_color: "#944949", font_color: "#ffffff") - expect(banner_color?).to be true + process = build(:legislation_process, background_color: "#944949", font_color: "#ffffff") + expect(banner_color?(process)).to be true end it "background color exist and font color not exist" do - @process = build(:legislation_process, background_color: "#944949", font_color: "") - expect(banner_color?).to be false + process = build(:legislation_process, background_color: "#944949", font_color: "") + expect(banner_color?(process)).to be false end it "background color not exist and font color exist" do - @process = build(:legislation_process, background_color: "", font_color: "#944949") - expect(banner_color?).to be false + process = build(:legislation_process, background_color: "", font_color: "#944949") + expect(banner_color?(process)).to be false end it "background and font color not exist" do - @process = build(:legislation_process, background_color: "", font_color: "") - expect(banner_color?).to be false + process = build(:legislation_process, background_color: "", font_color: "") + expect(banner_color?(process)).to be false end end end