Commit bbb40230 authored by David Foucher's avatar David Foucher

Merge branch 'improve-referentiel' into 'master'

adjust referentiel interface

See merge request !70
parents a8048d10 3d34d143
Pipeline #3557 passed with stage
in 1 minute and 27 seconds
......@@ -3,17 +3,18 @@
<div id="referentiel-main-div">
<div v-if="!this.isLoading">
<div id="referentiel-main-row">
<div class="container ml-5 mr-2">
<div class="container-fluid pl-5 pr-5">
<div class="row">
<div v-if="!isEditMode" :class="classCollapsedMenu">
<div class="mb-3 pull-right">
<div class="pb-3 pull-right">
<button @click="collapsed = !collapsed" type="button" class="btn main-button mb-5">
<span v-show="collapsed"><span class="chevron-toggle">&#8594;</span> Ouvrir le panneau</span>
<span v-show="!collapsed"><span class="chevron-toggle">&#8592;</span> Fermer le panneau</span>
</button>
</div>
<br>
<div v-show="!collapsed">
<h2 class="mb-5">Dispositifs de financement</h2>
<h2 class="pt-5 mb-5">Dispositifs de financement</h2>
<RulesMenu title="Régionaux" namespace="région" class="rules-menu" @click="this.forceRerender()"></RulesMenu>
<RulesMenu title="Nationaux" namespace="règles nationales" class="rules-menu"></RulesMenu>
<RulesMenu title="Organismes paritaires" namespace="organisme paritaire" class="rules-menu"></RulesMenu>
......
......@@ -18,6 +18,12 @@
<h4 v-if="isEditMode" class="pull-right"><em>Modification de la règle</em></h4>
<input v-else-if="this.modifiedHashFlag | this.newModification" v-b-modal.auth-modal type="button" class="main-button-primary btn pull-right" value="Soumettre une modification"/>
<!-- TODO: show gitlab link of modification if exists -->
<div v-else v-show="ruleComment != ''">
<span class="float-right" data-toggle="collapse" data-target="#rule-comment" aria-expanded="false" aria-controls="explain" style="cursor:pointer;" v-on:click="ruleCommentToggled=!ruleCommentToggled">
<button v-if="!ruleCommentToggled" class="btn main-button">Consulter la note de bas de page</button>
<button v-else class="btn main-button">Masquer la note</button>
</span>
</div>
</div>
</div>
<div v-show="!isEditMode" class="row">
......@@ -33,11 +39,6 @@
</div>
<div v-show="!isEditMode && !viewModification">
<div v-show="ruleComment != ''">
<span data-toggle="collapse" data-target="#rule-comment" aria-expanded="false" aria-controls="explain" style="cursor:pointer;" v-on:click="ruleCommentToggled=!ruleCommentToggled">
<button v-if="!ruleCommentToggled" class="btn main-button">Voir les notes de règle</button>
<button v-else class="btn main-button">Masquer les notes</button>
</span>
<div id="rule-comment" class="mt-3 card collapse">
<div class="card-body">
{{ this.ruleComment }}
......
<template>
<li>
<div :class="{bold: isFolder}" @dblclick="makeFolder">
<li style="">
<div :class="{bold: isFolder}" class="" @dblclick="makeFolder" style="margin-left:2.5%">
<div v-if="isFolder" @click="toggle">
<div v-if="!rootElement">
<span>{{ item.name }}</span>
<span class="main-button btn pull-right" style="width:5%"><strong>{{ isOpen ? '-' : '+' }}</strong></span>
<div v-if="!rootElement" class="form-inline rules-line">
<div v-html="transform(item.name)" style="width:95%"/>
<div class="main-button btn pull-right" style="width:5%"><strong>{{ isOpen ? '-' : '+' }}</strong></div>
</div>
</div>
<span v-else v-html="transform(item.name)" class="text-muted"></span>
<div v-else v-html="transform(item.name)" :class="{alors: isAlorsLine}" class="text-muted rules-line"/>
</div>
<hr v-show="!rootElement">
<hr v-show="!rootElement" style="padding:0px; margin:0px;">
<ul v-show="isOpen || rootElement" v-if="isFolder">
<TreeItem
class="item"
......@@ -39,6 +39,9 @@
isFolder: function() {
return this.item.children &&
this.item.children.length
},
isAlorsLine: function () {
return this.item.name.match(/Alors+ .*/gi);
}
},
methods: {
......@@ -63,11 +66,11 @@
.replace(/, ou /g, '<span class="bold text-dark">, ou </span>')
.replace(/Et /g, '<span class="bold text-dark">Et </span>')
.replace(/, et /g, '<span class="bold text-dark">, et </span>')
.replace(/Alors /g, '<span class="bold text-dark">Alors </span>')
.replace(/Alors+ .*/gi, "<div class='text-dark'>$&</div>")
.replace(/(#.+)/g, "<em class=\"comment\">$1</em>")
.replace(/appliquer les règles «([^»]+?)(.rules)?»/g, 'appliquer les règles « <a href="'+this.rulePath+'#$1.rules" class="btn main-button" title="Ouvrir les règles" style="display:inline-block">$1</a> »')
.replace(/appliquer les règles «([^»]+?)(.rules)?»/g, '<span class="rules-line"> appliquer les règles « <a href="'+this.rulePath+'#$1.rules" class="btn main-button" title="Ouvrir les règles" style="display:inline-block">$1</a> »</span>')
.replace(/(«.+»)/g, "<span class=\"string\">$1</span>")
.replace(/,([^ ])/g, ", $1");
.replace(/,([^ ])/g, "<span class=\"string\">, $1</span>");
},
},
}
......@@ -88,4 +91,14 @@
.rule-separator {
width: 100vh;
}
.alors {
background-color: rgba(153, 255, 102, 0.2);
transition: padding 0.2s 0s linear;
height:100%;
border-radius:5px;
}
.rules-line {
padding-top:1vh;
padding-bottom:1vh;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment