Commit 5a4e575e authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Menu information en aide de vue

parent 22cd66f2
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ use Application\Service\EcoleDoctorale\EcoleDoctoraleService;
use Application\Service\Etablissement\EtablissementService;
use Application\Service\These\TheseService;
use Application\Service\Variable\VariableService;
use Information\Service\InformationService;
use Interop\Container\ContainerInterface;
use Zend\Authentication\AuthenticationServiceInterface;

@@ -41,6 +42,12 @@ class IndexControllerFactory
        $ecoleDoctoraleService = $container->get(EcoleDoctoraleService::class);
        $controller->setEcoleDoctoraleService($ecoleDoctoraleService);

        /**
         * @var InformationService $informationService
         */
        $informationService = $container->get(InformationService::class);
        $controller->setInformationService($informationService);

        /**
         * @var VariableService $variableService
         */
+3 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ use Application\Service\EcoleDoctorale\EcoleDoctoraleServiceAwareTrait;
use Application\Service\Etablissement\EtablissementServiceAwareTrait;
use Application\Service\These\TheseServiceAwareTrait;
use Application\Service\Variable\VariableServiceAwareTrait;
use Information\Service\InformationServiceAwareTrait;
use UnicaenApp\Exception\RuntimeException;
use Zend\Authentication\AuthenticationServiceInterface;
use Zend\Http\Response;
@@ -21,6 +22,7 @@ class IndexController extends AbstractController
    use EtablissementServiceAwareTrait;
    use TheseServiceAwareTrait;
    use ActualiteServiceAwareTrait;
    use InformationServiceAwareTrait;

    /**
     * @var AuthenticationServiceInterface
@@ -72,6 +74,7 @@ class IndexController extends AbstractController
            'estDoctorant' => (bool) $this->userContextService->getIdentityDoctorant(),
            'url' => $this->actualiteService->isActif() ? $this->actualiteService->getUrl() : null,
            'offre' => $this->actualiteService->isOffre() ? $this->getEcoleDoctoraleService()->getOffre() : null,
            'informations' => $this->informationService->getInformations(true),
        ]);

        if ($response instanceof ViewModel) {
+9 −8
Original line number Diff line number Diff line
@@ -4,10 +4,12 @@
 * @var Role        $role Rôle courant
 * @var bool        $estDoctorant
 * @var array       $offre
 * @var Information[]       $informations
 */

use Application\Entity\Db\Role;
use Application\View\Renderer\PhpRenderer;
use Information\Entity\Db\Information;

$appName = $this->appInfos()->nom;
$subtitle = $this->appInfos()->desc;
@@ -23,17 +25,16 @@ echo $this->messenger()
<div class="row">

    <div id="sidebar" class="col-xs-12 col-md-2" role="navigation">
<!--        <div class="menu-information-header">-->
<!--            <ul class="nav nav-pills nav-stacked"><li>Informations générales</li></ul>-->
<!--        </div>-->
            <?php
               echo $this->navigation()->menu('Zend\Navigation\Information')
                  ->setUlClass('nav nav-pills nav-stacked menu-information')
                  ->setMinDepth(1)
                  ->setMaxDepth(1)
                  ->render();
//               echo $this->navigation()->menu('Zend\Navigation\Information')
//                  ->setUlClass('nav nav-pills nav-stacked menu-information')
//                  ->setMinDepth(1)
//                  ->setMaxDepth(1)
//                  ->render();
            ?>

            <?php echo $this->partial('application/index/partial/informations', ['informations' => $informations]) ?>

            <?php echo $this->partial('application/index/partial/actualites') ?>

            <?php if($offre) : ?>
+57 −0
Original line number Diff line number Diff line
<?php

/**
 * @var Information[] $informations
 **/

use Information\Entity\Db\Information;


?>
<ul class="menu-actualites nav nav-pills nav-stacked" style="padding: 1rem;">

    <span class="langue" id="FR">FR</span> |
    <span class="langue" id="EN">EN</span>

    <ul class="nav nav-pills nav-stacked informations">
        <?php foreach ($informations as $information) : ?>
        <li class="<?php echo $information->getLangue(); ?>">
            <a href="<?php echo $this->url('informations/afficher', ['id' => $information->getId()], [], true); ?>">
            <?php echo $information->getTitre(); ?>
            </a>
        </li>

        <?php endforeach; ?>
    </ul>
</ul>

<style>
    .selected {
        font-weight: bold;
        color: #0a3783;
    }

    .langue {
        cursor: pointer;
    }
</style>

<script>
    function showBonneLangue(langue) {
        $('ul.informations li').hide();
        $('span.langue').removeClass('selected');
        $('ul.informations li.' + langue).show();
        $('span.langue#' + langue).addClass('selected');
    }

    showBonneLangue('FR');

    $(function() {
        $('span.langue').on('click', function(event) {
            let langue = $(this).attr('id');
            // $('ul.informations li').hide();
            // $('ul.informations li.' + langue).show();
            showBonneLangue(langue);
        });
    });
</script>
 No newline at end of file
+30 −30
Original line number Diff line number Diff line
@@ -240,36 +240,36 @@ return [
            ],
        ],
        'information' => [
            'accueil' => [
                'label' => 'Accueil',
                'route' => 'home',
                'pages' => [
                    'doctorat' => [
                        'label' => 'Le doctorat',
                        'route' => 'informations/afficher',
                        'params' => ['id' => 61],
                        'title' => "Informations sur le doctorat et sa gestion"
                    ],
                    'ecoles-doctorales' => [
                        'label' => 'Les Ecoles Doctorales',
                        'route' => 'informations/afficher',
                        'params' => ['id' => 81],
                        'title' => "Informations sur les Ecoles Doctorales et le Collège des Ecoles doctorales"
                    ],
                    'guide-these' => [
                        'label' => 'Guide de la thèse',
                        'route' => 'informations/afficher',
                        'params' => ['id' => 82],
                        'title' => "Informations sur le déroulement de la thèse et formulaires administratifs à l’intention du doctorant et de ses encadrants"
                    ],
                    'guide-utilisation' => [
                        'label' => 'Guide d\'utilisation',
                        'route' => 'informations/afficher',
                        'params' => ['id' => 162],
                        'title' => "Guide d'utilisation de l'application SyGAL",
                    ],
                ],
            ],
//            'accueil' => [
//                'label' => 'Accueil',
//                'route' => 'home',
//                'pages' => [
//                    'doctorat' => [
//                        'label' => 'Le doctorat',
//                        'route' => 'informations/afficher',
//                        'params' => ['id' => 61],
//                        'title' => "Informations sur le doctorat et sa gestion"
//                    ],
//                    'ecoles-doctorales' => [
//                        'label' => 'Les Ecoles Doctorales',
//                        'route' => 'informations/afficher',
//                        'params' => ['id' => 81],
//                        'title' => "Informations sur les Ecoles Doctorales et le Collège des Ecoles doctorales"
//                    ],
//                    'guide-these' => [
//                        'label' => 'Guide de la thèse',
//                        'route' => 'informations/afficher',
//                        'params' => ['id' => 82],
//                        'title' => "Informations sur le déroulement de la thèse et formulaires administratifs à l’intention du doctorant et de ses encadrants"
//                    ],
//                    'guide-utilisation' => [
//                        'label' => 'Guide d\'utilisation',
//                        'route' => 'informations/afficher',
//                        'params' => ['id' => 162],
//                        'title' => "Guide d'utilisation de l'application SyGAL",
//                    ],
//                ],
//            ],
        ],
    ],
    'service_manager' => [
Loading