Commit a477983e authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

- Ajout des mots-clefs dans les activités pour les résultats de recherche (en...

 - Ajout des mots-clefs dans les activités pour les résultats de recherche (en dessous des disciplines)
 - Fix : Les filtres Disciplines et Mots-clefs n'ont plus de selection vide lors de l'ajout du critère
parent 7b04e70a
Loading
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -195,7 +195,6 @@
            <input type="hidden" name="criteria[]" class="criteria" value="{{criteria}}"/>
            <small>{{typeLabel}}</small>
            <select class="select2 form-control val1 changer types" id="filter_discipline" multiple>
                <option></option>
                <?php foreach ($disciplines as $id => $label): ?>
                    <option
                        value="<?= $id ?>"><?= $label ?></option>
@@ -216,7 +215,6 @@
            <input type="hidden" name="criteria[]" class="criteria" value="{{criteria}}"/>
            <small>{{typeLabel}}</small>
            <select class="select2 form-control val1 changer types" id="filter_tags" multiple>
                <option></option>
                <?php foreach ($tags as $id => $label): ?>
                    <option
                        value="<?= $id ?>"><?= $label ?></option>
@@ -851,11 +849,10 @@
                    console.log("DATAS:", datas);
                    datas.typeLabel = (labelsType[datas.type]);
                    datas.criteria = datas.type + ";" + datas.val1 + ";" + datas.val2;
                    console.log("DATAS:", datas.criteria);

                    var dom, applyChange;



                    if( datas.type == 'ap' || datas.type == 'sp' || datas.type == 'ao' || datas.type == 'so' ){
                        dom = $(tpl(datas));
                    }
@@ -963,7 +960,6 @@
                        var checkboxs = filter.find('.val2[type="checkbox"]');

                        if( checkboxs.length > 1 ){
                            console.log("VAL2 CHECKBOX x BEAUCOUP");
                            var values = [];
                            checkboxs.each(i => {
                                var checkbox = checkboxs[i];
@@ -973,12 +969,10 @@
                            });
                            val2 = values.join(',');
                        } else if (checkboxs.length == 1){
                            console.log("VAL2 CHECKBOX x 1");
                            var val2Elem = filter.find('.val2');
                            if( val2Elem ){
                                val2 = val2Elem[0].checked ? "1" : "0";
                            }
                            console.log('Val2', val2);
                        }

                        // Select
@@ -1098,8 +1092,6 @@

                    if(datas.type == 'td' && datas.val2 != null ){
                        if( datas.val2 == "1" ){
                            console.log('VAL2', datas.val2);
                            console.log('>>>>', dom.find('.val2'), dom.find('.val2').checked);
                            dom.find('.val2')[0].checked = true;
                        }
                    }
@@ -1204,7 +1196,7 @@
                        id: id++,
                        type: $(this).val(),
                        typeLabel: labelsType[$(this).val()],
                        val1: null,
                        val1: "",
                        labelVal1: null,
                        val2: null,
                        labelVal2: null
+11 −0
Original line number Diff line number Diff line
@@ -100,12 +100,23 @@ $show = $this->grant()->privilege(\Oscar\Provider\Privileges::ACTIVITY_SHOW, $ac
                <?php if ($activity->getDisciplines()->count()): ?>
                    <div>
                        <i class="icon-tags"></i>
                        Disciplines :
                        <?php foreach ($activity->getDisciplines() as $discipline): ?>
                            <span
                                class="discipline tag"><?= $discipline ?></span>
                        <?php endforeach; ?>
                    </div>
                <?php endif; ?>
                <?php if ($activity->getMotscles()->count()): ?>
                    <div>
                        <i class="icon-tags"></i>
                        Mot-clefs :
                        <?php foreach ($activity->getMotscles() as $motclef): ?>
                            <span
                                    class="discipline tag"><?= $motclef->getLabel() ?></span>
                        <?php endforeach; ?>
                    </div>
                <?php endif; ?>
                <div>
                <?php if ($activity->getCodeEOTP()): ?>
                    <?= $this->options()->getConfiguration()->getFinancialLabel() ?> <strong><?= $activity->getCodeEOTP() ?></strong>