erb_lint auto fix part of style 2/3

This commit is contained in:
Ivan Kuchin
2025-02-06 19:07:48 +01:00
parent fba9d4b506
commit a98789d986
33 changed files with 56 additions and 53 deletions
@@ -69,7 +69,7 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
<%
email_methods = [:smtp, :sendmail]
email_methods = %i[smtp sendmail]
email_methods << :letter_opener if Rails.env.development?
%>
<%= content_tag :fieldset, id: "mail_configuration", class: "form--fieldset" do %>
@@ -79,7 +79,7 @@ See COPYRIGHT and LICENSE files for more details.
<div class="form--field"><%= setting_text_field :smtp_address, container_class: "-middle" %></div>
<div class="form--field"><%= setting_text_field :smtp_port, size: 6, container_class: "-xslim" %></div>
<div class="form--field"><%= setting_text_field :smtp_domain, container_class: "-middle" %></div>
<div class="form--field"><%= setting_select(:smtp_authentication, [:none, :plain, :login, :cram_md5], container_class: "-slim") %></div>
<div class="form--field"><%= setting_select(:smtp_authentication, %i[none plain login cram_md5], container_class: "-slim") %></div>
<div class="form--field"><%= setting_text_field :smtp_user_name, container_class: "-middle" %></div>
<div class="form--field"><%= setting_password :smtp_password, container_class: "-middle" %></div>
<div class="form--field"><%= setting_check_box :smtp_enable_starttls_auto %></div>
+1 -1
View File
@@ -53,7 +53,7 @@
<td class="buttons">
<%= link_to(
op_icon("icon icon-delete"),
(attribute_help_text_path(attribute_help_text)),
attribute_help_text_path(attribute_help_text),
method: :delete,
data: { confirm: I18n.t(:text_are_you_sure) },
title: t(:button_delete)
@@ -10,7 +10,7 @@
<%= content_tag(
"opce-colors-autocompleter",
"",
class: "colors-autocomplete form--select-container " + "#{container_class.present? ? container_class : '-middle'}",
class: "colors-autocomplete form--select-container " + (container_class.present? ? container_class : "-middle").to_s,
data: { colors: options_for_colors(object),
selected_color: selected_color(object),
highlight_text_inline: highlight_text_inline,
+1 -1
View File
@@ -27,6 +27,6 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<%= call_hook(:view_common_error_details, { params: params, project: ((defined? @project) ? @project : nil) }) %>
<%= call_hook(:view_common_error_details, { params: params, project: (defined?(@project) ? @project : nil) }) %>
<% html_title h(status) %>
+1 -1
View File
@@ -155,7 +155,7 @@ See COPYRIGHT and LICENSE files for more details.
<td class="buttons">
<%= link_to(
op_icon("icon icon-delete"),
(custom_field_path(custom_field)),
custom_field_path(custom_field),
method: :delete,
data: { confirm: I18n.t(:text_are_you_sure) },
title: t(:button_delete)
+1 -1
View File
@@ -5,7 +5,7 @@
data-domain="<%= @current_token.try(:domain) %>"
data-user-count="<%= @current_token.restrictions.nil? ? t("js.admin.enterprise.upsale.unlimited") : @current_token.restrictions[:active_user_count] %>"
data-starts-at="<%= format_date @current_token.starts_at %>"
data-expires-at="<%= (@current_token.will_expire?) ? (format_date @current_token.expires_at) : t("js.admin.enterprise.upsale.unlimited") %>"
data-expires-at="<%= @current_token.will_expire? ? (format_date @current_token.expires_at) : t("js.admin.enterprise.upsale.unlimited") %>"
data-is-expired="<%= @current_token.expired?(reprieve: false) %>"
data-reprieve-days-left="<%= @current_token.reprieve_days_left %>">
</opce-enterprise-active-saved-trial>
+1 -1
View File
@@ -40,7 +40,7 @@ See COPYRIGHT and LICENSE files for more details.
<% @homescreen[:blocks].each do |block| %>
<% if block[:if].nil? || instance_eval(&block[:if]) %>
<div class="widget-box <%= block[:partial] %>">
<%= render partial: "homescreen/blocks/#{block[:partial]}", locals: (block[:locals] || {}) %>
<%= render partial: "homescreen/blocks/#{block[:partial]}", locals: block[:locals] || {} %>
</div>
<% end %>
<% end %>
+2 -2
View File
@@ -28,8 +28,8 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<%= Setting.localized_emails_header %>
<%= call_hook(:view_layouts_mailer_plain_before_content, self.assigns) %>
<%= call_hook(:view_layouts_mailer_plain_before_content, assigns) %>
<%= yield %>
<%= call_hook(:view_layouts_mailer_plain_after_content, self.assigns) %>
<%= call_hook(:view_layouts_mailer_plain_after_content, assigns) %>
--
<%= Setting.localized_emails_footer %>
+1 -1
View File
@@ -137,7 +137,7 @@ See COPYRIGHT and LICENSE files for more details.
<div class="form--field">
<%= f.password_field "account_password",
label: LdapAuthSource.human_attribute_name(:password),
placeholder: ((@ldap_auth_source.new_record? || @ldap_auth_source.account_password.blank?) ? "" : ("●" * 15)),
placeholder: (@ldap_auth_source.new_record? || @ldap_auth_source.account_password.blank? ? "" : ("●" * 15)),
autocomplete: "off",
container_class: "-middle" %>
<span class="form--field-instructions">
+5 -5
View File
@@ -44,7 +44,7 @@ See COPYRIGHT and LICENSE files for more details.
nil,
size: 25,
required: true,
container_class: (defined? input_size) ? "-#{input_size}" : "" %>
container_class: defined?(input_size) ? "-#{input_size}" : "" %>
</div>
</div>
@@ -57,7 +57,7 @@ See COPYRIGHT and LICENSE files for more details.
"aria-describedby" => "new_password_tooltip",
required: true,
class: "advanced-tooltip-trigger",
container_class: (defined? input_size) ? "-#{input_size}" : "" %>
container_class: defined?(input_size) ? "-#{input_size}" : "" %>
</div>
<div class="form--field-instructions">
<%= render_password_complexity_hint %>
@@ -74,17 +74,17 @@ See COPYRIGHT and LICENSE files for more details.
"aria-describedby" => "confirm_password_tooltip",
size: 25,
class: "advanced-tooltip-trigger",
container_class: (defined? input_size) ? "-#{input_size}" : "" %>
container_class: defined?(input_size) ? "-#{input_size}" : "" %>
</div>
<div class="form--field-instructions">
<%= I18n.t(
:confirm,
scope: [:activerecord, :errors, :models, :user, :attributes, :password, :match]
scope: %i[activerecord errors models user attributes password match]
) %>
<br>
<%= I18n.t(
:description,
scope: [:activerecord, :errors, :models, :user, :attributes, :password, :match]
scope: %i[activerecord errors models user attributes password match]
) %>
</div>
</div>
@@ -50,7 +50,7 @@ See COPYRIGHT and LICENSE files for more details.
} %>
<tbody>
<% granted_applications.each do |application, tokens| %>
<% latest = tokens.sort_by(&:created_at).last %>
<% latest = tokens.max_by(&:created_at) %>
<tr id="oauth-application-grant-<%= application.id %>">
<td class="-w-rel-60" data-test-selector="oauth-token-row-<%= application.id %>-name">
<%= t("oauth.application.named", name: application.name) %>
@@ -27,7 +27,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% name = @placeholder_user.name %>
<% html_title(t(:label_administration), "#{t('placeholder_users.deletion_info.heading', name: name)}") -%>
<% html_title(t(:label_administration), t("placeholder_users.deletion_info.heading", name: name).to_s) -%>
<%= labelled_tabular_form_for(
:placeholder_user,
+1 -1
View File
@@ -51,7 +51,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= t("project.destroy.confirmation", identifier: @project_to_destroy.identifier) %>
<% if @project_to_destroy.descendants.any? %>
<br>
<% descendants = h(@project_to_destroy.descendants.collect { |p| p.to_s }.join(", ")) %>
<% descendants = h(@project_to_destroy.descendants.collect(&:to_s).join(", ")) %>
<%= t("project.destroy.subprojects_confirmation", value: "<strong>#{h(descendants)}</strong>").html_safe %>
<% end %>
</p>
@@ -62,7 +62,7 @@ See COPYRIGHT and LICENSE files for more details.
label: t("repositories.subversion.password"),
name: "ignore",
id: "repository-password-placeholder",
value: ((repository.new_record? || repository.password.blank?) ? "" : ("x" * 15)),
value: (repository.new_record? || repository.password.blank? ? "" : ("x" * 15)),
container_class: "-middle"
) %>
<%=
@@ -78,9 +78,9 @@ See COPYRIGHT and LICENSE files for more details.
</td>
<td class="hidden-for-sighted"> <%= depth %></td>
<td class="size"><%= (entry.size ? number_to_human_size(entry.size, precision: 3) : "?") unless entry.dir? %></td>
<% changeset = @project.repository.find_changeset_by_name(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %>
<% changeset = @project.repository.find_changeset_by_name(entry.lastrev.identifier) if entry.lastrev&.identifier %>
<td class="revision"><%= link_to_revision(changeset, @project) if changeset %></td>
<td class="age"><%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %></td>
<td class="age"><%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev&.time %></td>
<td class="author"><%= if entry.lastrev
changeset.nil? ? h(replace_invalid_utf8(entry.lastrev.author.to_s.split("<").first)) : h(changeset.author)
end %></td>
+1 -1
View File
@@ -118,7 +118,7 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
<p>
<%
has_branches = (!@repository.branches.nil? && !@repository.branches.empty?)
has_branches = !@repository.branches.nil? && !@repository.branches.empty?
sep = ""
%>
@@ -37,7 +37,7 @@ See COPYRIGHT and LICENSE files for more details.
"name": <%= role.name.to_json.html_safe %>
} <%= "," unless ix == @roles.length - 1 %>
<% end %> ],
"total": <%= @total ? @total : @roles.size %>,
"more": <%= @more ? @more : 0 %>
"total": <%= @total || @roles.size %>,
"more": <%= @more || 0 %>
}
}
+2 -2
View File
@@ -51,8 +51,8 @@ See COPYRIGHT and LICENSE files for more details.
<dt class="<%= e.event_type %>">
<% event_type = e.event_type == "meeting" ? "meetings" : e.event_type %>
<% event_type = e.event_type == "budget" ? "budget" : event_type %>
<% event_type = e.event_type == "reply" ? "forums" : event_type %>
<% event_type = "budget" if e.event_type == "budget" %>
<% event_type = "forums" if e.event_type == "reply" %>
<%= icon_wrapper("icon-context icon-#{event_type}", e.event_name) %>
<% if e.project != @project %>
+1 -1
View File
@@ -28,6 +28,6 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<h1><%= link_to @news.title, news_url(@news) %></h1>
<em><%= @news.author.name if @news.author %></em>
<em><%= @news.author&.name %></em>
<%= format_text @news.description, only_path: false %>
+1 -1
View File
@@ -29,6 +29,6 @@ See COPYRIGHT and LICENSE files for more details.
<%= @news.title %>
<%= news_url(@news) %>
<%= @news.author.name if @news.author %>
<%= @news.author&.name %>
<%= @news.description %>
+2 -2
View File
@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.
"time_zone",
form: pref_fields,
include_blank: false,
container_class: (defined? input_size) ? "-#{input_size}" : "-wide"
container_class: defined?(input_size) ? "-#{input_size}" : "-wide"
) %>
<div class="form--field">
<%= pref_fields.select :theme, theme_options_for_select, container_class: "-middle" %>
@@ -43,7 +43,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= pref_fields.select :comments_sorting,
[[t("activities.work_packages.activity_tab.label_sort_asc"), "asc"],
[t("activities.work_packages.activity_tab.label_sort_desc"), "desc"]],
container_class: (defined? input_size) ? "-#{input_size}" : "" %>
container_class: defined?(input_size) ? "-#{input_size}" : "" %>
</div>
<div class="form--field"><%= pref_fields.check_box :warn_on_leaving_unsaved %></div>
<div class="form--field"><%= pref_fields.check_box :auto_hide_popups %></div>
+1 -1
View File
@@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#%>
<% html_title(t(:label_administration), "#{t(:label_change_status_of_user, username: @user.name)}") -%>
<% html_title(t(:label_administration), t(:label_change_status_of_user, username: @user.name).to_s) -%>
<% local_assigns[:additional_breadcrumb] = @user.name %>
<% new_status = t("user.#{@status_change}") %>
+1 -1
View File
@@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% layout = local_assigns[:layout] %>
<% html_title(layout == "my" ? t(:label_my_account) : t(:label_administration), "#{t('account.deletion_info.heading', name: @user.name)}") -%>
<% html_title(layout == "my" ? t(:label_my_account) : t(:label_administration), t("account.deletion_info.heading", name: @user.name).to_s) -%>
<%= render ::Users::DeletePageHeaderComponent.new(layout: layout, user: @user) %>
@@ -1,5 +1,5 @@
<%= I18n.t(:"mail.salutation", user: @user.firstname) %>
<%= "#{I18n.t(:"mail.work_packages.mentioned_by", user: @journal.user)}" %>
<%= I18n.t(:"mail.work_packages.mentioned_by", user: @journal.user).to_s %>
<%= "-" * 100 %>
@@ -65,7 +65,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= link_to h(row.name),
project_report_property_path(
(row.is_a?(Project) ? row : @project),
"#{report.field}",
report.field.to_s,
row.id
) %>
</td>
@@ -76,7 +76,7 @@ See COPYRIGHT and LICENSE files for more details.
project_report_property_status_path(
(row.is_a?(Project) ? row : @project),
status.id,
"#{report.field}",
report.field.to_s,
row.id
) %>
</td>
@@ -86,7 +86,7 @@ See COPYRIGHT and LICENSE files for more details.
{ report.field => row.id, "closed" => 0 },
project_report_property_open_path(
(row.is_a?(Project) ? row : @project),
"#{report.field}",
report.field.to_s,
row.id
) %>
</td>
@@ -95,7 +95,7 @@ See COPYRIGHT and LICENSE files for more details.
{ report.field => row.id, "closed" => 1 },
project_report_property_closed_path(
(row.is_a?(Project) ? row : @project),
"#{report.field}",
report.field.to_s,
row.id
) %>
</td>
@@ -104,7 +104,7 @@ See COPYRIGHT and LICENSE files for more details.
{ report.field => row.id },
project_report_property_path(
(row.is_a?(Project) ? row : @project),
"#{report.field}",
report.field.to_s,
row.id
) %>
</td>
+6 -6
View File
@@ -50,11 +50,11 @@ See COPYRIGHT and LICENSE files for more details.
<% for new_status in @statuses %>
<th class="workflow-table--current-status -table-border-top -table-border-bottom">
<%= link_to_function(
icon_wrapper("icon-context icon-checkmark", "#{t(:label_check_uncheck_all_in_column)}"),
icon_wrapper("icon-context icon-checkmark", t(:label_check_uncheck_all_in_column).to_s),
"OpenProject.helpers.toggleCheckboxesBySelector('table.transitions-#{name} input.new-status-#{new_status.id}')",
class: "no-decoration-on-hover",
title: "#{t(:label_check_uncheck_all_in_column)}",
alt: "#{t(:label_check_uncheck_all_in_column)}"
title: t(:label_check_uncheck_all_in_column).to_s,
alt: t(:label_check_uncheck_all_in_column).to_s
) %>
<%= h new_status.name %>
</th>
@@ -66,11 +66,11 @@ See COPYRIGHT and LICENSE files for more details.
<tr class="-table-border-left">
<td class="workflow-table--current-status -table-border-right">
<%= link_to_function(
icon_wrapper("icon-context icon-checkmark", "#{t(:label_check_uncheck_all_in_row)}"),
icon_wrapper("icon-context icon-checkmark", t(:label_check_uncheck_all_in_row).to_s),
"OpenProject.helpers.toggleCheckboxesBySelector('table.transitions-#{name} input.old-status-#{old_status.id}')",
class: "no-decoration-on-hover",
title: "#{t(:label_check_uncheck_all_in_row)}",
alt: "#{t(:label_check_uncheck_all_in_row)}"
title: t(:label_check_uncheck_all_in_row).to_s,
alt: t(:label_check_uncheck_all_in_row).to_s
) %>
<%= h old_status.name %>
</td>
@@ -90,7 +90,7 @@
view_mode:,
heading: t("saml.providers.label_configuration_details"),
description: t("saml.providers.section_texts.configuration"),
label: (provider.persisted? && !provider.configured?) ? t(:label_incomplete) : nil,
label: provider.persisted? && !provider.configured? ? t(:label_incomplete) : nil,
)
)
end
@@ -83,7 +83,10 @@ See COPYRIGHT and LICENSE files for more details.
</tr>
</thead>
<tbody>
<% total_budget = BigDecimal(0); labor_budget = BigDecimal(0); material_budget = BigDecimal(0); spent = BigDecimal(0) %>
<% total_budget = BigDecimal(0)
labor_budget = BigDecimal(0)
material_budget = BigDecimal(0)
spent = BigDecimal(0) %>
<% budgets.each do |budget| %>
<tr id="budget-<%= budget.id %>" class="<%= budget.css_classes %>">
<td><%= link_to budget.id, budget_path(budget.id) %></td>
@@ -91,7 +94,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= content_tag(:td, number_to_currency(budget.budget, precision: 0), class: "currency") %>
<%= content_tag(:td, number_to_currency(budget.spent, precision: 0), class: "currency") %>
<%= content_tag(:td, number_to_currency(budget.budget - budget.spent, precision: 0), class: "currency") %>
<%= content_tag(:td, extended_progress_bar(budget.budget_ratio, legend: "#{budget.budget_ratio}")) %>
<%= content_tag(:td, extended_progress_bar(budget.budget_ratio, legend: budget.budget_ratio.to_s)) %>
<%-
total_budget += budget.budget
labor_budget += budget.labor_budget
@@ -56,7 +56,7 @@ See COPYRIGHT and LICENSE files for more details.
<% if @cost_entry.work_package %>
<div class="form--field-instructions">
<%= h("#{@cost_entry.work_package}") %>
<%= h(@cost_entry.work_package.to_s) %>
</div>
<% end %>
</div>
@@ -42,7 +42,7 @@ See COPYRIGHT and LICENSE files for more details.
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { t(:caption_default_rate_history_for, user: @user.name) }
header.with_breadcrumbs(
[*(breadcrumb_items),
[*breadcrumb_items,
t(:caption_default_rate_history_for, user: @user.name)]
)
end
@@ -42,7 +42,7 @@ See COPYRIGHT and LICENSE files for more details.
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { t(:caption_default_rate_history_for, user: @user.name) }
header.with_breadcrumbs(
[*(breadcrumb_items),
[*breadcrumb_items,
t(:caption_default_rate_history_for, user: @user.name)]
)
end
@@ -29,7 +29,7 @@ See COPYRIGHT and LICENSE files for more details.
<%
tab ||= locals[:tab_contents] if defined? locals
if tab && tab.present?
if tab.present?
content = tab[:content]
content_type = tab[:content_type]
end
@@ -23,7 +23,7 @@
component.with_attribute(
key: ::Webhooks::Webhook.human_attribute_name("events"),
value: if @webhook.all_projects?
(t(:label_all))
t(:label_all)
else
@webhook.projects.join(", ")
end