Add rubocop spacing rules

We were following these rules in most places; we just didn't define them
anywhere.
This commit is contained in:
Javi Martín
2019-06-22 18:11:23 +02:00
parent c7f64f8493
commit f9ed186909
264 changed files with 652 additions and 577 deletions

View File

@@ -32,14 +32,14 @@
<div class="small-12 medium-6 column">
<%= translations_form.text_field :title,
placeholder: t("admin.banners.banner.title"),
data: {js_banner_title: "js_banner_title"},
data: { js_banner_title: "js_banner_title" },
label: t("admin.banners.banner.title") %>
</div>
<div class="small-12 column">
<%= translations_form.text_field :description,
placeholder: t("admin.banners.banner.description"),
data: {js_banner_description: "js_banner_description"},
data: { js_banner_description: "js_banner_description" },
label: t("admin.banners.banner.description") %>
</div>
<% end %>

View File

@@ -30,8 +30,8 @@
label: false,
maxlength: 8,
placeholder: t("admin.budget_headings.form.population"),
data: {toggle_focus: "population-info"},
aria: {describedby: "budgets-population-help-text"} %>
data: { toggle_focus: "population-info" },
aria: { describedby: "budgets-population-help-text" } %>
<%= f.text_field :latitude,
label: t("admin.budget_headings.form.latitude"),

View File

@@ -2,7 +2,7 @@
<%= form_tag(admin_budget_budget_investments_path(budget: @budget), method: :get, enforce_utf8: false) do %>
<div class="small-12 column">
<%= link_to "#advanced_filters_content",
data: {toggle: "advanced_filters"},
data: { toggle: "advanced_filters" },
class: "advanced-filters float-right clear" do %>
<%= t("admin.budget_investments.index.advanced_filters") %>
<% end %>
@@ -36,32 +36,32 @@
<%= select_tag :administrator_id,
options_for_select(admin_select_options, params[:administrator_id]),
{ prompt: t("admin.budget_investments.index.administrator_filter_all"),
label: false} %>
label: false } %>
</div>
<div class="small-12 medium-3 column">
<%= select_tag :valuator_or_group_id,
options_for_select(valuator_or_group_select_options, params[:valuator_or_group_id]),
{ prompt: t("admin.budget_investments.index.valuator_filter_all"),
label: false} %>
label: false } %>
</div>
<div class="small-12 medium-3 column">
<%= select_tag :heading_id,
options_for_select(budget_heading_select_options(@budget), params[:heading_id]),
{ prompt: t("admin.budget_investments.index.heading_filter_all"),
label: false} %>
label: false } %>
</div>
<div class="small-12 medium-3 column">
<%= select_tag :tag_name,
options_for_select(investment_tags_select_options(@budget), params[:tag_name]),
{ prompt: t("admin.budget_investments.index.tags_filter_all"),
label: false} %>
label: false } %>
</div>
<div class="small-12 medium-3 column">
<%= select_tag :milestone_tag_name,
options_for_select(investment_milestone_tags_select_options(@budget), params[:milestone_tag_name]),
{ prompt: t("admin.budget_investments.index.milestone_tags_filter_all"),
label: false} %>
label: false } %>
</div>
<div class="small-12 medium-6 column">

View File

@@ -47,7 +47,7 @@
</td>
<td class="small text-center" data-field="valuation_finished">
<%= investment.valuation_finished? ? t("shared.yes"): t("shared.no") %>
<%= investment.valuation_finished? ? t("shared.yes") : t("shared.no") %>
</td>
<td class="small text-center" data-field="visible_to_valuators">
@@ -94,6 +94,6 @@
<% if params[:advanced_filters]&.include?("selected") %>
<td class="small text-center" data-field="incompatible">
<%= investment.incompatible? ? t("shared.yes"): t("shared.no") %>
<%= investment.incompatible? ? t("shared.yes") : t("shared.no") %>
</td>
<% end %>

View File

