Commit 1588f0dc authored by Nicolas Nambinintsoa's avatar Nicolas Nambinintsoa
Browse files

Merge branch 'qa' into development

parents 40bacf9d 429a2e19
......@@ -362,7 +362,7 @@
}
#costum-scope-search .dropdown-result-global-search .content-result{
height: 390px;
overflow-y: overlay;
overflow-y: auto;
}
.headerSearchContainer .headerSearchleft{
display: flex;
......@@ -618,51 +618,171 @@
background:transparent;
}
.container-filters-horizontal {
.dropdown-menu-large {
margin-left: 0px;
margin-right: 16px;
padding: 20px 0px;
}
.dropdown-menu-large > div > div {
padding: 0;
margin: 0;
}
.dropdown-menu-large > div > div > div > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight:300;
color: #333333;
white-space: normal;
}
.dropdown-menu-large > div div > div > a:hover,
.dropdown-menu-large > div div > div > a:focus {
text-decoration: none;
color: #262626;
background-color: #f5f5f5;
}
.dropdown-menu-large .disabled > a,
.dropdown-menu-large .disabled > a:hover,
.dropdown-menu-large .disabled > a:focus {
color: #999999;
}
.dropdown-menu-large .disabled > a:hover,
.dropdown-menu-large .disabled > a:focus {
text-decoration: none;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
cursor: not-allowed;
}
.dropdown-menu-large .dropdown-title {
color: #428bca;
font-size: 14px;
text-transform: uppercase;
font-weight: 999 !important;
word-break: break-word;
}
@media (max-width: 768px) {
.dropdown-menu-large {
margin-left: 0 ;
margin-right: 0 ;
}
.dropdown-menu-large > div {
margin-bottom: 30px;
}
.dropdown-menu-large > div:last-child {
margin-bottom: 0;
}
}
#filterContainer .dropdown-large .dropdown-menu, .searchObjCSS .dropdown-large .dropdown-menu{
width: clamp( 650px, 950px, 1000px);
}
.thin{
padding: 0.2em !important;
border-radius: 0.2em;
display: block !important;
}
.dropdown-menu-large {
-webkit-column-width: 14em !important;
-moz-column-width: 14em !important;
column-width: 14em !important;
}
.dropdown-menu-large > .col {
padding: .2em 0em 0.1em 0.5em;
width: 14em;
}
.dropdown-menu-large > .col > div{
display: inline-block;
height: 100%;
width: 13.9em;
}
/* animation btn css */
.btnPdfAnimation {
transition: all .25s ease;
}
.pdfloading-animate {
/* position: absolute;
width: 60px;
height: 60px;*/
z-index: 100;
border-radius: 50%;
top: 0px;
left: 0px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
pointer-events: none;
opacity: 0;
transition: all .25s ease;
animation: pdfloading infinite .8s linear;
}
.pdfloading-animate:after {
content: '';
width: 25px;
height: 25px;
border-radius: 50%;
border: 3px solid transparent;
border-left: 3px solid #e21a1a;
animation: loading infinite .8s ease .05s;
/*position: absolute;*/
}
.container-filters-horizontal .dropdown {
margin: 8px 0px;
.btnPdfAnimation.pdfloading {
width: 60px;
}
.container-filters-horizontal .dropdown > a {
width: 100% !important;
margin: 0px !important;
display: flex !important;
justify-content: space-between !important;
align-items: center !important;
.btnPdfAnimation.pdfloading .btnpdftext, .btnPdfAnimation.pdfloading i {
display: none;
}
.container-filters-horizontal .searchBar-filters{
margin: 8px 0px !important;
.btnPdfAnimation .btnpdftext, .btnPdfAnimation i {
display: inline-block;
padding-left: 3px;
}
.container-filters-horizontal .searchBar-filters input{
width: 100%;
margin: 0px !important;
text-align: left;
.btnPdfAnimation.pdfloading .pdfloading-animate {
opacity: 1;
display: flex;
}
.container-filters-horizontal .searchBar-filters span{
margin: 0px !important;
.btnPdfAnimation .pdfloading-animate {
display: none;
}
.container-filters-horizontal #costum-scope-search{
margin: 8px 0px;
.generatebtnstyle {
margin-top: 10px;
margin-bottom: 10px;
border-radius: 3px;
letter-spacing: 1px;
}
.container-filters-horizontal #input-sec-search{
width: 100%;
margin: 0px;
.generatepdfbtnstyle.generatepdfbtn {
color: #b94a48;
border: solid 2px #b94a48;
}
.container-filters-horizontal #input-sec-search span{
margin: 0px;
.generatepdfbtnstyle.generateeditbtn {
color: #bd8753;
border: solid 2px #f3aa09;
}
.container-filters-horizontal #input-sec-search input{
width: 100% !important;
margin: 0px;
.generatepdfbtnstyle.generatedelbtn {
color: #b94a48;
border: solid 2px #b94a48;
}
.container-filters-horizontal #activeFilters{
margin-top: 30px;
@keyframes pdfloading {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
\ No newline at end of file
......@@ -269,8 +269,10 @@ var adminDirectory = {
var img = "";
if (e && typeof e.profilThumbImageUrl != "undefined" && e.profilThumbImageUrl!="")
img = '<img width="50" height="50" alt="image" class="img-circle" src="'+baseUrl+e.profilThumbImageUrl+'"><br/><span class="uppercase bold">'+type+"</span>";
else
img = '<i class="fa '+icon+' fa-2x"></i> <br/><span class="uppercase bold">'+type+"</span>";
else{
var typology= (typeof e.type !="undefined") ? e.type : type ;
img = '<i class="fa '+icon+' fa-2x"></i> <br/><span class="uppercase bold">'+typology+"</span>";
}
var lbhN = "lbh" ;
var urlH='#page.type.'+type+'.id.'+id;
var targetLink="target='_blank'";
......@@ -714,6 +716,14 @@ var adminDirectory = {
}
return str ;
},
validatePledge : function(e, id, type, aObj){
mylog.log("adminDirectory.actions validatePledge", e, id, type, aObj);
var str="";
if(typeof e.type != "undefined" && e.type == "pledge"){
str = '<button data-id="'+id+'" data-type="'+type+'" class="margin-right-5 validatePledgeBtn btn bg-green-k text-white"><i class="fa fa-check"></i> Valider (reçu)</button>';
}
return str;
},
status : function(e, id, type, aObj){
mylog.log("adminDirectory.actions.status", id, type);
//mylog.log(e);
......@@ -776,9 +786,13 @@ var adminDirectory = {
var subtype = "";
if( typeof aObj.panelAdmin != "undefined" &&
typeof aObj.panelAdmin.actions != "undefined" &&
typeof aObj.panelAdmin.actions.update != "undefined" &&
typeof aObj.panelAdmin.actions.update.subType != "undefined" )
subtype = ' data-subtype="'+aObj.panelAdmin.actions.update.subType+'" ';
typeof aObj.panelAdmin.actions.update != "undefined"){
if(typeof aObj.panelAdmin.actions.update.subType != "undefined")
subtype = ' data-subtype="'+aObj.panelAdmin.actions.update.subType+'" ';
else if(aObj.panelAdmin.actions.update.subTypeField && e[aObj.panelAdmin.actions.update.subTypeField])
subtype = ' data-subtype="'+e[aObj.panelAdmin.actions.update.subTypeField]+'" ';
}
mylog.log("adminDirectory.actions.update type", type);
var str ='<button data-id="'+id+'" data-type="'+type+'" '+subtype+' class="col-xs-12 updateBtn btn bg-green-k text-white"><i class="fa fa-pencil"></i> Modifier</button>';
......@@ -1112,6 +1126,32 @@ var adminDirectory = {
);
});
},
validatePledge : function(aObj){
mylog.log("validatePledgeBtn");
$("#"+aObj.container+" .validatePledgeBtn").off().on("click", function(){
$(this).find("i").removeClass("fa-check").addClass("fa-spinner fa-spin");
var $this=$(this);
var params={
id:$(this).data("id"),
type:$(this).data("type")
};
ajaxPost(
null,
baseUrl+'/co2/crowdfunding/validatepledge/type/'+params.type+'/id/'+params.id,
params,
function(data){
mylog.log("validatepledge callback",data);
if(data.result==true){
toastr.success(data.msg);
urlCtrl.loadByHash(location.hash);
}
else{
toastr.error(trad.somethingwentwrong);
}
}
);
});
},
status : function(aObj){
$("#"+aObj.container+" .statusBtn").off().on("click", function(){
mylog.log("adminDirectory..statusBtn ", $(this).data("id"), $(this).data("type"));
......
/* adminPanel _object_ permet l'initialisation et la navigation entre les différentes vues des différents espaces d'administrations*/
/* adminPanel _object_ permet l'initialisation et la navigation entre les différentes vues
des différents espaces d'administrations*/
var adminPanel = {
params:{},
init : function(){
if(typeof paramsAdmin.add != "undefined")
adminPanel.initAddButton(".contain-admin-add");
//connect all actions to buttons
adminPanel.bindButtonMenu();
//open de proper page
adminPanel.initView();
},
initAddButton : function(domContain){
......@@ -16,10 +21,11 @@ var adminPanel = {
var subFormType= (typeof v.subFormType != "undefined") ? 'data-form-subtype="'+v.subFormType+'" ' : "";
var addClass = (typeof v.class != "undefined") ? v.class : "";
var nameLabel=(typeof v.addLabel!= "undefined") ? v.addLabel : v.name;
var actionClass = (typeof v.optionModal!= "undefined") ? "btn-open-optionModal" : 'btn-open-form';
menuButtonCreate+='<button '+
formType+
subFormType+
'class="btn btn-link btn-open-form col-xs-6 col-sm-6 col-md-4 col-lg-4 text-'+v.color+' margin-bottom-10">'+
'class="btn btn-link '+actionClass+' col-xs-6 col-sm-6 col-md-4 col-lg-4 text-'+v.color+' margin-bottom-10">'+
'<h6><i class="fa fa-'+v.icon+'"></i><br/>'+
nameLabel+'</h6>'+
'</button>';
......@@ -59,6 +65,7 @@ var adminPanel = {
location.hash=hashAdmin;
}
//Get view admin
//Opens the page
adminPanel.views[adminPanel.params.view]();
});
},
......@@ -66,6 +73,10 @@ var adminPanel = {
adminPanel.bindViewActionEvent();
coInterface.bindButtonOpenForm();
},
//views are all pages available
//for navigation
views : {
index: function(){
adminPanel.initNav();
......@@ -179,6 +190,84 @@ var adminPanel = {
ajaxPost('#content-view-admin', baseUrl+'/'+moduleId+'/admin/reference', data, function(){});
},
pledge : function(){
var data={
title : "Promesses de don",
//types : ["crowdfunding"],
table : {
name: {
name : "Nom",
preview : true
},
amount : {
name : "Montant",
sum : true
},
type : {
name : "type",
preview : true
}
// validateField :{
// field : "type",
// value : "donation"
// }
},
actions:{
delete : true,
validatePledge : true
},
paramsFilter : {
container : "#filterContainer",
defaults : {
types : [ "crowdfunding" ],
//type : "pledge"
filters : {
type : "pledge"
}
}
}
};
ajaxPost('#content-view-admin', baseUrl+'/'+moduleId+'/admin/directory/', data, function(){},"html");
},
donation : function(){
var data={
title : "Dons validés",
//types : ["crowdfunding"],
table : {
name: {
name : "Nom",
preview : true
},
amount : {
name : "Montant",
sum : true
},
type : {
name : "type",
preview : true
}
},
actions:{
delete : true
},
paramsFilter : {
container : "#filterContainer",
defaults : {
types : [ "crowdfunding" ],
//type : "pledge"
filters : {
type : "donation"
}
}
}
};
ajaxPost('#content-view-admin', baseUrl+'/'+moduleId+'/admin/directory/', data, function(){},"html");
},
log : function(){
ajaxPost('#content-view-admin', baseUrl+'/'+moduleId+'/log/monitoring', null, function(){});
},
......
......@@ -38,7 +38,8 @@ function checkPoll(){
//returning multple server checks in a unique ajax call
if(userId){
_checkLoggued();
if(typeof refreshNotifications != "undefined") refreshNotifications(userId,"citoyens","");
var socketConnectionEtablish = Boolean(wsCO)
if(typeof refreshNotifications != "undefined" && !socketConnectionEtablish) refreshNotifications(userId,"citoyens","");
}
//according to the loaded page
......@@ -748,6 +749,7 @@ var coInterface = {
$(".btn-open-form").off().on("click",function(){
mylog.log("btn-open-form");
$('.bootbox').remove();
var typeForm = $(this).data("form-type");
currentKFormType = ($(this).data("form-subtype")) ? $(this).data("form-subtype") : null;
//dynFormCostum = (costum && costum.typeObj && costum.typeObj[typeForm]) ? costum.typeObj[typeForm]["dynFormCostum"] : null;
......@@ -760,6 +762,63 @@ var coInterface = {
dyFObj.openForm(typeForm);
}
});
$(".btn-open-optionModal").off().on("click",function(){
mylog.log("btn-open-optionModal");
coInterface.optionModalOpen($(this).data("form-type"));
var typeForm = $(this).data("form-type");
var modalHtml = "";
var btnClass = '';
var subText = '';
var btnClasses = {};
$.each( typeObj[typeForm].optionModal.list ,function(k,v){
btnClass = (typeof v.btnClass != "undefined") ? v.btnClass : 'btn-open-form';
subText = (typeof v.subText != "undefined") ? v.subText+"<br/>" : '';
btnClasses[btnClass] = true;
var btnLink = (typeof v.link != "undefined") ? v.link : 'javascript:;';
modalHtml += "<a href='"+btnLink+"' class='"+btnClass+"' data-form-type='"+typeForm+"'> <i class='fa fa-"+v.icon+" fa-2x'></i> "+v.label+"</a><br/>"+subText;
})
bootbox.dialog({
title: typeObj[typeForm].optionModal.title,
message: modalHtml
}).init(function(){
coInterface.bindButtonOpenForm();
$.each(btnClasses,function(btc,v){
//alert(typeof btc+":"+btc);
//class name can be a callback function ex : crteOpenForm inside ctenat/ctenat_index.js
if( btc != 'btn-open-form' && typeof eval("costumBindButton."+btc) == "function" )
eval("costumBindButton."+btc)();
})
});
});
},
optionModalOpen : function(typeForm) {
var modalHtml = "";
var btnClass = '';
var subText = '';
var btnClasses = {};
$.each( typeObj[typeForm].optionModal.list ,function(k,v){
btnClass = (typeof v.btnClass != "undefined") ? v.btnClass : 'btn-open-form';
subText = (typeof v.subText != "undefined") ? v.subText+"<br/>" : '';
btnClasses[btnClass] = true;
var btnLink = (typeof v.link != "undefined") ? v.link : 'javascript:;';
modalHtml += "<a href='"+btnLink+"' class='"+btnClass+"' data-form-type='"+typeForm+"'> <i class='fa fa-"+v.icon+" fa-2x'></i> "+v.label+"</a><br/>"+subText;
})
bootbox.dialog({
title: typeObj[typeForm].optionModal.title,
message: modalHtml
}).init(function(){
coInterface.bindButtonOpenForm();
$.each(btnClasses,function(btc,v){
//alert(typeof btc+":"+btc);
//class name can be a callback function ex : crteOpenForm inside ctenat/ctenat_index.js
if( btc != 'btn-open-form' && typeof eval("costumBindButton."+btc) == "function" )
eval("costumBindButton."+btc)();
})
});
},
bindLBHLinks : function() {
mylog.log("coInterface.bindLBHLinks");
......@@ -1811,17 +1870,57 @@ var urlCtrl = {
modalConten += '</div>';
if(typeof options.name != "undefined")
modalConten += '<h2 class="name">'+options.name+'</h2>';
modalConten += '<h3 class="text-secondary">'+options.title+'</h3>';
if(typeof options.title != "undefined")
modalConten += '<h3 class="text-secondary">'+options.title+'</h3>';
if(typeof options.html != "undefined")
modalConten += options.html;
else if (typeof options.text != "undefined")
modalConten += '<p class="text-muted">'+options.text+'</p>';
modalConten += '<a href="javascript:;" class="btn btn-show-more" data-dismiss="modal" aria-label="Close"><i class="fa fa-remove"></i>&nbsp;Fermer</a>';
if(notNull(options.link)) {
mylog.log("options link",typeof options.link);
if(typeof options.link=="object"){
var linksNumber=Object.keys(options.link).length;
modalConten += '<div class="col-xs-12 padding-10">';
$.each(options.link,function(k,v){
mylog.log("donationpledge",k,v);
var label=(typeof options.link[k].label!="undefined") ? options.link[k].label : "";
var icon=(typeof options.link[k].icon!="undefined") ? options.link[k].icon : "";
// Allow to add params in openForm depending on the link
if(typeof options.link[k].onclick && options.link[k].onclick.indexOf("dyFObj.openForm")>-1){
if(typeof options.link[k].dataExtend=="object"){
var openFObj={};
openFObj = options.link[k].onclick.substring(
options.link[k].onclick.lastIndexOf("{"),
options.link[k].onclick.lastIndexOf("}") + 1
);
var addParam={};
mylog.log("addParam",openFObj);
addParam=JSON.parse(openFObj);
mylog.log("dataExtend",options.link[k].dataExtend);
var dataExtended=$.extend(options.link[k].dataExtend,addParam);
mylog.log("dataExtended",dataExtended);
var stringExtended="";
stringExtended=JSON.stringify(dataExtended);
//alert(openFObj);
options.link[k].onclick = options.link[k].onclick.replaceAll(openFObj,stringExtended);
}
}
var onclick=(typeof options.link[k].onclick!="undefined") ? "onclick='"+options.link[k].onclick+"'" : "";
var link=(typeof options.link[k].link!="undefined") ? options.link[k].link : "";
modalConten+= '<a href="'+options.link[k].link+'" '+onclick+' class="btn btn-show-more "><i class="fa fa-'+ options.link[k].icon +'"></i>'+label+'</a>';
});
modalConten+= '</div>';
modalConten += '<a href="javascript:;" class="btn btn-show-more" data-dismiss="modal" aria-label="Close"><i class="fa fa-remove"></i>&nbsp;Fermer</a>';
}
else if(typeof options.link=="string"){
var labelLink=(typeof options.linkLabel != "undefined") ? options.linkLabel : trad.knowmore;
var targetB=(typeof options.targetB =="undefined") ? 'target="_blank"' :"";
var classLBH=(typeof options.linkClass !="undefined") ? options.linkClass :"";
modalConten += '<a href="javascript:;" class="btn btn-show-more" data-dismiss="modal" aria-label="Close"><i class="fa fa-remove"></i>&nbsp;Fermer</a>';
modalConten+= '<a href="'+options.link+'" '+targetB+' class="btn btn-show-more '+classLBH+'">'+labelLink+'</a>';
}
}
modalConten+= '</div>'+
'</div>'+
......
......@@ -474,12 +474,12 @@ var directory = {
'<div id="entity_'+params.collection+'_'+params.id+'" class="col-md-12 col-xs-12 col-sm-12 no-padding lib-item searchEntityContainer '+params.containerClass+'" data-category="view">'+
'<div class="lib-panel">'+
'<div class="row box-shadow">'+
'<div class="col-xs-12 col-sm-4 col-md-4 no-padding">'+
'<div class="col-xs-12 col-sm-3 col-md-2 no-padding">'+
'<a href="'+params.hash+'" class="'+params.hashClass+'">'+
params.imageProfilHtml+
'</a>'+
'</div>'+
'<div class="col-xs-12 col-sm-8 col-md-8">'+
'<div class="col-xs-12 col-sm-9 col-md-10">'+
'<div class="lib-row lib-header">'+
'<a href="'+params.hash+'" class="'+params.hashClass+'">'+params.name+'</a>'+
'<div class="lib-header-seperator"></div>'+
......@@ -923,6 +923,121 @@ var directory = {