Add missing developer page

This commit is contained in:
Jeremy Benoist
2016-03-16 23:56:42 +01:00
parent a0c6c244d9
commit 3fae7f1d08
12 changed files with 176 additions and 74 deletions

View File

@ -1,6 +1,6 @@
{% extends "WallabagCoreBundle::layout.html.twig" %}
{% block title %}{% trans %}New client{% endtrans %}{% endblock %}
{% block title %}{{ 'developer.client.page_title'|trans }}{% endblock %}
{% block content %}
<div class="row">
@ -8,7 +8,7 @@
<div class="card-panel settings">
<div class="row">
<p>{% trans %}You are about to create a new client. Please fill the field below for the redirect URI of your application.{% endtrans %}</p>
<p>{{ 'developer.client.page_description'|trans }}</p>
{{ form_start(form) }}
{{ form_errors(form) }}
@ -18,7 +18,7 @@
{{ form_widget(form.redirect_uris) }}
</div>
<a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a>
<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) }}

View File

@ -1,20 +1,20 @@
{% extends "WallabagCoreBundle::layout.html.twig" %}
{% block title %}{% trans %}Client parameters{% endtrans %}{% endblock %}
{% 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>{% trans %}Here are your client parameters.{% endtrans %}</p>
<p>{{ 'developer.client_parameter.page_description'|trans }}</p>
<ul>
<li>{% trans %}Client ID{% endtrans %}: <strong><pre>{{ client_id }}</pre></strong></li>
<li>{% trans %}Client secret{% endtrans %}: <strong><pre>{{ client_secret }}</pre></strong></li>
<li>{{ 'developer.client_parameter.field_id'|trans }}: <strong><pre>{{ client_id }}</pre></strong></li>
<li>{{ 'developer.client_parameter.field_secret'|trans }}: <strong><pre>{{ client_secret }}</pre></strong></li>
</ul>
<a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a>
<a href="{{ path('developer_howto_firstapp') }}" class="btn waves-effect waves-light">{% trans %}Read the howto "Create my first application"{% endtrans %}</a>
<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>

View File

@ -1,6 +1,6 @@
{% extends "WallabagCoreBundle::layout.html.twig" %}
{% block title %}{% trans %}How to create my first application{% endtrans %}{% endblock %}
{% block title %}{{ 'developer.howto.page_title'|trans }}{% endblock %}
{% block css %}
{{ parent() }}
@ -13,10 +13,10 @@
<div class="card-panel settings">
<div class="row">
<p>{% trans %}The following commands make use of the <a href="https://github.com/jkbrzt/httpie">HTTPie library</a>. Make sure it is installed on your system before using it.{% endtrans %}</p>
<p>{% trans %}You need a token to communicate between your 3rd application and wallabag API.{% endtrans %}</p>
<p>{% trans with {'%link%': path('developer_create_client')} %}To create this token, you need <a href="%link%">to create a new client</a>.{% endtrans %}</p>
<p>{% trans %}Now, create your token (replace client_id, client_secret, username and password with the good values):{% endtrans %}</p>
<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 http://v2.wallabag.org/oauth/v2/token \
grant_type=password \
@ -25,7 +25,7 @@
username=yourUsername \
password=yourPassw0rd</code></pre>
</p>
<p>{% trans %}The API will return a response like this:{% endtrans %}</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
@ -45,14 +45,14 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13
"token_type": "bearer"
}</code></pre>
</p>
<p>{% trans %}The access_token is useful to do a call to the API endpoint. For example:{% endtrans %}</p>
<p>{{ 'developer.howto.description.paragraph_6'|trans }}</p>
<p>
<pre><code class="language-bash">http GET http://v2.wallabag.org/api/entries.json \
"Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"</code></pre>
</p>
<p>{% trans %}This call will return all the entries for your user.{% endtrans %}</p>
<p>{% trans with {'%link%': path('nelmio_api_doc_index')} %}If you want to see all the API endpoints, you can have a look <a href="%link%">to our API documentation</a>.{% endtrans %}</p>
<p><a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a></p>
<p>{{ 'developer.howto.description.paragraph_7'|trans }}</p>
<p>{{ 'developer.howto.description.paragraph_8'|trans({'%link%': path('nelmio_api_doc_index')})|raw }}</p>
<p><a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{{ 'developer.howto.back'|trans }}</a></p>
</div>
</div>

