summaryrefslogtreecommitdiff
path: root/app/views/elevations/new.html.erb
blob: 1091ff364914b714d069332dae1900ae2aa8ba8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<h1><%= t(".title") %></h1>

<div id="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_label"><%= t(".code") %></div>
      <div class="layout_row_content">
        <%= text_field_tag :code, nil, :autocomplete => "one-time-code",
              :inputmode => "numeric", :autofocus => true %>
      </div>
      <div class="layout_row_label"></div>
      <div class="layout_row_content"><%= submit_tag t(".elevate") %></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>