From 8a4690b6a56afd836c4d6ea7f640934fafa6c9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 16 Feb 2016 20:18:59 +0100 Subject: add tests --- .../views/themes/baggy/Developer/client.html.twig | 31 +++++++++++ .../baggy/Developer/client_parameters.html.twig | 25 +++++++++ .../themes/baggy/Developer/howto_app.html.twig | 62 ++++++++++++++++++++++ .../views/themes/baggy/Developer/index.html.twig | 32 +++++++++++ 4 files changed, 150 insertions(+) create mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/client.html.twig create mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/client_parameters.html.twig create mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/howto_app.html.twig create mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/index.html.twig (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/baggy') 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 new file mode 100644 index 00000000..061f4631 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/client.html.twig @@ -0,0 +1,31 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}New client{% endtrans %}{% endblock %} + +{% block content %} +
+
+
+ +
+

{% trans %}You will create a new client. Please fill the field below for the redirect URI of your application:{% endtrans %}

+ {{ form_start(form) }} + {{ form_errors(form) }} +
+ {{ form_label(form.redirect_uris) }} + {{ form_errors(form.redirect_uris) }} + {{ form_widget(form.redirect_uris) }} +
+ + + {% trans %}Back{% endtrans %} + +
+ +
+
+
+ +{% endblock %} 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 new file mode 100644 index 00000000..8e3966b9 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/client_parameters.html.twig @@ -0,0 +1,25 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}Client parameters{% endtrans %}{% endblock %} + +{% block content %} +
+
+
+
+

{% trans %}Here are your client parameters.{% endtrans %}

+

{% trans %}Make sure to copy these parameters now. You won’t be able to see them again!{% endtrans %}

+
    +
  • {% trans %}Client ID:{% endtrans %}
    {{ client_id }}
  • +
  • {% trans %}Client secret:{% endtrans %}
    {{ client_secret }}
  • +
+ + {% trans %}Back{% endtrans %} + {% trans %}Read the howto "Create my first application"{% endtrans %} +
+
+ +
+
+ +{% endblock %} 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 new file mode 100644 index 00000000..497bb308 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/howto_app.html.twig @@ -0,0 +1,62 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}How to create my first application{% endtrans %}{% endblock %} + +{% block css %} + {{ parent() }} + +{% endblock %} + +{% block content %} +
+
+
+ +
+

The following commands make use of the HTTPie library. Make sure it is installed on your system before using it.

+

You need a token to communicate between your 3rd application and wallabag API.

+

To create this token, you need to create a new client.

+

Now, create your token (replace client_id, client_secret, username and password with the good values):

+

+

http POST http://v2.wallabag.org/oauth/v2/token \
+    grant_type=password \
+    client_id=12_5um6nz50ceg4088c0840wwc0kgg44g00kk84og044ggkscso0k \
+    client_secret=3qd12zpeaxes8cwg8c0404g888co4wo8kc4gcw0occww8cgw4k \
+    username=yourUsername \
+    password=yourPassw0rd
+

+

The API will return a response like this:

+

+

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"
+}
+

+

The access_token is useful to do a call to the API endpoint. For example:

+

+

http GET http://v2.wallabag.org/api/entries.json \
+    "Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"
+

+

This call will return all the entries for your user.

+

If you want to see all the API endpoints, you can have a look to our API documentation.

+

{% trans %}Back{% endtrans %}

+
+ +
+
+
+ +{% endblock %} 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 new file mode 100644 index 00000000..b983883f --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Developer/index.html.twig @@ -0,0 +1,32 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}Developer{% endtrans %}{% endblock %} + +{% block content %} +
+
+
+ +
+

{% trans %}Welcome to the wallabag API{% endtrans %}

+ +

{% trans %}Documentation{% endtrans %}

+ + + +

{% trans %}Clients{% endtrans %}

+ + +
+ +
+
+
+ + +{% endblock %} -- cgit v1.2.3 From 2c2308b7830e24409c6f4a52b52a616803b1a515 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 5 Mar 2016 20:04:19 +0100 Subject: Cleanup form - Avoid too much hidden data in the form (instead of manually define the submit button and hide the default, use the default one !) - Fix HTML syntax in client_parameters - Add developer link in baggy menu - Fix space between link in material footer --- .../Resources/views/themes/baggy/Developer/client.html.twig | 10 +++++----- .../views/themes/baggy/Developer/client_parameters.html.twig | 2 -- .../Resources/views/themes/baggy/Developer/howto_app.html.twig | 2 +- .../Resources/views/themes/baggy/Developer/index.html.twig | 1 - .../CoreBundle/Resources/views/themes/baggy/layout.html.twig | 1 + 5 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/baggy') 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 061f4631..5cbe1c39 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 @@ -8,20 +8,20 @@
-

