metamaps--metamaps/views/doorkeeper/authorizations/new.js

59 lines
2 KiB
JavaScript
Raw Permalink Normal View History

2018-03-05 18:18:51 +00:00
import React, { Component } from react
class MyComponent extends Component {
render = () => {
return (
<div id="yield">
2018-03-05 17:33:16 +00:00
<div className="centerContent">
<header className="page-header" role="banner">
2018-03-04 02:25:42 +00:00
<h1>{ t('.title') }</h1>
</header>
<main role="main">
2018-03-05 17:33:16 +00:00
<p className="h4">
{ raw t('.prompt', client_name: "<strong className=\"text-info\">#{ @pre_auth.client.name }</strong>") }
</p>
2018-03-04 02:25:42 +00:00
{ if @pre_auth.scopes.count > 0 }
<div id="oauth-permissions">
2018-03-04 02:25:42 +00:00
<p>{ t('.able_to') }:</p>
2018-03-05 17:33:16 +00:00
<ul className="text-info">
2018-03-04 02:25:42 +00:00
{ @pre_auth.scopes.each do |scope| }
<li>{ t scope, scope: [:doorkeeper, :scopes] }</li>
{ end }
</ul>
</div>
2018-03-04 02:25:42 +00:00
{ end }
2018-03-05 17:33:16 +00:00
<div className="actions">
<div className="inline-button button-margin-top">
2018-03-04 02:25:42 +00:00
{ form_tag oauth_authorization_path, method: :post do }
{ hidden_field_tag :client_id, @pre_auth.client.uid }
{ hidden_field_tag :redirect_uri, @pre_auth.redirect_uri }
{ hidden_field_tag :state, @pre_auth.state }
{ hidden_field_tag :response_type, @pre_auth.response_type }
{ hidden_field_tag :scope, @pre_auth.scope }
2018-03-05 17:33:16 +00:00
{ submit_tag t('doorkeeper.authorizations.buttons.authorize'), className: "button" }
2018-03-04 02:25:42 +00:00
{ end }
</div>
2018-03-05 17:33:16 +00:00
<div className="inline-button button-margin-top">
2018-03-04 02:25:42 +00:00
{ form_tag oauth_authorization_path, method: :delete do }
{ hidden_field_tag :client_id, @pre_auth.client.uid }
{ hidden_field_tag :redirect_uri, @pre_auth.redirect_uri }
{ hidden_field_tag :state, @pre_auth.state }
{ hidden_field_tag :response_type, @pre_auth.response_type }
{ hidden_field_tag :scope, @pre_auth.scope }
2018-03-05 17:33:16 +00:00
{ submit_tag t('doorkeeper.authorizations.buttons.deny'), className: "button red-button" }
2018-03-04 02:25:42 +00:00
{ end }
</div>
</div>
</main>
</div>
</div>
2018-03-05 18:18:51 +00:00
)
}
}
export default MyComponent