a2f41618e66f0ec0f3f637a10162966ae542ff1d
[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) %>')"></div>
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 <% end %>
20
21 <div class="container__content">
22 <%= if @app do %>
23 <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>
24 <%= render @view_module, "_scopes.html", Map.merge(assigns, %{form: f}) %>
25 <% end %>
26
27 <%= if @user do %>
28 <div class="actions">
29 <a class="button button--cancel" href="/">
30 <%= Gettext.dpgettext("static_pages", "oauth authorize cancel button", "Cancel") %>
31 </a>
32 <%= submit Gettext.dpgettext("static_pages", "oauth authorize approve button", "Approve"), class: "button--approve" %>
33 </div>
34 <% else %>
35 <%= if @params["registration"] in ["true", true] do %>
36 <h3><%= Gettext.dpgettext("static_pages", "oauth register page title", "This is the first time you visit! Please enter your Pleroma handle.") %></h3>
37 <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>
38 <div class="input">
39 <%= label f, :nickname, Gettext.dpgettext("static_pages", "oauth register nickname prompt", "Pleroma Handle") %>
40 <%= text_input f, :nickname, placeholder: "lain", autocomplete: "username" %>
41 </div>
42 <%= hidden_input f, :name, value: @params["name"] %>
43 <%= hidden_input f, :password, value: @params["password"] %>
44 <br>
45 <% else %>
46 <div class="input">
47 <%= label f, :name, Gettext.dpgettext("static_pages", "oauth login username prompt", "Username") %>
48 <%= text_input f, :name %>
49 </div>
50 <div class="input">
51 <%= label f, :password, Gettext.dpgettext("static_pages", "oauth login password prompt", "Password") %>
52 <%= password_input f, :password %>
53 </div>
54 <%= submit Gettext.dpgettext("static_pages", "oauth login button", "Log In") %>
55 <% end %>
56 <% end %>
57 </div>
58
59 <%= hidden_input f, :client_id, value: @client_id %>
60 <%= hidden_input f, :response_type, value: @response_type %>
61 <%= hidden_input f, :redirect_uri, value: @redirect_uri %>
62 <%= hidden_input f, :state, value: @state %>
63 <% end %>
64
65 <%= if Pleroma.Config.oauth_consumer_enabled?() do %>
66 <%= render @view_module, Pleroma.Web.Auth.WrapperAuthenticator.oauth_consumer_template(), assigns %>
67 <% end %>