View File

@ -1,6 +1,6 @@
{% extends "WallabagCoreBundle::layout.html.twig" %}
{% block title %}{% trans %}Developer{% endtrans %}{% endblock %}
{% block title %}{{ 'developer.page_title'|trans }}{% endblock %}
{% block content %}
<div class="row">
@ -8,21 +8,21 @@
<div class="card-panel settings">
<div class="row">
<h3>{% trans %}Welcome to the wallabag API{% endtrans %}</h3>
<h3>{{ 'developer.welcome_message'|trans }}</h3>
<h4>{% trans %}Documentation{% endtrans %}</h4>
<h4>{{ 'developer.documentation'|trans }}</h4>
<ul>
<li><a href="{{ path('developer_howto_firstapp') }}">{% trans %}How to create my first application{% endtrans %}</a></li>
<li><a href="{{ path('nelmio_api_doc_index') }}">{% trans %}View full API documentation{% endtrans %}</a></li>
<li><a href="{{ path('developer_howto_firstapp') }}">{{ 'developer.how_to_first_app'|trans }}</a></li>
<li><a href="{{ path('nelmio_api_doc_index') }}">{{ 'developer.full_documentation'|trans }}</a></li>
</ul>
<h4>{% trans %}Clients{% endtrans %}</h4>
<h4>{{ 'developer.clients.title'|trans }}</h4>
<ul>
<li><a href="{{ path('developer_create_client') }}">{% trans %}Create a new client{% endtrans %}</a></li>
<li><a href="{{ path('developer_create_client') }}">{{ 'developer.clients.create_new'|trans }}</a></li>
</ul>
<h4>{% trans %}Existing clients{% endtrans %}</h4>
<h4>{{ 'developer.existing_clients.title'|trans }}</h4>
{% if clients %}
<ul class="collapsible" data-collapsible="expandable">
{% for client in clients %}
@ -31,33 +31,33 @@
<div class="collapsible-body">
<table class="striped">
<tr>
<td>{% trans %}Client ID{% endtrans %}</td>
<td>{{ 'developer.existing_clients.field_id'|trans }}</td>
<td><strong><code>{{ client.id }}_{{ client.randomId }}</code></strong></td>
</tr>
<tr>
<td>{% trans %}Client secret{% endtrans %}</td>
<td>{{ 'developer.existing_clients.field_secret'|trans }}</td>
<td><strong><code>{{ client.secret }}</code></strong></td>
</tr>
<tr>
<td>{% trans %}Redirect URIs{% endtrans %}</td>
<td>{{ 'developer.existing_clients.field_uris'|trans }}</td>
<td><strong><code>{{ client.redirectUris|json_encode() }}</code></strong></td>
</tr>
<tr>
<td>{% trans %}Grant type allowed{% endtrans %}</td>
<td>{{ 'developer.existing_clients.field_grant_types'|trans }}</td>
<td><strong><code>{{ client.allowedGrantTypes|json_encode() }}</code></strong></td>
</tr>
</table>
<p>
{% trans %}You have the ability to remove this client. This action is IRREVERSIBLE !{% endtrans %}<br/>
{% trans %}If you remove it, every app configured with that client won't be able to auth on your wallabag.{% endtrans %}<br/>
<a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{% trans %}Remove this client{% endtrans %}</a>
{{ 'developer.remove.warn_message_1'|trans }}<br/>
{{ 'developer.remove.warn_message_2'|trans }}<br/>
<a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{{ 'developer.remove.action'|trans }}</a>
</p>
</div>
</li>
{% endfor %}
</ul>
{% else %}
{% trans %}No client yet.{% endtrans %}
{{ 'developer.existing_clients.no_client'|trans }}
{% endif %}
</div>