@@ -53,7 +53,7 @@
<div class="small-12 medium-6">
<%= f.select(:administrator_id,
@admins.collect{ |a| [a.description_or_name_and_email, a.id ] },
@admins.collect { |a| [a.description_or_name_and_email, a.id] },
{ include_blank: t("admin.budget_investments.edit.undefined") }) %>
</div>
</div>

View File

@@ -1,5 +1,5 @@
<%= link_to admin_budget_budget_investments_path(Budget::Investment.filter_params(params).to_h),
class: "back", data: {no_turbolink: true} do %>
class: "back", data: { no_turbolink: true } do %>
<span class="icon-angle-left"></span><%= t("shared.back") %>
<% end %>
@@ -62,7 +62,7 @@
<p>
<%= link_to t("admin.budget_investments.show.edit_classification"),
edit_admin_budget_budget_investment_path(@budget, @investment,
{anchor: "classification"}.merge(Budget::Investment.filter_params(params).to_h)) unless @budget.finished? %>
{ anchor: "classification" }.merge(Budget::Investment.filter_params(params).to_h)) unless @budget.finished? %>
</p>
<hr>

View File

@@ -6,7 +6,7 @@
<% ::Dashboard::Action.action_types.keys.each do |action_type_value| %>
<span class="margin-right">
<%= f.radio_button :action_type, action_type_value, label: false,
data: {toggle: "request_to_administrators short_description"} %>
data: { toggle: "request_to_administrators short_description" } %>
<%= f.label "action_type_#{action_type_value}", t("admin.dashboard.actions.action_type.#{action_type_value}") %>
</span>
<% end %>

View File

@@ -36,4 +36,4 @@
<% end %>
</table>
<%= paginate [@debates, @comments].sort_by {|x| x.size}.last %>
<%= paginate [@debates, @comments].sort_by { |x| x.size }.last %>

View File

@@ -6,6 +6,6 @@
<%= f.submit(t("admin.settings.index.features.#{setting.enabled? ? "disable" : "enable"}"),
class: "button #{setting.enabled? ? "hollow alert" : "success"}",
data: {confirm: t("admin.actions.confirm")}) %>
data: { confirm: t("admin.actions.confirm") }) %>
<% end %>
</div>

View File

@@ -1,6 +1,6 @@
<%= render "shared/globalize_locales", resource: @draft_version %>
<%= translatable_form_for [:admin, @process, @draft_version], url: url, html: {data: {watch_changes: true}} do |f| %>
<%= translatable_form_for [:admin, @process, @draft_version], url: url, html: { data: { watch_changes: true }} do |f| %>
<% if @draft_version.errors.any? %>
<div id="error_explanation" data-alert class="callout alert" data-closable>
@@ -38,7 +38,7 @@
<div class="markdown-editor-header truncate">
<%= t("admin.legislation.draft_versions.form.title_html",
draft_version_title: @draft_version.title,
process_title: @process.title ) %>
process_title: @process.title) %>
</div>
<div class="markdown-editor-buttons">

View File

@@ -3,7 +3,7 @@
display_style: lambda { |locale| enable_translation_style(@process, locale) },
manage_languages: false %>
<%= translatable_form_for [:admin, @process], url: url, html: {data: {watch_changes: true}} do |f| %>
<%= translatable_form_for [:admin, @process], url: url, html: { data: { watch_changes: true } } do |f| %>
<%= render "shared/errors", resource: @process %>
<div class="row">

View File

@@ -1,6 +1,6 @@
<%= render "shared/globalize_locales", resource: @process %>
<%= translatable_form_for [:admin, @process], html: {data: {watch_changes: true}} do |f| %>
<%= translatable_form_for [:admin, @process], html: { data: { watch_changes: true } } do |f| %>
<% if @process.errors.any? %>

View File

@@ -1,4 +1,4 @@
<%= form_for [:admin, @process], html: {data: {watch_changes: true}} do |f| %>
<%= form_for [:admin, @process], html: { data: { watch_changes: true } } do |f| %>
<% if @process.errors.any? %>
@@ -22,7 +22,7 @@
label: false,
placeholder: t("admin.legislation.proposals.form.custom_categories_placeholder"),
class: "js-tag-list",
aria: {describedby: "tag-list-help-text"} %>
aria: { describedby: "tag-list-help-text" } %>
</div>
<div class="small-12 medium-3 column clear end">

