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
This commit is contained in:
Jeremy Benoist 2016-03-05 20:04:19 +01:00
parent 5bf8f3f164
commit 2c2308b783
12 changed files with 16 additions and 20 deletions

View file

@ -35,7 +35,7 @@ class DeveloperController extends Controller
$clientForm->handleRequest($request); $clientForm->handleRequest($request);
if ($clientForm->isValid()) { if ($clientForm->isValid()) {
$client->setAllowedGrantTypes(array('token', 'authorization_code','password')); $client->setAllowedGrantTypes(array('token', 'authorization_code', 'password'));
$em->persist($client); $em->persist($client);
$em->flush(); $em->flush();

View file

@ -15,7 +15,7 @@ class ClientType extends AbstractType
{ {
$builder $builder
->add('redirect_uris', UrlType::class, array('required' => true)) ->add('redirect_uris', UrlType::class, array('required' => true))
->add('save', SubmitType::class) ->add('save', SubmitType::class, array('label' => 'Create new client'))
; ;
$builder->get('redirect_uris') $builder->get('redirect_uris')

View file

@ -8,20 +8,20 @@
<div class="card-panel settings"> <div class="card-panel settings">
<div class="row"> <div class="row">
<p>{% trans %}You will create a new client. Please fill the field below for the redirect URI of your application:{% endtrans %}</p> <p>{% trans %}You are about to create a new client. Please fill the field below for the redirect URI of your application:{% endtrans %}</p>
{{ form_start(form) }} {{ form_start(form) }}
{{ form_errors(form) }} {{ form_errors(form) }}
<div class="input-field col s12"> <div class="input-field col s12">
{{ form_label(form.redirect_uris) }} {{ form_label(form.redirect_uris) }}
{{ form_errors(form.redirect_uris) }} {{ form_errors(form.redirect_uris) }}
{{ form_widget(form.redirect_uris) }} {{ form_widget(form.redirect_uris) }}
</div> </div>
<div class="hidden">{{ form_rest(form) }}</div>
<a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a> <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a>
<button class="btn waves-effect waves-light" type="submit" name="action"> {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
{% trans %}Create new client{% endtrans %}
</button> {{ form_rest(form) }}
</div> </div>
</div> </div>

View file

@ -17,8 +17,6 @@
<a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a> <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a>
<a href="{{ path('howto-firstapp') }}" class="btn waves-effect waves-light">{% trans %}Read the howto "Create my first application"{% endtrans %}</a> <a href="{{ path('howto-firstapp') }}" class="btn waves-effect waves-light">{% trans %}Read the howto "Create my first application"{% endtrans %}</a>
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -58,5 +58,5 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13
</div> </div>
</div> </div>
</div> </div>
<script src="{{ asset('bundles/wallabagcore/themes/_global/js/prism.js') }}"></script> <script src="{{ asset('bundles/wallabagcore/themes/_global/js/prism.js') }}"></script>
{% endblock %} {% endblock %}

View file

@ -28,5 +28,4 @@
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -56,6 +56,7 @@
{% endif %} {% endif %}
<li><a href="{{ path('import') }}">{% trans %}import{% endtrans %}</a></li> <li><a href="{{ path('import') }}">{% trans %}import{% endtrans %}</a></li>
<li><a href="{{ path('howto') }}">{% trans %}howto{% endtrans %}</a></li> <li><a href="{{ path('howto') }}">{% trans %}howto{% endtrans %}</a></li>
<li><a href="{{ path('developer') }}">{% trans %}Developer{% endtrans %}</a></li>
<li><a href="{{ path('about') }}">{% trans %}about{% endtrans %}</a></li> <li><a href="{{ path('about') }}">{% trans %}about{% endtrans %}</a></li>
<li><a class="icon icon-power" href="{{ path('fos_user_security_logout') }}" title="{% trans %}logout{% endtrans %}">{% trans %}logout{% endtrans %}</a></li> <li><a class="icon icon-power" href="{{ path('fos_user_security_logout') }}" title="{% trans %}logout{% endtrans %}">{% trans %}logout{% endtrans %}</a></li>
</ul> </ul>

View file

@ -8,20 +8,20 @@
<div class="card-panel settings"> <div class="card-panel settings">
<div class="row"> <div class="row">
<p>{% trans %}You will create a new client. Please fill the field below for the redirect URI of your application:{% endtrans %}</p> <p>{% trans %}You are about to create a new client. Please fill the field below for the redirect URI of your application:{% endtrans %}</p>
{{ form_start(form) }} {{ form_start(form) }}
{{ form_errors(form) }} {{ form_errors(form) }}
<div class="input-field col s12"> <div class="input-field col s12">
{{ form_label(form.redirect_uris) }} {{ form_label(form.redirect_uris) }}
{{ form_errors(form.redirect_uris) }} {{ form_errors(form.redirect_uris) }}
{{ form_widget(form.redirect_uris) }} {{ form_widget(form.redirect_uris) }}
</div> </div>
<div class="hidden">{{ form_rest(form) }}</div>
<a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a> <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a>
<button class="btn waves-effect waves-light" type="submit" name="action"> {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
{% trans %}Create new client{% endtrans %}
</button> {{ form_rest(form) }}
</div> </div>
</div> </div>

View file

@ -17,8 +17,6 @@
<a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a> <a href="{{ path('developer') }}" class="waves-effect waves-light grey btn">{% trans %}Back{% endtrans %}</a>
<a href="{{ path('howto-firstapp') }}" class="btn waves-effect waves-light">{% trans %}Read the howto "Create my first application"{% endtrans %}</a> <a href="{{ path('howto-firstapp') }}" class="btn waves-effect waves-light">{% trans %}Read the howto "Create my first application"{% endtrans %}</a>
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -58,5 +58,5 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13
</div> </div>
</div> </div>
</div> </div>
<script src="{{ asset('bundles/wallabagcore/themes/_global/js/prism.js') }}"></script> <script src="{{ asset('bundles/wallabagcore/themes/_global/js/prism.js') }}"></script>
{% endblock %} {% endblock %}

View file

@ -28,5 +28,4 @@
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -117,6 +117,7 @@
<p>{% trans %}powered by{% endtrans %} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a></p> <p>{% trans %}powered by{% endtrans %} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a></p>
<a class="grey-text text-lighten-4 right" href="{{ path('about') }}">{% trans %}About{% endtrans %}</a> <a class="grey-text text-lighten-4 right" href="{{ path('about') }}">{% trans %}About{% endtrans %}</a>
<a class="grey-text text-lighten-4 right" href="{{ path('developer') }}">{% trans %}Developer{% endtrans %} <a class="grey-text text-lighten-4 right" href="{{ path('developer') }}">{% trans %}Developer{% endtrans %}
&nbsp;-&nbsp;
</div> </div>
</div> </div>
</footer> </footer>