View File

@ -1,6 +1,6 @@
{% extends "WallabagCoreBundle::layout.html.twig" %}
{% block title %}{% trans %}New client{% endtrans %}{% endblock %}
{% block title %}{{ 'developer.client.page_title'|trans }}{% endblock %}
{% block content %}
<div class="row">
@ -8,7 +8,7 @@
<div class="card-panel settings">
<div class="row">
<p>{% trans %}You are about to create a new client. Please fill the field below for the redirect URI of your application.{% endtrans %}</p>
<p>{{ 'developer.client.page_description'|trans }}</p>
{{ form_start(form) }}
{{ form_errors(form) }}
@ -18,7 +18,7 @@
{{ form_widget(form.redirect_uris) }}
</div>
<a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a>
<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) }}

View File

@ -1,20 +1,20 @@
{% extends "WallabagCoreBundle::layout.html.twig" %}
{% block title %}{% trans %}Client parameters{% endtrans %}{% endblock %}
{% 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>{% trans %}Here are your client parameters.{% endtrans %}</p>
<p>{{ 'developer.client_parameter.page_description'|trans }}</p>
<ul>
<li>{% trans %}Client ID{% endtrans %}: <strong><pre>{{ client_id }}</pre></strong></li>
<li>{% trans %}Client secret{% endtrans %}: <strong><pre>{{ client_secret }}</pre></strong></li>
<li>{{ 'developer.client_parameter.field_id'|trans }}: <strong><pre>{{ client_id }}</pre></strong></li>
<li>{{ 'developer.client_parameter.field_secret'|trans }}: <strong><pre>{{ client_secret }}</pre></strong></li>
</ul>
<a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a>
<a href="{{ path('developer_howto_firstapp') }}" class="btn waves-effect waves-light">{% trans %}Read the howto "Create my first application"{% endtrans %}</a>
<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>

View File

@ -1,6 +1,6 @@
{% extends "WallabagCoreBundle::layout.html.twig" %}
{% block title %}{% trans %}How to create my first application{% endtrans %}{% endblock %}
{% block title %}{{ 'developer.howto.page_title'|trans }}{% endblock %}
{% block css %}
{{ parent() }}
@ -13,10 +13,10 @@
<div class="card-panel settings">
<div class="row">
<p>{% trans %}The following commands make use of the <a href="https://github.com/jkbrzt/httpie">HTTPie library</a>. Make sure it is installed on your system before using it.{% endtrans %}</p>
<p>{% trans %}You need a token to communicate between your 3rd application and wallabag API.{% endtrans %}</p>
<p>{% trans with {'%link%': path('developer_create_client')} %}To create this token, you need <a href="%link%">to create a new client</a>.{% endtrans %}</p>
<p>{% trans %}Now, create your token (replace client_id, client_secret, username and password with the good values):{% endtrans %}</p>
<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 http://v2.wallabag.org/oauth/v2/token \
grant_type=password \
@ -25,7 +25,7 @@
username=yourUsername \
password=yourPassw0rd</code></pre>
</p>
<p>{% trans %}The API will return a response like this:{% endtrans %}</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
@ -45,14 +45,14 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13
"token_type": "bearer"
}</code></pre>
</p>
<p>{% trans %}The access_token is useful to do a call to the API endpoint. For example:{% endtrans %}</p>
<p>{{ 'developer.howto.description.paragraph_6'|trans }}</p>
<p>
<pre><code class="language-bash">http GET http://v2.wallabag.org/api/entries.json \
"Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"</code></pre>
</p>
<p>{% trans %}This call will return all the entries for your user.{% endtrans %}</p>
<p>{% trans with {'%link%': path('nelmio_api_doc_index')} %}If you want to see all the API endpoints, you can have a look <a href="%link%">to our API documentation</a>.{% endtrans %}</p>
<p><a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a></p>
<p>{{ 'developer.howto.description.paragraph_7'|trans }}</p>
<p>{{ 'developer.howto.description.paragraph_8'|trans({'%link%': path('nelmio_api_doc_index')})|raw }}</p>
<p><a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{{ 'developer.howto.back'|trans }}</a></p>
</div>
</div>

