Browse Source

API: UI and command 'list' renamed with 'gists'

tags/v1.7.0
Simon Vieille 2 years ago
parent
commit
4d2cf30de1

+ 5
- 0
app/locales/cn.yml View File

@@ -20,6 +20,11 @@ app:
my:
title: '我的 Gist'
nothing: '这家伙很懒,暂时没有内容'
api:
title: 'API'
warning: 'Keep it <strong>secret!</strong>'
form:
generate: 'Regenerate'

gist:
untitled: '未命名'

+ 5
- 0
app/locales/de.yml View File

@@ -20,6 +20,11 @@ app:
my:
title: 'Meine Gists'
nothing: 'Nichts zu finden (momentan)!'
api:
title: 'API'
warning: 'Keep it <strong>secret!</strong>'
form:
generate: 'Regenerate'

gist:
untitled: 'Ohne Titel'

+ 6
- 0
app/locales/en.yml View File

@@ -20,6 +20,12 @@ app:
my:
title: 'My gists'
nothing: 'Nothing yet!'
api:
title: 'API'
warning: 'Keep it <strong>secret!</strong>'
form:
generate: 'Regenerate'


gist:
untitled: 'Untitled'

+ 5
- 0
app/locales/es.yml View File

@@ -20,6 +20,11 @@ app:
my:
title: 'Mis Gists'
nothing: 'Nada por ahora.'
api:
title: 'API'
warning: 'Keep it <strong>secret!</strong>'
form:
generate: 'Regenerate'

gist:
untitled: 'Sin título'

+ 5
- 0
app/locales/fr.yml View File

@@ -20,6 +20,11 @@ app:
my:
title: 'Mes Gists'
nothing: 'Rien pour le moment !'
api:
title: 'API'
warning: 'Gardez-la <strong>secrète !</strong>'
form:
generate: 'Regénérer'

gist:
untitled: 'Sans titre'

+ 1
- 1
src/Gist/Command/ListCommand.php View File

@@ -25,7 +25,7 @@ class ListCommand extends Command
protected function configure()
{
$this
->setName('list')
->setName('gists')
->setDescription('List gists using the API');
}


+ 1
- 1
src/Gist/Controller/MyController.php View File

@@ -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 {

+ 51
- 38
src/Gist/Resources/views/My/my.html.twig View File

@@ -205,49 +205,62 @@
</div>
</div>

<div class="panel panel-default">
<div class="panel-heading">
{{ 'login.login.form.password.placeholder'|trans }}
</div>
<div class="panel-body">
<div class="tab-content">
<form action="{{ path('my', params) }}" method="post">
<p>
{{ form_errors(passwordForm.currentPassword) }}
{{ form_widget(passwordForm.currentPassword) }}
</p>

<p>
{{ form_errors(passwordForm.newPassword) }}
{{ form_widget(passwordForm.newPassword) }}
</p>

<p>
{{ form_rest(passwordForm) }}
<input type="submit" class="btn btn-primary" value="{{ 'form.submit'|trans }}">
</p>
</form>
{% set apiEnabled = app.settings.api.enabled %}

<div class="row">
<div class="col-md-{{ apiEnabled ? 6 : 12 }}">
<div class="panel panel-default">
<div class="panel-heading">
{{ 'login.login.form.password.placeholder'|trans }}
</div>
<div class="panel-body">
<div class="tab-content">
<form action="{{ path('my', params) }}" method="post">
<p>
{{ form_errors(passwordForm.currentPassword) }}
{{ form_widget(passwordForm.currentPassword) }}
</p>

<p>
{{ form_errors(passwordForm.newPassword) }}
{{ form_widget(passwordForm.newPassword) }}
</p>

<p>
{{ form_rest(passwordForm) }}
<input type="submit" class="btn btn-primary" value="{{ 'form.submit'|trans }}">
</p>
</form>
</div>
</div>
</div>
</div>
</div>
{% if apiEnabled %}
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
{{ 'my.api.title'|trans }}
</div>
<div class="panel-body">
<div class="tab-content">
<p>{{ 'my.api.warning'|trans|raw }}</p>

{% if app.settings.api.enabled %}
<div class="panel panel-default">
<div class="panel-heading">
{{ 'api.title'|trans }}
</div>
<div class="panel-body">
<div class="tab-content">
<form action="{{ path('my', params) }}" method="post">
<p>
<input type="text" name="apiKey" id="form-api-key" size="32" value="{{ apiKey }}" data-key="{{ apiKey }}">
<input type="submit" name="generateApiKey" value="{{ 'api.form.generate' }}">
</p>
</form>
<form action="{{ path('my', params) }}" method="post">
<div class="row">
<p class="col-md-12">
<input type="text" name="apiKey" id="form-api-key" class="form-control" value="{{ apiKey }}" data-key="{{ apiKey }}">
</p>
<p class="col-md-12">
<input type="submit" name="generateApiKey" value="{{ 'my.api.form.generate'|trans }}" class="btn btn-primary">
</p>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
</div>
</div>
</div>
{% endblock %}

Loading…
Cancel
Save