Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Move title and message from controller to view

Jan Sandbrinka30f89ad30b5
diff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/two_factor_devices_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/two_factor_devices_controller.rb
index 8577a42b784..3ad91c8bff6 100644
--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/two_factor_devices_controller.rb
+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/two_factor_devices_controller.rb
@@ -88,12 +88,7 @@ module ::TwoFactorAuthentication
##
# Request (if needed) the token for entering
def request_device_confirmation_token
- request_token_for_device(
- @device,
- confirm_path: url_for(action: :confirm, device_id: @device.id),
- title: I18n.t("two_factor_authentication.devices.confirm_device"),
- message: I18n.t("two_factor_authentication.devices.text_confirm_to_complete_html", identifier: @device.identifier)
- )
+ request_token_for_device(@device, confirm_path: url_for(action: :confirm, device_id: @device.id))
end
def request_token_for_device(device, locals)
diff --git a/modules/two_factor_authentication/app/views/two_factor_authentication/two_factor_devices/confirm.html.erb b/modules/two_factor_authentication/app/views/two_factor_authentication/two_factor_devices/confirm.html.erb
index ce5ef90245c..602e691a9e7 100644
--- a/modules/two_factor_authentication/app/views/two_factor_authentication/two_factor_devices/confirm.html.erb
+++ b/modules/two_factor_authentication/app/views/two_factor_authentication/two_factor_devices/confirm.html.erb
@@ -3,8 +3,8 @@
t('two_factor_authentication.devices.confirm_device') -%>
<%= styled_form_tag(confirm_path, method: :post, id: 'login-form', class: 'form -bordered', autocomplete: "off") do %>
- <h2><%= title %></h2>
- <p><%= message.html_safe %></p>
+ <h2><%= t("two_factor_authentication.devices.confirm_device") %></h2>
+ <p><%= t("two_factor_authentication.devices.text_confirm_to_complete_html", identifier: @device.identifier) %></p>
<hr class="form--separator">
<%= back_url_hidden_field_tag %>
<div class="form--field -required -wide-label">