View File

@@ -1,6 +1,6 @@
<%= render "shared/globalize_locales", resource: @question %>
<%= translatable_form_for [:admin, @process, @question], url: url, html: {data: {watch_changes: true}} do |f| %>
<%= translatable_form_for [:admin, @process, @question], url: url, html: { data: { watch_changes: true } } do |f| %>
<% if @question.errors.any? %>
<div class="small-12 medium-9 column">

View File

@@ -17,7 +17,7 @@
remote: true,
title: t("admin.booth_assignments.manage.actions.unassign"),
class: "button hollow alert expanded",
data: (booth_assignment.shifts? ? {confirm: "#{t("admin.poll_booth_assignments.alert.shifts")}"} : nil) if !@poll.expired? %>
data: (booth_assignment.shifts? ? { confirm: "#{t("admin.poll_booth_assignments.alert.shifts")}" } : nil) if !@poll.expired? %>
</td>
<% else %>
<td>

View File

@@ -21,7 +21,7 @@
method: :delete,
class: "button hollow alert expanded" %>
<% else %>
<%= link_to t("admin.poll_officers.officer.add"),{ controller: "admin/poll/officers", action: :create, user_id: officer.user_id },
<%= link_to t("admin.poll_officers.officer.add"), { controller: "admin/poll/officers", action: :create, user_id: officer.user_id },
method: :post,
class: "button success expanded" %>
<% end %>

View File

@@ -37,7 +37,7 @@
<%= fields_for :votation_type do |votation_f| %>
<div class="small-12 medium-6">
<%= votation_f.select :enum_type,
options_for_select(VotationType.enum_types.map {|k, v| [t(k, scope: :enum_type), v]},
options_for_select(VotationType.enum_types.map { |k, v| [t(k, scope: :enum_type), v] },
params.dig(:votation_type, :enum_type)), default: 0,
disabled: @question.persisted?, label: t("enum_type.title") %>
</div>
@@ -53,8 +53,8 @@
</div>
<div class="small-12 medium-6 js-prioritization_type hidden">
<%= votation_f.select :prioritization_type,
options_for_select(VotationType.prioritization_types.map {|k, v| [t(k, scope: :prioritization_type), v]},
params.dig(:votation_type, :prioritization_type) ), default: 0,
options_for_select(VotationType.prioritization_types.map { |k, v| [t(k, scope: :prioritization_type), v] },
params.dig(:votation_type, :prioritization_type)), default: 0,
disabled: @question.persisted?, label: t("prioritization_type.title") %>
</div>
<div class="small-12 medium-6 js-max_group_votes hidden">

View File

@@ -7,7 +7,7 @@
</tr>
</thead>
<tbody>
<% @poll.booth_assignments.sort_by {|ba| ba.booth.name }.each do |booth_assignment| %>
<% @poll.booth_assignments.sort_by { |ba| ba.booth.name }.each do |booth_assignment| %>
<tr id="booth_assignment_<%= booth_assignment.id %>_result">
<td><%= booth_assignment.booth.name %></td>
<td class="text-center">

View File

@@ -15,7 +15,7 @@
<div class="small-12 medium-3 column">
<label><%= t("admin.poll_shifts.new.task") %></label>
<%= 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"),
label: false },
class: "js-poll-shifts" %>

View File

@@ -1,7 +1,7 @@
<%= form_for(feature, url: admin_setting_path(feature), html: { id: "edit_#{dom_id(feature)}"}) do |f| %>
<%= form_for(feature, url: admin_setting_path(feature), html: { id: "edit_#{dom_id(feature)}" }) do |f| %>
<%= f.hidden_field :tab, value: tab if defined?(tab) %>
<%= f.hidden_field :value, id: dom_id(feature), value: (feature.enabled? ? "" : "active") %>
<%= f.submit(t("admin.settings.index.features.#{feature.enabled? ? "disable" : "enable"}"),
class: "button expanded #{feature.enabled? ? "hollow alert" : "success"}",
data: {confirm: t("admin.actions.confirm")}) %>
data: { confirm: t("admin.actions.confirm") }) %>
<% end %>

