mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
work on confidential / blur module
This commit is contained in:
parent
7c8b08c3a7
commit
ad8d40cb1c
@ -48,7 +48,7 @@ class Address
|
|||||||
* @ORM\Column(type="boolean")
|
* @ORM\Column(type="boolean")
|
||||||
* @Groups({"write"})
|
* @Groups({"write"})
|
||||||
*/
|
*/
|
||||||
private $confidential = false;
|
private bool $confidential = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
require('./blur.scss');
|
require('./blur.scss');
|
||||||
|
|
||||||
var toggleBlur = function(e){
|
document.querySelectorAll('.confidential').forEach(function (el) {
|
||||||
|
let i = document.createElement('i');
|
||||||
var btn = e.target;
|
const classes = ['fa', 'fa-eye', 'toggle'];
|
||||||
|
i.classList.add(...classes);
|
||||||
btn.previousElementSibling.classList.toggle("blur");
|
el.appendChild(i);
|
||||||
btn.classList.toggle("fa-eye");
|
const toggleBlur = function(e) {
|
||||||
btn.classList.toggle("fa-eye-slash");
|
for (let child of el.children) {
|
||||||
|
if (!child.classList.contains('toggle')) {
|
||||||
|
child.classList.toggle('blur');
|
||||||
}
|
}
|
||||||
|
|
||||||
var infos = document.getElementsByClassName("confidential");
|
|
||||||
for(var i=0; i < infos.length; i++){
|
|
||||||
infos[i].insertAdjacentHTML('beforeend', '<i class="fa fa-eye toggle" aria-hidden="true"></i>');
|
|
||||||
}
|
}
|
||||||
|
i.classList.toggle('fa-eye');
|
||||||
var toggles = document.getElementsByClassName("toggle");
|
i.classList.toggle('fa-eye-slash');
|
||||||
for(var i=0; i < toggles.length; i++){
|
|
||||||
toggles[i].addEventListener("click", toggleBlur);
|
|
||||||
}
|
}
|
||||||
|
i.addEventListener('click', toggleBlur);
|
||||||
|
toggleBlur();
|
||||||
|
});
|
||||||
|
@ -1,22 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="confidential" v-on:click="toggleBlur">
|
<div :class="classes">
|
||||||
<div class="confidential-content blur">
|
<div class="confidential-content" :class="{ 'blur': isBlurred }">
|
||||||
<slot name="confidential-content"></slot>
|
<slot name="confidential-content"></slot>
|
||||||
</div>
|
</div>
|
||||||
<i class="fa fa-eye toggle" aria-hidden="true"></i>
|
<div>
|
||||||
|
<i class="fa fa-eye toggle" aria-hidden="true" @click="toggleBlur"></i>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "Confidential",
|
name: "Confidential",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isBlurred: true,
|
||||||
|
};
|
||||||
|
},
|
||||||
methods : {
|
methods : {
|
||||||
toggleBlur: function(e){
|
toggleBlur() {
|
||||||
if(e.target.matches('.toggle')){
|
console.log('toggle blur');
|
||||||
e.target.previousElementSibling.classList.toggle("blur");
|
this.isBlurred = !this.isBlurred;
|
||||||
e.target.classList.toggle("fa-eye");
|
|
||||||
e.target.classList.toggle("fa-eye-slash");
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
must be shown in such list
|
must be shown in such list
|
||||||
#}
|
#}
|
||||||
{%- if render == 'list' -%}
|
{%- if render == 'list' -%}
|
||||||
<li class="chill-entity entity-address {% if address.confidential %}blur{% endif %}">
|
<li class="chill-entity entity-address {% if address.confidential %}confidential{% endif %}">
|
||||||
{% if options['with_picto'] %}
|
{% if options['with_picto'] %}
|
||||||
<i class="fa fa-li fa-map-marker"></i>
|
<i class="fa fa-li fa-map-marker"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -68,7 +68,7 @@
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
{%- if render == 'inline' -%}
|
{%- if render == 'inline' -%}
|
||||||
<span class="chill-entity entity-address {% if address.confidential %}blur{% endif %}">
|
<span class="chill-entity entity-address {% if address.confidential %}confidential{% endif %}">
|
||||||
{% if options['with_picto'] %}
|
{% if options['with_picto'] %}
|
||||||
<i class="fa fa-fw fa-map-marker"></i>
|
<i class="fa fa-fw fa-map-marker"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -77,7 +77,7 @@
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
{%- if render == 'bloc' -%}
|
{%- if render == 'bloc' -%}
|
||||||
<div class="chill-entity entity-address {% if address.confidential %}blur{% endif %}">
|
<div class="chill-entity entity-address {% if address.confidential %}confidential{% endif %}">
|
||||||
{% if options['has_no_address'] == true and address.isNoAddress == true %}
|
{% if options['has_no_address'] == true and address.isNoAddress == true %}
|
||||||
{% if address.postCode is not empty %}
|
{% if address.postCode is not empty %}
|
||||||
<div class="address{% if options['multiline'] %} multiline{% endif %}{% if options['with_delimiter'] %} delimiter{% endif %}">
|
<div class="address{% if options['multiline'] %} multiline{% endif %}{% if options['with_delimiter'] %} delimiter{% endif %}">
|
||||||
|
@ -151,14 +151,14 @@
|
|||||||
{% if accompanyingCourse.requestorPerson is not null %}
|
{% if accompanyingCourse.requestorPerson is not null %}
|
||||||
<h4 class="item-key">{{ 'Requestor'|trans }}</h4>
|
<h4 class="item-key">{{ 'Requestor'|trans }}</h4>
|
||||||
{% if accompanyingCourse.requestorAnonymous %}
|
{% if accompanyingCourse.requestorAnonymous %}
|
||||||
<div class="confidential"><p class="blur">{{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }}</p></div>
|
<div class="confidential"><p>{{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }}</p></div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }}
|
{{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% elseif accompanyingCourse.requestorThirdParty is not null %}
|
{% elseif accompanyingCourse.requestorThirdParty is not null %}
|
||||||
<h4 class="item-key">{{ 'Requestor'|trans }}</h4>
|
<h4 class="item-key">{{ 'Requestor'|trans }}</h4>
|
||||||
{% if accompanyingCourse.requestorAnonymous %}
|
{% if accompanyingCourse.requestorAnonymous %}
|
||||||
<div class="confidential"><p class="blur">{{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }}</p></div>
|
<div class="confidential"><p>{{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }}</p></div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }}
|
{{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
<div class="item-col">
|
<div class="item-col">
|
||||||
{% if options['isConfidential'] %}
|
{% if options['isConfidential'] %}
|
||||||
<div class="confidential">
|
<div class="confidential">
|
||||||
<div class="confidential-content blur">
|
<div class="confidential-content">
|
||||||
<ul class="list-content fa-ul">
|
<ul class="list-content fa-ul">
|
||||||
<li>
|
<li>
|
||||||
{{ thirdparty.getAddress|chill_entity_render_box({
|
{{ thirdparty.getAddress|chill_entity_render_box({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user