diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/material/Developer')
4 files changed, 58 insertions, 32 deletions
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 08d1cb15..061f4631 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 | |||
@@ -8,13 +8,20 @@ | |||
8 | <div class="card-panel settings"> | 8 | <div class="card-panel settings"> |
9 | 9 | ||
10 | <div class="row"> | 10 | <div class="row"> |
11 | <h3>My client parameters</h3> | 11 | <p>{% trans %}You will create a new client. Please fill the field below for the redirect URI of your application:{% endtrans %}</p> |
12 | <p>Here are your client parameters.</p> | 12 | {{ form_start(form) }} |
13 | <ul> | 13 | {{ form_errors(form) }} |
14 | <li>Client ID: {{ client_id }}</li> | 14 | <div class="input-field col s12"> |
15 | <li>Client secret: {{ client_secret }}</li> | 15 | {{ form_label(form.redirect_uris) }} |
16 | </ul> | 16 | {{ form_errors(form.redirect_uris) }} |
17 | <a class="waves-effect waves-light btn" href="{{ path('developer') }}">Back to Developer main page</a> | 17 | {{ form_widget(form.redirect_uris) }} |
18 | </div> | ||
19 | <div class="hidden">{{ form_rest(form) }}</div> | ||
20 | |||
21 | <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a> | ||
22 | <button class="btn waves-effect waves-light" type="submit" name="action"> | ||
23 | {% trans %}Create new client{% endtrans %} | ||
24 | </button> | ||
18 | </div> | 25 | </div> |
19 | 26 | ||
20 | </div> | 27 | </div> |
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 new file mode 100644 index 00000000..8e3966b9 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client_parameters.html.twig | |||
@@ -0,0 +1,25 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{% trans %}Client parameters{% endtrans %}{% endblock %} | ||
4 | |||
5 | {% block content %} | ||
6 | <div class="row"> | ||
7 | <div class="col s12"> | ||
8 | <div class="card-panel settings"> | ||
9 | <div class="row"> | ||
10 | <p>{% trans %}Here are your client parameters.{% endtrans %}</p> | ||
11 | <p><strong>{% trans %}Make sure to copy these parameters now. You won’t be able to see them again!{% endtrans %}</strong></p> | ||
12 | <ul> | ||
13 | <li>{% trans %}Client ID:{% endtrans %} <strong><pre>{{ client_id }}</pre></strong></li> | ||
14 | <li>{% trans %}Client secret:{% endtrans %} <strong><pre>{{ client_secret }}</pre></strong></li> | ||
15 | </ul> | ||
16 | |||
17 | <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a> | ||
18 | <a href="{{ path('howto-firstapp') }}" class="btn waves-effect waves-light">{% trans %}Read the howto "Create my first application"{% endtrans %}</a> | ||
19 | </div> | ||
20 | </div> | ||
21 | |||
22 | </div> | ||
23 | </div> | ||
24 | </div> | ||
25 | {% endblock %} | ||
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 2db15b16..497bb308 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 | |||
@@ -2,6 +2,11 @@ | |||
2 | 2 | ||
3 | {% block title %}{% trans %}How to create my first application{% endtrans %}{% endblock %} | 3 | {% block title %}{% trans %}How to create my first application{% endtrans %}{% endblock %} |
4 | 4 | ||
5 | {% block css %} | ||
6 | {{ parent() }} | ||
7 | <link rel="stylesheet" href="{{ asset('bundles/wallabagcore/themes/_global/css/prism.css') }}"> | ||
8 | {% endblock %} | ||
9 | |||
5 | {% block content %} | 10 | {% block content %} |
6 | <div class="row"> | 11 | <div class="row"> |
7 | <div class="col s12"> | 12 | <div class="col s12"> |
@@ -13,22 +18,16 @@ | |||
13 | <p>To create this token, you need <a href="{{ path('create_client') }}">to create a new client</a>.</p> | 18 | <p>To create this token, you need <a href="{{ path('create_client') }}">to create a new client</a>.</p> |
14 | <p>Now, create your token (replace client_id, client_secret, username and password with the good values):</p> | 19 | <p>Now, create your token (replace client_id, client_secret, username and password with the good values):</p> |
15 | <p> | 20 | <p> |
16 | <code> | 21 | <pre><code class="language-bash">http POST http://v2.wallabag.org/oauth/v2/token \ |
17 | <pre> | ||
18 | http POST http://v2.wallabag.org/oauth/v2/token \ | ||
19 | grant_type=password \ | 22 | grant_type=password \ |
20 | client_id=12_5um6nz50ceg4088c0840wwc0kgg44g00kk84og044ggkscso0k \ | 23 | client_id=12_5um6nz50ceg4088c0840wwc0kgg44g00kk84og044ggkscso0k \ |
21 | client_secret=3qd12zpeaxes8cwg8c0404g888co4wo8kc4gcw0occww8cgw4k \ | 24 | client_secret=3qd12zpeaxes8cwg8c0404g888co4wo8kc4gcw0occww8cgw4k \ |
22 | username=yourUsername \ | 25 | username=yourUsername \ |
23 | password=yourPassw0rd | 26 | password=yourPassw0rd</code></pre> |
24 | </pre> | ||
25 | </code> | ||
26 | </p> | 27 | </p> |
27 | <p>The API will return a response like this:</p> | 28 | <p>The API will return a response like this:</p> |
28 | <p> | 29 | <p> |
29 | <code> | 30 | <pre><code class="language-bash">HTTP/1.1 200 OK |
30 | <pre> | ||
31 | HTTP/1.1 200 OK | ||
32 | Cache-Control: no-store, private | 31 | Cache-Control: no-store, private |
33 | Connection: close | 32 | Connection: close |
34 | Content-Type: application/json | 33 | Content-Type: application/json |
@@ -44,25 +43,20 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13 | |||
44 | "refresh_token": "ODBjODU1NWUwNmUzZTBkNDQ5YWVlZTVlMjQ2Y2I0OWM2NTM1ZGM2M2Y3MDhjMTViM2U2MzYxYzRkMDk5ODRlZg", | 43 | "refresh_token": "ODBjODU1NWUwNmUzZTBkNDQ5YWVlZTVlMjQ2Y2I0OWM2NTM1ZGM2M2Y3MDhjMTViM2U2MzYxYzRkMDk5ODRlZg", |
45 | "scope": null, | 44 | "scope": null, |
46 | "token_type": "bearer" | 45 | "token_type": "bearer" |
47 | } | 46 | }</code></pre> |
48 | </pre> | ||
49 | </code> | ||
50 | </p> | 47 | </p> |
51 | <p>The access_token is useful to do a call to the API endpoint. For example:</p> | 48 | <p>The access_token is useful to do a call to the API endpoint. For example:</p> |
52 | <p> | 49 | <p> |
53 | <code> | 50 | <pre><code class="language-bash">http GET http://v2.wallabag.org/api/entries.json \ |
54 | <pre> | 51 | "Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"</code></pre> |
55 | http GET http://v2.wallabag.org/api/entries.json \ | ||
56 | "Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw" | ||
57 | </pre> | ||
58 | </code> | ||
59 | </p> | 52 | </p> |
60 | <p>This call will return all the entries for your user.</p> | 53 | <p>This call will return all the entries for your user.</p> |
61 | <p>If you want to see all the API endpoints, you can have a look <a href="{{ path('nelmio_api_doc_index') }}">to our API documentation</a>.</p> | 54 | <p>If you want to see all the API endpoints, you can have a look <a href="{{ path('nelmio_api_doc_index') }}">to our API documentation</a>.</p> |
62 | <p><a class="waves-effect waves-light btn" href="{{ path('developer') }}">Back to Developer main page</a></p> | 55 | <p><a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a></p> |
63 | </div> | 56 | </div> |
64 | 57 | ||
65 | </div> | 58 | </div> |
66 | </div> | 59 | </div> |
67 | </div> | 60 | </div> |
61 | <script src="{{ asset('bundles/wallabagcore/themes/_global/js/prism.js') }}"></script> | ||
68 | {% endblock %} | 62 | {% endblock %} |
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 3507b654..b983883f 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 | |||
@@ -8,18 +8,18 @@ | |||
8 | <div class="card-panel settings"> | 8 | <div class="card-panel settings"> |
9 | 9 | ||
10 | <div class="row"> | 10 | <div class="row"> |
11 | <h3>Welcome to the wallabag API</h3> | 11 | <h3>{% trans %}Welcome to the wallabag API{% endtrans %}</h3> |
12 | 12 | ||
13 | <h4>Documentation</h4> | 13 | <h4>{% trans %}Documentation{% endtrans %}</h4> |
14 | 14 | ||
15 | <ul> | 15 | <ul> |
16 | <li><a href="{{ path('howto-firstapp') }}">How to create my first application</a></li> | 16 | <li><a href="{{ path('howto-firstapp') }}">{% trans %}How to create my first application{% endtrans %}</a></li> |
17 | <li><a href="{{ path('nelmio_api_doc_index') }}">View full API documentation</a></li> | 17 | <li><a href="{{ path('nelmio_api_doc_index') }}">{% trans %}View full API documentation{% endtrans %}</a></li> |
18 | </ul> | 18 | </ul> |
19 | 19 | ||
20 | <h4>My clients</h4> | 20 | <h4>{% trans %}Clients{% endtrans %}</h4> |
21 | <ul> | 21 | <ul> |
22 | <li><a href="{{ path('create_client') }}">Create a new client</a></li> | 22 | <li><a href="{{ path('create_client') }}">{% trans %}Create a new client{% endtrans %}</a></li> |
23 | </ul> | 23 | </ul> |
24 | 24 | ||
25 | </div> | 25 | </div> |