Merge pull request 'metrics' (#375) from stats into develop
[akkoma] / lib / pleroma / web / templates / o_auth / o_auth / consumer.html.eex
index e7251bce81fb7d54cc5d9277c5afef8770a3a9d3..8b894cd58a3053413355b6972145a40b574fef5f 100644 (file)
@@ -1,14 +1,15 @@
-<h2>External OAuth Authorization</h2>
-<%= form_for @conn, o_auth_path(@conn, :request, :twitter), [method: "get"], fn f -> %>
-  <div class="scopes-input">
-  <%= label f, :scope, "Permissions" %>
-  <div class="scopes">
-    <%= text_input f, :scope, value: Enum.join(@available_scopes, " ") %>
-  </div>
+<h2><%= Gettext.dpgettext("static_pages", "oauth external provider page title", "Sign in with external provider") %></h2>
+
+<%= form_for @conn, Routes.o_auth_path(@conn, :prepare_request), [as: "authorization", method: "get"], fn f -> %>
+  <div style="display: none">
+    <%= render @view_module, "_scopes.html", Map.merge(assigns, %{form: f}) %>
   </div>
 
   <%= hidden_input f, :client_id, value: @client_id %>
   <%= hidden_input f, :redirect_uri, value: @redirect_uri %>
-  <%= hidden_input f, :state, value: @state%>
-  <%= submit "Sign in with Twitter" %>
+  <%= hidden_input f, :state, value: @state %>
+
+    <%= for strategy <- Pleroma.Config.oauth_consumer_strategies() do %>
+      <%= submit Gettext.dpgettext("static_pages", "oauth external provider sign in button", "Sign in with %{strategy}", strategy: String.capitalize(strategy)), name: "provider", value: strategy %>
+    <% end %>
 <% end %>