Commit f91ee221 authored by GrondinDam's avatar GrondinDam
Browse files

Merge branch 'pixelhumain-development2' into copedia

parents 76814c2c b9c23fc2
This diff is collapsed.
......@@ -6,6 +6,9 @@ var uiCoop = {
//$("#div-reopen-menu-left-container").removeClass("hidden");
$("#main-coop-container").html("");
$("#btn-close-coop").click(function(){
$("#coop-data-container").html("");
});
//KScrollTo("#div-reopen-menu-left-container");
//toogleNotif(false);
......@@ -429,6 +432,7 @@ var uiCoop = {
$("#comments-container").html("<i class='fa fa-spin fa-refresh'></i> Chargement des commentaires");
$(".footer-comments").html("");
getAjax("#comments-container",baseUrl+"/"+moduleId+"/comment/index/type/proposals/id/"+idParentProposal,
function(){ //$(".commentCount").html( $(".nbComments").html() );
$(".container-txtarea").hide();
......@@ -437,7 +441,7 @@ var uiCoop = {
var argval = $(this).data("argval");
$(".container-txtarea").show();
$(".textarea-new-comment").removeClass("bg-green-comment bg-red-comment");
$(".textarea-new-comment").removeClass("bg-green-comment bg-white-comment bg-red-comment");
var classe="";
var pholder="Votre commentaire";
if(argval == "up") { classe="bg-green-comment"; pholder="Votre argument pour"; }
......@@ -549,6 +553,8 @@ var uiCoop = {
$("#comments-container").html("<i class='fa fa-spin fa-refresh'></i> Chargement des commentaires");
$(".footer-comments").html("");
getAjax("#comments-container",baseUrl+"/"+moduleId+"/comment/index/type/actions/id/"+idAction,
function(){ //$(".commentCount").html( $(".nbComments").html() );
},"html");
......
......@@ -163,14 +163,14 @@ function addCustomValidators() {
}, "This slug already exists. Please choose an other one.");*/
jQuery.validator.addMethod("validUserName", function(value, element) {
//Check authorized caracters
var usernameRegex = /^[a-zA-Z0-9]+$/;
var usernameRegex = /^[a-zA-Z0-9\-]+$/;
var validUsername = value.match(usernameRegex);
if (validUsername == null) {
return false;
} else {
return true;
}
}, "Invalid username : Only characters A-Z, a-z, 0-9 and '-' are acceptable.");
}, tradDynForm.invalidUsername);
jQuery.validator.addMethod("uniqueUserName", function(value, element) {
//Check unique username
......
......@@ -391,7 +391,7 @@ function autoCompleteSearch(name, locality, indexMin, indexMax){
toastr.success(data.msg);
$(thiselement).html("<i class='fa fa-unlink text-green'></i>");
$(thiselement).attr("data-ownerlink","unparticipate");
$(thiselement).attr("data-original-title", "Ne plus particper à l'évènement");
$(thiselement).attr("data-original-title", "Ne plus participer à l'évènement");
addFloopEntity(id, type, data.parent);
showFloopDrawer(true);
}
......
......@@ -522,7 +522,7 @@ function autoCompleteSearch(name, locality, indexMin, indexMax, callBack){
});
$(".coopPanelHtml").click(function(){
$(".coopPanelHtml").off().click(function(){
var coopType = $(this).data("coop-type");
var coopId = $(this).data("coop-id");
var idParentRoom = $(this).data("coop-idparentroom");
......@@ -540,13 +540,13 @@ function autoCompleteSearch(name, locality, indexMin, indexMax, callBack){
uiCoop.startUI();
$("#modalCoop").modal("show");
if(coopType == "rooms"){
uiCoop.getCoopData(null, null, "room", null, coopId);
uiCoop.getCoopData(contextData.type, contextData.id, "room", null, coopId);
}else{
setTimeout(function(){
uiCoop.getCoopData(null, null, "room", null, idParentRoom,
uiCoop.getCoopData(contextData.type, contextData.id, "room", null, idParentRoom,
function(){
toastr.info(trad["processing"]);
uiCoop.getCoopData(null, null, coopType, null, coopId);
uiCoop.getCoopData(contextData.type, contextData.id, coopType, null, coopId);
}, false);
}, 1000);
}
......@@ -888,10 +888,13 @@ var directory = {
if(typeof(params.statusLink)!="undefined"){
if(typeof(params.statusLink.isAdmin)!="undefined" && typeof(params.statusLink.isAdminPending)=="undefined")
str+="<span class='text-red'>Administrateur</span>";
if(typeof(params.statusLink.isAdmin)!="undefined" && typeof(params.statusLink.isAdminPending)=="undefined" && typeof(params.statusLink.isAdminInviting)=="undefined")
str+="<span class='text-red'>"+trad.administrator+"</span>";
if(typeof(params.statusLink.isAdminInviting)!="undefined"){
str+="<span class='text-red'>"+trad.invitingToAdmin+"</span>";
}
if(typeof(params.statusLink.toBeValidated)!="undefined" || typeof(params.statusLink.isAdminPending)!="undefined")
str+="<span class='text-red'>En attente de validation</span>";
str+="<span class='text-red'>"+trad.waitingValidation+"</span>";
}
if(params.rolesLbl != "")
......@@ -1515,7 +1518,7 @@ var directory = {
str += '<h4 class="panel-title letter-turq"><i class="fa '+ params.ico + '"></i> '+ name + '</h4>';
if(params.type != "rooms")
str += '<h5 class=""><small><i class="fa fa-bell"></i> '+ trad[params.status] + '</small></h5>';
str += '<h5 class=""><small><i class="fa fa-certificate"></i> '+ trad[params.status] + '</small></h5>';
str += '<span class="text-dark">'+description+'</span>';
str += "</div>";
......
......@@ -276,9 +276,7 @@ function bindAboutPodElement() {
$("#typeAbout").html(tradCategory[data.resultGoods.values.type]);
$("#typeHeader .type-header").html(tradCategory[data.resultGoods.values.type]);
}
if(typeof data.resultGoods.values.email != "undefined"){
}
if(typeof data.resultGoods.values.email != "undefined"){
mylog.log("update email");
contextData.email = data.resultGoods.values.email;
......@@ -374,7 +372,7 @@ function bindAboutPodElement() {
}
}
};
//form.dynForm.jsonSchema.properties.slug = dyFInputs.slug("Slug", "Slug", {minlength : 3, uniqueSlug:true});
if(contextData.type == typeObj.person.col ){
form.dynForm.jsonSchema.properties.username = dyFInputs.inputText("Username", "Username", { required : true });
form.dynForm.jsonSchema.properties.birthDate = dyFInputs.birthDate;
......
......@@ -406,13 +406,13 @@ var Login = function() {
var oldCp = "";
function validateUserName() { console.log("validateUserName click");
function validateUserName() { mylog.log("validateUserName click");
var username = $('.form-register #username').val();
if(username.length >= 4) {
clearTimeout(timeout);
timeout = setTimeout(function() {
//mylog.log("bing !");
if (! isUniqueUsername(username)) { console.log("validateUserName notUnik");
if (! isUniqueUsername(username)) { mylog.log("validateUserName notUnik");
var validator = $( '.form-register' ).validate();
validator.showErrors({
"username": trad["usernamenotunique"]
......
......@@ -2,7 +2,7 @@ var notifications = null;
var maxNotifTimstamp = 0;
function bindNotifEvents(element){
$(".notifList"+element+" a.notif").off().on("click",function ()
$(".notifList"+element+" a.notif").off().on("mousedown",function (e)
{
markAsRead( $(this).data("id") );
hash = $(this).data("href");
......@@ -12,7 +12,10 @@ function bindNotifEvents(element){
setTimeout(function(){
// elem.addClass("read");
//elem.removeClass('animated bounceOutRight');
urlCtrl.loadByHash(hash);
if(e.which==2)
window.open(baseUrl+hash, '_blank');
else
urlCtrl.loadByHash(hash);
//notifCount();
}, 200);
});
......
......@@ -4,8 +4,43 @@ function initDateHeaderPage(params){
$(".header-banner").html(str);
}
function getCroppingModal(){
function pushListRoles(links){
//Members
if(typeof links.members != "undefined"){
$.each(links.members, function(e,v){
if(typeof v.roles != "undefined"){
$.each(v.roles, function(i,data){
if(data != "" && !rolesList.includes(data)){
rolesList.push(data);
}
});
}
});
}
//Contributors
if(typeof links.contributors != "undefined"){
$.each(links.contributors, function(e,v){
if(typeof v.roles != "undefined"){
$.each(v.roles, function(i,data){
if(data != "" && !rolesList.includes(data)){
rolesList.push(data);
}
});
}
});
}
//Attendees
if(typeof links.attendees != "undefined"){
$.each(links.attendees, function(e,v){
if(typeof v.roles != "undefined"){
$.each(v.roles, function(i,data){
if(data != "" && !rolesList.includes(data)){
rolesList.push(data);
}
});
}
});
}
}
function menuLeftShow(){
......@@ -646,6 +681,10 @@ function displayInTheContainer(data, dataName, dataIcon, contextType, edit){
if(typeof val.rolesLink != "undefined"){
console.log(val.rolesLink);
$.each(val.rolesLink, function(i,v){
//Push new roles in rolesList
if(v != "" && !rolesList.includes(v))
rolesList.push(v);
//Incrément and push roles in filter array
if(typeof listRoles[v] != "undefined")
listRoles[v].count++;
else
......
......@@ -34,6 +34,11 @@ dynForm = {
}else{
$("#ajaxFormModal #endDate").val("");
}
if(typeof useIdParentResolution != "undefined" && useIdParentResolution == true){
$("#idParentResolution").val(idParentResolution);
useIdParentResolution = false;
}
}
},
beforeBuild : function(){
......@@ -117,7 +122,8 @@ dynForm = {
label : "Date de fin",
placeholder : "Date de fin"
},
status: dyFInputs.inputHidden( "todo" ),
status: dyFInputs.inputHidden( "todo" ),
idParentResolution: dyFInputs.inputHidden( "" ),
tags : dyFInputs.tags(),
urls : dyFInputs.urls,
email : dyFInputs.inputHidden( ( (userId!=null && userConnected != null) ? userConnected.email : "" ) ),
......
dynForm = {
jsonSchema : {
title : typeObj.addAny.title,
icon : typeObj.addAny.icon,
noSubmitBtns : true,
properties : {
sectionBtn :{
label : tradDynForm.what+" ? ",
inputType : "tagList",
placeholder : "Choisir un type",
list : typeObj.addAny.sections,
trad : tradCategory,
init : function(){
$(".sectionBtn").off().on("click",function()
{
dyFObj.openForm($(this).data('key'));
});
//manage update bulding here
}
},
}
}
};
\ No newline at end of file
dynForm = {
jsonSchema : {
title : typeObj.apps.title,
icon : typeObj.apps.icon,
noSubmitBtns : true,
properties : {
sectionBtn :{
inputType : "tagList",
list : typeObj.apps.sections,
trad : tradCategory,
init : function(){
$(".sectionBtn").off().on("click",function()
{
urlCtrl.loadByHash($(this).data('key'));
});
}
},
}
}
};
\ No newline at end of file
dynForm = {
jsonSchema : {
title : typeObj.config.title,
icon : "cogs",
noSubmitBtns : true,
properties : {
sectionBtn :{
label : tradDynForm.whichkindofconfig+" ? ",
inputType : "tagList",
placeholder : "Choisir un type",
list : typeObj.config.sections,
trad : tradCategory,
init : function(){
$(".sectionBtn").off().on("click",function()
{
dyFObj.openForm($(this).data('key'));
});
//manage update bulding here
}
},
}
}
};
\ No newline at end of file
typeObj.config.sections = {
"sections" : {
"network" : { "label": "Network","key":"network","icon":"map-marker", "col":"network"}
}
};
dynForm = {
jsonSchema : {
title : typeObj.filter.title,
icon : typeObj.filter.title,
debug:true,
save : function () {
//alert("filter save "+dyFObj.activeModal);
if( typeof typeObj.network.filters == "undefined" )
typeObj.network.filters = [];
var formData = $("#openModal #ajaxFormModal").serializeFormJSON();
if(formData.key){
delete formData.key;
delete formData.collection;
delete formData.id;
}
formData.tags = formData.tags.split(",");
typeObj.network.filters.push( formData );
//mylog.log(typeObj.network.filters);
$(".filterList").html("");
$.each(typeObj.network.filters,function(k,v) {
$(".filterList").append(v.name+" <a href='javascript:;' onclick='typeObj.network.dynForm.removeFilter("+k+")'><i class='fa fa-times text-red'></i> </a><br/>");
})
$("#openModal").modal("hide");
dyFObj.activeModal = "#ajax-modal";
dyFObj.activeElem = "elementObj";
},
properties : {
info : {
inputType : "custom",
html:"<p class='text-red'>Les Filtres controle le menu de gauche et les tags que vous voulez présenter aux utilisateurs<hr></p>",
},
name : dyFInputs.name(),
tags : dyFInputs.tags()
}
}
};
\ No newline at end of file
dynForm = {
jsonSchema : {
title : typeObj.config.title,
icon : "cogs",
debug:true,
properties : {
info : {
inputType : "custom",
html:"<p class='text-red'>All DYNFORM existing inputs are all here <hr></p>",
},
type : dyFInputs.inputHidden(),
name : dyFInputs.name("network"),
"skin[title]" : dyFInputs.name(),
image : dyFInputs.image(),
"request[searchTag]" : dyFInputs.tags(),
tags : dyFInputs.tags(),
description : dyFInputs.textarea(tradDynForm.longDescription, "..."),
startDate :{
inputType : "datetime",
label : "Date de début",
placeholder : "Date de début"
},
endDate :{
inputType : "datetime",
label : "Date de fin",
placeholder : "Date de fin"
},
urls : dyFInputs.urls,
"result[displayImage]" : dyFInputs.radio( "Display Images ?", { "true" : { icon:"check-circle-o", lbl:trad.yes },
"false" : { icon:"circle-o", lbl:trad.no} } ),
//keyVal : dyFInputs.keyVal,
/*"linksTag[]" : dyFInputs.subDynform({
key : dyFInputs.name(),
tagParent : "Type",
"background-color" : "#f5f5f5",
"image" : "Travail.png",
"tags" : dyFInputs.tags(),
}, "multi"),*/
}
}
};
\ No newline at end of file
dynForm = {
removeFilter : function (ix) {
//alert(ix);
typeObj.network.filters.splice( ix, 1 );
$(".filterList").html("");
$.each(typeObj.network.filters,function( k,v ) {
$(".filterList").append(v.name+" <a href='javascript:;' onclick='typeObj.network.dynForm.removeFilter("+k+")'><i class='fa fa-times text-red'></i> </a><br/>");
})
},
jsonSchema : {
title : tradDynForm.configNetwork,
icon : "connectdevelop",
type : "object",
//debug : true,
beforeBuild : function(){
dyFObj.setMongoId('network',function(){
uploadObj.gotoUrl = location.hash;
});
},
afterSave : function(){
if( $('.fine-uploader-manual-trigger').fineUploader('getUploads').length > 0 )
$('.fine-uploader-manual-trigger').fineUploader('uploadStoredFiles');
else
{
dyFObj.closeForm();
urlCtrl.loadByHash( (uploadObj.gotoUrl) ? uploadObj.gotoUrl : location.hash );
}
},
canSubmitIf : function () {
return ( $("#ajaxFormModal #type").val() ) ? true : false ;
},
formatData : function(formData){
//alert("formatData");
if( $(dyFObj.activeModal+" #ajaxFormModal request[searchTag]").val() != "" && formData["request[searchTag]"] )
formData["request[searchTag]"] = formData["request[searchTag]"].split(",");
if( $(dyFObj.activeModal+" #ajaxFormModal add").val() != "" && formData.add )
formData.add = formData.add.split(",");
if( typeObj.network.filters )
formData.filters = typeObj.network.filters;
return formData;
},
properties : {
breadcrumb : {
inputType : "custom",
html:"<h4><a href='javascript:;'' class='btn btn-xs btn-danger' onclick='dyFObj.openForm(\"filr\")'><i class='fa fa-times'></i></a> NETWORK </h4>",
},
"type" : dyFInputs.inputHidden(),
"name" : dyFInputs.name(),
skinInfo : {
inputType : "custom",
html:"<p class='item-comment bg-green-comment'>SKIN Section<hr></p>",
},
"skin[title]" : dyFInputs.name(),
"skin[logo]" : dyFInputs.image(),
"skin[paramsLogo][origin]" : dyFInputs.radio( "Logo Origin ?", { "true" : { icon:"check-circle-o", lbl:trad.yes },
"false" : { icon:"circle-o", lbl:trad.no} } ),
/*dyFInputs.checkboxSimple("true", "skinparamsLogoorigin",
{ "onText" : "Oui",
"offText": "Non",
"onLabel" : "on",
"offLabel": "off",
"inputId" : ".skinparamsLogoorigin",
"labelText": "skin params Logo origin ?",
"labelInInput": "Activer les amendements",
"labelInformation": "<i class='fa fa-info-circle'></i> Les votes sont désactivés pendant la période d'amendement"
}),*/
filterInfo : {
inputType : "custom",
html:"<p class='item-comment bg-green-comment'>FILTER Section "+
"</p>",
},
"filters[types]" : dyFInputs.radio( "Types ?", { "true" : { icon:"check-circle-o", lbl:trad.yes },
"false" : { icon:"circle-o", lbl:trad.no} } ),
filterTagsInfo : {
inputType : "custom",
html:"<a href='javascript:;' class='btn btn-dark' onclick='dyFObj.openForm(\"filter\",null,null,true)'><i class='fa fa-plus'></i> Ajouter un Filtre</a>"+
"<div class='filterList'></div>",
},
addInfo : {
inputType : "custom",
html:"<p class='item-comment bg-green-comment'>ADD Section</p>",
},
add : dyFInputs.tags( ["organization","project","event"] ),
resultInfo : {
inputType : "custom",
html:"<p class='item-comment bg-green-comment'>RESULT Section</p>",
},
"result[displayImage]" : dyFInputs.radio( "Display Images ?", { "true" : { icon:"check-circle-o", lbl:trad.yes },
"false" : { icon:"circle-o", lbl:trad.no} } ),
requestInfo : {
inputType : "custom",
html:"<p class='item-comment bg-green-comment'>REQUEST Section</p>",
},
"request[searchTag]" : dyFInputs.tags(),
},
tooltips : {
filterTagsInfo : "CLALALALAL LFGSGSDF\n GFDSG FDSGSD",
"filters[types]" : "CLALALALAL LFGSGSDF\n GFDSG FDSGSD",
add : "XXXX SXKXKKXXOKOXSPOKXSKXSXSXS \n XS XS \n XS XS XS XS"
}
}
};
\ No newline at end of file
......@@ -360,7 +360,7 @@ function modifyNews(idNews,typeNews){
else if(updateNews[idNews]["media"]["type"]=="gallery_files"){
message += getMediaFiles(updateNews[idNews]["media"],idNews, "update")+
"<input type='hidden' class='type' value='gallery_files'>";
}else if (updateNews[idNews]["media"]["type"]=="gallery_files"){
}else if (updateNews[idNews]["media"]["type"]=="gallery_images"){
message += getMediaImages(updateNews[idNews]["media"], idNews,null,null, "update")+
"<input type='hidden' class='type' value='gallery_images'>";
}else{
......@@ -1360,7 +1360,7 @@ function getMediaImages(o,newsId,authorId,targetName,edit){
if(typeof edit != "undefined" && edit=="update"){
for(var i in o.images){
html+="<div class='updateImageNews'><img src='"+baseUrl+"/"+uploadUrl+"communecter/"+o.images[i].folder+"/"+o.images[i].name+"' style='width:75px; height:75px;'/>"+
"<a href='javascript:;' class='btn-red text-white deleteDoc' onclick='deleteDocFromNews(\'"+o.images[i]._id.$id+"\',\'"+edit+"\')'><i class='fa fa-times text-dark'></i></a>"+
"<a href='javascript:;' class='btn-red text-white deleteDoc'><i class='fa fa-times text-dark'></i></a>"+
"<input type='hidden' class='docsId' value='"+o.images[i]._id.$id+"'></div>";
}
return html;
......@@ -1439,7 +1439,7 @@ function getMediaFiles(o,newsId, edit){
html+="<div class='col-md-12 padding-5 shadow2 margin-top-5'>"+
"<a href='"+path+"' target='_blank'>"+documents.getIcon(o.files[i].contentKey)+" "+o.files[i].name+"</a>";
if(typeof edit != "undefined" && edit=="update"){
html+="<a href='javascript:;' class='btn-red text-white deleteDoc' onclick='deleteDocFromNews(\'"+o.files[i]._id.$id+"\',\'"+edit+"\')'><i class='fa fa-times text-dark'></i></a>"+
html+="<a href='javascript:;' class='btn-red text-white deleteDoc'><i class='fa fa-times text-dark'></i></a>"+
"<input type='hidden' class='docsId' value='"+o.files[i]._id.$id+"'>";
}
html +="</div>";
......
......@@ -62,7 +62,7 @@
}else if (typeof TPL_IFRAME != "undefined" && TPL_IFRAME==true){
url = "https://www.communecter.org/"+url;
popupContent += "<a href='"+url+"' target='_blank' class='item_map_list popup-marker' id='popup"+id+"'>";
}else{
}else{
popupContent += "<a href='"+url+"' onclick='"+onclick+"' class='item_map_list popup-marker lbh' id='popup"+id+"'>";
}
popupContent += "<div class='main-panel'>"
......
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