View File

@@ -1,4 +1,4 @@
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}" }) do |f| %>
<%= f.hidden_field :tab, value: tab if defined?(tab) %>
<div class="small-12 medium-6 large-8 column">
<%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %>

View File

@@ -17,7 +17,7 @@
<%= f.label :required_fields_to_verify %>
<p class="help-text" id="required-fields-to-verify-help-text"><%= required_fields_to_verify_text_help %></p>
<p class="help-text"> <%= example_text_help %></p>
<%= f.text_area :required_fields_to_verify, rows: "6", label: false, aria: {describedby: "required-fields-to-verify-help-text"} %>
<%= f.text_area :required_fields_to_verify, rows: "6", label: false, aria: { describedby: "required-fields-to-verify-help-text" } %>
<%= f.submit(class: "button", value: t("admin.signature_sheets.new.submit")) %>
<% end %>

View File

@@ -21,7 +21,7 @@
<div id="verified_signatures" class="callout success">
<strong>
<%= t("admin.signature_sheets.show.verified",
count: @signature_sheet.signatures.verified.count ) %>
count: @signature_sheet.signatures.verified.count) %>
</strong>
<br />
<strong>
@@ -35,7 +35,7 @@
<p>
<strong>
<%= 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") %>
</strong>
</p>

View File

@@ -1,4 +1,4 @@
<%= form_for [:admin, @content_block], html: {class: "edit_page", data: {watch_changes: true}} do |f| %>
<%= form_for [:admin, @content_block], html: { class: "edit_page", data: { watch_changes: true } } do |f| %>
<% if @content_block.errors.any? %>

View File

@@ -21,7 +21,7 @@
</div>
<div class="small-12 column">
<%= label_tag :body %>
<%= text_area_tag :body, @content_block.body, rows: 10 %>
<%= text_area_tag :body, @content_block.body, rows: 10 %>
<div class="small-12 medium-6 large-3">
<%= button_tag t("admin.menu.site_customization.buttons.content_block.update"), class: "button success expanded" %>
</div>

View File

@@ -14,7 +14,7 @@
<strong><%= image.name %></strong> (<%= image.required_width %>x<%= image.required_height %>)
</td>
<td class="small-12 medium-8">
<%= form_for([:admin, image], html: { id: "edit_#{dom_id(image)}"}) do |f| %>
<%= form_for([:admin, image], html: { id: "edit_#{dom_id(image)}" }) do |f| %>
<div class="small-12 medium-6 large-6 column">
<%= image_tag image.image.url if image.image.exists? %>
<%= f.file_field :image, label: false %>

View File

@@ -1,6 +1,6 @@
<%= render "shared/globalize_locales", resource: @page %>
<%= translatable_form_for [:admin, @page], html: {class: "edit_page", data: {watch_changes: true}} do |f| %>
<%= translatable_form_for [:admin, @page], html: { class: "edit_page", data: { watch_changes: true } } do |f| %>
<% if @page.errors.any? %>
<div id="error_explanation" data-alert class="callout alert" data-closable>
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>

View File

@@ -25,7 +25,7 @@
<%= form_for(tag,
url: admin_tag_path(tag),
as: :tag,
html: { id: "edit_tag_#{tag.id}"}) do |f| %>
html: { id: "edit_tag_#{tag.id}" }) do |f| %>
<strong><%= tag.name %></strong>
<% end %>

View File

@@ -12,7 +12,7 @@
<%= f.text_field :description %>
<div class="small-12 medium-6">
<%= f.select :valuator_group_id,
@valuator_groups.map {|group| [group.name, group.id] },
@valuator_groups.map { |group| [group.name, group.id] },
{ include_blank: true } %>
</div>
<div>