Allow encoding of an activity with configuration preset durations

fix #11

The activity form allow to receive pre-configured activity durations.

Those duration can be configured through the option
chill_activity.form.time_duration :

```yaml

chill_activity:
   form:
      time_duration:
         - { label: '12 minutes', seconds: 720 }
         # - ...

```

If a pre-existing activity receives a different time, the time is added
to the list of pre-configured duration time.
This commit is contained in:
2016-03-09 13:38:05 +01:00
parent f28a6e9fa0
commit 77b7333fea
9 changed files with 374 additions and 21 deletions

View File

@@ -27,6 +27,7 @@ services:
- "@chill.main.security.authorization.helper"
- "@doctrine.orm.entity_manager"
- "@chill.main.helper.translatable_string"
- "%chill_activity.form.time_duration%"
tags:
- { name: form.type, alias: chill_activitybundle_activity }

View File

@@ -24,6 +24,20 @@ Create: Créer
Back to the list: Retour à la liste
Save activity: Sauver l'activité
Reset form: Remise à zéro du formulaire
Choose the duration: Choisir la durée
5 minutes: 5 minutes
10 minutes: 10 minutes
15 minutes: 15 minutes
20 minutes: 20 minutes
25 minutes: 25 minutes
30 minutes: 30 minutes
45 minutes: 45 minutes
1 hour: 1 heure
1 hour 15: 1 heure 15
1 hour 30: 1 heure 30
1 hour 45: 1 heure 45
2 hours: 2 heures
#timeline
'%user% has done an %activity_type% on %date%': %user% a effectué une activité de type "%activity_type%" le %date%

View File

@@ -18,13 +18,13 @@
{% set activeRouteKey = 'chill_activity_activity_new' %}
{% block title %}{{ 'Activity create' |trans }}{% endblock title %}
{% block title 'Activity creation' |trans %}
{% block personcontent %}
<h2 class="chill-red">{{ "Activity creation"|trans }}</h1>
{{ form_start(form) }}
{{ 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>