Use HTML beautifier to indent ERB files

We had inconsistent indentation in many places. Now we're fixing them
and adding a linter to our CI so we don't accidentally introduce
inconsistent indentations again.
This commit is contained in:
Javi Martín
2025-02-20 18:41:46 +01:00
parent b4b33926cf
commit b51aa31e6a
66 changed files with 574 additions and 558 deletions

View File

@@ -21,6 +21,8 @@ jobs:
run: npx stylelint app/assets/stylesheets run: npx stylelint app/assets/stylesheets
- name: Markdownlint - name: Markdownlint
run: bundle exec mdl *.md docs/ 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 {} +
name: ${{ matrix.name }} name: ${{ matrix.name }}
steps: steps:
- name: Checkout code - name: Checkout code

View File

@@ -95,6 +95,7 @@ group :development do
gem "capistrano3-puma", "~> 5.2.0" gem "capistrano3-puma", "~> 5.2.0"
gem "erb_lint", "~> 0.9.0", require: false gem "erb_lint", "~> 0.9.0", require: false
gem "faraday-retry", "~> 2.2.1", 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 "mdl", "~> 0.13.0", require: false
gem "pronto", "~> 0.11.2", require: false gem "pronto", "~> 0.11.2", require: false
gem "pronto-erb_lint", "~> 0.1.6", require: false gem "pronto-erb_lint", "~> 0.1.6", require: false

View File

@@ -272,6 +272,7 @@ GEM
hashery (2.1.2) hashery (2.1.2)
hashie (5.0.0) hashie (5.0.0)
highline (2.0.3) highline (2.0.3)
htmlbeautifier (1.4.3)
htmlentities (4.3.4) htmlentities (4.3.4)
httparty (0.22.0) httparty (0.22.0)
csv csv
@@ -755,6 +756,7 @@ DEPENDENCIES
graphiql-rails (~> 1.8.0) graphiql-rails (~> 1.8.0)
graphql (~> 2.3.18) graphql (~> 2.3.18)
groupdate (~> 6.5.1) groupdate (~> 6.5.1)
htmlbeautifier (~> 1.4.3)
i18n-tasks (~> 0.9.37) i18n-tasks (~> 0.9.37)
image_processing (~> 1.13.0) image_processing (~> 1.13.0)
invisible_captcha (~> 2.3.0) invisible_captcha (~> 2.3.0)

View File

@@ -8,7 +8,8 @@
<div class="small-12 medium-3 column highlight padding"> <div class="small-12 medium-3 column highlight padding">
<strong><%= t("admin.poll_shifts.new.officer") %></strong> <strong><%= t("admin.poll_shifts.new.officer") %></strong>
<br><%= officer.name %> <br>
<%= officer.name %>
<%= f.hidden_field :officer_id, value: officer.id %> <%= f.hidden_field :officer_id, value: officer.id %>
</div> </div>

View File

@@ -17,28 +17,28 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% pages.each do |page| %> <% pages.each do |page| %>
<tr id="<%= dom_id(page) %>"> <tr id="<%= dom_id(page) %>">
<td><%= page.title %></td> <td><%= page.title %></td>
<td><%= page.slug %></td> <td><%= page.slug %></td>
<td><%= I18n.l page.created_at, format: :long %></td> <td><%= I18n.l page.created_at, format: :long %></td>
<td><%= I18n.l page.updated_at, format: :long %></td> <td><%= I18n.l page.updated_at, format: :long %></td>
<td><%= t("admin.site_customization.pages.page.status_#{page.status}") %></td> <td><%= t("admin.site_customization.pages.page.status_#{page.status}") %></td>
<td> <td>
<%= render Admin::TableActionsComponent.new(page) do |actions| %> <%= render Admin::TableActionsComponent.new(page) do |actions| %>
<%= actions.action(:cards, <%= actions.action(:cards,
text: t("admin.site_customization.pages.page.see_cards"), text: t("admin.site_customization.pages.page.see_cards"),
path: admin_site_customization_page_widget_cards_path(page)) %> path: admin_site_customization_page_widget_cards_path(page)) %>
<% if page.status == "published" %> <% if page.status == "published" %>
<%= actions.action(:show, <%= actions.action(:show,
text: t("admin.site_customization.pages.index.see_page"), text: t("admin.site_customization.pages.index.see_page"),
path: page.url) %> path: page.url) %>
<% end %>
<% end %> <% end %>
<% end %> </td>
</td> </tr>
</tr> <% end %>
<% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -30,7 +30,9 @@
<table class="investment-projects-summary"> <table class="investment-projects-summary">
<thead> <thead>
<tr><th colspan="2"><%= t("admin.stats.budget_balloting.votes_per_heading") %></th></tr> <tr>
<th colspan="2"><%= t("admin.stats.budget_balloting.votes_per_heading") %></th>
</tr>
</thead> </thead>
<tbody> <tbody>
@@ -49,7 +51,9 @@
<table class="investment-projects-summary user-count-by-heading"> <table class="investment-projects-summary user-count-by-heading">
<thead> <thead>
<tr><th colspan="2"><%= t("admin.stats.budget_balloting.participants_per_district") %></th></tr> <tr>
<th colspan="2"><%= t("admin.stats.budget_balloting.participants_per_district") %></th>
</tr>
</thead> </thead>
<tbody> <tbody>

View File

@@ -1,5 +1,6 @@
<div class="small-12 medium-4 column"> <div class="small-12 medium-4 column">
<%= tag.p(**options) do %> <%= tag.p(**options) do %>
<%= text %> <br><span class="number"><%= amount %></span> <%= text %> <br>
<span class="number"><%= amount %></span>
<% end %> <% end %>
</div> </div>

View File

@@ -24,7 +24,9 @@
</div> </div>
<div class="small-12 column"> <div class="small-12 column">
<div class="progress-bar-placeholder"><div class="loading-bar"></div></div> <div class="progress-bar-placeholder">
<div class="loading-bar"></div>
</div>
</div> </div>
<hr> <hr>

View File

@@ -13,7 +13,8 @@
<h1> <h1>
<%= link_to namespace_path do %> <%= link_to namespace_path do %>
<%= setting["org_name"] %> <%= setting["org_name"] %>
<br><small><%= namespaced_header_title %></small> <br>
<small><%= namespaced_header_title %></small>
<% end %> <% end %>
</h1> </h1>

View File

@@ -47,9 +47,7 @@
</p> </p>
<% option.videos.each do |video| %> <% option.videos.each do |video| %>
<%= link_to video.title, <%= link_to video.title, video.url, rel: "nofollow" %><br>
video.url,
rel: "nofollow" %><br>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>

View File

@@ -14,34 +14,34 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @admin_notifications.order(created_at: :desc).each do |admin_notification| %> <% @admin_notifications.order(created_at: :desc).each do |admin_notification| %>
<tr id="<%= dom_id(admin_notification) %>" class="admin_notification"> <tr id="<%= dom_id(admin_notification) %>" class="admin_notification">
<td> <td>
<%= admin_notification.title %> <%= admin_notification.title %>
</td> </td>
<td> <td>
<%= segment_name(admin_notification.segment_recipient) %> <%= segment_name(admin_notification.segment_recipient) %>
</td> </td>
<td> <td>
<% if admin_notification.draft? %> <% if admin_notification.draft? %>
<%= t("admin.admin_notifications.index.draft") %> <%= t("admin.admin_notifications.index.draft") %>
<% else %> <% else %>
<%= l admin_notification.sent_at.to_date %> <%= l admin_notification.sent_at.to_date %>
<% end %>
</td>
<td>
<% if admin_notification.draft? %>
<%= render Admin::TableActionsComponent.new(admin_notification) do |actions| %>
<%= actions.action(:preview, text: t("admin.admin_notifications.index.preview")) %>
<% end %> <% end %>
<% else %> </td>
<%= render Admin::TableActionsComponent.new(admin_notification, actions: []) do |actions| %> <td>
<%= 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 %>
<% end %> </td>
</td> </tr>
</tr> <% end %>
<% end %>
</tbody> </tbody>
</table> </table>
<% else %> <% else %>

