2019-02-13 16:33:22 -06:00
< % = if get_flash ( @conn , :info ) do % >
2018-02-08 10:57:30 -06:00
< p class = " alert alert-info " role = " alert " > < % = get_flash ( @conn , :info ) % > < / p >
2019-02-13 16:33:22 -06:00
< % end % >
< % = if get_flash ( @conn , :error ) do % >
2018-02-08 10:57:30 -06:00
< p class = " alert alert-danger " role = " alert " > < % = get_flash ( @conn , :error ) % > < / p >
2019-02-13 16:33:22 -06:00
< % end % >
2019-03-11 12:37:26 -05:00
2021-05-18 17:11:25 -05:00
< % = form_for @conn , Routes . o_auth_path ( @conn , :authorize ) , [ as : " authorization " ] , fn f -> % >
2019-03-27 07:39:35 -05:00
2020-11-28 12:51:06 -06:00
< % = if @user do % >
< div class = " account-header " >
< div class = " account-header__banner " style = " background-image: url('<%= Pleroma.User.banner_url(@user) %>') " > < / div >
< div class = " account-header__avatar " style = " background-image: url('<%= Pleroma.User.avatar_url(@user) %>') " > < / div >
< div class = " account-header__meta " >
< div class = " account-header__display-name " > < % = @user . name % > < / div >
< div class = " account-header__nickname " > @ < % = @user . nickname % > @ < % = Pleroma.User . get_host ( @user ) % > < / div >
< / div >
2019-04-11 11:02:38 -05:00
< / div >
< % end % >
2019-02-13 15:29:29 -06:00
2020-11-28 12:51:06 -06:00
< div class = " container__content " >
< % = if @app do % >
2022-02-28 10:23:15 -06:00
< 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 >
2022-11-02 20:56:43 -05:00
< % = render Phoenix.Controller . view_module ( @conn ) , " _scopes.html " , Map . merge ( assigns , %{ form : f } ) % >
2020-11-28 12:51:06 -06:00
< % end % >
< % = if @user do % >
< div class = " actions " >
2022-02-28 01:11:57 -06:00
< a class = " button button--cancel " href = " / " >
< % = Gettext . dpgettext ( " static_pages " , " oauth authorize cancel button " , " Cancel " ) % >
< / a >
< % = submit Gettext . dpgettext ( " static_pages " , " oauth authorize approve button " , " Approve " ) , class : " button--approve " % >
2020-11-28 12:51:06 -06:00
< / div >
< % else % >
< % = if @params [ " registration " ] in [ " true " , true ] do % >
2022-02-28 01:11:57 -06:00
< h3 > < % = Gettext . dpgettext ( " static_pages " , " oauth register page title " , " This is the first time you visit! Please enter your Pleroma handle. " ) % > < / h3 >
< 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 >
2020-11-28 12:51:06 -06:00
< div class = " input " >
2022-02-28 01:11:57 -06:00
< % = label f , :nickname , Gettext . dpgettext ( " static_pages " , " oauth register nickname prompt " , " Pleroma Handle " ) % >
2022-01-22 03:00:43 -06:00
< % = text_input f , :nickname , placeholder : " lain " , autocomplete : " username " % >
2020-11-28 12:51:06 -06:00
< / div >
< % = hidden_input f , :name , value : @params [ " name " ] % >
< % = hidden_input f , :password , value : @params [ " password " ] % >
< br >
< % else % >
< div class = " input " >
2022-02-28 01:11:57 -06:00
< % = label f , :name , Gettext . dpgettext ( " static_pages " , " oauth login username prompt " , " Username " ) % >
2020-11-28 12:51:06 -06:00
< % = text_input f , :name % >
< / div >
< div class = " input " >
2022-02-28 01:11:57 -06:00
< % = label f , :password , Gettext . dpgettext ( " static_pages " , " oauth login password prompt " , " Password " ) % >
2020-11-28 12:51:06 -06:00
< % = password_input f , :password % >
< / div >
2022-02-28 01:11:57 -06:00
< % = submit Gettext . dpgettext ( " static_pages " , " oauth login button " , " Log In " ) % >
2020-11-28 12:51:06 -06:00
< % end % >
< % end % >
< / div >
2017-09-06 12:06:25 -05:00
< % = hidden_input f , :client_id , value : @client_id % >
< % = hidden_input f , :response_type , value : @response_type % >
< % = hidden_input f , :redirect_uri , value : @redirect_uri % >
2019-04-04 14:41:03 -05:00
< % = hidden_input f , :state , value : @state % >
2019-06-03 10:58:04 -05:00
< % end % >
2019-06-03 10:00:32 -05:00
< % = if Pleroma.Config . oauth_consumer_enabled? ( ) do % >
2022-11-02 20:56:43 -05:00
< % = render Phoenix.Controller . view_module ( @conn ) , Pleroma.Web.Auth.WrapperAuthenticator . oauth_consumer_template ( ) , assigns % >
2019-06-03 10:00:32 -05:00
< % end % >