[#468] Merged `upstream/develop`.
[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 <h2>OAuth Authorization</h2>
8 <%= form_for @conn, o_auth_path(@conn, :authorize), [as: "authorization"], fn f -> %>
9 <%= label f, :name, "Name or email" %>
10 <%= text_input f, :name %>
11 <br>
12 <br>
13 <%= label f, :password, "Password" %>
14 <%= password_input f, :password %>
15 <br>
16 <br>
17
18 <%= label f, :scope, "Permissions" %>
19 <br>
20 <%= for scope <- @available_scopes do %>
21 <%# Note: using hidden input with `unchecked_value` in order to distinguish user's empty selection from `scope` param being omitted %>
22 <%= checkbox f, :"scope_#{scope}", value: scope in @scopes && scope, checked_value: scope, unchecked_value: "", name: "authorization[scope][]" %>
23 <%= label f, :"scope_#{scope}", String.capitalize(scope) %>
24 <br>
25 <% end %>
26
27 <%= hidden_input f, :client_id, value: @client_id %>
28 <%= hidden_input f, :response_type, value: @response_type %>
29 <%= hidden_input f, :redirect_uri, value: @redirect_uri %>
30 <%= hidden_input f, :state, value: @state%>
31 <%= submit "Authorize" %>
32 <% end %>