View File

@@ -28,7 +28,7 @@
</div> </div>
<div class="small-12 column"> <div class="small-12 column">
<strong><%= t("admin.admin_notifications.show.segment_recipient") %></strong><br> <strong><%= t("admin.admin_notifications.show.segment_recipient") %></strong><br>
<%= segment_name(@admin_notification.segment_recipient) %> <%= segment_name(@admin_notification.segment_recipient) %>
<% if @admin_notification.draft? %> <% if @admin_notification.draft? %>
<%= t("admin.admin_notifications.show.will_get_notified", <%= t("admin.admin_notifications.show.will_get_notified",

View File

@@ -11,7 +11,7 @@
<%= render "shared/errors", resource: @investment %> <%= render "shared/errors", resource: @investment %>
<% Budget::Investment.filter_params(params).to_h.each do |filter_name, filter_value| %> <% 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 %> <% end %>
<div class="row expanded"> <div class="row expanded">
@@ -74,9 +74,9 @@
<div class="small-12 column margin-top"> <div class="small-12 column margin-top">
<%= f.label :valuator_ids %> <%= f.label :valuator_ids %>
<ul> <ul>
<%= f.collection_check_boxes :valuator_group_ids, @valuator_groups, :id, :name do |group| %> <%= f.collection_check_boxes :valuator_group_ids, @valuator_groups, :id, :name do |group| %>
<li><%= group.label(title: group.object.name) { group.check_box + truncate(group.object.name, length: 60) } %></li> <li><%= group.label(title: group.object.name) { group.check_box + truncate(group.object.name, length: 60) } %></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
@@ -85,7 +85,7 @@
<%= f.label :valuator_ids, t("admin.budget_investments.edit.assigned_valuators") %> <%= f.label :valuator_ids, t("admin.budget_investments.edit.assigned_valuators") %>
<ul> <ul>
<%= f.collection_check_boxes :valuator_ids, @valuators, :id, :email do |b| %> <%= f.collection_check_boxes :valuator_ids, @valuators, :id, :email do |b| %>
<li><%= b.label(title: valuator_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %></li> <li><%= b.label(title: valuator_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
@@ -93,11 +93,11 @@
<div class="row expanded margin-top"> <div class="row expanded margin-top">
<% if @investment.incompatible? || @investment.winner? %> <% if @investment.incompatible? || @investment.winner? %>
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">
<h2 id="incompatible"><%= t("admin.budget_investments.edit.compatibility") %></h2> <h2 id="incompatible"><%= t("admin.budget_investments.edit.compatibility") %></h2>
<%= f.check_box :incompatible, <%= f.check_box :incompatible,
title: t("admin.budget_investments.edit.compatibility") %> title: t("admin.budget_investments.edit.compatibility") %>
</div> </div>
<% end %> <% end %>
<div class="small-12 medium-3 column float-left"> <div class="small-12 medium-3 column float-left">
<h2 id="selected"><%= t("admin.budget_investments.edit.selection") %></h2> <h2 id="selected"><%= t("admin.budget_investments.edit.selection") %></h2>

View File

@@ -39,17 +39,17 @@
<div class="in-favor inline-block"> <div class="in-favor inline-block">
<span class="icon-like"> <span class="icon-like">
<span class="show-for-sr"><%= t("votes.agree") %></span> <span class="show-for-sr"><%= t("votes.agree") %></span>
</span> </span>
<span class="percentage"><%= votes_percentage("likes", @debate) %></span> <span class="percentage"><%= votes_percentage("likes", @debate) %></span>
</div> </div>
<span class="bullet">&nbsp;&bull;&nbsp;</span> <span class="bullet">&nbsp;&bull;&nbsp;</span>
<div class="against inline-block"> <div class="against inline-block">
<span class="icon-unlike"> <span class="icon-unlike">
<span class="show-for-sr"><%= t("votes.disagree") %></span> <span class="show-for-sr"><%= t("votes.disagree") %></span>
</span> </span>
<span class="percentage"><%= votes_percentage("dislikes", @debate) %></span> <span class="percentage"><%= votes_percentage("dislikes", @debate) %></span>
</div> </div>

View File

@@ -14,21 +14,21 @@
<th scope="col" class="small-4"><%= t("admin.shared.actions") %></th> <th scope="col" class="small-4"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @investments.each do |investment| %> <% @investments.each do |investment| %>
<tr id="<%= dom_id(investment) %>"> <tr id="<%= dom_id(investment) %>">
<td class="align-top"> <td class="align-top">
<strong><%= investment.title %></strong> <strong><%= investment.title %></strong>
</td> </td>
<td> <td>
<div class="moderation-description"> <div class="moderation-description">
<%= wysiwyg(investment.description) %> <%= wysiwyg(investment.description) %>
</div> </div>
</td> </td>
<td class="align-top"> <td class="align-top">
<%= render Admin::HiddenTableActionsComponent.new(investment) %> <%= render Admin::HiddenTableActionsComponent.new(investment) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -13,21 +13,21 @@
<th scope="col"><%= t("admin.shared.actions") %></th> <th scope="col"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @comments.each do |comment| %> <% @comments.each do |comment| %>
<tr id="<%= dom_id(comment) %>"> <tr id="<%= dom_id(comment) %>">
<td> <td>
<%= sanitize_and_auto_link comment.body %><br> <%= sanitize_and_auto_link comment.body %><br>
<% if comment.commentable.hidden? %> <% if comment.commentable.hidden? %>
(<%= t("admin.hidden_comments.index.hidden_#{comment.commentable_type.downcase}") %>: <%= comment.commentable.title %>) (<%= t("admin.hidden_comments.index.hidden_#{comment.commentable_type.downcase}") %>: <%= comment.commentable.title %>)
<% else %> <% else %>
<%= link_to comment.commentable.title, commentable_path(comment) %> <%= link_to comment.commentable.title, commentable_path(comment) %>
<% end %> <% end %>
</td> </td>
<td> <td>
<%= render Admin::HiddenTableActionsComponent.new(comment) %> <%= render Admin::HiddenTableActionsComponent.new(comment) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -14,21 +14,21 @@
<th scope="col" class="small-4"><%= t("admin.shared.actions") %></th> <th scope="col" class="small-4"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @debates.each do |debate| %> <% @debates.each do |debate| %>
<tr id="<%= dom_id(debate) %>"> <tr id="<%= dom_id(debate) %>">
<td class="align-top"> <td class="align-top">
<strong><%= debate.title %></strong> <strong><%= debate.title %></strong>
</td> </td>
<td> <td>
<div class="moderation-description"> <div class="moderation-description">
<%= wysiwyg(debate.description) %> <%= wysiwyg(debate.description) %>
</div> </div>
</td> </td>
<td class="align-top"> <td class="align-top">
<%= render Admin::HiddenTableActionsComponent.new(debate) %> <%= render Admin::HiddenTableActionsComponent.new(debate) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -14,21 +14,21 @@
<th scope="col" class="small-4"><%= t("admin.shared.actions") %></th> <th scope="col" class="small-4"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @proposal_notifications.each do |proposal_notification| %> <% @proposal_notifications.each do |proposal_notification| %>
<tr id="<%= dom_id(proposal_notification) %>"> <tr id="<%= dom_id(proposal_notification) %>">
<td class="align-top"> <td class="align-top">
<strong><%= proposal_notification.title %></strong> <strong><%= proposal_notification.title %></strong>
</td> </td>
<td> <td>
<div class="moderation-description"> <div class="moderation-description">
<%= proposal_notification.body %> <%= proposal_notification.body %>
</div> </div>
</td> </td>
<td class="align-top"> <td class="align-top">
<%= render Admin::HiddenTableActionsComponent.new(proposal_notification) %> <%= render Admin::HiddenTableActionsComponent.new(proposal_notification) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -14,25 +14,25 @@
<th scope="col" class="small-4"><%= t("admin.shared.actions") %></th> <th scope="col" class="small-4"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @proposals.each do |proposal| %> <% @proposals.each do |proposal| %>
<tr id="<%= dom_id(proposal) %>"> <tr id="<%= dom_id(proposal) %>">
<td class="align-top"> <td class="align-top">
<strong><%= proposal.title %></strong> <strong><%= proposal.title %></strong>
</td> </td>
<td> <td>
<div class="moderation-description"> <div class="moderation-description">
<p><small><%= proposal.summary %></small></p> <p><small><%= proposal.summary %></small></p>
<%= wysiwyg(proposal.description) %> <%= wysiwyg(proposal.description) %>
<% if proposal.video_url.present? %> <% if proposal.video_url.present? %>
<p><%= sanitize_and_auto_link proposal.video_url %></p> <p><%= sanitize_and_auto_link proposal.video_url %></p>
<% end %> <% end %>
</div> </div>
</td> </td>
<td class="align-top"> <td class="align-top">
<%= render Admin::HiddenTableActionsComponent.new(proposal) %> <%= render Admin::HiddenTableActionsComponent.new(proposal) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -13,23 +13,23 @@
<th scope="col"><%= t("admin.shared.actions") %></th> <th scope="col"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @users.each do |user| %> <% @users.each do |user| %>
<tr id="<%= dom_id(user) %>"> <tr id="<%= dom_id(user) %>">
<td> <td>
<p><%= link_to user.name, admin_hidden_user_path(user) %></p> <p><%= link_to user.name, admin_hidden_user_path(user) %></p>
</td> </td>
<td> <td>
<%= render Admin::HiddenTableActionsComponent.new(user) %> <%= render Admin::HiddenTableActionsComponent.new(user) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<%= paginate @users %> <%= paginate @users %>
<% else %> <% else %>
<div class="callout primary margin"> <div class="callout primary margin">
<%= t("admin.hidden_users.index.no_hidden_users") %> <%= t("admin.hidden_users.index.no_hidden_users") %>
</div> </div>
<% end %> <% end %>

View File

@@ -29,31 +29,31 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @process.draft_versions.each do |draft_version| %> <% @process.draft_versions.each do |draft_version| %>
<tr id="<%= dom_id(draft_version) %>"> <tr id="<%= dom_id(draft_version) %>">
<td> <td>
<%= link_to draft_version.title, edit_admin_legislation_process_draft_version_path(@process, draft_version) %> <%= link_to draft_version.title, edit_admin_legislation_process_draft_version_path(@process, draft_version) %>
</td> </td>
<td><%= draft_version.created_at.to_date %></td> <td><%= draft_version.created_at.to_date %></td>
<td> <td>
<% if draft_version.status == "draft" %> <% if draft_version.status == "draft" %>
<%= Legislation::DraftVersion.human_attribute_name(:status_draft) %> <%= Legislation::DraftVersion.human_attribute_name(:status_draft) %>
<%= link_to "(#{t("admin.legislation.draft_versions.index.preview")})", <%= link_to "(#{t("admin.legislation.draft_versions.index.preview")})",
legislation_process_draft_version_path(@process, draft_version) %> legislation_process_draft_version_path(@process, draft_version) %>
<% else %> <% else %>
<%= Legislation::DraftVersion.human_attribute_name(:status_published) %> <%= Legislation::DraftVersion.human_attribute_name(:status_published) %>
<% end %> <% end %>
</td> </td>
<td class="text-center"><%= draft_version.total_comments %></td> <td class="text-center"><%= draft_version.total_comments %></td>
<td class="text-center"> <td class="text-center">
<% if draft_version.final_version %> <% if draft_version.final_version %>
<span class="icon-check" title="<%= draft_version.final_version %>"></span> <span class="icon-check" title="<%= draft_version.final_version %>"></span>
<% else %> <% else %>
<span class="icon-x delete" title="<%= draft_version.final_version %>"></span> <span class="icon-x delete" title="<%= draft_version.final_version %>"></span>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% end %> <% end %>

View File

@@ -18,7 +18,7 @@
<% if @process.questions.any? %> <% if @process.questions.any? %>
<table class="stack"> <table class="stack">
<thead> <thead>
<tr> <tr>
<th><%= t("admin.legislation.questions.table.title") %></th> <th><%= t("admin.legislation.questions.table.title") %></th>
<th><%= t("admin.legislation.questions.table.question_options") %></th> <th><%= t("admin.legislation.questions.table.question_options") %></th>
@@ -27,22 +27,22 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @process.questions.each do |question| %> <% @process.questions.each do |question| %>
<tr id="<%= dom_id(question) %>"> <tr id="<%= dom_id(question) %>">
<td> <td>
<%= link_to question.title, edit_admin_legislation_process_question_path(@process, question) %> <%= link_to question.title, edit_admin_legislation_process_question_path(@process, question) %>
</td> </td>
<td> <td>
<ul> <ul>
<% question.question_options.each do |question_option| %> <% question.question_options.each do |question_option| %>
<li><%= "#{question_option.value} (#{question_option.answers_count})" %></li> <li><%= "#{question_option.value} (#{question_option.answers_count})" %></li>
<% end %> <% end %>
</ul> </ul>
</td> </td>
<td class="text-center"><%= question.answers_count %></td> <td class="text-center"><%= question.answers_count %></td>
<td class="text-center"><%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: "comments") %></td> <td class="text-center"><%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: "comments") %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% end %> <% end %>

View File

@@ -13,15 +13,15 @@
<th scope="col"><%= t("admin.shared.actions") %></th> <th scope="col"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @users.each do |user| %> <% @users.each do |user| %>
<tr> <tr>
<td><%= user.name %></td> <td><%= user.name %></td>
<td><%= user.email %></td> <td><%= user.email %></td>
<td> <td>
<%= render Admin::Roles::TableActionsComponent.new(user.manager || user.build_manager) %> <%= render Admin::Roles::TableActionsComponent.new(user.manager || user.build_manager) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% else %> <% else %>

View File

@@ -13,15 +13,15 @@
<th scope="col"><%= t("admin.shared.actions") %></th> <th scope="col"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @users.each do |user| %> <% @users.each do |user| %>
<tr> <tr>
<td><%= user.name %></td> <td><%= user.name %></td>
<td><%= user.email %></td> <td><%= user.email %></td>
<td> <td>
<%= render Admin::Roles::TableActionsComponent.new(user.moderator || user.build_moderator) %> <%= render Admin::Roles::TableActionsComponent.new(user.moderator || user.build_moderator) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% else %> <% else %>

View File

@@ -14,28 +14,28 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @newsletters.order(created_at: :desc).each do |newsletter| %> <% @newsletters.order(created_at: :desc).each do |newsletter| %>
<tr id="<%= dom_id(newsletter) %>" class="newsletter"> <tr id="<%= dom_id(newsletter) %>" class="newsletter">
<td> <td>
<%= newsletter.subject %> <%= newsletter.subject %>
</td> </td>
<td> <td>
<%= segment_name(newsletter.segment_recipient) %> <%= segment_name(newsletter.segment_recipient) %>
</td> </td>
<td> <td>
<% if newsletter.draft? %> <% if newsletter.draft? %>
<%= t("admin.newsletters.index.draft") %> <%= t("admin.newsletters.index.draft") %>
<% else %> <% else %>
<%= l newsletter.sent_at.to_date %> <%= l newsletter.sent_at.to_date %>
<% end %> <% end %>
</td> </td>
<td> <td>
<%= render Admin::TableActionsComponent.new(newsletter) do |actions| %> <%= render Admin::TableActionsComponent.new(newsletter) do |actions| %>
<%= actions.action :preview, text: t("admin.newsletters.index.preview") %> <%= actions.action :preview, text: t("admin.newsletters.index.preview") %>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% else %> <% else %>

View File

@@ -8,10 +8,10 @@
<table> <table>
<thead> <thead>
<th scope="col"><%= t("admin.officials.index.name") %></th> <th scope="col"><%= t("admin.officials.index.name") %></th>
<th scope="col"><%= t("admin.officials.index.official_position") %></th> <th scope="col"><%= t("admin.officials.index.official_position") %></th>
<th scope="col"><%= t("admin.officials.index.official_level") %></th> <th scope="col"><%= t("admin.officials.index.official_level") %></th>
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></th> <th scope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @users.each do |user| %> <% @users.each do |user| %>

View File

@@ -21,30 +21,30 @@
<th scpope="col" class="small-3"><%= t("admin.shared.actions") %></th> <th scpope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @organizations.each do |organization| %> <% @organizations.each do |organization| %>
<% hidden += 1 and next if organization.user.nil? %> <% hidden += 1 and next if organization.user.nil? %>
<tr id="<%= dom_id(organization) %>"> <tr id="<%= dom_id(organization) %>">
<td><%= organization.name %></td> <td><%= organization.name %></td>
<td><%= organization.email %></td> <td><%= organization.email %></td>
<td><%= organization.phone_number %></td> <td><%= organization.phone_number %></td>
<td><%= organization.responsible_name %></td> <td><%= organization.responsible_name %></td>
<td> <td>
<% if organization.verified? %> <% if organization.verified? %>
<span class="icon-check"></span> <span class="icon-check"></span>
<%= t("admin.organizations.index.verified") %> <%= t("admin.organizations.index.verified") %>
<% elsif organization.rejected? %> <% elsif organization.rejected? %>
<span class="icon-x rejected"></span> <span class="icon-x rejected"></span>
<%= t("admin.organizations.index.rejected") %> <%= t("admin.organizations.index.rejected") %>
<% else %> <% else %>
<span class="icon-eye"></span> <span class="icon-eye"></span>
<%= t("admin.organizations.index.pending") %> <%= t("admin.organizations.index.pending") %>
<% end %> <% end %>
</td> </td>
<td> <td>
<%= render Admin::Organizations::TableActionsComponent.new(organization) %> <%= render Admin::Organizations::TableActionsComponent.new(organization) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -16,29 +16,29 @@
<th scpope="col" class="small-3"><%= t("admin.shared.actions") %></th> <th scpope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @organizations.each do |organization| %> <% @organizations.each do |organization| %>
<tr> <tr>
<td><%= organization.name %></td> <td><%= organization.name %></td>
<td><%= organization.email %></td> <td><%= organization.email %></td>
<td><%= organization.phone_number %></td> <td><%= organization.phone_number %></td>
<td><%= organization.responsible_name %></td> <td><%= organization.responsible_name %></td>
<td> <td>
<% if organization.verified? %> <% if organization.verified? %>
<span class="icon-check"></span> <span class="icon-check"></span>
<%= t("admin.organizations.index.verified") %> <%= t("admin.organizations.index.verified") %>
<% elsif organization.rejected? %> <% elsif organization.rejected? %>
<span class="icon-x"></span> <span class="icon-x"></span>
<%= t("admin.organizations.index.rejected") %> <%= t("admin.organizations.index.rejected") %>
<% else %> <% else %>
<span class="icon-eye"></span> <span class="icon-eye"></span>
<%= t("admin.organizations.index.pending") %> <%= t("admin.organizations.index.pending") %>
<% end %> <% end %>
</td> </td>
<td> <td>
<%= render Admin::Organizations::TableActionsComponent.new(organization) %> <%= render Admin::Organizations::TableActionsComponent.new(organization) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -16,14 +16,14 @@
</thead> </thead>
<tbody> <tbody>
<% @booths.each do |booth| %> <% @booths.each do |booth| %>
<tr> <tr>
<td> <td>
<%= booth.name %> <%= booth.name %>
</td> </td>
<td> <td>
<%= booth.location %> <%= booth.location %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -15,11 +15,11 @@
<th class="small-3"><%= t("admin.actions.actions") %></th> <th class="small-3"><%= t("admin.actions.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @booths.each do |booth| %> <% @booths.each do |booth| %>
<tr id="<%= dom_id(booth) %>" class="booth"> <tr id="<%= dom_id(booth) %>" class="booth">
<%= render "booth_assignment", booth: booth, booth_assignment: booth.assignment_on_poll(@poll) %> <%= render "booth_assignment", booth: booth, booth_assignment: booth.assignment_on_poll(@poll) %>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -21,9 +21,9 @@
<th><%= t("admin.actions.actions") %></th> <th><%= t("admin.actions.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @booths.each do |booth| %> <% @booths.each do |booth| %>
<%= render "booth", booth: booth %> <%= render "booth", booth: booth %>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -16,16 +16,16 @@
</thead> </thead>
<tbody> <tbody>
<% @officers.each do |user| %> <% @officers.each do |user| %>
<tr> <tr>
<td> <td>
<strong> <strong>
<%= link_to user.name, by_officer_admin_poll_officer_assignments_path(@poll, officer_id: user.id) %> <%= link_to user.name, by_officer_admin_poll_officer_assignments_path(@poll, officer_id: user.id) %>
</strong> </strong>
</td> </td>
<td> <td>
<%= user.email %> <%= user.email %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -19,8 +19,8 @@
<div class="inline-block margin-left"> <div class="inline-block margin-left">
<strong><%= t("admin.polls.index.geozone_restricted") %></strong> <strong><%= t("admin.polls.index.geozone_restricted") %></strong>
<br> <br>
<%= @poll.geozones.pluck(:name).to_sentence %> <%= @poll.geozones.pluck(:name).to_sentence %>
</div> </div>
<% end %> <% end %>
</div> </div>

View File

@@ -15,22 +15,22 @@
</thead> </thead>
<tbody> <tbody>
<% @officers.each do |user| %> <% @officers.each do |user| %>
<tr> <tr>
<td> <td>
<%= user.name %> <%= user.name %>
</td> </td>
<td> <td>
<%= user.email %> <%= user.email %>
</td> </td>
<td> <td>
<%= render Admin::TableActionsComponent.new( <%= render Admin::TableActionsComponent.new(
user, user,
actions: [:edit], actions: [:edit],
edit_text: t("admin.poll_shifts.new.edit_shifts"), edit_text: t("admin.poll_shifts.new.edit_shifts"),
edit_path: new_admin_booth_shift_path(officer_id: user.poll_officer.id) edit_path: new_admin_booth_shift_path(officer_id: user.poll_officer.id)
) %> ) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -32,28 +32,28 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @content_blocks.each do |content_block| %> <% @content_blocks.each do |content_block| %>
<tr id="<%= dom_id(content_block) %>"> <tr id="<%= dom_id(content_block) %>">
<td><%= "#{content_block.name} (#{content_block.locale})" %></td> <td><%= "#{content_block.name} (#{content_block.locale})" %></td>
<td><%= raw content_block.body %></td> <td><%= raw content_block.body %></td>
<td> <td>
<%= render Admin::TableActionsComponent.new(content_block) %> <%= render Admin::TableActionsComponent.new(content_block) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
<% @headings_content_blocks.each do |content_block| %> <% @headings_content_blocks.each do |content_block| %>
<tr id="<%= dom_id(content_block) %>"> <tr id="<%= dom_id(content_block) %>">
<td><%= "#{content_block.name} (#{content_block.locale})" %></td> <td><%= "#{content_block.name} (#{content_block.locale})" %></td>
<td><%= raw content_block.body %></td> <td><%= raw content_block.body %></td>
<td> <td>
<%= render Admin::TableActionsComponent.new( <%= render Admin::TableActionsComponent.new(
content_block, content_block,
edit_path: admin_site_customization_edit_heading_content_block_path(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) destroy_path: admin_site_customization_delete_heading_content_block_path(content_block)
) %> ) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% else %> <% else %>

View File

@@ -56,7 +56,9 @@
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">
<p class="featured"> <p class="featured">
<%= t "admin.stats.show.summary.proposal_votes" %> <br> <%= t "admin.stats.show.summary.proposal_votes" %> <br>
<span class="number"><%= number_with_delimiter(@proposal_votes) %> <br></span> <span class="number">
<%= number_with_delimiter(@proposal_votes) %> <br>
</span>
</p> </p>
<p> <p>
<%= t "admin.stats.show.summary.debate_votes" %> <br> <%= t "admin.stats.show.summary.debate_votes" %> <br>

View File

@@ -9,41 +9,41 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @system_emails.each do |system_email_title, system_email_actions| %> <% @system_emails.each do |system_email_title, system_email_actions| %>
<tr id="<%= system_email_title %>" class="system_email"> <tr id="<%= system_email_title %>" class="system_email">
<td> <td>
<%= t("admin.system_emails.#{system_email_title}.title") %> <%= t("admin.system_emails.#{system_email_title}.title") %>
</td> </td>
<td> <td>
<%= t("admin.system_emails.#{system_email_title}.description") %> <%= t("admin.system_emails.#{system_email_title}.description") %>
</td> </td>
<td> <td>
<%= render Admin::TableActionsComponent.new(system_email_title, actions: []) do |actions| %> <%= render Admin::TableActionsComponent.new(system_email_title, actions: []) do |actions| %>
<% if system_email_actions.include?("view") %> <% if system_email_actions.include?("view") %>
<%= actions.action(:show, <%= actions.action(:show,
text: t("admin.shared.view"), text: t("admin.shared.view"),
path: admin_system_email_view_path(system_email_title)) %> path: admin_system_email_view_path(system_email_title)) %>
<% end %> <% end %>
<% if system_email_actions.include?("preview_pending") %> <% if system_email_actions.include?("preview_pending") %>
<%= actions.action(:preview_pending, <%= actions.action(:preview_pending,
text: t("admin.system_emails.preview_pending.action"), text: t("admin.system_emails.preview_pending.action"),
path: admin_system_email_preview_pending_path(system_email_title)) %> path: admin_system_email_preview_pending_path(system_email_title)) %>
<%= actions.action(:send_pending, <%= actions.action(:send_pending,
text: t("admin.system_emails.preview_pending.send_pending"), text: t("admin.system_emails.preview_pending.send_pending"),
path: admin_system_email_send_pending_path(system_email_title), path: admin_system_email_send_pending_path(system_email_title),
method: :put) %> method: :put) %>
<% end %> <% end %>
<% if system_email_actions.include?("edit_info") %> <% if system_email_actions.include?("edit_info") %>
<p class="help-text"> <p class="help-text">
<%= t("admin.system_emails.edit_info") %><br> <%= t("admin.system_emails.edit_info") %><br>
<code><%= "app/views/mailer/#{system_email_title}.html.erb" %></code> <code><%= "app/views/mailer/#{system_email_title}.html.erb" %></code>
</p> </p>
<% end %>
<% end %> <% end %>
<% end %> </td>
</td> </tr>
</tr> <% end %>
<% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -18,22 +18,22 @@
<th scope="col"><%= t("admin.actions.actions") %></th> <th scope="col"><%= t("admin.actions.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<tr> <tr>
<td> <td>
<%= form_for(tag, <%= form_for(tag,
url: admin_tag_path(tag), url: admin_tag_path(tag),
as: :tag, as: :tag,
html: { id: "edit_tag_#{tag.id}" }) do |f| %> html: { id: "edit_tag_#{tag.id}" }) do |f| %>
<strong><%= tag.name %></strong> <strong><%= tag.name %></strong>
<% end %> <% end %>
</td> </td>
<td id="tag_<%= tag.id %>"> <td id="tag_<%= tag.id %>">
<%= render Admin::TableActionsComponent.new(tag, actions: [:destroy]) %> <%= render Admin::TableActionsComponent.new(tag, actions: [:destroy]) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -1,10 +1,10 @@
<% provide :title, t("budgets.executions.page_title", budget: @budget.name) %> <% provide :title, t("budgets.executions.page_title", budget: @budget.name) %>
<% content_for :meta_description do %><%= @budget.description_for_phase("finished") %><% end %> <% content_for :meta_description do %><%= @budget.description_for_phase("finished") %><% end %>
<% provide :social_media_meta_tags do %> <% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",
social_url: budget_executions_url(@budget), social_url: budget_executions_url(@budget),
social_title: @budget.name, social_title: @budget.name,
social_description: @budget.description_for_phase("finished") %> social_description: @budget.description_for_phase("finished") %>
<% end %> <% end %>
<% content_for :canonical do %> <% content_for :canonical do %>

View File

@@ -7,12 +7,12 @@
edit_budget_investment_path(investment.budget, investment), edit_budget_investment_path(investment.budget, investment),
method: :get, class: "button hollow expanded" %> method: :get, class: "button hollow expanded" %>
<% else %> <% else %>
<%= link_to image_path(investment.image), <%= link_to image_path(investment.image),
method: :delete, method: :delete,
class: "button hollow alert expanded" do %> class: "button hollow alert expanded" do %>
<span class="icon-image"></span> <span class="icon-image"></span>
<%= t("images.remove_image") %> <%= t("images.remove_image") %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>

View File

@@ -1,10 +1,10 @@
<% provide :social_media_meta_tags do %> <% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",
social_url: budget_investments_path(investment), social_url: budget_investments_path(investment),
social_title: investment.title, social_title: investment.title,
social_description: investment.description, social_description: investment.description,
twitter_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil), 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) %> og_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil) %>
<% end %> <% end %>
<section class="budget-investment-show" id="<%= dom_id(investment) %>"> <section class="budget-investment-show" id="<%= dom_id(investment) %>">
@@ -120,6 +120,6 @@
<%= render "communities/access_button", community: investment.community %> <%= render "communities/access_button", community: investment.community %>
</aside> </aside>
</div> </div>
</section> </section>

View File

@@ -30,40 +30,40 @@
<tbody> <tbody>
<% amount_available = heading_price %> <% amount_available = heading_price %>
<% investments.each do |investment| %> <% investments.each do |investment| %>
<tr id="<%= dom_id(investment) %>" <tr id="<%= dom_id(investment) %>"
class="budget-investments <%= investment.winner? ? "success" : "js-discarded" %>" class="budget-investments <%= investment.winner? ? "success" : "js-discarded" %>"
style="<%= investment.winner? ? "" : "display: none" %>"> style="<%= investment.winner? ? "" : "display: none" %>">
<td> <td>
<% if investment.winner? %> <% if investment.winner? %>
<span class="icon-check"> <span class="icon-check">
<span class="show-for-sr"> <span class="show-for-sr">
<%= t("budgets.results.accepted") %> <%= t("budgets.results.accepted") %>
</span>
</span> </span>
<% else %> </span>
<span class="icon-x delete"> <% else %>
<span class="show-for-sr"> <span class="icon-x delete">
<%= t("budgets.results.discarded") %> <span class="show-for-sr">
</span> <%= t("budgets.results.discarded") %>
</span> </span>
<% end %> </span>
<%= link_to investment.title, budget_investment_path(@budget, investment) %>
</td>
<td class="text-center">
<%= investment.ballot_lines_count %>
</td>
<% if @budget.show_money? %>
<td class="text-center">
<%= @budget.formatted_amount(investment.price) %>
</td>
<% if results_type == :compatible %>
<td class="small text-right"
title="<%= @budget.formatted_amount(amount_available) %> - <%= @budget.formatted_amount(investment.price) %>">
<%= @budget.formatted_amount(amount_available - investment.price) %>
<% amount_available -= investment.price if investment.winner? %>
</td>
<% end %>
<% end %> <% end %>
<%= link_to investment.title, budget_investment_path(@budget, investment) %>
</td>
<td class="text-center">
<%= investment.ballot_lines_count %>
</td>
<% if @budget.show_money? %>
<td class="text-center">
<%= @budget.formatted_amount(investment.price) %>
</td>
<% if results_type == :compatible %>
<td class="small text-right"
title="<%= @budget.formatted_amount(amount_available) %> - <%= @budget.formatted_amount(investment.price) %>">
<%= @budget.formatted_amount(amount_available - investment.price) %>
<% amount_available -= investment.price if investment.winner? %>
</td>
<% end %>
<% end %>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

View File

@@ -1,10 +1,10 @@
<% provide :title, t("budgets.results.page_title", budget: @budget.name) %> <% provide :title, t("budgets.results.page_title", budget: @budget.name) %>
<% content_for :meta_description do %><%= @budget.description_for_phase("finished") %><% end %> <% content_for :meta_description do %><%= @budget.description_for_phase("finished") %><% end %>
<% provide :social_media_meta_tags do %> <% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",
social_url: budget_results_url(@budget), social_url: budget_results_url(@budget),
social_title: @budget.name, social_title: @budget.name,
social_description: @budget.description_for_phase("finished") %> social_description: @budget.description_for_phase("finished") %>
<% end %> <% end %>
<% content_for :canonical do %> <% content_for :canonical do %>
<%= render "shared/canonical", href: budget_results_url(@budget) %> <%= render "shared/canonical", href: budget_results_url(@budget) %>

View File

@@ -1,9 +1,9 @@
<% provide :title, t("stats.budgets.page_title", budget: @budget.name) %> <% provide :title, t("stats.budgets.page_title", budget: @budget.name) %>
<% provide :social_media_meta_tags do %> <% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",
social_url: budget_stats_url(@budget), social_url: budget_stats_url(@budget),
social_title: @budget.name, social_title: @budget.name,
social_description: @budget.description_for_phase("finished") %> social_description: @budget.description_for_phase("finished") %>
<% end %> <% end %>
<div class="participation-stats budgets-stats"> <div class="participation-stats budgets-stats">
@@ -40,10 +40,10 @@
</p> </p>
<% end %> <% end %>
<p class="help-text"> <p class="help-text">
<%= t("stats.budgets.participatory_disclaimer") %> <%= t("stats.budgets.participatory_disclaimer") %>
</p> </p>
<p class="help-text"> <p class="help-text">
<%= t("stats.budgets.heading_disclaimer") %> <%= t("stats.budgets.heading_disclaimer") %>
</p> </p>
</div> </div>
</div> </div>

View File

@@ -12,7 +12,7 @@
<% if author?(@community, participant) %> <% if author?(@community, participant) %>
&nbsp;&bull;&nbsp; &nbsp;&bull;&nbsp;
<span class="label round is-author"> <span class="label round is-author">
<%= t("comments.comment.author") %> <%= t("comments.comment.author") %>
</span> </span>
<% end %> <% end %>

View File

@@ -25,9 +25,9 @@
</div> </div>
<div class="poster-content"> <div class="poster-content">
<h2><%= t("dashboard.poster.index.support") %></h2> <h2><%= t("dashboard.poster.index.support") %></h2>
<%= image_tag "quote_before_blue.png", alt: "" %> <%= image_tag "quote_before_blue.png", alt: "" %>
<h3><%= proposal.title %></h3> <h3><%= proposal.title %></h3>
<%= image_tag "quote_after_blue.png", alt: "" %> <%= image_tag "quote_after_blue.png", alt: "" %>
<p class="poster-footer"> <p class="poster-footer">
<%= sanitize(t("dashboard.poster.index.footer", link: proposal_url(proposal))) %> <%= sanitize(t("dashboard.poster.index.footer", link: proposal_url(proposal))) %>
</p> </p>

View File

@@ -9,8 +9,8 @@
<%= f.email_field :email, autofocus: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> <%= f.email_field :email, autofocus: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
<% if @requires_password %> <% if @requires_password %>
<p><%= f.password_field :password %></p> <p><%= f.password_field :password %></p>
<p><%= f.password_field :password_confirmation %></p> <p><%= f.password_field :password_confirmation %></p>
<% end %> <% end %>
<%= hidden_field_tag :confirmation_token, @confirmation_token %> <%= hidden_field_tag :confirmation_token, @confirmation_token %>

View File

@@ -38,7 +38,7 @@
</div> </div>
<div class="progress" role="progressbar" tabindex="0" aria-valuenow="0" aria-valuemin="0" <div class="progress" role="progressbar" tabindex="0" aria-valuenow="0" aria-valuemin="0"
aria-valuetext="<%= "#{next_goal_progress}%" %>" aria-valuemax="100"> aria-valuetext="<%= "#{next_goal_progress}%" %>" aria-valuemax="100">
<div class="progress-meter" style="width: <%= next_goal_progress %>%"></div> <div class="progress-meter" style="width: <%= next_goal_progress %>%"></div>
</div> </div>
</div> </div>

View File

@@ -1,22 +1,22 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html <%= common_html_attributes %>> <html <%= common_html_attributes %>>
<head> <head>
<title><%= t("mailers.title") %></title> <title><%= t("mailers.title") %></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" id="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0,maximum-scale=10.0" /> <meta name="viewport" id="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0,maximum-scale=10.0" />
</head> </head>
<body style="background: #fff; font-family:font-family: 'Open Sans','Helvetica Neue',arial,sans-serif !important; margin: 0 10px; padding: 0; text-align: left;"> <body style="background: #fff; font-family:font-family: 'Open Sans','Helvetica Neue',arial,sans-serif !important; margin: 0 10px; padding: 0; text-align: left;">
<%= render "layouts/mailer_header" %> <%= render "layouts/mailer_header" %>
<table cellpadding="0" cellspacing="0" border="0" style="background: #fff; margin: 0 auto; max-width: 700px; width:100%;"> <table cellpadding="0" cellspacing="0" border="0" style="background: #fff; margin: 0 auto; max-width: 700px; width:100%;">
<tbody> <tbody>
<tr> <tr>
<%= yield %> <%= yield %>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<%= render "layouts/mailer_footer" %> <%= render "layouts/mailer_footer" %>
</body> </body>
</html> </html>

View File

@@ -11,7 +11,7 @@
<div class="comment-footer"> <div class="comment-footer">
<% if annotation.comments.roots.count > Legislation::Annotation::COMMENTS_PAGE_SIZE %> <% if annotation.comments.roots.count > Legislation::Annotation::COMMENTS_PAGE_SIZE %>
<%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation), class: "button" do %> <%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation), class: "button" do %>
<strong><%= t("legislation.annotations.comments.see_all") %></strong> <strong><%= t("legislation.annotations.comments.see_all") %></strong>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -18,8 +18,8 @@
<aside class="small-12 medium-3 column"> <aside class="small-12 medium-3 column">
<div class="sidebar-divider"></div> <div class="sidebar-divider"></div>
<h2><%= t("legislation.shared.share") %></h2> <h2><%= t("legislation.shared.share") %></h2>
<%= render "/shared/social_share", <%= render "/shared/social_share",
title: t("legislation.shared.share_comment", version_name: @draft_version.title.downcase, process_name: @process.title), title: t("legislation.shared.share_comment", version_name: @draft_version.title.downcase, process_name: @process.title),
url: legislation_process_draft_version_path(process, draft_version) %> url: legislation_process_draft_version_path(process, draft_version) %>
</aside> </aside>
</div> </div>

