summaryrefslogtreecommitdiff
path: root/app/views/elevations/new.html.erb
blob: 8dd64e785b18ae46457c4e856bac69c583308401 (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
<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 %>
        </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>