Commit f96e57ea authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Merge branch 'bootstrap-datetime-picker' into 'master'

Bootstrap datetime picker

See merge request !1
parents 59c512dd 85ffa995
Loading
Loading
Loading
Loading
Loading
+22
Changes for README.md: 22 added lines, 0 removed lines.
Original line number Diff line number Diff line
# UnicaenApp

Ce module :

Est une bibliothèque qui fournit des classes de base, utilisables hors contexte web (entités, validateurs, exceptions, etc.)

C'est aussi le module de base (fondations) de toutes nos applications web qui :

- fournit les infos par défaut concernant l'application (nom, description, version, etc.)
- fournit le contrôleur et les vues pour les pages à propos (URL “/apropos”), contacts (“/contact”), plan de navigation (“/plan”), mentions légales (“/mentions-legales”), informatique et libertés (“/informatique-et-libertes”).
- configure les routes par défaut /application/:controller/:action pointant sur les contrôleurs du module “Application” de l'application.
- configure le composant multilingue et fournit les traductions des textes présent dans ce module.
-  fournit les vues associées aux pages d'erreur (standard et “404”).
- fournit le canevas de page (layout).
- spécifie le “doctype” HTML par défaut (HTML5).
- désactive l'affichage détaillé des erreurs rencontrées (notamment les exceptions).
- crée la page de navigation “Accueil” (niveau 0) et ses pages de navigation filles (niveau 1) “UCBN”, à propos, contacts, plan de navigation, mentions légales, informatique et libertés.


## Documentation

- [Widgets](./doc/widgets.md)
+3 −3
Changes for config/module.config.php: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ namespace UnicaenApp;

use UnicaenApp\Service\Mailer\MailerService;
use UnicaenApp\Service\Mailer\MailerServiceFactory;
use UnicaenApp\View\Helper\QueryParamsHelperFactory;