View File

@@ -1,10 +1,10 @@
<% provide :title, @proposal.title %> <% provide :title, @proposal.title %>
<% content_for :meta_description do %><%= @proposal.summary %><% end %> <% content_for :meta_description do %><%= @proposal.summary %><% end %>
<% provide :social_media_meta_tags do %> <% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",
social_url: legislation_process_proposal_url(process_id: @process), social_url: legislation_process_proposal_url(process_id: @process),
social_title: @proposal.title, social_title: @proposal.title,
social_description: @proposal.summary %> social_description: @proposal.summary %>
<% end %> <% end %>
<% content_for :canonical do %> <% content_for :canonical do %>
<%= render "shared/canonical", href: legislation_process_proposal_url(process_id: @process) %> <%= render "shared/canonical", href: legislation_process_proposal_url(process_id: @process) %>

View File

@@ -19,9 +19,9 @@
officing_poll_ballot_sheets_path(poll), officing_poll_ballot_sheets_path(poll),
class: "button" %> class: "button" %>
<%= link_to t("officing.polls.final.add_results"), <%= link_to t("officing.polls.final.add_results"),
new_officing_poll_ballot_sheet_path(poll), new_officing_poll_ballot_sheet_path(poll),
class: "button hollow" %> class: "button hollow" %>
<% else %> <% else %>
<%= link_to t("officing.polls.final.add_results"), <%= link_to t("officing.polls.final.add_results"),
new_officing_poll_result_path(poll), new_officing_poll_result_path(poll),

