Commit 0a64f915 authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

tweaks

parent 3248ed16
......@@ -137,24 +137,15 @@ var addStepParams = {
tplCtx.collection = "forms";
tplCtx.path = "subForms";
tplCtx.value = subForms;
var now = new Date();
var cx = ""+now.getDate() + (now.getMonth()+1) + now.getFullYear()+"_"+now.getHours()+now.getMinutes();
var newFormId = "<?php echo $el["slug"] ?>"+cx+"_"+tplCtx.value.length;
tplCtx.value.push(newFormId);
if( formData.name.indexOf("form:") >= 0 ){
var parts = formData.name.split(":");
mylog.log( "addStepParams added existing form", parts[1] );
if( typeof tplCtx.value == "undefined" )
tplCtx.value = [ parts[1] ];
else
tplCtx.value.push( parts[1] );
var newForm = {
collection : "forms",
value : {
id : newFormId,
name : formData.name,
type : "openForm",
inputs : {}
}
};
mylog.log("addStepParams new sub Form",newForm);
dataHelper.path2Value( newForm, function() {
mylog.log("addStepParams created new sub Form",newFormId);
if(typeof tplCtx.value == "undefined")
toastr.error('value cannot be empty!');
else {
......@@ -163,7 +154,36 @@ var addStepParams = {
urlCtrl.loadByHash(location.hash);
} );
}
} );
} else {
var now = new Date();
var cx = ""+now.getDate() + (now.getMonth()+1) + now.getFullYear()+"_"+now.getHours()+now.getMinutes();
var newFormId = "<?php echo $el["slug"] ?>"+cx+"_"+tplCtx.value.length;
tplCtx.value.push(newFormId);
var newForm = {
collection : "forms",
value : {
id : newFormId,
name : formData.name,
type : "openForm",
inputs : {}
}
};
mylog.log("addStepParams new sub Form",newForm);
dataHelper.path2Value( newForm, function() {
mylog.log("addStepParams created new sub Form",newFormId);
if(typeof tplCtx.value == "undefined")
toastr.error('value cannot be empty!');
else {
mylog.log("addStepParams save tplCtx",tplCtx);
dataHelper.path2Value( tplCtx, function(params) {
urlCtrl.loadByHash(location.hash);
} );
}
} );
}
}
}
};
......
......@@ -181,42 +181,7 @@ if($canEdit)
</div>
<div class="col-xs-12 text-center " style="font-size: 1.5em; padding-top: 20px;" >
<?php
if(isset($this->costum["cms"]["textIntro"])){
echo htmlentities($this->costum["cms"]["textIntro"]);
} else { ?> <b>Lorem ipsum dolor sit amet</b>, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<br/><br/>
<b>Lorem ipsum dolor sit amet</b>, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<br/><br/>
<b>Lorem ipsum dolor sit amet</b>, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<br/><br/>
<b>Lorem ipsum dolor sit amet</b>, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<?php }
if($canEdit)
echo "<a class='btn btn-xs btn-danger editBtn' href='javascript:;' data-key='textIntro' data-type='textarea' data-markdown='1' data-path='costum.cms.textIntro' data-label='Expliquez les objectifs de ce formulaire ? '><i class='fa fa-pencil'></i></a>";
?>
</div>
</div><br/>
......@@ -238,7 +203,7 @@ if($canEdit)
<?php
if(isset($this->costum["cms"]["sec1Title"])){
echo htmlentities($this->costum["cms"]["sec1Title"]);
} else { ?> Sondage <?php }
} else { ?> Open Form <?php }
if($canEdit)
echo "<a class='btn btn-xs btn-danger editBtn' href='javascript:;' data-key='sec1Title' data-type='text' data-path='costum.cms.sec1Title' data-label='Titre '><i class='fa fa-pencil'></i></a>";
?>
......
......@@ -56,7 +56,7 @@ foreach ($forms as $fix => $f) {
<i class='fa fa-file-text-o'></i> RÉPONDRE
</a>
<?php } else { ?>
<a target='_blank' href='costum/co/index/slug/<?php echo $el["slug"] ?>#form.edit.id.<?php echo $fix ?>' class="btn btn-xs btn-primary col-md-4 col-sm-12 bold">
<a target='_blank' href='costum/co/index/slug/<?php echo $el["slug"] ?>/form/<?php echo $fix ?>#form.edit.id.<?php echo $fix ?>' class="btn btn-xs btn-primary col-md-4 col-sm-12 bold">
<i class='fa fa-pencil'></i> CONSTRUIRE
</a>
<?php } ?>
......
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