Commit b5c246ff authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

trads poi stuff back

parent d52140aa
......@@ -23,9 +23,14 @@ dynForm = {
if( $('#ajaxFormModal #parentId > optgroup > option[value="'+contextData.id+'"]').length == 0 )
$('#ajaxFormModal #parentId > optgroup[label="events"]').prepend('<option value="'+contextData.id+'" selected>'+tradDynForm["ispartof"]+' : '+contextData.name+'</option>');
else if ( contextData && contextData.id ){
else if ( contextData && contextData.id && contextData.type ){
$("#ajaxFormModal #parentId").val( contextData.id );
$("#ajaxFormModal #parentType").val( contextData.type );
} else if(userConnected){
$('#ajaxFormModal #parentId').val( userId );
$("#ajaxFormModal #parentType").val( "citoyens" );
}
if ( contextData && typeof contextData.organizerId != "undefined"){
$("#ajaxFormModal #organizerId").val( contextData.organizerId );
......@@ -33,8 +38,7 @@ dynForm = {
if(contextData && typeof contextData.organizerType != "undefined")
$("#ajaxFormModal #organizerType").val( contextData.organizerType );
//$("#ajax-modal-modal-title").html($("#ajax-modal-modal-title").html()+" sur "+contextData.name );
if( contextData && contextData.type )
$("#ajaxFormModal #parentType").val( contextData.type );
if(contextData.startDateDB && contextData.endDateDB){
$("#ajaxFormModal").after("<input type='hidden' id='startDateParent' value='"+contextData.startDateDB+"'/>"+
......
......@@ -39,10 +39,17 @@ dynForm = {
$("#ajaxFormModal #parentType").val( contextData.type );
$("#ajax-modal-modal-title").append(
" <br><small class='text-white'>"+tradDynForm["speakingas"]+" : <span class='text-dark'>"+
" <br><small class='text-white'>"+tradDynForm.speakingas+" : <span class='text-dark'>"+
contextData.name+
"</span></small>" );
}
}else if(userConnected){
$('#ajaxFormModal #parentId').val( userId );
$("#ajaxFormModal #parentType").val( "citoyens" );
$("#ajax-modal-modal-title").append(
" <br><small class='text-white'>"+tradDynForm.speakingas+" : <span class='text-dark'>"+
userConnected.name+
"</span></small>" );
}
},
},
beforeBuild : function(){
......
......@@ -9,26 +9,17 @@ dynForm = {
dyFInputs.setSub("bg-green-poi");
},
onload : function(data){
if(data && data.section && data.type && data.subtype ){
$("#ajaxFormModal #id").val(data.id);
$(".breadcrumbcustom").html( "<h4><a href='javascript:;'' class='btn btn-xs btn-danger' onclick='dyFObj.elementObj.dynForm.jsonSchema.actions.clear()'><i class='fa fa-times'></i></a> "+data.section+" > "+data.type+" > "+data.subtype+"</h4>" );
if(data && data.type){
$(".breadcrumbcustom").html( "<h4><a href='javascript:;'' class='btn btn-xs btn-danger' onclick='dyFObj.elementObj.dynForm.jsonSchema.actions.clear()'><i class='fa fa-times'></i></a> "+tradCategory[data.type]+"</h4>");
$(".sectionBtntagList").hide();
$(".typeBtntagList").hide();
} else
$(".typeBtntagList,.nametext, .descriptiontextarea, .contactInfotext, .locationlocation, .urlsarray, .imageuploader, .tagstags, #btn-submit-form").hide();
$(".nametext, .descriptiontextarea, .contactInfotext, .locationlocation, .urlsarray, .imageuploader, .tagstags, #btn-submit-form").hide();
},
},
beforeSave : function(){
var tagAndTypes = "";
if( $("#ajaxFormModal #section").val() )
tagAndTypes += $("#ajaxFormModal #section").val();
if( $("#ajaxFormModal #type").val() )
tagAndTypes += ","+$("#ajaxFormModal #type").val();
if( $("#ajaxFormModal #subtype").val() )
tagAndTypes += ","+$("#ajaxFormModal #subtype").val();
$("#ajaxFormModal #tags").val( tagAndTypes );
$("#ajaxFormModal #type").val($("#ajaxFormModal #section").val());
if( typeof $("#ajaxFormModal #description").code === 'function' )
$("#ajaxFormModal #description").val( $("#ajaxFormModal #description").code() );
......@@ -52,10 +43,7 @@ dynForm = {
}
},
canSubmitIf : function () {
if( $("#ajaxFormModal #section").val() && $("#ajaxFormModal #type").val() && $("#ajaxFormModal #subtype").val() )
return true;
else
return false;
return ( $("#ajaxFormModal #type").val() ) ? true : false ;
},
actions : {
clear : function() {
......@@ -68,58 +56,6 @@ dynForm = {
$(".subtypeSection").html("");
$(".subtypeSectioncustom").show();
$(".nametext, .descriptiontextarea, .contactInfotext, .locationlocation, .urlsarray, .imageuploader, .tagstags, #btn-submit-form").hide();
},
initTypeBtn : function () {
$(".typeBtn").off().on("click",function(){
$(".typeBtn").removeClass("active btn-dark-blue text-white");
$( "."+$(this).data('key')+"Btn" ).toggleClass("active btn-dark-blue text-white");
$("#ajaxFormModal #type").val( ( $(this).hasClass('active') ) ? $(this).data('key') : "" );
$(".breadcrumbcustom").html( "<h4><a href='javascript:;'' class='btn btn-xs btn-danger' onclick='dyFObj.elementObj.dynForm.jsonSchema.actions.clear()'><i class='fa fa-times'></i></a> "+$(".sectionBtn.active").data('tag')+" > "+$(".typeBtn.active").data('tag')+"</h4>" );
$(".typeBtntagList").hide();
//$(".typeBtn:not(.active)").hide();
$("#ajaxFormModal #subtype").val("");
fieldHTML = "";
var filt = (poi.currentLeftFilters != null ) ? poi[poi.currentLeftFilters] : poi.filters;
if(filt[ $(this).data('key') ]["subcat"].length >= 1)
{
$.each(filt[ $(this).data('key') ]["subcat"], function(k,v) {
fieldHTML += '<div class="col-md-6 padding-5">'+
'<a class="btn tagListEl subtypeBtn '+tradCategory[k]+'Btn " data-tag="'+tradCategory[v]+'" data-key="'+v+'" href="javascript:;">'+tradCategory[v]+'</a>' +
"</div>";
});
$(".subtypeSection").html('<hr class="col-md-12 no-padding">'+
'<label class="col-md-12 text-left control-label no-padding" for="typeBtn">'+
'<i class="fa fa-chevron-down"></i> '+tradDynForm["subcategory"]+
'</label>' + fieldHTML );
$(".subtypeBtn").off().on("click",function()
{
$( ".subtypeBtn" ).removeClass("active");
$(this).addClass("active");
$("#ajaxFormModal #subtype").val( ( $(this).hasClass('active') ) ? $(this).data('key') : "" );
$(".nametext, .descriptiontextarea, .pricetext, .contactInfotext, .locationlocation, .imageuploader, .formshowerscustom, .tagstags, .deviseselect").show();
if($(".form-group.sectionhidden #section").val() == "donation" ||
$(".form-group.sectionhidden #section").val() == "sharing" ||
$(".form-group.sectionhidden #section").val() == "lookingfor"){
$(".pricetext, .deviseselect").hide();
}else{
$(".pricetext, .deviseselect").show();
}
//$(".subtypeBtn:not(.active)").hide();
$(".breadcrumbcustom").html( "<h4><a href='javascript:;'' class='btn btn-xs btn-danger' onclick='dyFObj.elementObj.dynForm.jsonSchema.actions.clear()'><i class='fa fa-times'></i></a> "+
$(".sectionBtn.active").data('tag')+" > "+$(".typeBtn.active").data('tag')+" > "+$(".subtypeBtn.active").data('tag')+"</h4>" );
$(".subtypeSectioncustom").hide();
dyFObj.canSubmitIf();
});
} else {
$(".nametext, .descriptiontextarea, .pricetext, .contactInfotext, .locationlocation, .imageuploader, .formshowerscustom, .tagstags, .deviseselect").show();
}
});
}
},
properties : {
......@@ -146,48 +82,17 @@ dynForm = {
$(".typeBtntagList").show();
$(".sectionBtn").removeClass("active btn-dark-blue text-white");
$( "."+$(this).data('key')+"Btn" ).toggleClass("active btn-dark-blue text-white");
$("#ajaxFormModal #section").val( ( $(this).hasClass('active') ) ? $(this).data('key') : "" );
$("#ajaxFormModal #type").val( ( $(this).hasClass('active') ) ? $(this).data('key') : "" );
//$(".sectionBtn:not(.active)").hide();
var sectionKey = $(this).data('key');
//alert(sectionKey);
var what = { title : tradDynForm["inwhichcategoryforpoi"]+" ?",
icon : poi.sections[sectionKey].icon }
if( jsonHelper.notNull( "poi.sections."+sectionKey+".filters" ) ){
//alert('build btns menu'+poi.sections[sectionKey].filters);
poi.currentLeftFilters = poi.sections[sectionKey].filters;
var filters = poi[poi.currentLeftFilters];
directory.sectionFilter( filters, ".typeBtntagList",what,'btn');
dyFObj.elementObj.dynForm.jsonSchema.actions.initTypeBtn();
}
else if( poi.currentLeftFilters != null ) {
//alert('rebuild common list');
directory.sectionFilter( poi.filters, ".typeBtntagList",what,'btn');
dyFObj.elementObj.dynForm.jsonSchema.actions.initTypeBtn()
poi.currentLeftFilters = null;
}
$(".breadcrumbcustom").html( "<h4><a href='javascript:;'' class='btn btn-xs btn-danger' onclick='dyFObj.elementObj.dynForm.jsonSchema.actions.clear()'><i class='fa fa-times'></i></a> "+$(this).data('tag')+"</h4>");
$(".sectionBtntagList").hide();
$(".nametext, .descriptiontextarea, .contactInfotext, .locationlocation, .urlsarray, .imageuploader, .tagstags").show();
dyFObj.canSubmitIf();
});
}
},
section : dyFInputs.inputHidden(),
typeBtn :{
label : tradDynForm["inwhichcategoryforpoi"]+" ? ",
inputType : "tagList",
placeholder : "Choisir une catégorie",
list : poi.filters,
trad:tradCategory,
init : function(){
poi.currentLeftFilters = null;
dyFObj.elementObj.dynForm.jsonSchema.actions.initTypeBtn();
}
},
type : dyFInputs.inputHidden(),
subtypeSection : {
inputType : "custom",
html:"<div class='subtypeSection'></div>"
},
subtype : dyFInputs.inputHidden(),
name : dyFInputs.name("poi"),
image : dyFInputs.image(),
//description : dyFInputs.description,
......
{
"sections" : {
"sharing": {
"label":"Share",
"labelFront":"To share",
"key" : "sharing",
"icon" : "exchange",
"section":2,
"color":"azure"
},
"donation": {
"label":"Give",
"labelFront":"To give",
"key" : "donation",
"icon" : "gift",
"section":2,
"color":"azure"
},
"forsale": {
"label":"Sale",
"labelFront":"For sale",
"key" : "forsale",
"icon" : "money",
"section":3,
"color":"azure"
},
"forrent": {
"label":"Rent",
"labelFront":"For rent",
"key" : "forrent",
"icon" : "external-link",
"section":3,
"color":"azure"
},
"lookingfor" : {
"label":"Need",
"labelFront":"Looking for",
"key" : "lookingfor",
"icon" : "eye",
"section":4,
"color":"azure"
},
"job": {
"label":"Jobs",
"labelFront":"Offers",
"key" : "job",
"icon" : "briefcase",
"section":5,
"color":"azure",
"filters" : "jobFilters"
}
},
"filters" : {
"Technology" :
{ "icon" : "laptop",
"subcat" : ["TV / Video", "IT", "Touchpads", "Telephony", "Camera", "Audio device"]
},
"Property" :
{ "icon" : "building",
"subcat" : ["House", "Flat", "Ground", "Parking", "Office"]
},
"Vehicles" :
{ "icon" : "car",
"subcat" :
[ "Car",
"SUV",
"Utility",
"Moto",
"Scooter",
"Boat",
"Small car",
"Bikes",
"Car equipment",
"2-wheeled equipment",
"Boat equipment",
"Bike equipment"
]
},
"Home" :
{ "icon" : "home",
"subcat" :
[ "Household appliances",
"Furniture",
"Baby equipment",
"Animals",
"Various"
]
},
"Leisure" :
{ "icon" : "smile-o",
"subcat" :
[ "Sports",
"Musical instrument",
"Sound system",
"CD / DVD",
"Toy",
"Games",
"Books / Comics",
"Collections",
"DIY",
"Gardening",
"Art / Deco",
"Model making",
"Childcare",
"Animals",
"Various"
]
},
"Fashion" :
{ "icon" : "shopping-bag",
"subcat" :
[ "Clothes",
"Shoes",
"Accessories",
"Watches",
"Jewels"
]
}
},
"jobFilters" : {
"Purchase-Comptability-Management" : {
"icon":"briefcase",
"subcat" : []
},
"Arts-Crafts" : {
"icon":"paint-brush",
"subcat" : []
},
"Bank-Insurance" : {
"icon":"money",
"subcat" : []
},
"Building-Public_works" : {
"icon":"building",
"subcat" : []
},
"Trade-Sales" : {
"icon":"handshake-o",
"subcat" : []
},
"Communication-Multimedia" : {
"icon":"television",
"subcat" : []
},
"Consultant-Market_research" : {
"icon":"search",
"subcat" : []
},
"Natural_spaces" : {
"icon":"tree",
"subcat" : []
},
"Agriculture" : {
"icon":"shopping-basket",
"subcat" : []
},
"Fishing" : {
"icon":"tint",
"subcat" : []
},
"Animals_care" : {
"icon":"medkit",
"subcat" : []
},
"Hotel_business" : {
"icon":"hotel",
"subcat" : []
},
"Catering" : {
"icon":"cutlery",
"subcat" : []
},
"Tourism" : {
"icon":"info-circle",
"subcat" : []
},
"Animation" : {
"icon":"signing",
"subcat" : []
},
"Property" : {
"icon":"building-o",
"subcat" : []
},
"Industry" : {
"icon":"industry",
"subcat" : []
},
"IT-Telecommunication" : {
"icon":"wifi",
"subcat" : []
},
"Installation-Maintenance" : {
"icon":"wrench",
"subcat" : []
},
"Marketing-Strategy" : {
"icon":"area-chart",
"subcat" : []
},
"Human_Ressources" : {
"icon":"group",
"subcat" : []
},
"Health" : {
"icon":"stethoscope",
"subcat" : []
},
"Secretariat-Assistantship" : {
"icon":"support",
"subcat" : []
},
"Home_services" : {
"icon":"blind",
"subcat" : []
},
"Public_services" : {
"icon":"university",
"subcat" : []
},
"Spectacle" : {
"icon":"star",
"subcat" : []
},
"Sport" : {
"icon":"futbol-o",
"subcat" : []
},
"Transport-Logistic" : {
"icon":"truck",
"subcat" : []
}
}
}
......@@ -5,6 +5,7 @@
"metaTitle" : "Réseau sociétal citoyen",
"metaDesc" : "Communecter : Connecter à sa commune, inter connecter les communs, un réseau sociétal pour un citoyen connecté et acteur au centre de sa société.",
"devises" : {"€" : "€",
"Ğ1" : "Ğ1",
"£" : "£",
"$" : "$",
"CFP" : "CFP"},
......
......@@ -584,6 +584,7 @@ var tradDynForm = {
"whichkindofroom":"<?php echo Yii::t("form","Which kind of room do you want to create") ?>",
"whichkindofpoi":"<?php echo Yii::t("form","Which kind of point do you want to locate") ?>",
"whichkindofconfig":"<?php echo Yii::t("form","Which kind of config") ?>",
"whichRessourceType":"<?php echo Yii::t("form","Which kind of Ressource") ?>",
"whichkindofclassified":"<?php echo Yii::t("form","Which kind of classified is it") ?>",
"inwhichcategoryforclassified":"<?php echo Yii::t("form","In which category do you want to publish the classified") ?>",
"inwhichcategoryforpoi":"<?php echo Yii::t("form","In which category do you want to publish the point of interest") ?>",
......
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