add layout for form, consistency with reports

- add buttons at the bottom
This commit is contained in:
Julien Fastré 2015-07-05 23:58:15 +02:00
parent 7f367a857e
commit e0561340a5
5 changed files with 29 additions and 12 deletions

View File

@ -113,8 +113,6 @@ class ActivityController extends Controller
)
);
$form->add('submit', 'submit', array('label' => 'Create'));
return $form;
}

View File

@ -20,6 +20,8 @@ Scope: Cercle
Activity creation: Nouvelle activité
Create: Créer
Back to the list: Retour à la liste
Save activity: Sauver l'activité
Reset form: Remise à zéro du formulaire
#timeline
'%user% has done an %activity_type% on %date%': %user% a effectué une activité de type "%activity_type%" le %date%

View File

@ -23,7 +23,20 @@
{% block personcontent %}
<h1>{{ "Update activity"|trans }}</h1>
{{ form(edit_form) }}
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
<div class="grid-12 centered sticky-form-buttons">
<button class="sc-button green margin-10" type="submit"><i class="fa fa-save"></i> {{ 'Save activity'|trans }}</button>
<button class="sc-button red margin-10" type="reset"><i class="fa fa-eraser"></i> {{ 'Reset form'|trans }}</button>
</div>
{{ form_end(edit_form) }}
{# {{ form(delete_form) }} #}
{% endblock %}
{% block js %}
<script type="text/javascript">
chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]', '{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
</script>
{% endblock %}

View File

@ -23,13 +23,17 @@
{% block personcontent %}
<h1>{{ "Activity creation"|trans }}</h1>
{{ form(form) }}
{{ form_start(form) }}
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activity_list', {'person_id': person.id}) }}">
{{ "Back to the list" | trans }}
</a>
</li>
</ul>
{{ form_widget(form) }}
<div class="grid-12 centered sticky-form-buttons">
<button class="sc-button green margin-10" type="submit"><i class="fa fa-save"></i> {{ 'Add a new activity'|trans }}</button>
</div>
{{ form_end(form) }}
{% endblock %}
{% block js %}
<script type="text/javascript">
chill.displayAlertWhenLeavingUnsubmittedForm('form[name="{{ form.vars.form.vars.name }}"]', '{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
</script>
{% endblock %}

View File

@ -38,5 +38,5 @@
<i class="fa fa-pencil"></i> {{ 'Edit the activity'|trans }}
</a>
{{ form(delete_form) }}
{# {{ form(delete_form) }} #}
{% endblock personcontent %}