Add and apply ArgumentAlignment rubocop rule

We're choosing the default `with_first_argument` style because it's the
one we use the most.
This commit is contained in:
Javi Martín
2023-07-01 17:37:58 +02:00
parent 32b1fc53e1
commit 629e208e9d
202 changed files with 907 additions and 830 deletions

View File

@@ -18,6 +18,9 @@ Bundler/OrderedGems:
Enabled: true Enabled: true
ConsiderPunctuation: true ConsiderPunctuation: true
Layout/ArgumentAlignment:
Enabled: true
Layout/ArrayAlignment: Layout/ArrayAlignment:
Enabled: true Enabled: true

View File

@@ -20,20 +20,20 @@
<% if feature?(:map) %> <% if feature?(:map) %>
<%= f.select :geozone_id, <%= f.select :geozone_id,
geozone_options, geozone_options,
include_blank: t("geozones.none"), include_blank: t("geozones.none"),
hint: t("admin.budget_headings.form.geozone_info") %> hint: t("admin.budget_headings.form.geozone_info") %>
<% end %> <% end %>
<% if heading.budget.approval_voting? %> <% if heading.budget.approval_voting? %>
<%= f.number_field :max_ballot_lines, <%= f.number_field :max_ballot_lines,
hint: t("admin.budget_headings.form.max_ballot_lines_info") %> hint: t("admin.budget_headings.form.max_ballot_lines_info") %>
<% end %> <% end %>
<%= f.text_field :population, <%= f.text_field :population,
maxlength: 8, maxlength: 8,
data: { toggle_focus: "population-info" }, data: { toggle_focus: "population-info" },
hint: t("admin.budget_headings.form.population_info") %> hint: t("admin.budget_headings.form.population_info") %>
<%= f.text_field :latitude, maxlength: 22 %> <%= f.text_field :latitude, maxlength: 22 %>
<%= f.text_field :longitude, maxlength: 22 %> <%= f.text_field :longitude, maxlength: 22 %>

View File

@@ -39,9 +39,9 @@
<div class="small-12 column"> <div class="small-12 column">
<%= translations_form.text_area :description, <%= translations_form.text_area :description,
maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH, maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH,
class: "html-area", class: "html-area",
hint: t("admin.budget_phases.edit.description_help_text") %> hint: t("admin.budget_phases.edit.description_help_text") %>
</div> </div>
<div class="small-12 column"> <div class="small-12 column">

View File

@@ -29,7 +29,8 @@
<%= enabled_cell(phase) %> <%= enabled_cell(phase) %>
</td> </td>
<td> <td>
<%= render Admin::TableActionsComponent.new(phase, <%= render Admin::TableActionsComponent.new(
phase,
actions: [:edit], actions: [:edit],
edit_path: edit_path(phase) edit_path: edit_path(phase)
) %> ) %>

View File

@@ -10,8 +10,8 @@
<div class="row expanded"> <div class="row expanded">
<div class="small-12 medium-9 large-6 column end"> <div class="small-12 medium-9 large-6 column end">
<%= translations_form.text_field :name, <%= translations_form.text_field :name,
maxlength: Budget.title_max_length, maxlength: Budget.title_max_length,
hint: t("admin.budgets.edit.name_description") %> hint: t("admin.budgets.edit.name_description") %>
</div> </div>
</div> </div>
<div class="row expanded"> <div class="row expanded">
@@ -67,9 +67,9 @@
<% %w[administrators valuators].each do |staff| %> <% %w[administrators valuators].each do |staff| %>
<div class="small-12 medium-6 large-3 column end"> <div class="small-12 medium-6 large-3 column end">
<%= link_to t("admin.budgets.edit.#{staff}", count: budget.send(staff).count), <%= link_to t("admin.budgets.edit.#{staff}", count: budget.send(staff).count),
"#", "#",
class: "button expanded hollow js-budget-show-#{staff}-list js-budget-show-users-list", class: "button expanded hollow js-budget-show-#{staff}-list js-budget-show-users-list",
data: { toggle: "#{staff}_list", texts: t("admin.budgets.edit.#{staff}") } %> data: { toggle: "#{staff}_list", texts: t("admin.budgets.edit.#{staff}") } %>
</div> </div>
<% end %> <% end %>

View File

@@ -32,8 +32,8 @@
<div class="callout primary"> <div class="callout primary">
<p> <p>
<%= sanitize(t("admin.machine_learning.feature_disabled", <%= sanitize(t("admin.machine_learning.feature_disabled",
link: link_to(t("admin.machine_learning.feature_disabled_link"), link: link_to(t("admin.machine_learning.feature_disabled_link"),
admin_settings_path(anchor: "tab-feature-flags")))) %> admin_settings_path(anchor: "tab-feature-flags")))) %>
</p> </p>
</div> </div>
<% end %> <% end %>

View File

