diff --git a/changelog.d/oauth-static-page.change b/changelog.d/oauth-static-page.change new file mode 100644 index 0000000000..09bc5a0b8b --- /dev/null +++ b/changelog.d/oauth-static-page.change @@ -0,0 +1 @@ +Improve the UI of the OAuth login page served directly from the backend diff --git a/lib/pleroma/web/templates/o_auth/o_auth/_scopes.html.eex b/lib/pleroma/web/templates/o_auth/o_auth/_scopes.html.eex index 310bf23587..0816ffc02d 100644 --- a/lib/pleroma/web/templates/o_auth/o_auth/_scopes.html.eex +++ b/lib/pleroma/web/templates/o_auth/o_auth/_scopes.html.eex @@ -8,7 +8,7 @@ <%= checkbox @form, :"scope_#{scope}", value: scope in @scopes && scope, checked_value: scope, unchecked_value: "", name: "authorization[scope][]" %> <%= label @form, :"scope_#{scope}", String.capitalize(scope) %> <%= if scope in @scopes && scope do %> - <%= scope %> <%= :"Elixir.Gettext".dgettext(Gettext, "oauth_scopes", scope) %> + <%= :"Elixir.Gettext".dgettext(Gettext, "oauth_scopes", scope) %> <% end %> <% else %> @@ -17,3 +17,162 @@ <% end %> + + diff --git a/lib/pleroma/web/templates/o_auth/o_auth/show.html.eex b/lib/pleroma/web/templates/o_auth/o_auth/show.html.eex index 6bc8eb6023..1e486fffb9 100644 --- a/lib/pleroma/web/templates/o_auth/o_auth/show.html.eex +++ b/lib/pleroma/web/templates/o_auth/o_auth/show.html.eex @@ -20,16 +20,16 @@
<%= if @app do %> -

<%= raw Gettext.dpgettext("static_pages", "oauth authorize message", "Application %{client_name} is requesting access to your account.", client_name: safe_to_string(html_escape(@app.client_name))) %>

+

<%= raw Gettext.dpgettext("static_pages", "oauth authorize message", "Application %{client_name} is requesting access to your account.", client_name: safe_to_string(html_escape(@app.client_name))) %>

<%= render Phoenix.Controller.view_module(@conn), "_scopes.html", Map.merge(assigns, %{form: f}) %> <% end %> <%= if @user do %>
- + <%= Gettext.dpgettext("static_pages", "oauth authorize cancel button", "Cancel") %> - <%= submit Gettext.dpgettext("static_pages", "oauth authorize approve button", "Approve"), class: "button--approve" %> + <%= submit Gettext.dpgettext("static_pages", "oauth authorize approve button", "Approve"), class: "button" %>
<% else %> <%= if @params["registration"] in ["true", true] do %> @@ -41,17 +41,18 @@
<%= hidden_input f, :name, value: @params["name"] %> <%= hidden_input f, :password, value: @params["password"] %> -
+ <%= submit Gettext.dpgettext("static_pages", "oauth register button", "Register"), class: "button" %> <% else %> +

<%= Gettext.dpgettext("static_pages", "oauth login page title", "Sign in to your account") %>

<%= label f, :name, Gettext.dpgettext("static_pages", "oauth login username prompt", "Username") %> - <%= text_input f, :name %> + <%= text_input f, :name, autocomplete: "username" %>
<%= label f, :password, Gettext.dpgettext("static_pages", "oauth login password prompt", "Password") %> - <%= password_input f, :password %> + <%= password_input f, :password, autocomplete: "current-password" %>
- <%= submit Gettext.dpgettext("static_pages", "oauth login button", "Log In") %> + <%= submit Gettext.dpgettext("static_pages", "oauth login button", "Log In"), class: "button" %> <% end %> <% end %> @@ -65,3 +66,103 @@ <%= if Pleroma.Config.oauth_consumer_enabled?() do %> <%= render Phoenix.Controller.view_module(@conn), Pleroma.Web.Auth.WrapperAuthenticator.oauth_consumer_template(), assigns %> <% end %> + +