Merge branch 'feature/quack' into '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 <div class="input">
10 <%= label f, :name, "Name or email" %>
11 <%= text_input f, :name %>
12 </div>
13 <div class="input">
14 <%= label f, :password, "Password" %>
15 <%= password_input f, :password %>
16 </div>
17 <div class="scopes-input">
18 <%= label f, :scope, "Permissions" %>
19 <div class="scopes">
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 <div class="scope">
23 <%= checkbox f, :"scope_#{scope}", value: scope in @scopes && scope, checked_value: scope, unchecked_value: "", name: "authorization[scope][]" %>
24 <%= label f, :"scope_#{scope}", String.capitalize(scope) %>
25 </div>
26 <% end %>
27 </div>
28 </div>
29
30 <%= hidden_input f, :client_id, value: @client_id %>
31 <%= hidden_input f, :response_type, value: @response_type %>
32 <%= hidden_input f, :redirect_uri, value: @redirect_uri %>
33 <%= hidden_input f, :state, value: @state%>
34 <%= submit "Authorize" %>
35 <% end %>