View File

@@ -81,7 +81,7 @@
<%= results_by_booth[booth_assignment].first.booth_assignment.booth.name %> <%= results_by_booth[booth_assignment].first.booth_assignment.booth.name %>
</td> </td>
<td> <td>
<%= 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) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>

View File

@@ -9,10 +9,10 @@
method: :post, method: :post,
remote: true, remote: true,
html: { id: "new_officing_voter" } do |f| %> html: { id: "new_officing_voter" } do |f| %>
<%= f.hidden_field :poll_id, value: poll.id %> <%= f.hidden_field :poll_id, value: poll.id %>
<%= f.hidden_field :user_id, value: @user.id %> <%= f.hidden_field :user_id, value: @user.id %>
<%= f.submit t("officing.voters.show.submit"), <%= f.submit t("officing.voters.show.submit"),
class: "button success", class: "button success",
data: { disable_with: t("officing.voters.can_vote.submit_disable_with") } %> data: { disable_with: t("officing.voters.can_vote.submit_disable_with") } %>
<% end %> <% end %>
</td> </td>

View File

@@ -13,18 +13,18 @@
</thead> </thead>
<tbody> <tbody>
<% @polls.each do |poll| %> <% @polls.each do |poll| %>
<tr id="<%= dom_id(poll) %>"> <tr id="<%= dom_id(poll) %>">
<td> <td>
<%= poll.name %> <%= poll.name %>
</td> </td>
<% if poll.votable_by?(@user) %> <% if poll.votable_by?(@user) %>
<%= render "can_vote", poll: poll %> <%= render "can_vote", poll: poll %>
<% elsif poll.voted_by?(@user) || poll.user_has_an_online_ballot?(@user) %> <% elsif poll.voted_by?(@user) || poll.user_has_an_online_ballot?(@user) %>
<%= render "already_voted" %> <%= render "already_voted" %>
<% else %> <% else %>
<%= render "cannot_vote" %> <%= render "cannot_vote" %>
<% end %> <% end %>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -1,10 +1,10 @@
<% provide :title, t("devise_views.organizations.registrations.new.title") %> <% provide :title, t("devise_views.organizations.registrations.new.title") %>
<h2><%= t("devise_views.organizations.registrations.new.title") %></h2> <h2><%= t("devise_views.organizations.registrations.new.title") %></h2>
<%= form_for(resource, as: :user, url: organization_registration_path) do |f| %> <%= form_for(resource, as: :user, url: organization_registration_path) do |f| %>
<%= render "shared/errors", resource: resource %> <%= render "shared/errors", resource: resource %>
<div class="row"> <div class="row">
<div class="small-12 column"> <div class="small-12 column">
<%= f.fields_for :organization do |fo| %> <%= f.fields_for :organization do |fo| %>
<%= fo.text_field :name, autofocus: true, maxlength: Organization.name_max_length %> <%= fo.text_field :name, autofocus: true, maxlength: Organization.name_max_length %>