return [
    /**
@@ -334,7 +333,8 @@ return [
            'userProfileSelect' => 'UnicaenAuth\View\Helper\UserProfileSelectFactory',
            'Message'           => 'UnicaenApp\Message\View\Helper\MessageHelperFactory',
            'messenger'         => 'UnicaenApp\View\Helper\MessengerFactory',
            'queryParams'       => QueryParamsHelperFactory::class,
            'queryParams'       => View\Helper\QueryParamsHelperFactory::class,
            'formControlGroup'  => Form\View\Helper\FormControlGroupFactory::class,
        ],
        'invokables'   => [
            'appConnection'             => 'UnicaenApp\View\Helper\AppConnection',
@@ -345,8 +345,8 @@ return [
            'multipageFormNav'          => 'UnicaenApp\Form\View\Helper\MultipageFormNav',
            'multipageFormRow'          => 'UnicaenApp\Form\View\Helper\MultipageFormRow',
            'multipageFormRecap'        => 'UnicaenApp\Form\View\Helper\MultipageFormRecap',
            'formControlGroup'          => 'UnicaenApp\Form\View\Helper\FormControlGroup',
            'formDate'                  => 'UnicaenApp\Form\View\Helper\FormDate',
            'formDateTime'              => Form\View\Helper\FormDateTime::class,
            'formDateInfSup'            => 'UnicaenApp\Form\View\Helper\FormDateInfSup',
            'formRowDateInfSup'         => 'UnicaenApp\Form\View\Helper\FormRowDateInfSup',
            'formSearchAndSelect'       => 'UnicaenApp\Form\View\Helper\FormSearchAndSelect',
+3
Changes for doc/widgets.md: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Widgets Javascript

[Bootstrap DatetimePicker](./widgets/bootstrap-datetimepicker.md)
 No newline at end of file
+37
Changes for doc/widgets/bootstrap-datetimepicker.md: 37 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Bootstrap DateTimePicker

Utilise le composant suivant : https://eonasdan.github.io/bootstrap-datetimepicker
pour dessiner des composants DateTime, Date ou Time.

## Installation

Attention : ce composant n'est pas activé par défaut. Il faut ajouter le code Javascript suivant
dans votre fichier `public/js/app.js` en adptant les URL débutant par `vendor/unicaen/app/` à votre contexte :

```javascript
/* DateTime Picker */
WidgetInitializer.add('bootstrap-datetimepicker', 'bootstrapDatetimepicker', function(){
    WidgetInitializer.includeJs(Url('vendor/unicaen/app/js/bootstrap-datetimepicker.min.js'));
    WidgetInitializer.includeCss(Url('vendor/unicaen/app/css/bootstrap-datetimepicker.min.css'));
});
```

## Usage

Voici un exemple de composant ajouté à un formulaire Zend :

```php
$this->add([
    'type'       => 'DateTime',
    'name'       => 'horaire-debut',
    'options'    => [
        'label'  => 'Horaire de début',
        'format' => \UnicaenApp\Util::DATETIME_FORMAT, /* Formats de DateTime au standard PHP. La conversion en format MomentJS est automatique */
        /* Placez ici d'autres options que vous souhaiteriez transmettre au widget */
    ],
]);
```

Ce code fait appel au composant standard `DateTime` du Zend Framework.
Il n'y a rien de spécifique à faire dans la vue, à part utiliser l'aide de vue `FormControlGroup` 
pour afficher le composant.
+5
Changes for public/css/bootstrap-datetimepicker.min.css: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
/*!
 * Datetimepicker for Bootstrap 3
 * version : 4.17.47
 * https://github.com/Eonasdan/bootstrap-datetimepicker/
 */.bootstrap-datetimepicker-widget{list-style:none}.bootstrap-datetimepicker-widget.dropdown-menu{display:block;margin:2px 0;padding:4px;width:19em}@media (min-width:768px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}@media (min-width:992px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}@media (min-width:1200px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}.bootstrap-datetimepicker-widget.dropdown-menu:before,.bootstrap-datetimepicker-widget.dropdown-menu:after{content:'';display:inline-block;position:absolute}.bootstrap-datetimepicker-widget.dropdown-menu.bottom:before{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,0.2);top:-7px;left:7px}.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after{border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid white;top:-6px;left:8px}.bootstrap-datetimepicker-widget.dropdown-menu.top:before{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;border-top-color:rgba(0,0,0,0.2);bottom:-7px;left:6px}.bootstrap-datetimepicker-widget.dropdown-menu.top:after{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid white;bottom:-6px;left:7px}.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before{left:auto;right:6px}.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after{left:auto;right:7px}.bootstrap-datetimepicker-widget .list-unstyled{margin:0}.bootstrap-datetimepicker-widget a[data-action]{padding:6px 0}.bootstrap-datetimepicker-widget a[data-action]:active{box-shadow:none}.bootstrap-datetimepicker-widget .timepicker-hour,.bootstrap-datetimepicker-widget .timepicker-minute,.bootstrap-datetimepicker-widget .timepicker-second{width:54px;font-weight:bold;font-size:1.2em;margin:0}.bootstrap-datetimepicker-widget button[data-action]{padding:6px}.bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Increment Hours"}.bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Increment Minutes"}.bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Decrement Hours"}.bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Decrement Minutes"}.bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Show Hours"}.bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Show Minutes"}.bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Toggle AM/PM"}.bootstrap-datetimepicker-widget .btn[data-action="clear"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Clear the picker"}.bootstrap-datetimepicker-widget .btn[data-action="today"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Set the date to today"}.bootstrap-datetimepicker-widget .picker-switch{text-align:center}.bootstrap-datetimepicker-widget .picker-switch::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Toggle Date and Time Screens"}.bootstrap-datetimepicker-widget .picker-switch td{padding:0;margin:0;height:auto;width:auto;line-height:inherit}.bootstrap-datetimepicker-widget .picker-switch td span{line-height:2.5;height:2.5em;width:100%}.bootstrap-datetimepicker-widget table{width:100%;margin:0}.bootstrap-datetimepicker-widget table td,.bootstrap-datetimepicker-widget table th{text-align:center;border-radius:4px}.bootstrap-datetimepicker-widget table th{height:20px;line-height:20px;width:20px}.bootstrap-datetimepicker-widget table th.picker-switch{width:145px}.bootstrap-datetimepicker-widget table th.disabled,.bootstrap-datetimepicker-widget table th.disabled:hover{background:none;color:#777;cursor:not-allowed}.bootstrap-datetimepicker-widget table th.prev::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Previous Month"}.bootstrap-datetimepicker-widget table th.next::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Next Month"}.bootstrap-datetimepicker-widget table thead tr:first-child th{cursor:pointer}.bootstrap-datetimepicker-widget table thead tr:first-child th:hover{background:#eee}.bootstrap-datetimepicker-widget table td{height:54px;line-height:54px;width:54px}.bootstrap-datetimepicker-widget table td.cw{font-size:.8em;height:20px;line-height:20px;color:#777}.bootstrap-datetimepicker-widget table td.day{height:20px;line-height:20px;width:20px}.bootstrap-datetimepicker-widget table td.day:hover,.bootstrap-datetimepicker-widget table td.hour:hover,.bootstrap-datetimepicker-widget table td.minute:hover,.bootstrap-datetimepicker-widget table td.second:hover{background:#eee;cursor:pointer}.bootstrap-datetimepicker-widget table td.old,.bootstrap-datetimepicker-widget table td.new{color:#777}.bootstrap-datetimepicker-widget table td.today{position:relative}.bootstrap-datetimepicker-widget table td.today:before{content:'';display:inline-block;border:solid transparent;border-width:0 0 7px 7px;border-bottom-color:#337ab7;border-top-color:rgba(0,0,0,0.2);position:absolute;bottom:4px;right:4px}.bootstrap-datetimepicker-widget table td.active,.bootstrap-datetimepicker-widget table td.active:hover{background-color:#337ab7;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.bootstrap-datetimepicker-widget table td.active.today:before{border-bottom-color:#fff}.bootstrap-datetimepicker-widget table td.disabled,.bootstrap-datetimepicker-widget table td.disabled:hover{background:none;color:#777;cursor:not-allowed}.bootstrap-datetimepicker-widget table td span{display:inline-block;width:54px;height:54px;line-height:54px;margin:2px 1.5px;cursor:pointer;border-radius:4px}.bootstrap-datetimepicker-widget table td span:hover{background:#eee}.bootstrap-datetimepicker-widget table td span.active{background-color:#337ab7;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.bootstrap-datetimepicker-widget table td span.old{color:#777}.bootstrap-datetimepicker-widget table td span.disabled,.bootstrap-datetimepicker-widget table td span.disabled:hover{background:none;color:#777;cursor:not-allowed}.bootstrap-datetimepicker-widget.usetwentyfour td.hour{height:27px;line-height:27px}.bootstrap-datetimepicker-widget.wider{width:21em}.bootstrap-datetimepicker-widget .datepicker-decades .decade{line-height:1.8em !important}.input-group.date .input-group-addon{cursor:pointer}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}
 No newline at end of file
Loading