{% trans %}You will create a new client. Please fill the field below for the redirect URI of your application:{% endtrans %}

+

{% trans %}You are about to create a new client. Please fill the field below for the redirect URI of your application:{% endtrans %}

{{ form_start(form) }} {{ form_errors(form) }} +
{{ form_label(form.redirect_uris) }} {{ form_errors(form.redirect_uris) }} {{ form_widget(form.redirect_uris) }}
- {% trans %}Back{% endtrans %} - + {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} + + {{ 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 8e3966b9..a2a28d50 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 @@ -17,8 +17,6 @@ {% trans %}Back{% endtrans %} {% trans %}Read the howto "Create my first application"{% endtrans %} - - 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 497bb308..88788776 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 @@ -58,5 +58,5 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13 - + {% endblock %} 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 b983883f..87dd4a5f 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 @@ -28,5 +28,4 @@ - {% endblock %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig index 84604762..7f098066 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig @@ -56,6 +56,7 @@ {% endif %}
  • {% trans %}import{% endtrans %}
  • {% trans %}howto{% endtrans %}
  • +
  • {% trans %}Developer{% endtrans %}
  • {% trans %}about{% endtrans %}
  • {% trans %}logout{% endtrans %}
  • -- cgit v1.2.3 From 9bf15f02695823652a0e783c915b039836f51626 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 5 Mar 2016 21:44:39 +0100 Subject: Add listing clients Rename route to be more consistive (ie: prefixed with developer_) --- .../baggy/Developer/client_parameters.html.twig | 3 +- .../themes/baggy/Developer/howto_app.html.twig | 2 +- .../views/themes/baggy/Developer/index.html.twig | 41 ++++++++++++++++++++-- 3 files changed, 41 insertions(+), 5 deletions(-) (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/baggy') 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 a2a28d50..c2f7e95c 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 @@ -8,14 +8,13 @@

    {% trans %}Here are your client parameters.{% endtrans %}

    -

    {% trans %}Make sure to copy these parameters now. You won’t be able to see them again!{% endtrans %}

    • {% trans %}Client ID:{% endtrans %}
      {{ client_id }}
    • {% trans %}Client secret:{% endtrans %}
      {{ client_secret }}
    {% trans %}Back{% endtrans %} - {% trans %}Read the howto "Create my first application"{% endtrans %} + {% trans %}Read the howto "Create my first application"{% endtrans %}
    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 88788776..1aece1d9 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 @@ -15,7 +15,7 @@

    The following commands make use of the HTTPie library. Make sure it is installed on your system before using it.

    You need a token to communicate between your 3rd application and wallabag API.

    -

    To create this token, you need to create a new client.

    +

    To create this token, you need to create a new client.

    Now, create your token (replace client_id, client_secret, username and password with the good values):

    http POST http://v2.wallabag.org/oauth/v2/token \
    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 87dd4a5f..604bfec9 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
    @@ -13,15 +13,52 @@
                     

    {% trans %}Documentation{% endtrans %}

    {% trans %}Clients{% endtrans %}

    +

    {% trans %}Existing clients{% endtrans %}

    + {% if clients %} +
      + {% for client in clients %} +
    • +
      #{{ client.id }}
      +
      + + + + + + + + + + + + + + + + + +
      {% trans %}Client ID:{% endtrans %}{{ client.id }}_{{ client.randomId }}
      {% trans %}Client secret:{% endtrans %}{{ client.secret }}
      {% trans %}Redirect URIs:{% endtrans %}{{ client.redirectUris|json_encode() }}
      {% trans %}Grant type allowed:{% endtrans %}{{ client.allowedGrantTypes|json_encode() }}
      +

      + {% trans %}You have the ability to remove this client. This action is IRREVERSIBLE !{% endtrans %}
      + {% trans %}If you remove it, every app configured with that client won't be able to auth on your wallabag.{% endtrans %}
      + {% trans %}Remove this client{% endtrans %} +

      +
      +
    • + {% endfor %} +
    + {% else %} + {% trans %}No client yet.{% endtrans %} + {% endif %}
    -- cgit v1.2.3 From 1256f6fe34ed4e5f7a1d9eec2ac8092da44de191 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 5 Mar 2016 22:29:58 +0100 Subject: Add translations --- .../Resources/views/themes/baggy/Developer/client.html.twig | 2 +- .../views/themes/baggy/Developer/client_parameters.html.twig | 4 ++-- .../Resources/views/themes/baggy/Developer/index.html.twig | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/baggy') 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 5cbe1c39..c9ce6d08 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 @@ -8,7 +8,7 @@
    -

    {% trans %}You are about to create a new client. Please fill the field below for the redirect URI of your application:{% endtrans %}

    +

    {% trans %}You are about to create a new client. Please fill the field below for the redirect URI of your application.{% endtrans %}

    {{ form_start(form) }} {{ form_errors(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 c2f7e95c..a214dfd0 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 @@ -9,8 +9,8 @@

    {% trans %}Here are your client parameters.{% endtrans %}

      -
    • {% trans %}Client ID:{% endtrans %}
      {{ client_id }}
    • -
    • {% trans %}Client secret:{% endtrans %}
      {{ client_secret }}
    • +
    • {% trans %}Client ID{% endtrans %}:
      {{ client_id }}
    • +
    • {% trans %}Client secret{% endtrans %}:
      {{ client_secret }}
    {% trans %}Back{% endtrans %} 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 604bfec9..2e7dbcab 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 @@ -31,19 +31,19 @@
    - + - + - + - +
    {% trans %}Client ID:{% endtrans %}{% trans %}Client ID{% endtrans %} {{ client.id }}_{{ client.randomId }}
    {% trans %}Client secret:{% endtrans %}{% trans %}Client secret{% endtrans %} {{ client.secret }}
    {% trans %}Redirect URIs:{% endtrans %}{% trans %}Redirect URIs{% endtrans %} {{ client.redirectUris|json_encode() }}
    {% trans %}Grant type allowed:{% endtrans %}{% trans %}Grant type allowed{% endtrans %} {{ client.allowedGrantTypes|json_encode() }}
    -- cgit v1.2.3 From 2766668b59249e00e8c9077063bae17fe9cb5ec6 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 7 Mar 2016 08:58:08 +0100 Subject: Use external js & css --- .../Resources/views/themes/baggy/Developer/howto_app.html.twig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/baggy') 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 1aece1d9..84e49ede 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 @@ -4,7 +4,7 @@ {% block css %} {{ parent() }} - + {% endblock %} {% block content %} @@ -58,5 +58,6 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13
    - + + {% endblock %} -- cgit v1.2.3 From f17281417c481c85761552b7dad48a9a0d49248c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 7 Mar 2016 09:20:20 +0100 Subject: Translate "how to" page --- .../views/themes/baggy/Developer/howto_app.html.twig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/baggy') 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 84e49ede..382e6311 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 @@ -13,10 +13,10 @@
    -

    The following commands make use of the HTTPie library. Make sure it is installed on your system before using it.

    -

    You need a token to communicate between your 3rd application and wallabag API.

    -

    To create this token, you need to create a new client.

    -

    Now, create your token (replace client_id, client_secret, username and password with the good values):

    +

    {% trans %}The following commands make use of the HTTPie library. Make sure it is installed on your system before using it.{% endtrans %}

    +

    {% trans %}You need a token to communicate between your 3rd application and wallabag API.{% endtrans %}

    +

    {% trans with {'%link%': path('developer_create_client')} %}To create this token, you need to create a new client.{% endtrans %}

    +

    {% trans %}Now, create your token (replace client_id, client_secret, username and password with the good values):{% endtrans %}

    http POST http://v2.wallabag.org/oauth/v2/token \
         grant_type=password \
    @@ -25,7 +25,7 @@
         username=yourUsername \
         password=yourPassw0rd

    -

    The API will return a response like this:

    +

    {% trans %}The API will return a response like this:{% endtrans %}

    HTTP/1.1 200 OK
     Cache-Control: no-store, private
    @@ -45,13 +45,13 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13
         "token_type": "bearer"
     }

    -

    The access_token is useful to do a call to the API endpoint. For example:

    +

    {% trans %}The access_token is useful to do a call to the API endpoint. For example:{% endtrans %}

    http GET http://v2.wallabag.org/api/entries.json \
         "Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"

    -

    This call will return all the entries for your user.

    -

    If you want to see all the API endpoints, you can have a look to our API documentation.

    +

    {% trans %}This call will return all the entries for your user.{% endtrans %}

    +

    {% trans with {'%link%': path('nelmio_api_doc_index')} %}If you want to see all the API endpoints, you can have a look to our API documentation.{% endtrans %}

    {% trans %}Back{% endtrans %}

    -- cgit v1.2.3