diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-03-16 23:56:42 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-03-20 21:56:42 +0100 |
commit | 3fae7f1d08be2debb5aff7d14e0976b6197323b8 (patch) | |
tree | 87a44e1b0206b790a22a54d8bcc2222531bd37c8 /src/Wallabag | |
parent | a0c6c244d9e873abee2c1d4b078f781e41ad8331 (diff) | |
download | wallabag-3fae7f1d08be2debb5aff7d14e0976b6197323b8.tar.gz wallabag-3fae7f1d08be2debb5aff7d14e0976b6197323b8.tar.zst wallabag-3fae7f1d08be2debb5aff7d14e0976b6197323b8.zip |
Add missing developer page
Diffstat (limited to 'src/Wallabag')
12 files changed, 176 insertions, 74 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/DeveloperController.php b/src/Wallabag/CoreBundle/Controller/DeveloperController.php index e5cfd83c..7cb0ead2 100644 --- a/src/Wallabag/CoreBundle/Controller/DeveloperController.php +++ b/src/Wallabag/CoreBundle/Controller/DeveloperController.php | |||
@@ -49,7 +49,7 @@ class DeveloperController extends Controller | |||
49 | 49 | ||
50 | $this->get('session')->getFlashBag()->add( | 50 | $this->get('session')->getFlashBag()->add( |
51 | 'notice', | 51 | 'notice', |
52 | 'New client created.' | 52 | 'flashes.developer.notice.client_created' |
53 | ); | 53 | ); |
54 | 54 | ||
55 | return $this->render('WallabagCoreBundle:Developer:client_parameters.html.twig', array( | 55 | return $this->render('WallabagCoreBundle:Developer:client_parameters.html.twig', array( |
@@ -80,7 +80,7 @@ class DeveloperController extends Controller | |||
80 | 80 | ||
81 | $this->get('session')->getFlashBag()->add( | 81 | $this->get('session')->getFlashBag()->add( |
82 | 'notice', | 82 | 'notice', |
83 | 'Client deleted' | 83 | 'flashes.developer.notice.client_deleted' |
84 | ); | 84 | ); |
85 | 85 | ||
86 | return $this->redirect($this->generateUrl('developer')); | 86 | return $this->redirect($this->generateUrl('developer')); |
diff --git a/src/Wallabag/CoreBundle/Form/Type/ClientType.php b/src/Wallabag/CoreBundle/Form/Type/ClientType.php index dd934715..9f620414 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ClientType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ClientType.php | |||
@@ -14,8 +14,8 @@ class ClientType extends AbstractType | |||
14 | public function buildForm(FormBuilderInterface $builder, array $options) | 14 | public function buildForm(FormBuilderInterface $builder, array $options) |
15 | { | 15 | { |
16 | $builder | 16 | $builder |
17 | ->add('redirect_uris', UrlType::class, array('required' => true, 'label' => 'Redirect URIs')) | 17 | ->add('redirect_uris', UrlType::class, array('required' => true, 'label' => 'developer.client.form.redirect_uris_label')) |
18 | ->add('save', SubmitType::class, array('label' => 'Create a new client')) | 18 | ->add('save', SubmitType::class, array('label' => 'developer.client.form.save_label')) |
19 | ; | 19 | ; |
20 | 20 | ||
21 | $builder->get('redirect_uris') | 21 | $builder->get('redirect_uris') |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 4f4ed215..1cd8b26e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | |||
@@ -325,6 +325,53 @@ import: | |||
325 | page_title: 'Import > Wallabag v2' | 325 | page_title: 'Import > Wallabag v2' |
326 | description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.' | 326 | description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.' |
327 | 327 | ||
328 | developer: | ||
329 | page_title: 'Developer' | ||
330 | welcome_message: 'Welcome to the wallabag API' | ||
331 | documentation: 'Documentation' | ||
332 | how_to_first_app: 'How to create my first application' | ||
333 | full_documentation: 'View full API documentation' | ||
334 | clients: | ||
335 | title: 'Clients' | ||
336 | create_new: 'Create a new client' | ||
337 | existing_clients: | ||
338 | title: 'Existing clients' | ||
339 | field_id: 'Client ID' | ||
340 | field_secret: 'Client secret' | ||
341 | field_uris: 'Redirect URIs' | ||
342 | field_grant_types: 'Grant type allowed' | ||
343 | no_client: 'No client yet.' | ||
344 | remove: | ||
345 | warn_message_1: 'You have the ability to remove this client. This action is IRREVERSIBLE !' | ||
346 | warn_message_2: "If you remove it, every app configured with that client won't be able to auth on your wallabag." | ||
347 | action: 'Remove this client' | ||
348 | client: | ||
349 | page_title: 'Developer > New client' | ||
350 | page_description: 'You are about to create a new client. Please fill the field below for the redirect URI of your application.' | ||
351 | form: | ||
352 | redirect_uris_label: 'Redirect URIs' | ||
353 | save_label: 'Create a new client' | ||
354 | action_back: 'Back' | ||
355 | client_parameter: | ||
356 | page_title: 'Developer > Client parameters' | ||
357 | page_description: 'Here are your client parameters.' | ||
358 | field_id: 'Client ID' | ||
359 | field_secret: 'Client secret' | ||
360 | back: 'Back' | ||
361 | read_howto: 'Read the howto "Create my first application"' | ||
362 | howto: | ||
363 | page_title: 'Developer > How to create my first application' | ||
364 | description: | ||
365 | paragraph_1: '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.' | ||
366 | paragraph_2: 'You need a token to communicate between your 3rd application and wallabag API.' | ||
367 | paragraph_3: 'To create this token, you need <a href="%link%">to create a new client</a>.' | ||
368 | paragraph_4: 'Now, create your token (replace client_id, client_secret, username and password with the good values):' | ||
369 | paragraph_5: 'The API will return a response like this:' | ||
370 | paragraph_6: 'The access_token is useful to do a call to the API endpoint. For example:' | ||
371 | paragraph_7: 'This call will return all the entries for your user.' | ||
372 | paragraph_8: 'If you want to see all the API endpoints, you can have a look <a href="%link%">to our API documentation</a>.' | ||
373 | back: 'Back' | ||
374 | |||
328 | validator: | 375 | validator: |
329 | password_must_match: 'The password fields must match.' | 376 | password_must_match: 'The password fields must match.' |
330 | password_too_short: 'Password should by at least 8 chars long' | 377 | password_too_short: 'Password should by at least 8 chars long' |
@@ -364,3 +411,7 @@ flashes: | |||
364 | failed: 'Import failed, please try again.' | 411 | failed: 'Import failed, please try again.' |
365 | failed_on_file: 'Error while processing import. Please verify your import file.' | 412 | failed_on_file: 'Error while processing import. Please verify your import file.' |
366 | summary: 'Import summary: %imported% imported, %skipped% already saved.' | 413 | summary: 'Import summary: %imported% imported, %skipped% already saved.' |
414 | developer: | ||
415 | notice: | ||
416 | client_created: 'New client created.' | ||
417 | client_deleted: 'Client deleted' | ||
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 959bd11c..b689f7cc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | |||
@@ -323,6 +323,53 @@ import: | |||
323 | page_title: 'Importer > Wallabag v2' | 323 | page_title: 'Importer > Wallabag v2' |
324 | description: "Cet outil va importer tous vos articles d'une autre instance de wallabag v2. Allez dans tous vos articles, puis, sur la barre latérale, cliquez sur \"JSON\". Vous allez récupérer un fichier \"All articles.json\"" | 324 | description: "Cet outil va importer tous vos articles d'une autre instance de wallabag v2. Allez dans tous vos articles, puis, sur la barre latérale, cliquez sur \"JSON\". Vous allez récupérer un fichier \"All articles.json\"" |
325 | 325 | ||
326 | developer: | ||
327 | page_title: 'Développeur' | ||
328 | welcome_message: "Bienvenue sur l'API de wallabag" | ||
329 | documentation: 'Documentation' | ||
330 | how_to_first_app: 'Comment créer votre première application' | ||
331 | full_documentation: "Voir la documentation complète de l'API" | ||
332 | clients: | ||
333 | title: 'Clients' | ||
334 | create_new: 'Créer une nouveau client' | ||
335 | existing_clients: | ||
336 | title: 'Les clients existants' | ||
337 | field_id: 'ID Client' | ||
338 | field_secret: 'Clé secrète' | ||
339 | field_uris: 'URLs de redirection' | ||
340 | field_grant_types: 'Type de privilège accordé' | ||
341 | no_client: 'Aucun client pour le moment' | ||
342 | remove: | ||
343 | warn_message_1: 'Vous avez la possibilité de supprimer un client. Cette action est IRREVERSIBLE !' | ||
344 | warn_message_2: "Si vous supprimez un client, toutes les applications qui l'utilisaient ne fonctionneront plus avec votre compte wallabag." | ||
345 | action: 'Supprimer ce client' | ||
346 | client: | ||
347 | page_title: 'Développeur > Nouveau client' | ||
348 | page_description: "Vous allez créer un nouveau client. Merci de remplir l'url de redirection vers votre application." | ||
349 | form: | ||
350 | redirect_uris_label: 'URLs de redirection' | ||
351 | save_label: 'Créer un nouveau client' | ||
352 | action_back: 'Retour' | ||
353 | client_parameter: | ||
354 | page_title: 'Développeur > Les paramètres de votre client' | ||
355 | page_description: 'Voilà les paramètres de votre client' | ||
356 | field_id: 'ID Client' | ||
357 | field_secret: 'Clé secrète' | ||
358 | back: 'Retour' | ||
359 | read_howto: 'Lire "comment créer ma première application"' | ||
360 | howto: | ||
361 | page_title: 'Développeur > Comment créer votre première application' | ||
362 | description: | ||
363 | paragraph_1: "Les commandes suivantes utilisent la <a href=\"https://github.com/jkbrzt/httpie\">librarie HTTPie</a>. Assurez-vous qu'elle soit installée avant de l'utiliser." | ||
364 | paragraph_2: "Vous avez besoin d'un token pour échanger entre votre application et l'API de wallabag." | ||
365 | paragraph_3: 'Pour créer un token, vous devez <a href="%link%">créer un nouveau client</a>.' | ||
366 | paragraph_4: 'Maintenant créez votre token (remplacer client_id, client_secret, username et password avec les bonnes valeurs):' | ||
367 | paragraph_5: "L'API vous retournera une réponse comme ça :" | ||
368 | paragraph_6: "L'access_token doit être utilisé pour faire un appel à l'API. Par exemple :" | ||
369 | paragraph_7: "Cet appel va retourner tous les articles de l'utilisateur." | ||
370 | paragraph_8: "Si vous voulez toutes les méthodes de l'API, jetez un oeil <a href=\"%link%\">à la documentation de l'API</a>." | ||
371 | back: 'Retour' | ||
372 | |||
326 | validator: | 373 | validator: |
327 | password_must_match: 'Les mots de passe doivent être identique' | 374 | password_must_match: 'Les mots de passe doivent être identique' |
328 | password_too_short: 'Le mot de passe doit avoir au moins 8 caractères' | 375 | password_too_short: 'Le mot de passe doit avoir au moins 8 caractères' |
@@ -362,3 +409,7 @@ flashes: | |||
362 | failed: "L'import a échoué, veuillez ré-essayer" | 409 | failed: "L'import a échoué, veuillez ré-essayer" |
363 | failed_on_file: "Erreur lors du traitement de l'import. Vérifier votre fichier." | 410 | failed_on_file: "Erreur lors du traitement de l'import. Vérifier votre fichier." |
364 | summary: "Rapport d'import: %imported% importés, %skipped% déjà présent." | 411 | summary: "Rapport d'import: %imported% importés, %skipped% déjà présent." |
412 | developer: | ||
413 | notice: | ||
414 | client_created: 'Nouveau client créé' | ||
415 | client_deleted: 'Client supprimé' | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/client.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/client.html.twig index c9ce6d08..78a9dc04 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/client.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/client.html.twig | |||
@@ -1,6 +1,6 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | 1 | {% extends "WallabagCoreBundle::layout.html.twig" %} |
2 | 2 | ||
3 | {% block title %}{% trans %}New client{% endtrans %}{% endblock %} | 3 | {% block title %}{{ 'developer.client.page_title'|trans }}{% endblock %} |
4 | 4 | ||
5 | {% block content %} | 5 | {% block content %} |
6 | <div class="row"> | 6 | <div class="row"> |
@@ -8,7 +8,7 @@ | |||
8 | <div class="card-panel settings"> | 8 | <div class="card-panel settings"> |
9 | 9 | ||
10 | <div class="row"> | 10 | <div class="row"> |
11 | <p>{% trans %}You are about to create a new client. Please fill the field below for the redirect URI of your application.{% endtrans %}</p> | 11 | <p>{{ 'developer.client.page_description'|trans }}</p> |
12 | {{ form_start(form) }} | 12 | {{ form_start(form) }} |
13 | {{ form_errors(form) }} | 13 | {{ form_errors(form) }} |
14 | 14 | ||
@@ -18,7 +18,7 @@ | |||
18 | {{ form_widget(form.redirect_uris) }} | 18 | {{ form_widget(form.redirect_uris) }} |
19 | </div> | 19 | </div> |
20 | 20 | ||
21 | <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a> | 21 | <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{{ 'developer.client.action_back'|trans }}</a> |
22 | {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} | 22 | {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} |
23 | 23 | ||
24 | {{ form_rest(form) }} | 24 | {{ form_rest(form) }} |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/client_parameters.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/client_parameters.html.twig index a214dfd0..b615fa3b 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/client_parameters.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/client_parameters.html.twig | |||
@@ -1,20 +1,20 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | 1 | {% extends "WallabagCoreBundle::layout.html.twig" %} |
2 | 2 | ||
3 | {% block title %}{% trans %}Client parameters{% endtrans %}{% endblock %} | 3 | {% block title %}{{ 'developer.client_parameter.page_title'|trans }}{% endblock %} |
4 | 4 | ||
5 | {% block content %} | 5 | {% block content %} |
6 | <div class="row"> | 6 | <div class="row"> |
7 | <div class="col s12"> | 7 | <div class="col s12"> |
8 | <div class="card-panel settings"> | 8 | <div class="card-panel settings"> |
9 | <div class="row"> | 9 | <div class="row"> |
10 | <p>{% trans %}Here are your client parameters.{% endtrans %}</p> | 10 | <p>{{ 'developer.client_parameter.page_description'|trans }}</p> |
11 | <ul> | 11 | <ul> |
12 | <li>{% trans %}Client ID{% endtrans %}: <strong><pre>{{ client_id }}</pre></strong></li> | 12 | <li>{{ 'developer.client_parameter.field_id'|trans }}: <strong><pre>{{ client_id }}</pre></strong></li> |
13 | <li>{% trans %}Client secret{% endtrans %}: <strong><pre>{{ client_secret }}</pre></strong></li> | 13 | <li>{{ 'developer.client_parameter.field_secret'|trans }}: <strong><pre>{{ client_secret }}</pre></strong></li> |
14 | </ul> | 14 | </ul> |
15 | 15 | ||
16 | <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a> | 16 | <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{{ 'developer.client_parameter.back'|trans }}</a> |
17 | <a href="{{ path('developer_howto_firstapp') }}" class="btn waves-effect waves-light">{% trans %}Read the howto "Create my first application"{% endtrans %}</a> | 17 | <a href="{{ path('developer_howto_firstapp') }}" class="btn waves-effect waves-light">{{ 'developer.client_parameter.read_howto'|trans }}</a> |
18 | </div> | 18 | </div> |
19 | </div> | 19 | </div> |
20 | </div> | 20 | </div> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/howto_app.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/howto_app.html.twig index 382e6311..acbc2c88 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/howto_app.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/howto_app.html.twig | |||
@@ -1,6 +1,6 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | 1 | {% extends "WallabagCoreBundle::layout.html.twig" %} |
2 | 2 | ||
3 | {% block title %}{% trans %}How to create my first application{% endtrans %}{% endblock %} | 3 | {% block title %}{{ 'developer.howto.page_title'|trans }}{% endblock %} |
4 | 4 | ||
5 | {% block css %} | 5 | {% block css %} |
6 | {{ parent() }} | 6 | {{ parent() }} |
@@ -13,10 +13,10 @@ | |||
13 | <div class="card-panel settings"> | 13 | <div class="card-panel settings"> |
14 | 14 | ||
15 | <div class="row"> | 15 | <div class="row"> |
16 | <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> | 16 | <p>{{ 'developer.howto.description.paragraph_1'|trans|raw }}</p> |
17 | <p>{% trans %}You need a token to communicate between your 3rd application and wallabag API.{% endtrans %}</p> | 17 | <p>{{ 'developer.howto.description.paragraph_2'|trans }}</p> |
18 | <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> | 18 | <p>{{ 'developer.howto.description.paragraph_3'|trans({'%link%': path('developer_create_client')})|raw }}</p> |
19 | <p>{% trans %}Now, create your token (replace client_id, client_secret, username and password with the good values):{% endtrans %}</p> | 19 | <p>{{ 'developer.howto.description.paragraph_4'|trans }}</p> |
20 | <p> | 20 | <p> |
21 | <pre><code class="language-bash">http POST http://v2.wallabag.org/oauth/v2/token \ | 21 | <pre><code class="language-bash">http POST http://v2.wallabag.org/oauth/v2/token \ |
22 | grant_type=password \ | 22 | grant_type=password \ |
@@ -25,7 +25,7 @@ | |||
25 | username=yourUsername \ | 25 | username=yourUsername \ |
26 | password=yourPassw0rd</code></pre> | 26 | password=yourPassw0rd</code></pre> |
27 | </p> | 27 | </p> |
28 | <p>{% trans %}The API will return a response like this:{% endtrans %}</p> | 28 | <p>{{ 'developer.howto.description.paragraph_5'|trans }}</p> |
29 | <p> | 29 | <p> |
30 | <pre><code class="language-bash">HTTP/1.1 200 OK | 30 | <pre><code class="language-bash">HTTP/1.1 200 OK |
31 | Cache-Control: no-store, private | 31 | Cache-Control: no-store, private |
@@ -45,14 +45,14 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13 | |||
45 | "token_type": "bearer" | 45 | "token_type": "bearer" |
46 | }</code></pre> | 46 | }</code></pre> |
47 | </p> | 47 | </p> |
48 | <p>{% trans %}The access_token is useful to do a call to the API endpoint. For example:{% endtrans %}</p> | 48 | <p>{{ 'developer.howto.description.paragraph_6'|trans }}</p> |
49 | <p> | 49 | <p> |
50 | <pre><code class="language-bash">http GET http://v2.wallabag.org/api/entries.json \ | 50 | <pre><code class="language-bash">http GET http://v2.wallabag.org/api/entries.json \ |
51 | "Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"</code></pre> | 51 | "Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"</code></pre> |
52 | </p> | 52 | </p> |
53 | <p>{% trans %}This call will return all the entries for your user.{% endtrans %}</p> | 53 | <p>{{ 'developer.howto.description.paragraph_7'|trans }}</p> |
54 | <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> | 54 | <p>{{ 'developer.howto.description.paragraph_8'|trans({'%link%': path('nelmio_api_doc_index')})|raw }}</p> |
55 | <p><a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a></p> | 55 | <p><a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{{ 'developer.howto.back'|trans }}</a></p> |
56 | </div> | 56 | </div> |
57 | 57 | ||
58 | </div> | 58 | </div> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/index.html.twig index 2e7dbcab..e12779b7 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/index.html.twig | |||
@@ -1,6 +1,6 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | 1 | {% extends "WallabagCoreBundle::layout.html.twig" %} |
2 | 2 | ||
3 | {% block title %}{% trans %}Developer{% endtrans %}{% endblock %} | 3 | {% block title %}{{ 'developer.page_title'|trans }}{% endblock %} |
4 | 4 | ||
5 | {% block content %} | 5 | {% block content %} |
6 | <div class="row"> | 6 | <div class="row"> |
@@ -8,21 +8,21 @@ | |||
8 | <div class="card-panel settings"> | 8 | <div class="card-panel settings"> |
9 | 9 | ||
10 | <div class="row"> | 10 | <div class="row"> |
11 | <h3>{% trans %}Welcome to the wallabag API{% endtrans %}</h3> | 11 | <h3>{{ 'developer.welcome_message'|trans }}</h3> |
12 | 12 | ||
13 | <h4>{% trans %}Documentation{% endtrans %}</h4> | 13 | <h4>{{ 'developer.documentation'|trans }}</h4> |
14 | 14 | ||
15 | <ul> | 15 | <ul> |
16 | <li><a href="{{ path('developer_howto_firstapp') }}">{% trans %}How to create my first application{% endtrans %}</a></li> | 16 | <li><a href="{{ path('developer_howto_firstapp') }}">{{ 'developer.how_to_first_app'|trans }}</a></li> |
17 | <li><a href="{{ path('nelmio_api_doc_index') }}">{% trans %}View full API documentation{% endtrans %}</a></li> | 17 | <li><a href="{{ path('nelmio_api_doc_index') }}">{{ 'developer.full_documentation'|trans }}</a></li> |
18 | </ul> | 18 | </ul> |
19 | 19 | ||
20 | <h4>{% trans %}Clients{% endtrans %}</h4> | 20 | <h4>{{ 'developer.clients.title'|trans }}</h4> |
21 | <ul> | 21 | <ul> |
22 | <li><a href="{{ path('developer_create_client') }}">{% trans %}Create a new client{% endtrans %}</a></li> | 22 | <li><a href="{{ path('developer_create_client') }}">{{ 'developer.clients.create_new'|trans }}</a></li> |
23 | </ul> | 23 | </ul> |
24 | 24 | ||
25 | <h4>{% trans %}Existing clients{% endtrans %}</h4> | 25 | <h4>{{ 'developer.existing_clients.title'|trans }}</h4> |
26 | {% if clients %} | 26 | {% if clients %} |
27 | <ul class="collapsible" data-collapsible="expandable"> | 27 | <ul class="collapsible" data-collapsible="expandable"> |
28 | {% for client in clients %} | 28 | {% for client in clients %} |
@@ -31,33 +31,33 @@ | |||
31 | <div class="collapsible-body"> | 31 | <div class="collapsible-body"> |
32 | <table class="striped"> | 32 | <table class="striped"> |
33 | <tr> | 33 | <tr> |
34 | <td>{% trans %}Client ID{% endtrans %}</td> | 34 | <td>{{ 'developer.existing_clients.field_id'|trans }}</td> |
35 | <td><strong><code>{{ client.id }}_{{ client.randomId }}</code></strong></td> | 35 | <td><strong><code>{{ client.id }}_{{ client.randomId }}</code></strong></td> |
36 | </tr> | 36 | </tr> |
37 | <tr> | 37 | <tr> |
38 | <td>{% trans %}Client secret{% endtrans %}</td> | 38 | <td>{{ 'developer.existing_clients.field_secret'|trans }}</td> |
39 | <td><strong><code>{{ client.secret }}</code></strong></td> | 39 | <td><strong><code>{{ client.secret }}</code></strong></td> |
40 | </tr> | 40 | </tr> |
41 | <tr> | 41 | <tr> |
42 | <td>{% trans %}Redirect URIs{% endtrans %}</td> | 42 | <td>{{ 'developer.existing_clients.field_uris'|trans }}</td> |
43 | <td><strong><code>{{ client.redirectUris|json_encode() }}</code></strong></td> | 43 | <td><strong><code>{{ client.redirectUris|json_encode() }}</code></strong></td> |
44 | </tr> | 44 | </tr> |
45 | <tr> | 45 | <tr> |
46 | <td>{% trans %}Grant type allowed{% endtrans %}</td> | 46 | <td>{{ 'developer.existing_clients.field_grant_types'|trans }}</td> |
47 | <td><strong><code>{{ client.allowedGrantTypes|json_encode() }}</code></strong></td> | 47 | <td><strong><code>{{ client.allowedGrantTypes|json_encode() }}</code></strong></td> |
48 | </tr> | 48 | </tr> |
49 | </table> | 49 | </table> |
50 | <p> | 50 | <p> |
51 | {% trans %}You have the ability to remove this client. This action is IRREVERSIBLE !{% endtrans %}<br/> | 51 | {{ 'developer.remove.warn_message_1'|trans }}<br/> |
52 | {% trans %}If you remove it, every app configured with that client won't be able to auth on your wallabag.{% endtrans %}<br/> | 52 | {{ 'developer.remove.warn_message_2'|trans }}<br/> |
53 | <a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{% trans %}Remove this client{% endtrans %}</a> | 53 | <a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{{ 'developer.remove.action'|trans }}</a> |
54 | </p> | 54 | </p> |
55 | </div> | 55 | </div> |
56 | </li> | 56 | </li> |
57 | {% endfor %} | 57 | {% endfor %} |
58 | </ul> | 58 | </ul> |
59 | {% else %} | 59 | {% else %} |
60 | {% trans %}No client yet.{% endtrans %} | 60 | {{ 'developer.existing_clients.no_client'|trans }} |
61 | {% endif %} | 61 | {% endif %} |
62 | </div> | 62 | </div> |
63 | 63 | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client.html.twig index c9ce6d08..78a9dc04 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client.html.twig | |||
@@ -1,6 +1,6 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | 1 | {% extends "WallabagCoreBundle::layout.html.twig" %} |
2 | 2 | ||
3 | {% block title %}{% trans %}New client{% endtrans %}{% endblock %} | 3 | {% block title %}{{ 'developer.client.page_title'|trans }}{% endblock %} |
4 | 4 | ||
5 | {% block content %} | 5 | {% block content %} |
6 | <div class="row"> | 6 | <div class="row"> |
@@ -8,7 +8,7 @@ | |||
8 | <div class="card-panel settings"> | 8 | <div class="card-panel settings"> |
9 | 9 | ||
10 | <div class="row"> | 10 | <div class="row"> |
11 | <p>{% trans %}You are about to create a new client. Please fill the field below for the redirect URI of your application.{% endtrans %}</p> | 11 | <p>{{ 'developer.client.page_description'|trans }}</p> |
12 | {{ form_start(form) }} | 12 | {{ form_start(form) }} |
13 | {{ form_errors(form) }} | 13 | {{ form_errors(form) }} |
14 | 14 | ||
@@ -18,7 +18,7 @@ | |||
18 | {{ form_widget(form.redirect_uris) }} | 18 | {{ form_widget(form.redirect_uris) }} |
19 | </div> | 19 | </div> |
20 | 20 | ||
21 | <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a> | 21 | <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{{ 'developer.client.action_back'|trans }}</a> |
22 | {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} | 22 | {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} |
23 | 23 | ||
24 | {{ form_rest(form) }} | 24 | {{ form_rest(form) }} |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client_parameters.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client_parameters.html.twig index a214dfd0..b615fa3b 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client_parameters.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client_parameters.html.twig | |||
@@ -1,20 +1,20 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | 1 | {% extends "WallabagCoreBundle::layout.html.twig" %} |
2 | 2 | ||
3 | {% block title %}{% trans %}Client parameters{% endtrans %}{% endblock %} | 3 | {% block title %}{{ 'developer.client_parameter.page_title'|trans }}{% endblock %} |
4 | 4 | ||
5 | {% block content %} | 5 | {% block content %} |
6 | <div class="row"> | 6 | <div class="row"> |
7 | <div class="col s12"> | 7 | <div class="col s12"> |
8 | <div class="card-panel settings"> | 8 | <div class="card-panel settings"> |
9 | <div class="row"> | 9 | <div class="row"> |
10 | <p>{% trans %}Here are your client parameters.{% endtrans %}</p> | 10 | <p>{{ 'developer.client_parameter.page_description'|trans }}</p> |
11 | <ul> | 11 | <ul> |
12 | <li>{% trans %}Client ID{% endtrans %}: <strong><pre>{{ client_id }}</pre></strong></li> | 12 | <li>{{ 'developer.client_parameter.field_id'|trans }}: <strong><pre>{{ client_id }}</pre></strong></li> |
13 | <li>{% trans %}Client secret{% endtrans %}: <strong><pre>{{ client_secret }}</pre></strong></li> | 13 | <li>{{ 'developer.client_parameter.field_secret'|trans }}: <strong><pre>{{ client_secret }}</pre></strong></li> |
14 | </ul> | 14 | </ul> |
15 | 15 | ||
16 | <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a> | 16 | <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{{ 'developer.client_parameter.back'|trans }}</a> |
17 | <a href="{{ path('developer_howto_firstapp') }}" class="btn waves-effect waves-light">{% trans %}Read the howto "Create my first application"{% endtrans %}</a> | 17 | <a href="{{ path('developer_howto_firstapp') }}" class="btn waves-effect waves-light">{{ 'developer.client_parameter.read_howto'|trans }}</a> |
18 | </div> | 18 | </div> |
19 | </div> | 19 | </div> |
20 | </div> | 20 | </div> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/howto_app.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/howto_app.html.twig index 382e6311..acbc2c88 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/howto_app.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/howto_app.html.twig | |||
@@ -1,6 +1,6 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | 1 | {% extends "WallabagCoreBundle::layout.html.twig" %} |
2 | 2 | ||
3 | {% block title %}{% trans %}How to create my first application{% endtrans %}{% endblock %} | 3 | {% block title %}{{ 'developer.howto.page_title'|trans }}{% endblock %} |
4 | 4 | ||
5 | {% block css %} | 5 | {% block css %} |
6 | {{ parent() }} | 6 | {{ parent() }} |
@@ -13,10 +13,10 @@ | |||
13 | <div class="card-panel settings"> | 13 | <div class="card-panel settings"> |
14 | 14 | ||
15 | <div class="row"> | 15 | <div class="row"> |
16 | <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> | 16 | <p>{{ 'developer.howto.description.paragraph_1'|trans|raw }}</p> |
17 | <p>{% trans %}You need a token to communicate between your 3rd application and wallabag API.{% endtrans %}</p> | 17 | <p>{{ 'developer.howto.description.paragraph_2'|trans }}</p> |
18 | <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> | 18 | <p>{{ 'developer.howto.description.paragraph_3'|trans({'%link%': path('developer_create_client')})|raw }}</p> |
19 | <p>{% trans %}Now, create your token (replace client_id, client_secret, username and password with the good values):{% endtrans %}</p> | 19 | <p>{{ 'developer.howto.description.paragraph_4'|trans }}</p> |
20 | <p> | 20 | <p> |
21 | <pre><code class="language-bash">http POST http://v2.wallabag.org/oauth/v2/token \ | 21 | <pre><code class="language-bash">http POST http://v2.wallabag.org/oauth/v2/token \ |
22 | grant_type=password \ | 22 | grant_type=password \ |
@@ -25,7 +25,7 @@ | |||
25 | username=yourUsername \ | 25 | username=yourUsername \ |
26 | password=yourPassw0rd</code></pre> | 26 | password=yourPassw0rd</code></pre> |
27 | </p> | 27 | </p> |
28 | <p>{% trans %}The API will return a response like this:{% endtrans %}</p> | 28 | <p>{{ 'developer.howto.description.paragraph_5'|trans }}</p> |
29 | <p> | 29 | <p> |
30 | <pre><code class="language-bash">HTTP/1.1 200 OK | 30 | <pre><code class="language-bash">HTTP/1.1 200 OK |
31 | Cache-Control: no-store, private | 31 | Cache-Control: no-store, private |
@@ -45,14 +45,14 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13 | |||
45 | "token_type": "bearer" | 45 | "token_type": "bearer" |
46 | }</code></pre> | 46 | }</code></pre> |
47 | </p> | 47 | </p> |
48 | <p>{% trans %}The access_token is useful to do a call to the API endpoint. For example:{% endtrans %}</p> | 48 | <p>{{ 'developer.howto.description.paragraph_6'|trans }}</p> |
49 | <p> | 49 | <p> |
50 | <pre><code class="language-bash">http GET http://v2.wallabag.org/api/entries.json \ | 50 | <pre><code class="language-bash">http GET http://v2.wallabag.org/api/entries.json \ |
51 | "Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"</code></pre> | 51 | "Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"</code></pre> |
52 | </p> | 52 | </p> |
53 | <p>{% trans %}This call will return all the entries for your user.{% endtrans %}</p> | 53 | <p>{{ 'developer.howto.description.paragraph_7'|trans }}</p> |
54 | <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> | 54 | <p>{{ 'developer.howto.description.paragraph_8'|trans({'%link%': path('nelmio_api_doc_index')})|raw }}</p> |
55 | <p><a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a></p> | 55 | <p><a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{{ 'developer.howto.back'|trans }}</a></p> |
56 | </div> | 56 | </div> |
57 | 57 | ||
58 | </div> | 58 | </div> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/index.html.twig index 2e7dbcab..e12779b7 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/index.html.twig | |||
@@ -1,6 +1,6 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | 1 | {% extends "WallabagCoreBundle::layout.html.twig" %} |
2 | 2 | ||
3 | {% block title %}{% trans %}Developer{% endtrans %}{% endblock %} | 3 | {% block title %}{{ 'developer.page_title'|trans }}{% endblock %} |
4 | 4 | ||
5 | {% block content %} | 5 | {% block content %} |
6 | <div class="row"> | 6 | <div class="row"> |
@@ -8,21 +8,21 @@ | |||
8 | <div class="card-panel settings"> | 8 | <div class="card-panel settings"> |
9 | 9 | ||
10 | <div class="row"> | 10 | <div class="row"> |
11 | <h3>{% trans %}Welcome to the wallabag API{% endtrans %}</h3> | 11 | <h3>{{ 'developer.welcome_message'|trans }}</h3> |
12 | 12 | ||
13 | <h4>{% trans %}Documentation{% endtrans %}</h4> | 13 | <h4>{{ 'developer.documentation'|trans }}</h4> |
14 | 14 | ||
15 | <ul> | 15 | <ul> |
16 | <li><a href="{{ path('developer_howto_firstapp') }}">{% trans %}How to create my first application{% endtrans %}</a></li> | 16 | <li><a href="{{ path('developer_howto_firstapp') }}">{{ 'developer.how_to_first_app'|trans }}</a></li> |
17 | <li><a href="{{ path('nelmio_api_doc_index') }}">{% trans %}View full API documentation{% endtrans %}</a></li> | 17 | <li><a href="{{ path('nelmio_api_doc_index') }}">{{ 'developer.full_documentation'|trans }}</a></li> |
18 | </ul> | 18 | </ul> |
19 | 19 | ||
20 | <h4>{% trans %}Clients{% endtrans %}</h4> | 20 | <h4>{{ 'developer.clients.title'|trans }}</h4> |
21 | <ul> | 21 | <ul> |
22 | <li><a href="{{ path('developer_create_client') }}">{% trans %}Create a new client{% endtrans %}</a></li> | 22 | <li><a href="{{ path('developer_create_client') }}">{{ 'developer.clients.create_new'|trans }}</a></li> |
23 | </ul> | 23 | </ul> |
24 | 24 | ||
25 | <h4>{% trans %}Existing clients{% endtrans %}</h4> | 25 | <h4>{{ 'developer.existing_clients.title'|trans }}</h4> |
26 | {% if clients %} | 26 | {% if clients %} |
27 | <ul class="collapsible" data-collapsible="expandable"> | 27 | <ul class="collapsible" data-collapsible="expandable"> |
28 | {% for client in clients %} | 28 | {% for client in clients %} |
@@ -31,33 +31,33 @@ | |||
31 | <div class="collapsible-body"> | 31 | <div class="collapsible-body"> |
32 | <table class="striped"> | 32 | <table class="striped"> |
33 | <tr> | 33 | <tr> |
34 | <td>{% trans %}Client ID{% endtrans %}</td> | 34 | <td>{{ 'developer.existing_clients.field_id'|trans }}</td> |
35 | <td><strong><code>{{ client.id }}_{{ client.randomId }}</code></strong></td> | 35 | <td><strong><code>{{ client.id }}_{{ client.randomId }}</code></strong></td> |
36 | </tr> | 36 | </tr> |
37 | <tr> | 37 | <tr> |
38 | <td>{% trans %}Client secret{% endtrans %}</td> | 38 | <td>{{ 'developer.existing_clients.field_secret'|trans }}</td> |
39 | <td><strong><code>{{ client.secret }}</code></strong></td> | 39 | <td><strong><code>{{ client.secret }}</code></strong></td> |
40 | </tr> | 40 | </tr> |
41 | <tr> | 41 | <tr> |
42 | <td>{% trans %}Redirect URIs{% endtrans %}</td> | 42 | <td>{{ 'developer.existing_clients.field_uris'|trans }}</td> |
43 | <td><strong><code>{{ client.redirectUris|json_encode() }}</code></strong></td> | 43 | <td><strong><code>{{ client.redirectUris|json_encode() }}</code></strong></td> |
44 | </tr> | 44 | </tr> |
45 | <tr> | 45 | <tr> |
46 | <td>{% trans %}Grant type allowed{% endtrans %}</td> | 46 | <td>{{ 'developer.existing_clients.field_grant_types'|trans }}</td> |
47 | <td><strong><code>{{ client.allowedGrantTypes|json_encode() }}</code></strong></td> | 47 | <td><strong><code>{{ client.allowedGrantTypes|json_encode() }}</code></strong></td> |
48 | </tr> | 48 | </tr> |
49 | </table> | 49 | </table> |
50 | <p> | 50 | <p> |
51 | {% trans %}You have the ability to remove this client. This action is IRREVERSIBLE !{% endtrans %}<br/> | 51 | {{ 'developer.remove.warn_message_1'|trans }}<br/> |
52 | {% trans %}If you remove it, every app configured with that client won't be able to auth on your wallabag.{% endtrans %}<br/> | 52 | {{ 'developer.remove.warn_message_2'|trans }}<br/> |
53 | <a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{% trans %}Remove this client{% endtrans %}</a> | 53 | <a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{{ 'developer.remove.action'|trans }}</a> |
54 | </p> | 54 | </p> |
55 | </div> | 55 | </div> |
56 | </li> | 56 | </li> |
57 | {% endfor %} | 57 | {% endfor %} |
58 | </ul> | 58 | </ul> |
59 | {% else %} | 59 | {% else %} |
60 | {% trans %}No client yet.{% endtrans %} | 60 | {{ 'developer.existing_clients.no_client'|trans }} |
61 | {% endif %} | 61 | {% endif %} |
62 | </div> | 62 | </div> |
63 | 63 | ||