From 4d2cf30de1bcda2dd1acb220a3878545af925d57 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 21 Sep 2017 17:56:37 +0200 Subject: [PATCH] API: UI and command 'list' renamed with 'gists' --- app/locales/cn.yml | 5 ++ app/locales/de.yml | 5 ++ app/locales/en.yml | 6 ++ app/locales/es.yml | 5 ++ app/locales/fr.yml | 5 ++ src/Gist/Command/ListCommand.php | 2 +- src/Gist/Controller/MyController.php | 2 +- src/Gist/Resources/views/My/my.html.twig | 87 ++++++++++++++---------- 8 files changed, 78 insertions(+), 39 deletions(-) diff --git a/app/locales/cn.yml b/app/locales/cn.yml index 30c5aa7..adfe2d8 100644 --- a/app/locales/cn.yml +++ b/app/locales/cn.yml @@ -20,6 +20,11 @@ app: my: title: '我的 Gist' nothing: '这家伙很懒,暂时没有内容' + api: + title: 'API' + warning: 'Keep it secret!' + form: + generate: 'Regenerate' gist: untitled: '未命名' diff --git a/app/locales/de.yml b/app/locales/de.yml index 42cc012..c91934d 100644 --- a/app/locales/de.yml +++ b/app/locales/de.yml @@ -20,6 +20,11 @@ app: my: title: 'Meine Gists' nothing: 'Nichts zu finden (momentan)!' + api: + title: 'API' + warning: 'Keep it secret!' + form: + generate: 'Regenerate' gist: untitled: 'Ohne Titel' diff --git a/app/locales/en.yml b/app/locales/en.yml index 51630d3..ff80822 100644 --- a/app/locales/en.yml +++ b/app/locales/en.yml @@ -20,6 +20,12 @@ app: my: title: 'My gists' nothing: 'Nothing yet!' + api: + title: 'API' + warning: 'Keep it secret!' + form: + generate: 'Regenerate' + gist: untitled: 'Untitled' diff --git a/app/locales/es.yml b/app/locales/es.yml index 75cfe90..2d8176b 100644 --- a/app/locales/es.yml +++ b/app/locales/es.yml @@ -20,6 +20,11 @@ app: my: title: 'Mis Gists' nothing: 'Nada por ahora.' + api: + title: 'API' + warning: 'Keep it secret!' + form: + generate: 'Regenerate' gist: untitled: 'Sin título' diff --git a/app/locales/fr.yml b/app/locales/fr.yml index 7674d1b..8741cf5 100644 --- a/app/locales/fr.yml +++ b/app/locales/fr.yml @@ -20,6 +20,11 @@ app: my: title: 'Mes Gists' nothing: 'Rien pour le moment !' + api: + title: 'API' + warning: 'Gardez-la secrète !' + form: + generate: 'Regénérer' gist: untitled: 'Sans titre' diff --git a/src/Gist/Command/ListCommand.php b/src/Gist/Command/ListCommand.php index 4c2f1f9..878b443 100644 --- a/src/Gist/Command/ListCommand.php +++ b/src/Gist/Command/ListCommand.php @@ -25,7 +25,7 @@ class ListCommand extends Command protected function configure() { $this - ->setName('list') + ->setName('gists') ->setDescription('List gists using the API'); } diff --git a/src/Gist/Controller/MyController.php b/src/Gist/Controller/MyController.php index e54a76c..d59f315 100644 --- a/src/Gist/Controller/MyController.php +++ b/src/Gist/Controller/MyController.php @@ -63,7 +63,7 @@ class MyController extends Controller if (empty($apiKey)) { $regenerateApiKey = true; } - // FIXME: CSRF issue!. + // FIXME: CSRF issue! elseif ($request->request->get('apiKey') === $apiKey && $request->request->has('generateApiKey')) { $regenerateApiKey = true; } else { diff --git a/src/Gist/Resources/views/My/my.html.twig b/src/Gist/Resources/views/My/my.html.twig index 9f954bb..9ccbbc7 100644 --- a/src/Gist/Resources/views/My/my.html.twig +++ b/src/Gist/Resources/views/My/my.html.twig @@ -205,49 +205,62 @@ -
-
- {{ 'login.login.form.password.placeholder'|trans }} -
-
-
-
-

- {{ form_errors(passwordForm.currentPassword) }} - {{ form_widget(passwordForm.currentPassword) }} -

+ {% set apiEnabled = app.settings.api.enabled %} -

- {{ form_errors(passwordForm.newPassword) }} - {{ form_widget(passwordForm.newPassword) }} -

+
+
+
+
+ {{ 'login.login.form.password.placeholder'|trans }} +
+
+
+ +

+ {{ form_errors(passwordForm.currentPassword) }} + {{ form_widget(passwordForm.currentPassword) }} +

-

- {{ form_rest(passwordForm) }} - -

- -
-
-
+

+ {{ form_errors(passwordForm.newPassword) }} + {{ form_widget(passwordForm.newPassword) }} +

- {% if app.settings.api.enabled %} -
-
- {{ 'api.title'|trans }} -
-
-
-
-

- - -

-
+

+ {{ form_rest(passwordForm) }} + +

+ +
- {% endif %} + {% if apiEnabled %} +
+
+
+ {{ 'my.api.title'|trans }} +
+
+
+

{{ 'my.api.warning'|trans|raw }}

+ +
+
+

+ +

+

+ +

+
+
+
+
+
+
+ {% endif %} +
{% endblock %}