View File

@ -1,6 +1,6 @@
{% extends "WallabagCoreBundle::layout.html.twig" %}
{% block title %}{% trans %}Developer{% endtrans %}{% endblock %}
{% block title %}{{ 'developer.page_title'|trans }}{% endblock %}
{% block content %}
<div class="row">
@ -8,21 +8,21 @@
<div class="card-panel settings">
<div class="row">
<h3>{% trans %}Welcome to the wallabag API{% endtrans %}</h3>
<h3>{{ 'developer.welcome_message'|trans }}</h3>
<h4>{% trans %}Documentation{% endtrans %}</h4>
<h4>{{ 'developer.documentation'|trans }}</h4>
<ul>
<li><a href="{{ path('developer_howto_firstapp') }}">{% trans %}How to create my first application{% endtrans %}</a></li>
<li><a href="{{ path('nelmio_api_doc_index') }}">{% trans %}View full API documentation{% endtrans %}</a></li>
<li><a href="{{ path('developer_howto_firstapp') }}">{{ 'developer.how_to_first_app'|trans }}</a></li>
<li><a href="{{ path('nelmio_api_doc_index') }}">{{ 'developer.full_documentation'|trans }}</a></li>
</ul>
<h4>{% trans %}Clients{% endtrans %}</h4>
<h4>{{ 'developer.clients.title'|trans }}</h4>
<ul>
<li><a href="{{ path('developer_create_client') }}">{% trans %}Create a new client{% endtrans %}</a></li>
<li><a href="{{ path('developer_create_client') }}">{{ 'developer.clients.create_new'|trans }}</a></li>
</ul>
<h4>{% trans %}Existing clients{% endtrans %}</h4>
<h4>{{ 'developer.existing_clients.title'|trans }}</h4>
{% if clients %}
<ul class="collapsible" data-collapsible="expandable">
{% for client in clients %}
@ -31,33 +31,33 @@
<div class="collapsible-body">
<table class="striped">
<tr>
<td>{% trans %}Client ID{% endtrans %}</td>
<td>{{ 'developer.existing_clients.field_id'|trans }}</td>
<td><strong><code>{{ client.id }}_{{ client.randomId }}</code></strong></td>
</tr>
<tr>
<td>{% trans %}Client secret{% endtrans %}</td>
<td>{{ 'developer.existing_clients.field_secret'|trans }}</td>
<td><strong><code>{{ client.secret }}</code></strong></td>
</tr>
<tr>
<td>{% trans %}Redirect URIs{% endtrans %}</td>
<td>{{ 'developer.existing_clients.field_uris'|trans }}</td>
<td><strong><code>{{ client.redirectUris|json_encode() }}</code></strong></td>
</tr>
<tr>
<td>{% trans %}Grant type allowed{% endtrans %}</td>
<td>{{ 'developer.existing_clients.field_grant_types'|trans }}</td>
<td><strong><code>{{ client.allowedGrantTypes|json_encode() }}</code></strong></td>
</tr>
</table>
<p>
{% trans %}You have the ability to remove this client. This action is IRREVERSIBLE !{% endtrans %}<br/>
{% trans %}If you remove it, every app configured with that client won't be able to auth on your wallabag.{% endtrans %}<br/>
<a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{% trans %}Remove this client{% endtrans %}</a>
{{ 'developer.remove.warn_message_1'|trans }}<br/>
{{ 'developer.remove.warn_message_2'|trans }}<br/>
<a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{{ 'developer.remove.action'|trans }}</a>
</p>
</div>
</li>
{% endfor %}
</ul>
{% else %}
{% trans %}No client yet.{% endtrans %}
{{ 'developer.existing_clients.no_client'|trans }}
{% endif %}
</div>