make 2fa UI less awful
[akkoma] / lib / pleroma / web / templates / o_auth / o_auth / show.html.eex
1 <%= if get_flash(@conn, :info) do %>
2 <p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
3 <% end %>
4 <%= if get_flash(@conn, :error) do %>
5 <p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
6 <% end %>
7
8 <%= form_for @conn, Routes.o_auth_path(@conn, :authorize), [as: "authorization"], fn f -> %>
9
10 <%= if @user do %>
11 <div class="account-header">
12 <div class="account-header__banner" style="background-image: url('<%= Pleroma.User.banner_url(@user) %>')"></div>
13 <div class="account-header__avatar" style="background-image: url('<%= Pleroma.User.avatar_url(@user) %>')">
14 <div class="account-header__meta">
15 <div class="account-header__display-name"><%= @user.name %></div>
16 <div class="account-header__nickname">@<%= @user.nickname %>@<%= Pleroma.User.get_host(@user) %></div>
17 </div>
18 </div>
19
20 </div>
21 <% end %>
22
23 <div class="container__content">
24 <%= if @app do %>
25 <div class="panel-heading">
26 <p><%= raw Gettext.dpgettext("static_pages", "oauth authorize message", "Application <strong>%{client_name}</strong> is requesting access to your account.", client_name: safe_to_string(html_escape(@app.client_name))) %></p>
27 </div>
28 <% end %>
29
30 <div class="panel-content">
31 <%= render @view_module, "_scopes.html", Map.merge(assigns, %{form: f}) %>
32 <%= if @user do %>
33 <div class="actions">
34 <a class="button button-cancel" href="/">
35 <%= Gettext.dpgettext("static_pages", "oauth authorize cancel button", "Cancel") %>
36 </a>
37 <%= submit Gettext.dpgettext("static_pages", "oauth authorize approve button", "Approve"), class: "button--approve" %>
38 </div>
39 <% else %>
40 <%= if @params["registration"] in ["true", true] do %>
41 <h3><%= Gettext.dpgettext("static_pages", "oauth register page title", "This is your first visit! Please enter your Akkoma handle.") %></h3>
42 <p><%= Gettext.dpgettext("static_pages", "oauth register nickname unchangeable warning", "Choose carefully! You won't be able to change this later. You will be able to change your display name, though.") %></p>
43 <div class="input">
44 <%= label f, :nickname, Gettext.dpgettext("static_pages", "oauth register nickname prompt", "Pleroma Handle") %>
45 <%= text_input f, :nickname, placeholder: "lain", autocomplete: "username" %>
46 </div>
47 <%= hidden_input f, :name, value: @params["name"] %>
48 <%= hidden_input f, :password, value: @params["password"] %>
49 <br>
50 <% else %>
51 <div class="input">
52 <%= label f, :name, Gettext.dpgettext("static_pages", "oauth login username prompt", "Username") %>
53 <%= text_input f, :name %>
54 </div>
55 <div class="input">
56 <%= label f, :password, Gettext.dpgettext("static_pages", "oauth login password prompt", "Password") %>
57 <%= password_input f, :password %>
58 </div>
59 <%= submit Gettext.dpgettext("static_pages", "oauth login button", "Log In") %>
60 <% end %>
61 <% end %>
62 </div>
63 </div>
64
65 <%= hidden_input f, :client_id, value: @client_id %>
66 <%= hidden_input f, :response_type, value: @response_type %>
67 <%= hidden_input f, :redirect_uri, value: @redirect_uri %>
68 <%= hidden_input f, :state, value: @state %>
69 <% end %>
70
71 <%= if Pleroma.Config.oauth_consumer_enabled?() do %>
72 <%= render @view_module, Pleroma.Web.Auth.WrapperAuthenticator.oauth_consumer_template(), assigns %>
73 <% end %>