forked from wallabag/wallabag
Move templates
This commit is contained in:
37
templates/Developer/client.html.twig
Normal file
37
templates/Developer/client.html.twig
Normal file
@ -0,0 +1,37 @@
|
||||
{% extends "layout.html.twig" %}
|
||||
|
||||
{% block title %}{{ 'developer.client.page_title'|trans }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<div class="card-panel settings">
|
||||
|
||||
<div class="row">
|
||||
<p>{{ 'developer.client.page_description'|trans }}</p>
|
||||
{{ form_start(form) }}
|
||||
{{ form_errors(form) }}
|
||||
|
||||
<div class="input-field col s12">
|
||||
{{ form_label(form.name) }}
|
||||
{{ form_errors(form.name) }}
|
||||
{{ form_widget(form.name) }}
|
||||
</div>
|
||||
|
||||
<div class="input-field col s12">
|
||||
{{ form_label(form.redirect_uris) }}
|
||||
{{ form_errors(form.redirect_uris) }}
|
||||
{{ form_widget(form.redirect_uris) }}
|
||||
</div>
|
||||
|
||||
<a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{{ 'developer.client.action_back'|trans }}</a>
|
||||
{{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
|
||||
|
||||
{{ form_rest(form) }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
41
templates/Developer/client_parameters.html.twig
Normal file
41
templates/Developer/client_parameters.html.twig
Normal file
@ -0,0 +1,41 @@
|
||||
{% extends "layout.html.twig" %}
|
||||
|
||||
{% block title %}{{ 'developer.client_parameter.page_title'|trans }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<div class="card-panel settings">
|
||||
<div class="row">
|
||||
<p>{{ 'developer.client_parameter.page_description'|trans }}</p>
|
||||
|
||||
<table class="striped">
|
||||
<tr>
|
||||
<td>{{ 'developer.client_parameter.field_name'|trans }}</td>
|
||||
<td><strong><code>{{ client_name }}</code></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'developer.client_parameter.field_id'|trans }}</td>
|
||||
<td>
|
||||
<strong><code>{{ client_id }}</code></strong>
|
||||
<button class="btn" data-clipboard-text="{{ client_id }}">{{ 'developer.client.copy_to_clipboard'|trans }}</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'developer.client_parameter.field_secret'|trans }}</td>
|
||||
<td>
|
||||
<strong><code>{{ client_secret }}</code></strong>
|
||||
<button class="btn" data-clipboard-text="{{ client_secret }}">{{ 'developer.client.copy_to_clipboard'|trans }}</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
||||
<a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{{ 'developer.client_parameter.back'|trans }}</a>
|
||||
<a href="{{ path('developer_howto_firstapp') }}" class="btn waves-effect waves-light">{{ 'developer.client_parameter.read_howto'|trans }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
56
templates/Developer/howto_app.html.twig
Normal file
56
templates/Developer/howto_app.html.twig
Normal file
@ -0,0 +1,56 @@
|
||||
{% extends "layout.html.twig" %}
|
||||
|
||||
{% block title %}{{ 'developer.howto.page_title'|trans }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<div class="card-panel settings">
|
||||
|
||||
<div class="row">
|
||||
<p>{{ 'developer.howto.description.paragraph_1'|trans|raw }}</p>
|
||||
<p>{{ 'developer.howto.description.paragraph_2'|trans }}</p>
|
||||
<p>{{ 'developer.howto.description.paragraph_3'|trans({'%link%': path('developer_create_client')})|raw }}</p>
|
||||
<p>{{ 'developer.howto.description.paragraph_4'|trans }}</p>
|
||||
<p>
|
||||
<pre><code class="language-bash">http POST {{ wallabag_url }}/oauth/v2/token \
|
||||
grant_type=password \
|
||||
client_id=12_5um6nz50ceg4088c0840wwc0kgg44g00kk84og044ggkscso0k \
|
||||
client_secret=3qd12zpeaxes8cwg8c0404g888co4wo8kc4gcw0occww8cgw4k \
|
||||
username=yourUsername \
|
||||
password=yourPassw0rd</code></pre>
|
||||
</p>
|
||||
<p>{{ 'developer.howto.description.paragraph_5'|trans }}</p>
|
||||
<p>
|
||||
<pre><code class="language-bash">HTTP/1.1 200 OK
|
||||
Cache-Control: no-store, private
|
||||
Connection: close
|
||||
Content-Type: application/json
|
||||
Date: Tue, 06 Oct 2015 18:24:03 GMT
|
||||
Host: localhost:8000
|
||||
Pragma: no-cache
|
||||
X-Debug-Token: be00a1
|
||||
X-Debug-Token-Link: /profiler/be00a1
|
||||
X-Powered-By: PHP/5.5.9-1ubuntu4.13
|
||||
{
|
||||
"access_token": "ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw",
|
||||
"expires_in": 3600,
|
||||
"refresh_token": "ODBjODU1NWUwNmUzZTBkNDQ5YWVlZTVlMjQ2Y2I0OWM2NTM1ZGM2M2Y3MDhjMTViM2U2MzYxYzRkMDk5ODRlZg",
|
||||
"scope": null,
|
||||
"token_type": "bearer"
|
||||
}</code></pre>
|
||||
</p>
|
||||
<p>{{ 'developer.howto.description.paragraph_6'|trans }}</p>
|
||||
<p>
|
||||
<pre><code class="language-bash">http GET {{ wallabag_url }}/api/entries.json \
|
||||
"Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"</code></pre>
|
||||
</p>
|
||||
<p>{{ 'developer.howto.description.paragraph_7'|trans }}</p>
|
||||
<p>{{ 'developer.howto.description.paragraph_8'|trans({'%link%': path('nelmio_api_doc.swagger_ui')})|raw }}</p>
|
||||
<p><a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{{ 'developer.howto.back'|trans }}</a></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
78
templates/Developer/index.html.twig
Normal file
78
templates/Developer/index.html.twig
Normal file
@ -0,0 +1,78 @@
|
||||
{% extends "layout.html.twig" %}
|
||||
|
||||
{% block title %}{{ 'developer.page_title'|trans }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<div class="card-panel settings">
|
||||
|
||||
<div class="row">
|
||||
<h3>{{ 'developer.welcome_message'|trans }}</h3>
|
||||
|
||||
<h4>{{ 'developer.documentation'|trans }}</h4>
|
||||
|
||||
<ul>
|
||||
<li><a href="{{ path('developer_howto_firstapp') }}">{{ 'developer.how_to_first_app'|trans }}</a></li>
|
||||
<li><a href="https://doc.wallabag.org/en/developer/api/readme.html">{{ 'developer.full_documentation'|trans }}</a></li>
|
||||
<li><a href="{{ path('nelmio_api_doc.swagger_ui') }}">{{ 'developer.list_methods'|trans }}</a></li>
|
||||
</ul>
|
||||
|
||||
<h4>{{ 'developer.clients.title'|trans }}</h4>
|
||||
<ul>
|
||||
<li><a href="{{ path('developer_create_client') }}" class="waves-effect waves-light btn">{{ 'developer.clients.create_new'|trans }}</a></li>
|
||||
</ul>
|
||||
|
||||
<h4>{{ 'developer.existing_clients.title'|trans }}</h4>
|
||||
{% if clients %}
|
||||
<ul class="collapsible" data-collapsible="expandable">
|
||||
{% for client in clients %}
|
||||
<li>
|
||||
<div class="collapsible-header">{{ client.name }} - #{{ client.id }}</div>
|
||||
<div class="collapsible-body">
|
||||
<table class="striped">
|
||||
<tr>
|
||||
<td>{{ 'developer.existing_clients.field_id'|trans }}</td>
|
||||
<td>
|
||||
<strong><code>{{ client.clientId }}</code></strong>
|
||||
<button class="btn" data-clipboard-text="{{ client.clientId }}">{{ 'developer.client.copy_to_clipboard'|trans }}</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'developer.existing_clients.field_secret'|trans }}</td>
|
||||
<td>
|
||||
<strong><code>{{ client.secret }}</code></strong>
|
||||
<button class="btn" data-clipboard-text="{{ client.secret }}">{{ 'developer.client.copy_to_clipboard'|trans }}</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'developer.existing_clients.field_uris'|trans }}</td>
|
||||
<td><strong><code>{{ client.redirectUris|json_encode() }}</code></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'developer.existing_clients.field_grant_types'|trans }}</td>
|
||||
<td><strong><code>{{ client.allowedGrantTypes|json_encode() }}</code></strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>{{ 'developer.remove.warn_message_1'|trans({'%name%': client.name}) }}</p>
|
||||
<p>{{ 'developer.remove.warn_message_2'|trans({'%name%': client.name}) }}</p>
|
||||
<form action="{{ path('developer_delete_client', {id: client.id}) }}" method="post" name="delete-client">
|
||||
<input type="hidden" name="token" value="{{ csrf_token('delete-client') }}" />
|
||||
|
||||
<button class="waves-effect waves-light btn red" type="submit">{{ 'developer.remove.action'|trans({'%name%': client.name}) }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
{{ 'developer.existing_clients.no_client'|trans }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user