Commit 97816af1 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Merge branch 'release-2.0.0' into develop

parents 97e99ac4 5096c51c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -9,6 +9,10 @@ Journal des modifications
- Listes de diffusion Sympa : page d'activation/désactivation des listes pour lesquelles SyGAL peut fournir
  les abonnés et les proopriétaires via une URL. 
- Nouveau rôle 'Authentifié(e)' permettant d'ajuster les privilèges d'un simple utilisateur authentifié. 
- Ajout des champs Thèmes et Lien pour les offres de thèses des ED
- Ajout du menu secondaire offre de thèse
- Refonte de la gestion du menu secondaire principal pour tenir compte correctement de l'affichage
- Ajout de la gestion multilingue du menu secondaire principal

1.4.9 (08/09/2020)
------------------
+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) : ?>
+70 −0
Original line number Diff line number Diff line
<?php

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

$langues = [];
foreach ($informations as $information) $langues[$information->getLangue()->getId()] = $information->getLangue();

use Information\Entity\Db\Information;
use Information\Entity\Db\InformationLangue;


?>

    <ul class="nav nav-pills nav-stacked menu-secondaire informations">
        <?php foreach ($langues as $langue) : ?>
            <span class="flag langue" id="<?php echo $langue->getId(); ?>">
            <img src="<?php echo $langue->getDrapeau(); ?>" style="width: 30px;">
        </span>
        <?php endforeach; ?>

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

<style>
    .selected {
        font-weight: bold;
        border: 3px solid #337ab7;
        background: #337ab7;

    }

    .flag {
        height: 30px;
        display: inline-block;
        margin: 5px;
    }

    .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
Loading