Files
Phraseanet/templates/web/developers/application.html.twig
2012-10-04 15:44:48 +02:00

91 lines
3.0 KiB
Twig

{% extends 'account/base.html.twig' %}
{% use "developers/header.html.twig" with header as parent_header %}
{% block head %}
{{ block('parent_header') }}
{% endblock %}
{% block content %}
<h1 style='text-align:left'>{% trans 'Application' %}</h1>
<input type="hidden" value="{{application.get_id}}" name="app_id"/>
<div>
<ul class='app-list'>
<li>
<div>
<span class='app-row'><strong><a class="link" href="/developers/application/{{application.get_id}}/">{{application.get_name}}</a></strong></span>
<span class='app-row'>{{application.get_description }}</span>
</div>
</li>
</ul>
</div>
<h1 style='text-align:left'>{% trans 'settings OAuth' %}</h1>
<p style='text-align:left'>{% trans 'Les parametres oauth de votre application.' %}</p>
<table id="app-oauth-setting">
<tbody>
<tr>
<td>Client ID</td>
<td>{{application.get_client_id}}</td>
</tr>
<tr>
<td>Client Secret</td>
<td>{{application.get_client_secret}}</td>
</tr>
<tr>
<td>{% trans 'URL de callback' %}</td>
{% if application.get_type == constant('API_OAuth2_Application::DESKTOP_TYPE') %}
<td>
<span>{{application.get_redirect_uri}}</span>
</td>
{% else %}
<td class="url_callback"><span class="url_callback_input">{{application.get_redirect_uri}}</span>
<button type="button" class="save_callback" style="display:none;">save</button>
<button type="button" class="modifier_callback" style="display:none;">modifier</button>
</td>
{%endif%}
</tr>
<tr>
<td>Authorize endpoint</td>
<td>{{app['phraseanet.registry'].get('GV_ServerName')}}api/oauthv2/authorize</td>
</tr>
<tr>
<td>Access endpoint</td>
<td>{{app['phraseanet.registry'].get('GV_ServerName')}}api/oauthv2/token</td>
</tr>
<tr>
<td>{% trans 'Activer le grant_type de type password pour votre application' %}</td>
<td><input class="grant-type" type='checkbox' {{ application.is_password_granted() ? "checked='checked'" : ""}} name="grant" value='{{application.get_id()}}'></td>
</tr>
</tbody>
</table>
<h1 style='text-align:left'>{% trans 'Votre token d\'access' %}</h1>
<p style='text-align:left'> {% trans 'Les paramétres oauth de votre application.' %}</p>
<table id="app-access-token-setting">
<tbody>
<tr>
<td style='width:25%'>
{% trans 'Token' %}
</td>
<td>
<span id="my_access_token">
{% if not token is none %}
{{token|default('')}}
{% else %}
{% trans 'Le token n\'a pas encore ete genere' %}
{% endif %}
</span>
</td>
</tr>
<tr>
<td style='width:25%'></td>
<td><button id="generate_access" type="button" value="{{application.get_id}}">{% trans 'boutton::generer' %}</button></td>
</tr>
</tbody>
</table>
<div style='text-align:left'>
<a class="link" href="/developers/applications/"><button>{% trans 'boutton::retour' %}</button></a>
</div>
{% endblock %}