View File

@@ -7,7 +7,7 @@
<h3><%= link_to @proposal.title, @proposal %></h3> <h3><%= link_to @proposal.title, @proposal %></h3>
<div data-alert class="callout warning"> <div data-alert class="callout warning">
<%= t("proposals.retire_form.warning") %> <%= t("proposals.retire_form.warning") %>
</div> </div>
<%= render "shared/globalize_locales", resource: @proposal, manage_languages: false %> <%= render "shared/globalize_locales", resource: @proposal, manage_languages: false %>

View File

@@ -1,9 +1,9 @@
<% provide :title, @proposal.title %> <% provide :title, @proposal.title %>
<% provide :social_media_meta_tags do %> <% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",
social_url: proposal_url(@proposal), social_url: proposal_url(@proposal),
social_title: @proposal.title, social_title: @proposal.title,
social_description: @proposal.summary %> social_description: @proposal.summary %>
<% end %> <% end %>
<% content_for :canonical do %> <% content_for :canonical do %>
<%= render "shared/canonical", href: proposal_url(@proposal) %> <%= render "shared/canonical", href: proposal_url(@proposal) %>

View File

@@ -1,12 +1,12 @@
<% if resource.author.hidden? || resource.author.erased? %> <% if resource.author.hidden? || resource.author.erased? %>
<span class="icon-deleted author-deleted"></span> <span class="icon-deleted author-deleted"></span>
<span class="author deleted"> <span class="author deleted">
<%= t("shared.author_info.author_deleted") %> <%= t("shared.author_info.author_deleted") %>
</span> </span>
<% else %> <% else %>
<%= render Shared::AvatarComponent.new(resource.author, size: 32, class: "author-photo") %> <%= render Shared::AvatarComponent.new(resource.author, size: 32, class: "author-photo") %>
<span class="author"> <span class="author">
<%= link_to resource.author.name, user_path(resource.author) %> <%= link_to resource.author.name, user_path(resource.author) %>
</span> </span>
<% if resource.respond_to?(:association_name) && resource.association_name.present? %> <% if resource.respond_to?(:association_name) && resource.association_name.present? %>

