blob: 8e1b59c27cb87cc7666d2ce154c9e3158ea6a373 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<h1><%= t(".title") %></h1>
<div class="admin_layout">
<% if current_user.otp_enrolled? %>
<p class="field_hint">
<%= t(".hint", :minutes => AuthenticatedSystem::ELEVATION_MAX_AGE.in_minutes.to_i) %>
</p>
<%= form_tag elevation_path do %>
<div class="layout_row">
<div class="layout_row_label"><%= t(".code") %></div>
<div class="layout_row_content">
<%= text_field_tag :code, nil, :autocomplete => "one-time-code",
:inputmode => "numeric", :autofocus => true, :maxlength => 6,
:pattern => "[0-9]{6}", :class => "otp_code" %>
</div>
</div>
<div class="layout_row">
<div class="layout_row_label"></div>
<div class="layout_row_content"><%= submit_tag t(".elevate") %></div>
</div>
<% end %>
<% else %>
<%# An admin without an enrolled factor cannot elevate at all. Say so and
point at enrolment rather than showing a field that cannot work. %>
<p><%= t(".not_enrolled") %></p>
<%= link_to t(".enrol"), otp_enrollment_path, :class => "action_button" %>
<% end %>
</div>
|