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

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

View File

@@ -28,7 +28,7 @@
</div>
<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) %>
<% if @admin_notification.draft? %>
<%= t("admin.admin_notifications.show.will_get_notified",

View File

@@ -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 %>
<div class="row expanded">
@@ -74,9 +74,9 @@
<div class="small-12 column margin-top">
<%= f.label :valuator_ids %>
<ul>
<%= 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>
<% end %>
<%= 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>
<% end %>
</ul>
</div>
@@ -85,7 +85,7 @@
<%= f.label :valuator_ids, t("admin.budget_investments.edit.assigned_valuators") %>
<ul>
<%= 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 %>
</ul>
</div>
@@ -93,11 +93,11 @@
<div class="row expanded margin-top">
<% if @investment.incompatible? || @investment.winner? %>
<div class="small-12 medium-3 column">
<h2 id="incompatible"><%= t("admin.budget_investments.edit.compatibility") %></h2>
<%= f.check_box :incompatible,
title: t("admin.budget_investments.edit.compatibility") %>
</div>
<div class="small-12 medium-3 column">
<h2 id="incompatible"><%= t("admin.budget_investments.edit.compatibility") %></h2>
<%= f.check_box :incompatible,
title: t("admin.budget_investments.edit.compatibility") %>
</div>
<% end %>
<div class="small-12 medium-3 column float-left">
<h2 id="selected"><%= t("admin.budget_investments.edit.selection") %></h2>

View File

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

View File

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

View File

@@ -13,21 +13,21 @@
<th scope="col"><%= t("admin.shared.actions") %></th>
</thead>
<tbody>
<% @comments.each do |comment| %>
<tr id="<%= dom_id(comment) %>">
<td>
<%= sanitize_and_auto_link comment.body %><br>
<% 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 %>
</td>
<td>
<%= render Admin::HiddenTableActionsComponent.new(comment) %>
</td>
</tr>
<% end %>
<% @comments.each do |comment| %>
<tr id="<%= dom_id(comment) %>">
<td>
<%= sanitize_and_auto_link comment.body %><br>
<% 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 %>
</td>
<td>
<%= render Admin::HiddenTableActionsComponent.new(comment) %>
</td>
</tr>
<% end %>
</tbody>
</table>

View File

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

View File

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

View File

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

View File

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

View File

@@ -29,31 +29,31 @@
</tr>
</thead>
<tbody>
<% @process.draft_versions.each do |draft_version| %>
<tr id="<%= dom_id(draft_version) %>">
<td>
<%= link_to draft_version.title, edit_admin_legislation_process_draft_version_path(@process, draft_version) %>
</td>
<td><%= draft_version.created_at.to_date %></td>
<td>
<% 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 %>
</td>
<td class="text-center"><%= draft_version.total_comments %></td>
<td class="text-center">
<% if draft_version.final_version %>
<span class="icon-check" title="<%= draft_version.final_version %>"></span>
<% else %>
<span class="icon-x delete" title="<%= draft_version.final_version %>"></span>
<% end %>
</td>
</tr>
<% end %>
<% @process.draft_versions.each do |draft_version| %>
<tr id="<%= dom_id(draft_version) %>">
<td>
<%= link_to draft_version.title, edit_admin_legislation_process_draft_version_path(@process, draft_version) %>
</td>
<td><%= draft_version.created_at.to_date %></td>
<td>
<% 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 %>
</td>
<td class="text-center"><%= draft_version.total_comments %></td>
<td class="text-center">
<% if draft_version.final_version %>
<span class="icon-check" title="<%= draft_version.final_version %>"></span>
<% else %>
<span class="icon-x delete" title="<%= draft_version.final_version %>"></span>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>

View File

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

View File

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

View File

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

View File

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

View File

@@ -8,10 +8,10 @@
<table>
<thead>
<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_level") %></th>
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></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_level") %></th>
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead>
<tbody>
<% @users.each do |user| %>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -15,22 +15,22 @@
</thead>
<tbody>
<% @officers.each do |user| %>
<tr>
<td>
<%= user.name %>
</td>
<td>
<%= user.email %>
</td>
<td>
<%= render Admin::TableActionsComponent.new(
<tr>
<td>
<%= user.name %>
</td>
<td>
<%= user.email %>
</td>
<td>
<%= 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)
) %>
</td>
</tr>
</td>
</tr>
<% end %>
</tbody>
</table>

View File

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

View File

@@ -56,7 +56,9 @@
<div class="small-12 medium-3 column">
<p class="featured">
<%= 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>
<%= t "admin.stats.show.summary.debate_votes" %> <br>

View File

@@ -9,41 +9,41 @@
</tr>
</thead>
<tbody>
<% @system_emails.each do |system_email_title, system_email_actions| %>
<tr id="<%= system_email_title %>" class="system_email">
<td>
<%= t("admin.system_emails.#{system_email_title}.title") %>
</td>
<td>
<%= t("admin.system_emails.#{system_email_title}.description") %>
</td>
<td>
<%= 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| %>
<tr id="<%= system_email_title %>" class="system_email">
<td>
<%= t("admin.system_emails.#{system_email_title}.title") %>
</td>
<td>
<%= t("admin.system_emails.#{system_email_title}.description") %>
</td>
<td>
<%= 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") %>
<p class="help-text">
<%= t("admin.system_emails.edit_info") %><br>
<code><%= "app/views/mailer/#{system_email_title}.html.erb" %></code>
</p>
<% if system_email_actions.include?("edit_info") %>
<p class="help-text">
<%= t("admin.system_emails.edit_info") %><br>
<code><%= "app/views/mailer/#{system_email_title}.html.erb" %></code>
</p>
<% end %>
<% end %>
<% end %>
</td>
</tr>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>

View File

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