Commit 1e47cd4a authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Options pour le VH des instances et des types

parent 78078406
Loading
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -20,3 +20,12 @@
    border-radius: 0 0.25rem 0.25rem 0;
    height: 1.5rem;
}

.etat-solo {
    border-radius: 0.25rem;
    width:4rem;
    color:white;
    display: inline-block;
    text-align: center;
    height: 1.75rem;
}
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -14,6 +14,10 @@ class EtatInstanceViewHelper extends AbstractHelper
     * @param EtatInstance $instance
     * @param array $options
     * @return string|Partial
     * 
     * -- OPTIONS --
     * 'display-categorie' affiche la partie catégorie default:true;
     * 'display-type' affiche la partie type default:true;
     */
    public function __invoke(?EtatInstance $instance, array $options = [])
    {
+4 −0
Original line number Diff line number Diff line
@@ -15,6 +15,10 @@ class EtatTypeViewHelper extends AbstractHelper
     * @param EtatType $type
     * @param array $options
     * @return string|Partial
     * 
     * -- OPTIONS --
     * 'display-categorie' affiche la partie catégorie default:true;
     * 'display-type' affiche la partie type default:true;
     */
    public function __invoke(?EtatType $type, array $options = [])
    {
+1 −1
Original line number Diff line number Diff line
@@ -41,5 +41,5 @@ else $type = null;
    </div>
</div>
<?php else : ?>
    <?php echo $this->etattype($type); ?>
    <?php echo $this->etattype($type, $options); ?>
<?php endif; ?>
+16 −0
Original line number Diff line number Diff line
@@ -7,6 +7,9 @@ use UnicaenEtat\Entity\Db\EtatType;
 * @var array $options
 */

$displayCategorie = (isset($options['display-categorie'])?$options['display-categorie']!==false:true);
$displayType = (isset($options['display-type'])?$options['display-type']!==false:true);

$type_couleur = ($type)?$type->getCouleur():"gray";
$type_icone = ($type)?$type->getIcone():"white";
$type_libelle = ($type)?$type->getLibelle():"Vide";
@@ -16,6 +19,7 @@ $categorie_icone = ($type AND $type->getCategorie())?$type->getCategorie()->getI
$categorie_libelle = ($type AND $type->getCategorie())?$type->getCategorie()->getLibelle():"Vide";
?>

<?php if ($displayType && $displayCategorie) : ?>
    <div style="display: inline-block;min-width: 6rem;">
        <div class="etat-leftpart" title="<?php echo str_replace("'", "", $type_libelle); ?>" style="background: <?php echo $type_couleur; ?>;">
            <span class="<?php echo ($type_icone)?:"fas fa-question"; ?>" aria-hidden="true"></span>
@@ -24,3 +28,15 @@ $categorie_libelle = ($type AND $type->getCategorie())?$type->getCategorie()->ge
            <span class="<?php echo ($categorie_icone)?:"fas fa-question"; ?>" aria-hidden="true"></span>
        </div>
    </div>
<?php else : ?>
    <?php if ($displayType) : ?>
        <div class="etat-solo" style="display: inline-block; background: <?php echo $type_couleur; ?>" title="<?php echo str_replace("'", "", $type_libelle); ?>">
            <span class="<?php echo ($type_icone)?:"fas fa-question"; ?>" aria-hidden="true"></span>
        </div>
    <?php endif; ?>
    <?php if ($displayCategorie) : ?>
        <div class="etat-solo" style="display: inline-block; background: <?php echo $categorie_couleur; ?>" title="<?php echo str_replace("'", "", $categorie_libelle); ?>">
            <span class="<?php echo ($categorie_icone)?:"fas fa-question"; ?>" aria-hidden="true"></span>
        </div>
    <?php endif; ?>
<?php endif; ?>
Loading