View File

@@ -3,7 +3,9 @@
<% valid_filters.each do |filter| %> <% valid_filters.each do |filter| %>
<% if current_filter == filter %> <% if current_filter == filter %>
<li class="is-active"><h2><%= t("#{i18n_namespace}.filters.#{filter}") %></h2></li> <li class="is-active">
<h2><%= t("#{i18n_namespace}.filters.#{filter}") %></h2>
</li>
<% else %> <% else %>
<li><%= link_to t("#{i18n_namespace}.filters.#{filter}"), <li><%= link_to t("#{i18n_namespace}.filters.#{filter}"),
current_path_with_query_params(filter: filter, page: 1) %></li> current_path_with_query_params(filter: filter, page: 1) %></li>

View File

@@ -2,12 +2,12 @@
<p id="price"> <p id="price">
<strong> <strong>
<%= t("valuation.budget_investments.show.price") %> <%= t("valuation.budget_investments.show.price") %>
(<%= t("valuation.budget_investments.show.currency") %>): (<%= t("valuation.budget_investments.show.currency") %>):
</strong> </strong>
<% if @investment.price.present? %> <% if @investment.price.present? %>
<%= @investment.price %> <%= @investment.price %>
<% else %> <% else %>
<%= t("valuation.budget_investments.show.undefined") %> <%= t("valuation.budget_investments.show.undefined") %>
<% end %> <% end %>
</p> </p>
@@ -20,7 +20,7 @@
<% if @investment.price_first_year.present? %> <% if @investment.price_first_year.present? %>
<%= @investment.price_first_year %> <%= @investment.price_first_year %>
<% else %> <% else %>
<%= t("valuation.budget_investments.show.undefined") %> <%= t("valuation.budget_investments.show.undefined") %>
<% end %> <% end %>
</p> </p>
<% end %> <% end %>