@@ -17,7 +17,8 @@
</td> </td>
<td> <td>
<% if officer.persisted? %> <% if officer.persisted? %>
<%= render Admin::TableActionsComponent.new(officer, <%= render Admin::TableActionsComponent.new(
officer,
actions: [:destroy], actions: [:destroy],
destroy_text: t("admin.poll_officers.officer.delete"), destroy_text: t("admin.poll_officers.officer.delete"),
destroy_options: { class: "destroy-officer-link" } destroy_options: { class: "destroy-officer-link" }

View File

@@ -13,9 +13,9 @@
<% else %> <% else %>
<div class="small-12 medium-6 large-4 column"> <div class="small-12 medium-6 large-4 column">
<%= f.select :poll_id, <%= f.select :poll_id,
options_for_select(select_options), options_for_select(select_options),
prompt: t("admin.questions.index.select_poll"), prompt: t("admin.questions.index.select_poll"),
hint: t("admin.questions.form.poll_help") %> hint: t("admin.questions.form.poll_help") %>
</div> </div>
<% end %> <% end %>
</div> </div>

View File

@@ -1,5 +1,6 @@
<% if already_has_role? %> <% if already_has_role? %>
<%= render Admin::TableActionsComponent.new(record, <%= render Admin::TableActionsComponent.new(
record,
actions: actions, actions: actions,
destroy_options: { class: "destroy-role-link" } destroy_options: { class: "destroy-role-link" }
) %> ) %>

View File

@@ -46,10 +46,10 @@ class Attachable::FieldsComponent < ApplicationComponent
def file_field def file_field
klass = attachable.persisted? || attachable.cached_attachment.present? ? " hide" : "" klass = attachable.persisted? || attachable.cached_attachment.present? ? " hide" : ""
f.file_field :attachment, f.file_field :attachment,
label_options: { class: "button hollow #{klass}" }, label_options: { class: "button hollow #{klass}" },
accept: accepted_content_types_extensions, accept: accepted_content_types_extensions,
class: "js-#{singular_name}-attachment", class: "js-#{singular_name}-attachment",
data: { url: direct_upload_path } data: { url: direct_upload_path }
end end
def direct_upload_path def direct_upload_path

View File

@@ -2,21 +2,22 @@
<div class="filter"> <div class="filter">
<%= label_tag :milestone_tag, t("budgets.executions.filters.milestone_tag.label") %> <%= label_tag :milestone_tag, t("budgets.executions.filters.milestone_tag.label") %>
<%= select_tag :milestone_tag, <%= select_tag :milestone_tag,
options_for_select( options_for_select(
options_for_milestone_tags, options_for_milestone_tags,
params[:milestone_tag] params[:milestone_tag]
), ),
prompt: t("budgets.executions.filters.milestone_tag.all", prompt: t("budgets.executions.filters.milestone_tag.all",
count: budget.investments.winners.with_milestones.count) %> count: budget.investments.winners.with_milestones.count) %>
</div> </div>
<div class="filter"> <div class="filter">
<%= label_tag :status, t("budgets.executions.filters.status.label") %> <%= label_tag :status, t("budgets.executions.filters.status.label") %>
<%= select_tag :status, <%= select_tag :status,
options_from_collection_for_select(statuses, options_from_collection_for_select(statuses,
:id, lambda { |s| "#{s.name} (#{filters_select_counts(s.id)})" }, :id,
params[:status]), lambda { |s| "#{s.name} (#{filters_select_counts(s.id)})" },
prompt: t("budgets.executions.filters.status.all", params[:status]),
count: budget.investments.winners.with_milestones.count) %> prompt: t("budgets.executions.filters.status.all",
count: budget.investments.winners.with_milestones.count) %>
</div> </div>
<div class="submit"> <div class="submit">
<%= submit_tag t("shared.filter") %> <%= submit_tag t("shared.filter") %>

View File

@@ -18,15 +18,15 @@
<%= f.translatable_fields do |translations_form| %> <%= f.translatable_fields do |translations_form| %>
<div> <div>
<%= translations_form.text_field :title, <%= translations_form.text_field :title,
maxlength: Budget::Investment.title_max_length, maxlength: Budget::Investment.title_max_length,
data: suggest_data(investment) %> data: suggest_data(investment) %>
</div> </div>
<div class="js-suggest" data-locale="<%= translations_form.locale %>"></div> <div class="js-suggest" data-locale="<%= translations_form.locale %>"></div>
<div> <div>
<%= translations_form.text_area :description, <%= translations_form.text_area :description,
maxlength: Budget::Investment.description_max_length, maxlength: Budget::Investment.description_max_length,
class: "html-area" %> class: "html-area" %>
</div> </div>
<% end %> <% end %>
</fieldset> </fieldset>
@@ -94,11 +94,11 @@
<% unless current_user.manager? || investment.persisted? %> <% unless current_user.manager? || investment.persisted? %>
<div> <div>
<%= f.check_box :terms_of_service, <%= f.check_box :terms_of_service,
title: t("form.accept_terms_title"), title: t("form.accept_terms_title"),
label: t("form.accept_terms", label: t("form.accept_terms",
policy: link_to(t("form.policy"), "/privacy", target: "blank"), policy: link_to(t("form.policy"), "/privacy", target: "blank"),
conditions: link_to(t("form.conditions"), "/conditions", target: "blank") conditions: link_to(t("form.conditions"), "/conditions", target: "blank")
) %> ) %>
</div> </div>
<% end %> <% end %>

View File

@@ -10,13 +10,12 @@
<% elsif assigned_heading.present? %> <% elsif assigned_heading.present? %>
<p> <p>
<%= sanitize(t("budgets.investments.index.sidebar.different_heading_assigned", <%= sanitize(t("budgets.investments.index.sidebar.different_heading_assigned",
heading_link: heading_link(assigned_heading, budget) heading_link: heading_link(assigned_heading, budget))) %>
)) %>
<br> <br>
<small> <small>
<%= sanitize(t("budgets.investments.index.sidebar.change_ballot", <%= sanitize(t("budgets.investments.index.sidebar.change_ballot",
check_ballot: link_to(t("budgets.investments.index.sidebar.check_ballot_link"), check_ballot: link_to(t("budgets.investments.index.sidebar.check_ballot_link"),
budget_ballot_path(budget)))) %> budget_ballot_path(budget)))) %>
</small> </small>
</p> </p>
<% else %> <% else %>
@@ -26,7 +25,7 @@
<p> <p>
<%= sanitize(ballot.change_vote_info( <%= sanitize(ballot.change_vote_info(
link: link_to(t("budgets.investments.index.sidebar.change_vote_link"), link: link_to(t("budgets.investments.index.sidebar.change_vote_link"),
budget_ballot_path(budget)))) %> budget_ballot_path(budget)))) %>
</p> </p>
<ul class="ballot-list"> <ul class="ballot-list">
@@ -39,6 +38,6 @@
</ul> </ul>
<%= link_to t("budgets.investments.header.check_ballot"), <%= link_to t("budgets.investments.header.check_ballot"),
budget_ballot_path(budget), budget_ballot_path(budget),
class: "button hollow expanded" %> class: "button hollow expanded" %>
</div> </div>

View File

@@ -13,22 +13,22 @@
</div> </div>
<% if feature?(:remove_investments_supports) %> <% if feature?(:remove_investments_supports) %>
<%= button_to remove_support_path, <%= button_to remove_support_path,
class: "button button-remove-support expanded", class: "button button-remove-support expanded",
method: "delete", method: "delete",
remote: true, remote: true,
"aria-label": remove_support_aria_label do %> "aria-label": remove_support_aria_label do %>
<%= t("budgets.investments.votes.remove_support") %> <%= t("budgets.investments.votes.remove_support") %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<% else %> <% else %>
<%= button_to t("budgets.investments.votes.support"), support_path, <%= button_to t("budgets.investments.votes.support"), support_path,
class: "button button-support expanded", class: "button button-support expanded",
title: t("budgets.investments.investment.support_title"), title: t("budgets.investments.investment.support_title"),
method: "post", method: "post",
remote: !display_support_alert?, remote: !display_support_alert?,
data: ({ confirm: confirm_vote_message } if display_support_alert?), data: ({ confirm: confirm_vote_message } if display_support_alert?),
"aria-label": support_aria_label %> "aria-label": support_aria_label %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
@@ -38,11 +38,11 @@
<% if user_voted_for? && setting["twitter_handle"] %> <% if user_voted_for? && setting["twitter_handle"] %>
<div class="share-supported"> <div class="share-supported">
<%= render "shared/social_share", <%= render "shared/social_share",
title: investment.title, title: investment.title,
image_url: image_absolute_url(investment.image, :thumb), image_url: image_absolute_url(investment.image, :thumb),
url: budget_investment_url(investment.budget, investment), url: budget_investment_url(investment.budget, investment),
description: investment.title, description: investment.title,
mobile: investment.title %> mobile: investment.title %>
</div> </div>
<% end %> <% end %>
</div> </div>

View File

@@ -16,13 +16,13 @@
<% else %> <% else %>
<div class="callout warning"> <div class="callout warning">
<%= sanitize(t("budgets.investments.index.sidebar.verified_only", <%= sanitize(t("budgets.investments.index.sidebar.verified_only",
verify: link_to_verify_account)) %> verify: link_to_verify_account)) %>
</div> </div>
<% end %> <% end %>
<% else %> <% else %>
<div class="callout primary"> <div class="callout primary">
<%= sanitize(t("budgets.investments.index.sidebar.not_logged_in", <%= sanitize(t("budgets.investments.index.sidebar.not_logged_in",
sign_in: link_to_signin, sign_up: link_to_signup)) %> sign_in: link_to_signin, sign_up: link_to_signup)) %>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -14,7 +14,7 @@
</header> </header>
<p><%= t("budgets.supports_info.time", <p><%= t("budgets.supports_info.time",
phase_end_date: l(budget.current_phase.ends_at.to_date, format: :long)) %></p> phase_end_date: l(budget.current_phase.ends_at.to_date, format: :long)) %></p>
<p><%= t("budgets.supports_info.share") %></p> <p><%= t("budgets.supports_info.share") %></p>

View File

@@ -4,9 +4,9 @@
<span class="in-favor"> <span class="in-favor">
<%= button_to vote_comment_path(comment, value: "yes"), <%= button_to vote_comment_path(comment, value: "yes"),
method: "post", method: "post",
remote: can?(:vote, comment), remote: can?(:vote, comment),
title: t("votes.agree") do %> title: t("votes.agree") do %>
<span class="show-for-sr"><%= t("votes.agree") %></span> <span class="show-for-sr"><%= t("votes.agree") %></span>
<% end %> <% end %>
<%= comment.total_likes %> <%= comment.total_likes %>
@@ -14,9 +14,9 @@
<span class="against"> <span class="against">
<%= button_to vote_comment_path(comment, value: "no"), <%= button_to vote_comment_path(comment, value: "no"),
method: "post", method: "post",
remote: can?(:vote, comment), remote: can?(:vote, comment),
title: t("votes.disagree") do %> title: t("votes.disagree") do %>
<span class="show-for-sr"><%= t("votes.disagree") %></span> <span class="show-for-sr"><%= t("votes.disagree") %></span>
<% end %> <% end %>
<%= comment.total_dislikes %> <%= comment.total_dislikes %>

View File

@@ -9,15 +9,15 @@
<%= f.translatable_fields do |translations_form| %> <%= f.translatable_fields do |translations_form| %>
<div> <div>
<%= translations_form.text_field :title, <%= translations_form.text_field :title,
maxlength: Debate.title_max_length, maxlength: Debate.title_max_length,
data: suggest_data(debate) %> data: suggest_data(debate) %>
</div> </div>
<div class="js-suggest" data-locale="<%= translations_form.locale %>"></div> <div class="js-suggest" data-locale="<%= translations_form.locale %>"></div>
<div> <div>
<%= translations_form.text_area :description, <%= translations_form.text_area :description,
maxlength: Debate.description_max_length, maxlength: Debate.description_max_length,
class: "html-area" %> class: "html-area" %>
</div> </div>
<% end %> <% end %>
</fieldset> </fieldset>
@@ -42,11 +42,11 @@
<% if debate.new_record? %> <% if debate.new_record? %>
<div> <div>
<%= f.check_box :terms_of_service, <%= f.check_box :terms_of_service,
title: t("form.accept_terms_title"), title: t("form.accept_terms_title"),
label: t("form.accept_terms", label: t("form.accept_terms",
policy: link_to(t("form.policy"), "/privacy", target: "blank"), policy: link_to(t("form.policy"), "/privacy", target: "blank"),
conditions: link_to(t("form.conditions"), "/conditions", target: "blank") conditions: link_to(t("form.conditions"), "/conditions", target: "blank")
) %> ) %>
</div> </div>
<% end %> <% end %>

View File

@@ -7,8 +7,8 @@
<p class="info"> <p class="info">
<%= sanitize(t("layouts.footer.description", <%= sanitize(t("layouts.footer.description",
open_source: link_to(t("layouts.footer.open_source"), t("layouts.footer.open_source_url"), target: "blank", rel: "nofollow"), open_source: link_to(t("layouts.footer.open_source"), t("layouts.footer.open_source_url"), target: "blank", rel: "nofollow"),
consul: link_to(t("layouts.footer.consul"), t("layouts.footer.consul_url"), target: "blank", rel: "nofollow"))) %> consul: link_to(t("layouts.footer.consul"), t("layouts.footer.consul_url"), target: "blank", rel: "nofollow"))) %>
</p> </p>
</div> </div>

View File

@@ -1,19 +1,19 @@
<% if user %> <% if user %>
<li> <li>
<%= layout_menu_link_to t("layouts.header.my_activity_link"), <%= layout_menu_link_to t("layouts.header.my_activity_link"),
user_path(user), user_path(user),
controller_name == "users", controller_name == "users",
rel: "nofollow", rel: "nofollow",
title: t("shared.go_to_page") + title: t("shared.go_to_page") +
t("layouts.header.my_activity_link") %> t("layouts.header.my_activity_link") %>
</li> </li>
<li> <li>
<%= layout_menu_link_to t("layouts.header.my_account_link"), <%= layout_menu_link_to t("layouts.header.my_account_link"),
account_path, account_path,
controller_name == "account", controller_name == "account",
rel: "nofollow", rel: "nofollow",
title: t("shared.go_to_page") + title: t("shared.go_to_page") +
t("layouts.header.my_account_link") %> t("layouts.header.my_account_link") %>
</li> </li>
<li> <li>
<%= link_to t("devise_views.menu.login_items.logout"), <%= link_to t("devise_views.menu.login_items.logout"),

View File

@@ -21,9 +21,9 @@
<% if feature?(:polls) %> <% if feature?(:polls) %>
<li> <li>
<%= layout_menu_link_to t("layouts.header.poll_questions"), <%= layout_menu_link_to t("layouts.header.poll_questions"),
polls_path, polls_path,
controller_name == "polls" || (controller_name == "questions" && controller.class.module_parent == Polls), controller_name == "polls" || (controller_name == "questions" && controller.class.module_parent == Polls),
accesskey: "3" %> accesskey: "3" %>
</li> </li>
<% end %> <% end %>
<% if feature?(:legislation) %> <% if feature?(:legislation) %>
@@ -37,9 +37,9 @@
<% if feature?(:budgets) %> <% if feature?(:budgets) %>
<li> <li>
<%= layout_menu_link_to t("layouts.header.budgets"), <%= layout_menu_link_to t("layouts.header.budgets"),
budgets_path, budgets_path,
controller_name == "budgets" || controller_name == "investments", controller_name == "budgets" || controller_name == "investments",
accesskey: "5" %> accesskey: "5" %>
</li> </li>
<% end %> <% end %>
<% if feature?(:sdg) %> <% if feature?(:sdg) %>

View File

@@ -12,10 +12,10 @@
<% if current_user&.voted_as_when_voted_for(proposal) && setting["twitter_handle"] %> <% if current_user&.voted_as_when_voted_for(proposal) && setting["twitter_handle"] %>
<div class="share-supported"> <div class="share-supported">
<%= render "shared/social_share", <%= render "shared/social_share",
title: proposal.title, title: proposal.title,
url: proposal_url(proposal), url: proposal_url(proposal),
description: proposal.summary, description: proposal.summary,
mobile: proposal.title %> mobile: proposal.title %>
</div> </div>
<% end %> <% end %>
</div> </div>

View File

@@ -13,7 +13,7 @@
<td><%= budget.current_phase.name %></td> <td><%= budget.current_phase.name %></td>
<td align="right"> <td align="right">
<%= link_to t("management.budgets.print_investments"), <%= link_to t("management.budgets.print_investments"),
print_management_budget_investments_path(budget) %> print_management_budget_investments_path(budget) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>

View File

@@ -9,8 +9,8 @@
<%= f.translatable_fields do |translations_form| %> <%= f.translatable_fields do |translations_form| %>
<div> <div>
<%= translations_form.text_field :title, <%= translations_form.text_field :title,
maxlength: Proposal.title_max_length, maxlength: Proposal.title_max_length,
data: suggest_data(proposal) %> data: suggest_data(proposal) %>
</div> </div>
<div class="js-suggest" data-locale="<%= translations_form.locale %>"></div> <div class="js-suggest" data-locale="<%= translations_form.locale %>"></div>
@@ -52,7 +52,7 @@
<% if Geozone.any? %> <% if Geozone.any? %>
<div> <div>
<%= f.select :geozone_id, geozone_select_options, <%= f.select :geozone_id, geozone_select_options,
include_blank: t("geozones.none") %> include_blank: t("geozones.none") %>
</div> </div>
<% end %> <% end %>
@@ -90,7 +90,7 @@
<% if current_user.unverified? %> <% if current_user.unverified? %>
<div> <div>
<%= f.text_field :responsible_name, <%= f.text_field :responsible_name,
hint: t("proposals.form.proposal_responsible_name_note") %> hint: t("proposals.form.proposal_responsible_name_note") %>
</div> </div>
<% end %> <% end %>
@@ -101,11 +101,11 @@
<% if proposal.new_record? %> <% if proposal.new_record? %>
<div> <div>
<%= f.check_box :terms_of_service, <%= f.check_box :terms_of_service,
title: t("form.accept_terms_title"), title: t("form.accept_terms_title"),
label: t("form.accept_terms", label: t("form.accept_terms",
policy: link_to(t("form.policy"), "/privacy", target: "blank"), policy: link_to(t("form.policy"), "/privacy", target: "blank"),
conditions: link_to(t("form.conditions"), "/conditions", target: "blank") conditions: link_to(t("form.conditions"), "/conditions", target: "blank")
) %> ) %>
</div> </div>
<% end %> <% end %>

View File

@@ -8,11 +8,11 @@
</div> </div>
<% else %> <% else %>
<%= button_to vote_url, <%= button_to vote_url,
class: "button button-support small expanded", class: "button button-support small expanded",
title: t("proposals.proposal.support_title"), title: t("proposals.proposal.support_title"),
method: "post", method: "post",
remote: true, remote: true,
"aria-label": support_aria_label do %> "aria-label": support_aria_label do %>
<%= t("proposals.proposal.support") %> <%= t("proposals.proposal.support") %>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -12,15 +12,15 @@
</fieldset> </fieldset>
<%= f.text_field :related_sdg_list, <%= f.text_field :related_sdg_list,
class: "input", class: "input",
hint: sanitize(t("sdg.related_list_selector.hint", hint: sanitize(t("sdg.related_list_selector.hint",
link: link_to(t("sdg.related_list_selector.help.text"), link: link_to(t("sdg.related_list_selector.help.text"),
sdg_help_path, sdg_help_path,
title: t("shared.target_blank"), title: t("shared.target_blank"),
target: "_blank")), target: "_blank")),
attributes: %w[href title target]), attributes: %w[href title target]),
data: { "suggestions-list": sdg_related_suggestions, data: { "suggestions-list": sdg_related_suggestions,
"remove-tag-text": t("sdg.related_list_selector.remove_tag") } %> "remove-tag-text": t("sdg.related_list_selector.remove_tag") } %>
</div> </div>
<div class="help-section callout primary hide"> <div class="help-section callout primary hide">

View File

@@ -15,8 +15,8 @@
<div class="filter"> <div class="filter">
<label for="js-advanced-search-date-min"><%= t("shared.advanced_search.date") %></label> <label for="js-advanced-search-date-min"><%= t("shared.advanced_search.date") %></label>
<%= select_tag("advanced_search[date_min]", date_range_options, <%= select_tag("advanced_search[date_min]", date_range_options,
include_blank: t("shared.advanced_search.date_range_blank"), include_blank: t("shared.advanced_search.date_range_blank"),
id: "js-advanced-search-date-min") %> id: "js-advanced-search-date-min") %>
</div> </div>
<div id="js-custom-date" class="custom-date-filters" style="display: none"> <div id="js-custom-date" class="custom-date-filters" style="display: none">
@@ -25,16 +25,16 @@
<%= t("shared.advanced_search.from") %> (<%= t("shared.advanced_search.date_placeholder") %>) <%= t("shared.advanced_search.from") %> (<%= t("shared.advanced_search.date_placeholder") %>)
</label> </label>
<%= text_field_tag "advanced_search[date_min]", <%= text_field_tag "advanced_search[date_min]",
advanced_search[:date_min], advanced_search[:date_min],
class: "js-calendar" %> class: "js-calendar" %>
</div> </div>
<div class="filter"> <div class="filter">
<label for="advanced_search_date_max"> <label for="advanced_search_date_max">
<%= t("shared.advanced_search.to") %> (<%= t("shared.advanced_search.date_placeholder") %>) <%= t("shared.advanced_search.to") %> (<%= t("shared.advanced_search.date_placeholder") %>)
</label> </label>
<%= text_field_tag "advanced_search[date_max]", <%= text_field_tag "advanced_search[date_max]",
advanced_search[:date_max], advanced_search[:date_max],
class: "js-calendar" %> class: "js-calendar" %>
</div> </div>
</div> </div>
</div> </div>
@@ -43,12 +43,12 @@
<div class="filter"> <div class="filter">
<label for="advanced_search_goal"><%= t("shared.advanced_search.goal") %></label> <label for="advanced_search_goal"><%= t("shared.advanced_search.goal") %></label>
<%= select_tag("advanced_search[goal]", goal_options, <%= select_tag("advanced_search[goal]", goal_options,
include_blank: t("shared.advanced_search.goal_blank")) %> include_blank: t("shared.advanced_search.goal_blank")) %>
</div> </div>
<div class="filter"> <div class="filter">
<label for="advanced_search_target"><%= t("shared.advanced_search.target") %></label> <label for="advanced_search_target"><%= t("shared.advanced_search.target") %></label>
<%= select_tag("advanced_search[target]", target_options, <%= select_tag("advanced_search[target]", target_options,
include_blank: t("shared.advanced_search.target_blank")) %> include_blank: t("shared.advanced_search.target_blank")) %>
</div> </div>
<% end %> <% end %>

View File

@@ -1,11 +1,11 @@
<div class="in-favor-against"> <div class="in-favor-against">
<div class="in-favor"> <div class="in-favor">
<%= button_to polymorphic_path(votable, action: :vote, value: "yes"), <%= button_to polymorphic_path(votable, action: :vote, value: "yes"),
class: "like #{voted_classes[:in_favor]}", class: "like #{voted_classes[:in_favor]}",
title: t("votes.agree"), title: t("votes.agree"),
"aria-label": agree_aria_label, "aria-label": agree_aria_label,
method: "post", method: "post",
remote: true do %> remote: true do %>
<span class="show-for-sr"><%= t("votes.agree") %></span> <span class="show-for-sr"><%= t("votes.agree") %></span>
<% end %> <% end %>
<span class="percentage"><%= votes_percentage("likes", votable) %></span> <span class="percentage"><%= votes_percentage("likes", votable) %></span>
@@ -13,11 +13,11 @@
<div class="against"> <div class="against">
<%= button_to polymorphic_path(votable, action: :vote, value: "no"), <%= button_to polymorphic_path(votable, action: :vote, value: "no"),
class: "unlike #{voted_classes[:against]}", class: "unlike #{voted_classes[:against]}",
title: t("votes.disagree"), title: t("votes.disagree"),
"aria-label": disagree_aria_label, "aria-label": disagree_aria_label,
method: "post", method: "post",
remote: true do %> remote: true do %>
<span class="show-for-sr"><%= t("votes.disagree") %></span> <span class="show-for-sr"><%= t("votes.disagree") %></span>
<% end %> <% end %>
<span class="percentage"><%= votes_percentage("dislikes", votable) %></span> <span class="percentage"><%= votes_percentage("dislikes", votable) %></span>

View File

@@ -40,9 +40,9 @@ class Shared::MapLocationComponent < ApplicationComponent
def remove_marker def remove_marker
button_tag remove_marker_label, button_tag remove_marker_label,
id: remove_marker_id, id: remove_marker_id,
class: "map-location-remove-marker", class: "map-location-remove-marker",
type: "button" type: "button"
end end
def data def data

View File

@@ -10,7 +10,7 @@ class Admin::LocalCensusRecordsController < Admin::BaseController
@local_census_record = LocalCensusRecord.new(local_census_record_params) @local_census_record = LocalCensusRecord.new(local_census_record_params)
if @local_census_record.save if @local_census_record.save
redirect_to admin_local_census_records_path, redirect_to admin_local_census_records_path,
notice: t("admin.local_census_records.create.notice") notice: t("admin.local_census_records.create.notice")
else else
render :new render :new
end end
@@ -19,7 +19,7 @@ class Admin::LocalCensusRecordsController < Admin::BaseController
def update def update
if @local_census_record.update(local_census_record_params) if @local_census_record.update(local_census_record_params)
redirect_to admin_local_census_records_path, redirect_to admin_local_census_records_path,
notice: t("admin.local_census_records.update.notice") notice: t("admin.local_census_records.update.notice")
else else
render :edit render :edit
end end
@@ -28,7 +28,7 @@ class Admin::LocalCensusRecordsController < Admin::BaseController
def destroy def destroy
@local_census_record.destroy! @local_census_record.destroy!
redirect_to admin_local_census_records_path, redirect_to admin_local_census_records_path,
notice: t("admin.local_census_records.destroy.notice") notice: t("admin.local_census_records.destroy.notice")
end end
private private

View File

@@ -12,7 +12,7 @@ class Admin::Poll::Questions::Answers::DocumentsController < Admin::Poll::BaseCo
if @answer.save if @answer.save
redirect_to admin_answer_documents_path(@answer), redirect_to admin_answer_documents_path(@answer),
notice: t("admin.documents.create.success_notice") notice: t("admin.documents.create.success_notice")
else else
render :index render :index
end end

View File

@@ -16,7 +16,7 @@ class Admin::Poll::Questions::Answers::ImagesController < Admin::Poll::BaseContr
if @answer.save if @answer.save
redirect_to admin_answer_images_path(@answer), redirect_to admin_answer_images_path(@answer),
notice: t("flash.actions.create.poll_question_answer_image") notice: t("flash.actions.create.poll_question_answer_image")
else else
render :new render :new
end end

View File

@@ -11,7 +11,7 @@ class Admin::Poll::Questions::Answers::VideosController < Admin::Poll::BaseContr
def create def create
if @video.save if @video.save
redirect_to admin_answer_videos_path(@answer), redirect_to admin_answer_videos_path(@answer),
notice: t("flash.actions.create.poll_question_answer_video") notice: t("flash.actions.create.poll_question_answer_video")
else else
render :new render :new
end end

View File

@@ -12,7 +12,7 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController
def create def create
if @answer.save if @answer.save
redirect_to admin_question_path(@question), redirect_to admin_question_path(@question),
notice: t("flash.actions.create.poll_question_answer") notice: t("flash.actions.create.poll_question_answer")
else else
render :new render :new
end end
@@ -24,7 +24,7 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController
def update def update
if @answer.update(answer_params) if @answer.update(answer_params)
redirect_to admin_question_path(@question), redirect_to admin_question_path(@question),
notice: t("flash.actions.save_changes.notice") notice: t("flash.actions.save_changes.notice")
else else
render :edit render :edit
end end

View File

@@ -14,7 +14,7 @@ module Budgets
respond_to do |format| respond_to do |format|
format.html do format.html do
redirect_to budget_investments_path(heading_id: @investment.heading.id), redirect_to budget_investments_path(heading_id: @investment.heading.id),
notice: t("flash.actions.create.support") notice: t("flash.actions.create.support")
end end
format.js { render :show } format.js { render :show }

View File

@@ -12,7 +12,8 @@ class GraphqlController < ApplicationController
begin begin
raise GraphqlController::QueryStringError if query_string.nil? raise GraphqlController::QueryStringError if query_string.nil?
result = ConsulSchema.execute(query_string, result = ConsulSchema.execute(
query_string,
variables: prepare_variables, variables: prepare_variables,
context: {}, context: {},
operation_name: params[:operationName] operation_name: params[:operationName]

View File

@@ -9,7 +9,7 @@ class Management::Budgets::Investments::VotesController < Management::BaseContro
respond_to do |format| respond_to do |format|
format.html do format.html do
redirect_to management_budget_investments_path(heading_id: @investment.heading.id), redirect_to management_budget_investments_path(heading_id: @investment.heading.id),
notice: t("flash.actions.create.support") notice: t("flash.actions.create.support")
end end
format.js { render :show } format.js { render :show }

View File

@@ -2,7 +2,7 @@ module LinksHelper
def render_destroy_element_link(builder, element) def render_destroy_element_link(builder, element)
link_to_remove_association element.new_record? ? t("links.form.cancel_button") : link_to_remove_association element.new_record? ? t("links.form.cancel_button") :
t("links.form.delete_button"), t("links.form.delete_button"),
builder, class: "delete remove-element" builder, class: "delete remove-element"
end end
def link_to_signin(options = {}) def link_to_signin(options = {})

View File

@@ -60,10 +60,10 @@ module ProposalsDashboardHelper
label = [] label = []
label << t("dashboard.resource.required_days", label << t("dashboard.resource.required_days",
days: resource.day_offset) if resource.day_offset > 0 days: resource.day_offset) if resource.day_offset > 0
label << t("dashboard.resource.required_supports", label << t("dashboard.resource.required_supports",
supports: number_with_delimiter(resource.required_supports, supports: number_with_delimiter(resource.required_supports,
delimiter: ".")) if resource.required_supports > 0 delimiter: ".")) if resource.required_supports > 0
safe_join label, h(" #{t("dashboard.resource.and")})") + tag(:br) safe_join label, h(" #{t("dashboard.resource.and")})") + tag(:br)
end end

View File

@@ -73,7 +73,7 @@ module Abilities
can [:hide, :admin_update, :toggle_selection], Budget::Investment can [:hide, :admin_update, :toggle_selection], Budget::Investment
can [:valuate, :comment_valuation], Budget::Investment can [:valuate, :comment_valuation], Budget::Investment
cannot [:admin_update, :toggle_selection, :valuate, :comment_valuation], cannot [:admin_update, :toggle_selection, :valuate, :comment_valuation],
Budget::Investment, budget: { phase: "finished" } Budget::Investment, budget: { phase: "finished" }
can :create, Budget::ValuatorAssignment can :create, Budget::ValuatorAssignment

View File

@@ -96,9 +96,9 @@ module Abilities
can :suggest, Budget::Investment, budget: { phase: "accepting" } can :suggest, Budget::Investment, budget: { phase: "accepting" }
can :destroy, Budget::Investment, budget: { phase: ["accepting", "reviewing"] }, author_id: user.id can :destroy, Budget::Investment, budget: { phase: ["accepting", "reviewing"] }, author_id: user.id
can [:create, :destroy], ActsAsVotable::Vote, can [:create, :destroy], ActsAsVotable::Vote,
voter_id: user.id, voter_id: user.id,
votable_type: "Budget::Investment", votable_type: "Budget::Investment",
votable: { budget: { phase: "selecting" }} votable: { budget: { phase: "selecting" }}
can [:show, :create], Budget::Ballot, budget: { phase: "balloting" } can [:show, :create], Budget::Ballot, budget: { phase: "balloting" }
can [:create, :destroy], Budget::Ballot::Line, budget: { phase: "balloting" } can [:create, :destroy], Budget::Ballot::Line, budget: { phase: "balloting" }

View File

@@ -51,9 +51,9 @@ class Budget
has_many :comments, -> { where(valuation: false) }, as: :commentable, inverse_of: :commentable has_many :comments, -> { where(valuation: false) }, as: :commentable, inverse_of: :commentable
has_one :summary_comment, as: :commentable, class_name: "MlSummaryComment", dependent: :destroy has_one :summary_comment, as: :commentable, class_name: "MlSummaryComment", dependent: :destroy
has_many :valuations, -> { where(valuation: true) }, has_many :valuations, -> { where(valuation: true) },
as: :commentable, as: :commentable,
inverse_of: :commentable, inverse_of: :commentable,
class_name: "Comment" class_name: "Comment"
validates_translation :title, presence: true, length: { in: 4..Budget::Investment.title_max_length } validates_translation :title, presence: true, length: { in: 4..Budget::Investment.title_max_length }
validates_translation :description, presence: true, length: { maximum: Budget::Investment.description_max_length } validates_translation :description, presence: true, length: { maximum: Budget::Investment.description_max_length }

View File

@@ -27,8 +27,8 @@ class Budget::VotingStyles::Base
def voted_info(heading) def voted_info(heading)
I18n.t("budgets.investments.index.sidebar.voted_info.#{name}", I18n.t("budgets.investments.index.sidebar.voted_info.#{name}",
count: investments(heading).count, count: investments(heading).count,
amount_spent: budget.formatted_amount(investments_price(heading))) amount_spent: budget.formatted_amount(investments_price(heading)))
end end
def amount_available_info(heading) def amount_available_info(heading)

View File

@@ -6,25 +6,25 @@ module Attachable
attr_accessor :cached_attachment attr_accessor :cached_attachment
validates :attachment, validates :attachment,
presence: true, presence: true,
file_content_type: { file_content_type: {
allow: ->(record) { record.accepted_content_types }, allow: ->(record) { record.accepted_content_types },
if: -> { association_class && attachment.attached? }, if: -> { association_class && attachment.attached? },
message: ->(record, *) do message: ->(record, *) do
I18n.t("#{record.model_name.plural}.errors.messages.wrong_content_type", I18n.t("#{record.model_name.plural}.errors.messages.wrong_content_type",
content_type: record.attachment_content_type, content_type: record.attachment_content_type,
accepted_content_types: record.class.humanized_accepted_content_types) accepted_content_types: record.class.humanized_accepted_content_types)
end end
}, },
file_size: { file_size: {
less_than_or_equal_to: ->(record) { record.max_file_size.megabytes }, less_than_or_equal_to: ->(record) { record.max_file_size.megabytes },
if: -> { association_class && attachment.attached? }, if: -> { association_class && attachment.attached? },
message: ->(record, *) do message: ->(record, *) do
I18n.t("#{record.model_name.plural}.errors.messages.in_between", I18n.t("#{record.model_name.plural}.errors.messages.in_between",
min: "0 Bytes", min: "0 Bytes",
max: "#{record.max_file_size} MB") max: "#{record.max_file_size} MB")
end end
} }
before_validation :set_attachment_from_cached_attachment, if: -> { cached_attachment.present? } before_validation :set_attachment_from_cached_attachment, if: -> { cached_attachment.present? }
end end

View File

@@ -3,9 +3,9 @@ module Relationable
included do included do
has_many :related_contents, has_many :related_contents,
as: :parent_relationable, as: :parent_relationable,
inverse_of: :parent_relationable, inverse_of: :parent_relationable,
dependent: :destroy dependent: :destroy
end end
def find_related_content(relationable) def find_related_content(relationable)

View File

@@ -11,9 +11,9 @@ class Legislation::DraftVersion < ApplicationRecord
belongs_to :process, foreign_key: "legislation_process_id", inverse_of: :draft_versions belongs_to :process, foreign_key: "legislation_process_id", inverse_of: :draft_versions
has_many :annotations, has_many :annotations,
foreign_key: "legislation_draft_version_id", foreign_key: "legislation_draft_version_id",
inverse_of: :draft_version, inverse_of: :draft_version,
dependent: :destroy dependent: :destroy
validates_translation :title, presence: true validates_translation :title, presence: true
validates_translation :body, presence: true validates_translation :body, presence: true

View File

@@ -27,21 +27,21 @@ class Legislation::Process < ApplicationRecord
CSS_HEX_COLOR = /\A#?(?:[A-F0-9]{3}){1,2}\z/i CSS_HEX_COLOR = /\A#?(?:[A-F0-9]{3}){1,2}\z/i
has_many :draft_versions, -> { order(:id) }, has_many :draft_versions, -> { order(:id) },
foreign_key: "legislation_process_id", foreign_key: "legislation_process_id",
inverse_of: :process, inverse_of: :process,
dependent: :destroy dependent: :destroy
has_one :final_draft_version, -> { where final_version: true, status: "published" }, has_one :final_draft_version, -> { where final_version: true, status: "published" },
class_name: "Legislation::DraftVersion", class_name: "Legislation::DraftVersion",
foreign_key: "legislation_process_id", foreign_key: "legislation_process_id",
inverse_of: :process inverse_of: :process
has_many :questions, -> { order(:id) }, has_many :questions, -> { order(:id) },
foreign_key: "legislation_process_id", foreign_key: "legislation_process_id",
inverse_of: :process, inverse_of: :process,
dependent: :destroy dependent: :destroy
has_many :proposals, -> { order(:id) }, has_many :proposals, -> { order(:id) },
foreign_key: "legislation_process_id", foreign_key: "legislation_process_id",
inverse_of: :process, inverse_of: :process,
dependent: :destroy dependent: :destroy
validates_translation :title, presence: true validates_translation :title, presence: true
validates :start_date, presence: true validates :start_date, presence: true

View File

@@ -62,9 +62,11 @@ class Poll < ApplicationRecord
end end
def self.overlaping_with(poll) def self.overlaping_with(poll)
where("? < ends_at and ? >= starts_at", poll.starts_at.beginning_of_day, where("? < ends_at and ? >= starts_at",
poll.ends_at.end_of_day).where.not(id: poll.id) poll.starts_at.beginning_of_day,
.where(related: poll.related) poll.ends_at.end_of_day)
.where.not(id: poll.id)
.where(related: poll.related)
end end
def title def title

View File

@@ -15,9 +15,9 @@ class Poll::Question < ApplicationRecord
has_many :comments, as: :commentable, inverse_of: :commentable has_many :comments, as: :commentable, inverse_of: :commentable
has_many :answers, class_name: "Poll::Answer" has_many :answers, class_name: "Poll::Answer"
has_many :question_answers, -> { order "given_order asc" }, has_many :question_answers, -> { order "given_order asc" },
class_name: "Poll::Question::Answer", class_name: "Poll::Question::Answer",
inverse_of: :question, inverse_of: :question,
dependent: :destroy dependent: :destroy
has_many :partial_results has_many :partial_results
belongs_to :proposal belongs_to :proposal

View File

@@ -2,10 +2,10 @@ class Tenant < ApplicationRecord
enum schema_type: %w[subdomain domain] enum schema_type: %w[subdomain domain]
validates :schema, validates :schema,
presence: true, presence: true,
uniqueness: true, uniqueness: true,
exclusion: { in: ->(*) { excluded_subdomains }}, exclusion: { in: ->(*) { excluded_subdomains }},
format: { with: URI::DEFAULT_PARSER.regexp[:HOST] } format: { with: URI::DEFAULT_PARSER.regexp[:HOST] }
validates :name, presence: true, uniqueness: true validates :name, presence: true, uniqueness: true
after_create :create_schema after_create :create_schema

View File

@@ -26,55 +26,55 @@ class User < ApplicationRecord
has_many :proposals, -> { with_hidden }, foreign_key: :author_id, inverse_of: :author has_many :proposals, -> { with_hidden }, foreign_key: :author_id, inverse_of: :author
has_many :activities has_many :activities
has_many :budget_investments, -> { with_hidden }, has_many :budget_investments, -> { with_hidden },
class_name: "Budget::Investment", class_name: "Budget::Investment",
foreign_key: :author_id, foreign_key: :author_id,
inverse_of: :author inverse_of: :author
has_many :comments, -> { with_hidden }, inverse_of: :user has_many :comments, -> { with_hidden }, inverse_of: :user
has_many :failed_census_calls has_many :failed_census_calls
has_many :notifications has_many :notifications
has_many :direct_messages_sent, has_many :direct_messages_sent,
class_name: "DirectMessage", class_name: "DirectMessage",
foreign_key: :sender_id, foreign_key: :sender_id,
inverse_of: :sender inverse_of: :sender
has_many :direct_messages_received, has_many :direct_messages_received,
class_name: "DirectMessage", class_name: "DirectMessage",
foreign_key: :receiver_id, foreign_key: :receiver_id,
inverse_of: :receiver inverse_of: :receiver
has_many :legislation_answers, class_name: "Legislation::Answer", dependent: :destroy, inverse_of: :user has_many :legislation_answers, class_name: "Legislation::Answer", dependent: :destroy, inverse_of: :user
has_many :follows has_many :follows
has_many :legislation_annotations, has_many :legislation_annotations,
class_name: "Legislation::Annotation", class_name: "Legislation::Annotation",
foreign_key: :author_id, foreign_key: :author_id,
inverse_of: :author inverse_of: :author
has_many :legislation_proposals, has_many :legislation_proposals,
class_name: "Legislation::Proposal", class_name: "Legislation::Proposal",
foreign_key: :author_id, foreign_key: :author_id,
inverse_of: :author inverse_of: :author
has_many :legislation_questions, has_many :legislation_questions,
class_name: "Legislation::Question", class_name: "Legislation::Question",
foreign_key: :author_id, foreign_key: :author_id,
inverse_of: :author inverse_of: :author
has_many :polls, foreign_key: :author_id, inverse_of: :author has_many :polls, foreign_key: :author_id, inverse_of: :author
has_many :poll_answers, has_many :poll_answers,
class_name: "Poll::Answer", class_name: "Poll::Answer",
foreign_key: :author_id, foreign_key: :author_id,
inverse_of: :author inverse_of: :author
has_many :poll_pair_answers, has_many :poll_pair_answers,
class_name: "Poll::PairAnswer", class_name: "Poll::PairAnswer",
foreign_key: :author_id, foreign_key: :author_id,
inverse_of: :author inverse_of: :author
has_many :poll_partial_results, has_many :poll_partial_results,
class_name: "Poll::PartialResult", class_name: "Poll::PartialResult",
foreign_key: :author_id, foreign_key: :author_id,
inverse_of: :author inverse_of: :author
has_many :poll_questions, has_many :poll_questions,
class_name: "Poll::Question", class_name: "Poll::Question",
foreign_key: :author_id, foreign_key: :author_id,
inverse_of: :author inverse_of: :author
has_many :poll_recounts, has_many :poll_recounts,
class_name: "Poll::Recount", class_name: "Poll::Recount",
foreign_key: :author_id, foreign_key: :author_id,
inverse_of: :author inverse_of: :author
has_many :related_contents, foreign_key: :author_id, inverse_of: :author, dependent: nil has_many :related_contents, foreign_key: :author_id, inverse_of: :author, dependent: nil
has_many :topics, foreign_key: :author_id, inverse_of: :author has_many :topics, foreign_key: :author_id, inverse_of: :author
belongs_to :geozone belongs_to :geozone

View File

@@ -55,8 +55,8 @@ class Verification::Management::Email
if document_number_mismatch? if document_number_mismatch?
errors.add(:email, errors.add(:email,
I18n.t("management.email_verifications.document_mismatch", I18n.t("management.email_verifications.document_mismatch",
document_type: ApplicationController.helpers.humanize_document_type(user.document_type), document_type: ApplicationController.helpers.humanize_document_type(user.document_type),
document_number: user.document_number)) document_number: user.document_number))
end end
end end

View File

@@ -1,6 +1,7 @@
<h2 class="inline-block"><%= t("admin.admin_notifications.index.section_title") %></h2> <h2 class="inline-block"><%= t("admin.admin_notifications.index.section_title") %></h2>
<%= link_to t("admin.admin_notifications.index.new_notification"), new_admin_admin_notification_path, <%= link_to t("admin.admin_notifications.index.new_notification"),
class: "button float-right" %> new_admin_admin_notification_path,
class: "button float-right" %>
<% if @admin_notifications.any? %> <% if @admin_notifications.any? %>
<table id="admin_notifications"> <table id="admin_notifications">

View File

@@ -17,12 +17,12 @@
<%= f.translatable_fields do |translations_form| %> <%= f.translatable_fields do |translations_form| %>
<div class="small-12 medium-6 column"> <div class="small-12 medium-6 column">
<%= translations_form.text_field :title, <%= translations_form.text_field :title,
data: { js_banner_title: "js_banner_title" } %> data: { js_banner_title: "js_banner_title" } %>
</div> </div>
<div class="small-12 column"> <div class="small-12 column">
<%= translations_form.text_field :description, <%= translations_form.text_field :description,
data: { js_banner_description: "js_banner_description" } %> data: { js_banner_description: "js_banner_description" } %>
</div> </div>
<% end %> <% end %>
</div> </div>

View File

@@ -1,5 +1,6 @@
<%= link_to t("admin.banners.index.create"), <%= link_to t("admin.banners.index.create"),
new_admin_banner_path, class: "button float-right" %> new_admin_banner_path,
class: "button float-right" %>
<h2 class="inline-block"><%= t("admin.banners.index.title") %></h2> <h2 class="inline-block"><%= t("admin.banners.index.title") %></h2>

View File

@@ -1,16 +1,16 @@
<% if params[:filter].present? && params[:advanced_filters].present? %> <% if params[:filter].present? && params[:advanced_filters].present? %>
<p class="inline-block"><%= sanitize(t("#{i18n_namespace}.filters.two_filters", <p class="inline-block"><%= sanitize(t("#{i18n_namespace}.filters.two_filters",
filter: t("#{i18n_namespace}.filters.#{params[:filter]}"), filter: t("#{i18n_namespace}.filters.#{params[:filter]}"),
advanced_filters: budget_investments_advanced_filters(params[:advanced_filters]))) %></p> advanced_filters: budget_investments_advanced_filters(params[:advanced_filters]))) %></p>
<% elsif params[:filter].present? %> <% elsif params[:filter].present? %>
<p class="inline-block"><%= sanitize(t("#{i18n_namespace}.filters.one_filter", <p class="inline-block"><%= sanitize(t("#{i18n_namespace}.filters.one_filter",
filter: t("#{i18n_namespace}.filters.#{params[:filter]}"))) %></p> filter: t("#{i18n_namespace}.filters.#{params[:filter]}"))) %></p>
<% elsif params[:advanced_filters].present? %> <% elsif params[:advanced_filters].present? %>
<p class="inline-block"><%= sanitize(t("#{i18n_namespace}.filters.one_filter", <p class="inline-block"><%= sanitize(t("#{i18n_namespace}.filters.one_filter",
filter: budget_investments_advanced_filters(params[:advanced_filters]))) %></p> filter: budget_investments_advanced_filters(params[:advanced_filters]))) %></p>
<% end %> <% end %>

View File

@@ -9,7 +9,8 @@
<% if @investments.any? %> <% if @investments.any? %>
<h3 class="inline-block"><%= page_entries_info @investments %></h3> <h3 class="inline-block"><%= page_entries_info @investments %></h3>
<%= render "admin/shared/columns_selector", <%= render "admin/shared/columns_selector",
cookie: "investments-columns", default: %w[id title supports admin valuator geozone feasibility price valuation_finished visible_to_valuators selected incompatible] %> cookie: "investments-columns",
default: %w[id title supports admin valuator geozone feasibility price valuation_finished visible_to_valuators selected incompatible] %>
<br> <br>
<%= render "filters_description", i18n_namespace: "admin.budget_investments.index" %> <%= render "filters_description", i18n_namespace: "admin.budget_investments.index" %>

View File

@@ -1,8 +1,8 @@
<div class="extra-info float-right"> <div class="extra-info float-right">
<%= t "admin.budget_investments.show.info", <%= t "admin.budget_investments.show.info",
budget_name: @budget.name, budget_name: @budget.name,
group_name: @investment.group.name, group_name: @investment.group.name,
id: @investment.id %> id: @investment.id %>
</div> </div>
<br> <br>

View File

@@ -18,13 +18,13 @@
<%= f.translatable_fields do |translations_form| %> <%= f.translatable_fields do |translations_form| %>
<div class="small-12 column"> <div class="small-12 column">
<%= translations_form.text_field :title, <%= translations_form.text_field :title,
maxlength: Budget::Investment.title_max_length %> maxlength: Budget::Investment.title_max_length %>
</div> </div>
<div class="small-12 column"> <div class="small-12 column">
<%= translations_form.text_area :description, <%= translations_form.text_area :description,
maxlength: Budget::Investment.description_max_length, maxlength: Budget::Investment.description_max_length,
class: "html-area" %> class: "html-area" %>
</div> </div>
<% end %> <% end %>
@@ -52,8 +52,8 @@
<div class="small-12 medium-6"> <div class="small-12 medium-6">
<%= f.select(:administrator_id, <%= f.select(:administrator_id,
@admins.map { |a| [a.description_or_name_and_email, a.id] }, @admins.map { |a| [a.description_or_name_and_email, a.id] },
{ include_blank: t("admin.budget_investments.edit.undefined") }) %> { include_blank: t("admin.budget_investments.edit.undefined") }) %>
</div> </div>
</div> </div>
@@ -65,10 +65,10 @@
<% end %> <% end %>
</div> </div>
<%= f.text_field :valuation_tag_list, <%= f.text_field :valuation_tag_list,
value: @investment.valuation_tag_list.sort.join(","), value: @investment.valuation_tag_list.sort.join(","),
label: false, label: false,
placeholder: t("admin.budget_investments.edit.tags_placeholder"), placeholder: t("admin.budget_investments.edit.tags_placeholder"),
class: "js-tag-list" %> class: "js-tag-list" %>
</div> </div>
<div class="small-12 column margin-top"> <div class="small-12 column margin-top">
@@ -96,19 +96,19 @@
<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>
<%= f.check_box :selected, <%= f.check_box :selected,
title: t("admin.budget_investments.edit.selection") %> title: t("admin.budget_investments.edit.selection") %>
</div> </div>
</div> </div>
<div class="small-12 column"> <div class="small-12 column">
<%= f.text_field :milestone_tag_list, <%= f.text_field :milestone_tag_list,
value: @investment.milestone_tag_list.sort.join(", ") %> value: @investment.milestone_tag_list.sort.join(", ") %>
</div> </div>
<div class="small-12 column margin-top"> <div class="small-12 column margin-top">

View File

@@ -5,8 +5,9 @@
<%= f.label :action_type %> <%= f.label :action_type %>
<% ::Dashboard::Action.action_types.keys.each do |action_type_value| %> <% ::Dashboard::Action.action_types.keys.each do |action_type_value| %>
<span class="margin-right"> <span class="margin-right">
<%= f.radio_button :action_type, action_type_value, <%= f.radio_button :action_type,
data: { toggle: "request_to_administrators short_description" } %> action_type_value,
data: { toggle: "request_to_administrators short_description" } %>
</span> </span>
<% end %> <% end %>
</div> </div>

View File

@@ -1,5 +1,6 @@
<%= link_to t("admin.dashboard.actions.index.create"), <%= link_to t("admin.dashboard.actions.index.create"),
new_admin_dashboard_action_path, class: "button success float-right" %> new_admin_dashboard_action_path,
class: "button success float-right" %>
<h2 class="inline-block"> <h2 class="inline-block">
<%= t("admin.dashboard.actions.index.title") %> <%= t("admin.dashboard.actions.index.title") %>

View File

@@ -25,7 +25,8 @@
</td> </td>
<td> <td>
<% unless task.executed_at? %> <% unless task.executed_at? %>
<%= render Admin::TableActionsComponent.new(task, <%= render Admin::TableActionsComponent.new(
task,
actions: [:edit], actions: [:edit],
edit_text: t("admin.dashboard.administrator_tasks.index.solve") edit_text: t("admin.dashboard.administrator_tasks.index.solve")
) %> ) %>

View File

@@ -13,7 +13,7 @@
<%= select_tag :users_segment, options_for_select(user_segments_options) %> <%= select_tag :users_segment, options_for_select(user_segments_options) %>
<%= submit_tag t("admin.emails_download.index.download_emails_button"), <%= submit_tag t("admin.emails_download.index.download_emails_button"),
class: "button", class: "button",
data: { disable_with: false } %> data: { disable_with: false } %>
<% end %> <% end %>
</div> </div>

View File

@@ -35,8 +35,8 @@
<div class="small-12 medium-8 column fullscreen-container"> <div class="small-12 medium-8 column fullscreen-container">
<div class="markdown-editor-header truncate"> <div class="markdown-editor-header truncate">
<%= sanitize(t("admin.legislation.draft_versions.form.title", <%= sanitize(t("admin.legislation.draft_versions.form.title",
draft_version_title: @draft_version.title, draft_version_title: @draft_version.title,
process_title: @process.title)) %> process_title: @process.title)) %>
</div> </div>
<div class="markdown-editor-buttons"> <div class="markdown-editor-buttons">

View File

@@ -29,7 +29,9 @@
<div class="js-add-fields-container"> <div class="js-add-fields-container">
<div class="small-12 medium-9 column"> <div class="small-12 medium-9 column">
<%= link_to_add_association t("admin.legislation.questions.form.add_option"), <%= link_to_add_association t("admin.legislation.questions.form.add_option"),
f, :question_options, class: "button hollow" %> f,
:question_options,
class: "button hollow" %>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -9,11 +9,11 @@
<h3><%= t("admin.local_census_records.imports.show.subtitle") %></h3> <h3><%= t("admin.local_census_records.imports.show.subtitle") %></h3>
<%= render "local_census_records", <%= render "local_census_records",
title: t("admin.local_census_records.imports.show.errored"), title: t("admin.local_census_records.imports.show.errored"),
id: "invalid-local-census-records", id: "invalid-local-census-records",
local_census_records: @import.invalid_records %> local_census_records: @import.invalid_records %>
<%= render "local_census_records", <%= render "local_census_records",
title: t("admin.local_census_records.imports.show.created"), title: t("admin.local_census_records.imports.show.created"),
id: "created-local-census-records", id: "created-local-census-records",
local_census_records: @import.created_records %> local_census_records: @import.created_records %>

View File

@@ -5,9 +5,9 @@
<div class="row"> <div class="row">
<div class="small-12 medium-6 margin-bottom column"> <div class="small-12 medium-6 margin-bottom column">
<%= f.select :status_id, <%= f.select :status_id,
@statuses.map { |s| [s.name, s.id] }, @statuses.map { |s| [s.name, s.id] },
{ include_blank: @statuses.any? ? "" : t("admin.milestones.form.no_statuses_defined") }, { include_blank: @statuses.any? ? "" : t("admin.milestones.form.no_statuses_defined") },
{ disabled: @statuses.blank? } %> { disabled: @statuses.blank? } %>
<%= link_to t("admin.milestones.form.admin_statuses"), <%= link_to t("admin.milestones.form.admin_statuses"),
admin_milestone_statuses_path %> admin_milestone_statuses_path %>
</div> </div>

View File

@@ -47,9 +47,9 @@
<% if milestone.documents.present? %> <% if milestone.documents.present? %>
<% milestone.documents.each do |document| %> <% milestone.documents.each do |document| %>
<%= link_to document.title, <%= link_to document.title,
document.attachment, document.attachment,
target: "_blank", target: "_blank",
rel: "nofollow" %><br> rel: "nofollow" %><br>
<% end %> <% end %>
<% end %> <% end %>
</td> </td>

View File

@@ -1,6 +1,7 @@
<h2 class="inline-block"><%= t("admin.newsletters.index.title") %></h2> <h2 class="inline-block"><%= t("admin.newsletters.index.title") %></h2>
<%= link_to t("admin.newsletters.index.new_newsletter"), new_admin_newsletter_path, <%= link_to t("admin.newsletters.index.new_newsletter"),
class: "button float-right" %> new_admin_newsletter_path,
class: "button float-right" %>
<% if @newsletters.any? %> <% if @newsletters.any? %>
<table id="newsletters"> <table id="newsletters">

View File

@@ -3,8 +3,8 @@
<h2><%= t("admin.newsletters.new.title") %></h2> <h2><%= t("admin.newsletters.new.title") %></h2>
<p> <p>
<%= sanitize(t("admin.newsletters.new.header_footer_help_text", <%= sanitize(t("admin.newsletters.new.header_footer_help_text",
link: link_to(t("admin.newsletters.new.image_link"), link: link_to(t("admin.newsletters.new.image_link"),
admin_site_customization_images_path))) %> admin_site_customization_images_path))) %>
</p> </p>
<%= render "form" %> <%= render "form" %>

View File

@@ -12,7 +12,8 @@
</td> </td>
<td> <td>
<% unless @poll.expired? %> <% unless @poll.expired? %>
<%= render Admin::TableActionsComponent.new(booth_assignment, <%= render Admin::TableActionsComponent.new(
booth_assignment,
actions: [:destroy], actions: [:destroy],
destroy_text: t("admin.booth_assignments.manage.actions.unassign"), destroy_text: t("admin.booth_assignments.manage.actions.unassign"),
destroy_confirmation: (booth_assignment.shifts? ? t("admin.poll_booth_assignments.alert.shifts") : ""), destroy_confirmation: (booth_assignment.shifts? ? t("admin.poll_booth_assignments.alert.shifts") : ""),

View File

@@ -7,7 +7,8 @@
<td class="text-center"><%= poll.sdg_target_list %></td> <td class="text-center"><%= poll.sdg_target_list %></td>
<% end %> <% end %>
<td> <td>
<%= render Admin::TableActionsComponent.new(poll, <%= render Admin::TableActionsComponent.new(
poll,
destroy_confirmation: t("admin.polls.destroy.alert") destroy_confirmation: t("admin.polls.destroy.alert")
) do |actions| %> ) do |actions| %>
<%= actions.action(:configure) %> <%= actions.action(:configure) %>

View File

@@ -5,7 +5,7 @@
<%= render "shared/errors", resource: @answer %> <%= render "shared/errors", resource: @answer %>
<%= f.hidden_field :given_order, <%= f.hidden_field :given_order,
value: @answer.persisted? ? @answer.given_order : @answer.class.last_position(@answer.question_id || @question.id) + 1 %> value: @answer.persisted? ? @answer.given_order : @answer.class.last_position(@answer.question_id || @question.id) + 1 %>
<div class="row"> <div class="row">
<%= f.translatable_fields do |translations_form| %> <%= f.translatable_fields do |translations_form| %>

View File

@@ -14,29 +14,29 @@
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">
<%= f.select :task, <%= f.select :task,
Poll::Shift.tasks.map { |k, v| [t("admin.poll_shifts.#{k}"), k] }, Poll::Shift.tasks.map { |k, v| [t("admin.poll_shifts.#{k}"), k] },
{ prompt: t("admin.poll_shifts.new.select_task") }, { prompt: t("admin.poll_shifts.new.select_task") },
class: "js-poll-shifts" %> class: "js-poll-shifts" %>
</div> </div>
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">
<label><%= t("admin.poll_shifts.new.date") %></label> <label><%= t("admin.poll_shifts.new.date") %></label>
<%= select "shift[date]", "vote_collection_date", <%= select "shift[date]", "vote_collection_date",
options_for_select(shift_vote_collection_dates(@booth, @voting_polls)), options_for_select(shift_vote_collection_dates(@booth, @voting_polls)),
{ prompt: @voting_polls.present? ? t("admin.poll_shifts.new.select_date") : t("admin.poll_shifts.new.no_voting_days") }, { prompt: @voting_polls.present? ? t("admin.poll_shifts.new.select_date") : t("admin.poll_shifts.new.no_voting_days") },
class: "js-shift-vote-collection-dates" %> class: "js-shift-vote-collection-dates" %>
<%= select "shift[date]", "recount_scrutiny_date", <%= select "shift[date]", "recount_scrutiny_date",
options_for_select(shift_recount_scrutiny_dates(@booth, @recount_polls)), options_for_select(shift_recount_scrutiny_dates(@booth, @recount_polls)),
{ prompt: t("admin.poll_shifts.new.select_date") }, { prompt: t("admin.poll_shifts.new.select_date") },
class: "js-shift-recount-scrutiny-dates", class: "js-shift-recount-scrutiny-dates",
hidden: "hidden" %> hidden: "hidden" %>
</div> </div>
<%= f.hidden_field :booth_id, value: @booth.id %> <%= f.hidden_field :booth_id, value: @booth.id %>
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">
<%= f.submit t("admin.poll_shifts.new.add_shift"), <%= f.submit t("admin.poll_shifts.new.add_shift"),
class: "button expanded margin-top" %> class: "button expanded margin-top" %>
</div> </div>
</fieldset> </fieldset>
<% end %> <% end %>

View File

@@ -3,9 +3,9 @@
method: :get, remote: true do |f| %> method: :get, remote: true do |f| %>
<div class="input-group"> <div class="input-group">
<%= text_field_tag :search, <%= text_field_tag :search,
@search, @search,
placeholder: t("admin.poll_shifts.new.search_officer_placeholder"), placeholder: t("admin.poll_shifts.new.search_officer_placeholder"),
id: "search-officers" %> id: "search-officers" %>
<div class="input-group-button"> <div class="input-group-button">
<%= submit_tag t("admin.poll_shifts.new.search_officer_button"), <%= submit_tag t("admin.poll_shifts.new.search_officer_button"),
class: "button" %> class: "button" %>

View File

@@ -17,7 +17,8 @@
<td><%= shift.officer_email %></td> <td><%= shift.officer_email %></td>
<td><%= t("admin.poll_shifts.#{shift.task}") %></td> <td><%= t("admin.poll_shifts.#{shift.task}") %></td>
<td> <td>
<%= render Admin::TableActionsComponent.new(shift, <%= render Admin::TableActionsComponent.new(
shift,
actions: [:destroy], actions: [:destroy],
destroy_text: t("admin.poll_shifts.new.remove_shift") destroy_text: t("admin.poll_shifts.new.remove_shift")
) %> ) %>

View File

@@ -6,8 +6,8 @@
<% Setting.mime_types[group].each do |content_type, mime_type_value| %> <% Setting.mime_types[group].each do |content_type, mime_type_value| %>
<span class="content-type"> <span class="content-type">
<%= check_box_tag content_type, <%= check_box_tag content_type,
setting.value.split.include?(mime_type_value), setting.value.split.include?(mime_type_value),
setting.value.split.include?(mime_type_value) %> setting.value.split.include?(mime_type_value) %>
<%= label_tag content_type, content_type.upcase %> <%= label_tag content_type, content_type.upcase %>
</span> </span>
<% end %> <% end %>

View File

@@ -23,7 +23,7 @@
<div class="small-12 medium-6 large-4 margin-top"> <div class="small-12 medium-6 large-4 margin-top">
<%= submit_tag t("admin.settings.index.map.form.submit"), <%= submit_tag t("admin.settings.index.map.form.submit"),
class: "button hollow expanded" %> class: "button hollow expanded" %>
</div> </div>
<% end %> <% end %>

View File

@@ -2,10 +2,10 @@
<%= f.hidden_field :tab, id: dom_id(setting, :tab), value: tab if defined?(tab) %> <%= f.hidden_field :tab, id: dom_id(setting, :tab), value: tab if defined?(tab) %>
<div class="small-12 medium-6 large-8 column"> <div class="small-12 medium-6 large-8 column">
<%= f.text_area :value, <%= f.text_area :value,
label: false, label: false,
id: dom_id(setting, :value), id: dom_id(setting, :value),
"aria-label": strip_tags(t("settings.#{setting.key}")), "aria-label": strip_tags(t("settings.#{setting.key}")),
"aria-describedby": dom_id(setting, :description) %> "aria-describedby": dom_id(setting, :description) %>
</div> </div>
<div class="small-12 medium-6 large-4 column"> <div class="small-12 medium-6 large-4 column">
<%= f.submit(t("admin.settings.index.update_setting"), class: "button hollow expanded") %> <%= f.submit(t("admin.settings.index.update_setting"), class: "button hollow expanded") %>

View File

@@ -5,9 +5,9 @@
</div> </div>
<div class="small-12 medium-6 column"> <div class="small-12 medium-6 column">
<%= select_tag :heading_id, <%= select_tag :heading_id,
options_for_select(budget_heading_select_options(@budget), options_for_select(budget_heading_select_options(@budget),
params[:heading_id]), params[:heading_id]),
include_blank: true %> include_blank: true %>
</div> </div>
</div> </div>
<div class="row"> <div class="row">

View File

@@ -4,7 +4,7 @@
<%= form_for [:admin, @signature_sheet] do |f| %> <%= form_for [:admin, @signature_sheet] do |f| %>
<%= render "shared/errors", <%= render "shared/errors",
resource: @signature_sheet %> resource: @signature_sheet %>
<div class="small-12 medium-6 large-4"> <div class="small-12 medium-6 large-4">
<%= f.text_field :title %> <%= f.text_field :title %>

View File

@@ -21,12 +21,12 @@
<div id="verified_signatures" class="callout success"> <div id="verified_signatures" class="callout success">
<strong> <strong>
<%= t("admin.signature_sheets.show.verified", <%= t("admin.signature_sheets.show.verified",
count: @signature_sheet.signatures.verified.count) %> count: @signature_sheet.signatures.verified.count) %>
</strong> </strong>
<br /> <br />
<strong> <strong>
<%= t("admin.signature_sheets.show.voted", <%= t("admin.signature_sheets.show.voted",
count: @voted_signatures) %> count: @voted_signatures) %>
</strong> </strong>
</div> </div>
@@ -35,7 +35,7 @@
<p> <p>
<strong> <strong>
<%= t("admin.signature_sheets.show.unverified", <%= t("admin.signature_sheets.show.unverified",
count: @signature_sheet.signatures.unverified.count) %> count: @signature_sheet.signatures.unverified.count) %>
<%= t("admin.signature_sheets.show.unverified_error") %> <%= t("admin.signature_sheets.show.unverified_error") %>
</strong> </strong>
</p> </p>

View File

@@ -1,4 +1,4 @@
<%= render "shared/common_globalize_locales", <%= render "shared/common_globalize_locales",
resource: nil, resource: nil,
display_style: lambda { |locale| site_customization_display_translation_style(locale) }, display_style: lambda { |locale| site_customization_display_translation_style(locale) },
manage_languages: defined?(manage_languages) ? manage_languages : true %> manage_languages: defined?(manage_languages) ? manage_languages : true %>

View File

@@ -13,9 +13,9 @@
<%= link_to t("admin.stats.show.proposal_notifications"), <%= link_to t("admin.stats.show.proposal_notifications"),
proposal_notifications_admin_stats_path, class: "button hollow" %> proposal_notifications_admin_stats_path, class: "button hollow" %>
<%= link_to t("admin.stats.show.incomplete_verifications"), <%= link_to t("admin.stats.show.incomplete_verifications"),
admin_verifications_path, class: "button hollow" %> admin_verifications_path, class: "button hollow" %>
<%= link_to t("admin.stats.show.sdg"), <%= link_to t("admin.stats.show.sdg"),
sdg_admin_stats_path, class: "button hollow" if feature?(:sdg) %> sdg_admin_stats_path, class: "button hollow" if feature?(:sdg) %>
</div> </div>
<div class="clear"></div> <div class="clear"></div>

View File

@@ -31,10 +31,10 @@
</div> </div>
<%= link_to t("admin.system_emails.preview_pending.moderate_pending"), <%= link_to t("admin.system_emails.preview_pending.moderate_pending"),
admin_system_email_moderate_pending_path(system_email_id: "proposal_notification_digest", admin_system_email_moderate_pending_path(system_email_id: "proposal_notification_digest",
id: preview.id), id: preview.id),
method: :put, method: :put,
class: "button hollow float-right" %> class: "button hollow float-right" %>
</div> </div>
<hr> <hr>
<% end %> <% end %>

View File

@@ -22,11 +22,11 @@
<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 %>">

View File

@@ -2,9 +2,9 @@
<% 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

@@ -37,12 +37,12 @@
<div class="small-12 medium-9"> <div class="small-12 medium-9">
<div class="callout warning margin-top"> <div class="callout warning margin-top">
<%= sanitize(t("budgets.investments.header.different_heading_assigned", <%= sanitize(t("budgets.investments.header.different_heading_assigned",
heading_link: heading_link(@assigned_heading, @budget))) %> heading_link: heading_link(@assigned_heading, @budget))) %>
<br> <br>
<small> <small>
<%= sanitize(t("budgets.investments.header.change_ballot", <%= sanitize(t("budgets.investments.header.change_ballot",
check_ballot: link_to(t("budgets.investments.header.check_ballot_link"), check_ballot: link_to(t("budgets.investments.header.check_ballot_link"),
budget_ballot_path(@budget)))) %> budget_ballot_path(@budget)))) %>
</small> </small>
</div> </div>
</div> </div>

View File

@@ -42,7 +42,7 @@
<div class="supports"> <div class="supports">
<span class="total-supports no-button"> <span class="total-supports no-button">
<%= t("budgets.investments.investment.supports", <%= t("budgets.investments.investment.supports",
count: investment.total_votes) %> count: investment.total_votes) %>
</span> </span>
</div> </div>
</div> </div>
@@ -50,9 +50,9 @@
<div id="<%= dom_id(investment) %>_ballot" <div id="<%= dom_id(investment) %>_ballot"
class="small-12 medium-3 column text-center"> class="small-12 medium-3 column text-center">
<%= render "/budgets/investments/ballot", <%= render "/budgets/investments/ballot",
investment: investment, investment: investment,
investment_ids: investment_ids, investment_ids: investment_ids,
ballot: ballot %> ballot: ballot %>
</div> </div>
<% elsif investment.should_show_price? %> <% elsif investment.should_show_price? %>
<div id="<%= dom_id(investment) %>_price" <div id="<%= dom_id(investment) %>_price"

View File

@@ -46,8 +46,8 @@
<% if feature?(:allow_attached_documents) %> <% if feature?(:allow_attached_documents) %>
<%= render "documents/documents", <%= render "documents/documents",
documents: investment.documents, documents: investment.documents,
max_documents_allowed: Budget::Investment.max_documents_allowed %> max_documents_allowed: Budget::Investment.max_documents_allowed %>
<% end %> <% end %>
<%= render "shared/tags", taggable: investment %> <%= render "shared/tags", taggable: investment %>

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) %>">
@@ -39,7 +39,7 @@
<span class="total-supports"> <span class="total-supports">
<strong> <strong>
<%= t("budgets.investments.investment.supports", <%= t("budgets.investments.investment.supports",
count: investment.total_votes) %> count: investment.total_votes) %>
</strong> </strong>
</span> </span>
</div> </div>
@@ -49,9 +49,9 @@
<div class="text-center"> <div class="text-center">
<div id="<%= dom_id(investment) %>_ballot"> <div id="<%= dom_id(investment) %>_ballot">
<%= render "ballot", <%= render "ballot",
investment: investment, investment: investment,
investment_ids: investment_ids, investment_ids: investment_ids,
ballot: ballot %> ballot: ballot %>
</div> </div>
</div> </div>
<% end %> <% end %>
@@ -93,22 +93,23 @@
<% if investment.should_show_price_explanation? %> <% if investment.should_show_price_explanation? %>
<div class="text-center" data-magellan> <div class="text-center" data-magellan>
<%= link_to t("budgets.investments.show.see_price_explanation"), <%= link_to t("budgets.investments.show.see_price_explanation"),
"#price_explanation", class: "small" %> "#price_explanation",
class: "small" %>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
<%= render "shared/social_share", <%= render "shared/social_share",
share_title: t("budgets.investments.show.share"), share_title: t("budgets.investments.show.share"),
title: investment.title, title: investment.title,
image_url: image_absolute_url(investment.image, :thumb), image_url: image_absolute_url(investment.image, :thumb),
url: budget_investment_url(investment.budget, investment), url: budget_investment_url(investment.budget, investment),
description: t("budgets.investments.share.message", description: t("budgets.investments.share.message",
title: investment.title, title: investment.title,
handle: setting["org_name"]), handle: setting["org_name"]),
mobile: t("budgets.investments.share.message", mobile: t("budgets.investments.share.message",
title: investment.title, title: investment.title,
handle: setting["twitter_handle"]) %> handle: setting["twitter_handle"]) %>
<% if current_user %> <% if current_user %>
<div class="sidebar-divider"></div> <div class="sidebar-divider"></div>

View File

@@ -3,11 +3,12 @@
<% if can?(:create, Budget::Investment.new(budget: @budget)) %> <% if can?(:create, Budget::Investment.new(budget: @budget)) %>
<% if current_user && current_user.level_two_or_three_verified? %> <% if current_user && current_user.level_two_or_three_verified? %>
<%= link_to t("budgets.investments.index.sidebar.create"), <%= link_to t("budgets.investments.index.sidebar.create"),
new_budget_investment_path(budget_id: @budget.id), class: "button budget expanded" %> new_budget_investment_path(budget_id: @budget.id),
class: "button budget expanded" %>
<% else %> <% else %>
<div class="callout warning"> <div class="callout warning">
<%= sanitize(t("budgets.investments.index.sidebar.verified_only", <%= sanitize(t("budgets.investments.index.sidebar.verified_only",
verify: link_to_verify_account)) %> verify: link_to_verify_account)) %>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -7,9 +7,9 @@
<% content_for :canonical do %> <% content_for :canonical do %>
<% if @heading.present? %> <% if @heading.present? %>
<%= render "shared/canonical", <%= render "shared/canonical",
href: budget_investments_url(@budget, href: budget_investments_url(@budget,
heading_id: @heading.id, heading_id: @heading.id,
filter: @current_filter) %> filter: @current_filter) %>
<% else %> <% else %>
<%= render "shared/canonical", href: budget_investments_url(@budget) %> <%= render "shared/canonical", href: budget_investments_url(@budget) %>
<% end %> <% end %>

View File

@@ -4,9 +4,9 @@
<% end %> <% end %>
<%= render "/budgets/investments/investment_show", <%= render "/budgets/investments/investment_show",
investment: @investment, investment: @investment,
investment_ids: @investment_ids, investment_ids: @investment_ids,
ballot: @ballot %> ballot: @ballot %>
<div class="row"> <div class="row">
<div class="small-12 column"> <div class="small-12 column">

View File

@@ -2,9 +2,9 @@
<% 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

@@ -3,9 +3,9 @@
<% end %> <% 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_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">

View File

@@ -4,9 +4,9 @@
<div id="js-comment-form-<%= css_id %>" class="comment-form"> <div id="js-comment-form-<%= css_id %>" class="comment-form">
<%= form_for Comment.new, remote: true, html: { id: "new_comment_#{css_id}" } do |f| %> <%= form_for Comment.new, remote: true, html: { id: "new_comment_#{css_id}" } do |f| %>
<%= f.text_area :body, <%= f.text_area :body,
id: "comment-body-#{css_id}", id: "comment-body-#{css_id}",
maxlength: Comment.body_max_length, maxlength: Comment.body_max_length,
label: leave_comment_text(commentable) %> label: leave_comment_text(commentable) %>
<%= f.hidden_field :commentable_type, value: commentable.class.name, id: "comment_commentable_type_#{css_id}" %> <%= f.hidden_field :commentable_type, value: commentable.class.name, id: "comment_commentable_type_#{css_id}" %>
<%= f.hidden_field :commentable_id, value: commentable.id, id: "comment_commentable_id_#{css_id}" %> <%= f.hidden_field :commentable_id, value: commentable.id, id: "comment_commentable_id_#{css_id}" %>
@@ -18,15 +18,15 @@
<% if can? :comment_as_moderator, commentable %> <% if can? :comment_as_moderator, commentable %>
<div class="float-right"> <div class="float-right">
<%= f.check_box :as_moderator, <%= f.check_box :as_moderator,
label: t("comments.form.comment_as_moderator"), label: t("comments.form.comment_as_moderator"),
id: "comment-as-moderator-#{css_id}" %> id: "comment-as-moderator-#{css_id}" %>
</div> </div>
<% end %> <% end %>
<% if can? :comment_as_administrator, commentable %> <% if can? :comment_as_administrator, commentable %>
<div class="float-right"> <div class="float-right">
<%= f.check_box :as_administrator, <%= f.check_box :as_administrator,
label: t("comments.form.comment_as_admin"), label: t("comments.form.comment_as_admin"),
id: "comment-as-administrator-#{css_id}" %> id: "comment-as-administrator-#{css_id}" %>
</div> </div>
<% end %> <% end %>

View File

@@ -5,6 +5,7 @@
<p class="topic-info"> <p class="topic-info">
<%= t("communities.poll.take_part", <%= t("communities.poll.take_part",
from: l(poll.starts_at.to_date), to: l(poll.ends_at.to_date)) %> from: l(poll.starts_at.to_date),
to: l(poll.ends_at.to_date)) %>
</p> </p>
</div> </div>

View File

@@ -2,8 +2,8 @@
<div class="goal-supports"> <div class="goal-supports">
<strong> <strong>
<%= t("dashboard.goal.target_supports", <%= t("dashboard.goal.target_supports",
count: number_with_precision(goal.required_supports, count: number_with_precision(goal.required_supports,
delimiter: ".", precision: 0)) %> delimiter: ".", precision: 0)) %>
</strong> </strong>
</div> </div>

View File

@@ -8,8 +8,8 @@
<div class="small-12 column small-centered margin-top"> <div class="small-12 column small-centered margin-top">
<%= link_to t("dashboard.resource.view_resource"), <%= link_to t("dashboard.resource.view_resource"),
new_proposal_dashboard_mailing_path(proposal.to_param), new_proposal_dashboard_mailing_path(proposal.to_param),
class: "button expanded" %> class: "button expanded" %>
</div> </div>
</div> </div>
</div> </div>

Some files were not shown because too many files have changed in this diff Show More