View File

@@ -6,21 +6,21 @@
<fieldset class="fieldset"> <fieldset class="fieldset">
<legend><%= t("valuation.budget_investments.edit.feasibility") %></legend> <legend><%= t("valuation.budget_investments.edit.feasibility") %></legend>
<div class="small-4 column"> <div class="small-4 column">
<span class="radio"> <span class="radio">
<%= f.radio_button :feasibility, "undecided" %> <%= f.radio_button :feasibility, "undecided" %>
</span> </span>
</div> </div>
<div class="small-4 column"> <div class="small-4 column">
<span class="radio"> <span class="radio">
<%= f.radio_button :feasibility, "feasible" %> <%= f.radio_button :feasibility, "feasible" %>
</span> </span>
</div> </div>
<div class="small-4 column"> <div class="small-4 column">
<span class="radio"> <span class="radio">
<%= f.radio_button :feasibility, "unfeasible" %> <%= f.radio_button :feasibility, "unfeasible" %>
</span> </span>
</div> </div>
</fieldset> </fieldset>
</div> </div>

View File

@@ -33,25 +33,25 @@
<div class="row"> <div class="row">
<div class="small-12 medium-8"> <div class="small-12 medium-8">
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">
<%= f.select :document_type, document_types, prompt: "" %> <%= f.select :document_type, document_types, prompt: "" %>
</div> </div>
<div class="small-12 medium-5 column end"> <div class="small-12 medium-5 column end">
<div class="inline-block"> <div class="inline-block">
<%= f.label :document_number, t("verification.residence.new.document_number") %> <%= f.label :document_number, t("verification.residence.new.document_number") %>
</div> </div>
<button type="button" class="inline-block" data-toggle="info-document-number"> <button type="button" class="inline-block" data-toggle="info-document-number">
<span class="icon-help"></span> <span class="icon-help"></span>
<span class="show-for-sr"><%= t("verification.residence.new.document_number_help_title") %></span> <span class="show-for-sr"><%= t("verification.residence.new.document_number_help_title") %></span>
</button> </button>
<div class="dropdown-pane" id="info-document-number" data-dropdown <div class="dropdown-pane" id="info-document-number" data-dropdown
data-hover="true" data-hover-pane="true"> data-hover="true" data-hover-pane="true">
<%= sanitize(t("verification.residence.new.document_number_help_text")) %> <%= sanitize(t("verification.residence.new.document_number_help_text")) %>
</div> </div>
<%= f.text_field :document_number, label: false %> <%= f.text_field :document_number, label: false %>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -13,8 +13,8 @@
<% @verified_users.each do |verified_user| %> <% @verified_users.each do |verified_user| %>
<% if verified_user.email.present? %> <% if verified_user.email.present? %>
<li id="<%= dom_id(verified_user) %>_email"> <li id="<%= dom_id(verified_user) %>_email">
<span><%= mask_email(verified_user.email) %></span> <span><%= mask_email(verified_user.email) %></span>
<span><%= render "form", url: email_path, verified_user: verified_user %></span> <span><%= render "form", url: email_path, verified_user: verified_user %></span>
</li> </li>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -15,15 +15,15 @@ describe Admin::Stats::SDG::GoalComponent do
render_inline component render_inline component
expect(page).to have_text "Proposals 3" expect(page).to have_text "Proposals 3", normalize_ws: true
expect(page).to have_text "Polls 2" expect(page).to have_text "Polls 2", normalize_ws: true
expect(page).to have_text "Debates 1" expect(page).to have_text "Debates 1", normalize_ws: true
expect("Current budget").to appear_before("Past year budget") expect("Current budget").to appear_before("Past year budget")
expect(page).to have_text "Investment projects sent 2" expect(page).to have_text "Investment projects sent 2", normalize_ws: true
expect(page).to have_text "Winner investment projects 0" expect(page).to have_text "Winner investment projects 0", normalize_ws: true
expect(page).to have_text "Approved amount $0" expect(page).to have_text "Approved amount $0", normalize_ws: true
expect(page).to have_text "Investment projects sent 1" expect(page).to have_text "Investment projects sent 1", normalize_ws: true
expect(page).to have_text "Winner investment projects 1" expect(page).to have_text "Winner investment projects 1", normalize_ws: true
expect(page).to have_text "Approved amount $1,000" expect(page).to have_text "Approved amount $1,000", normalize_ws: true
end end
end end