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

docs for costum

parent 6708683f
...@@ -642,40 +642,40 @@ var dataHelper = { ...@@ -642,40 +642,40 @@ var dataHelper = {
$(elem).before("<small class='block letter-light text-left'><i class='fa fa-info-circle'></i> "+tradDynForm["discovermarkdownsyntax"]+"</small>"); $(elem).before("<small class='block letter-light text-left'><i class='fa fa-info-circle'></i> "+tradDynForm["discovermarkdownsyntax"]+"</small>");
}, },
path2Value : function ( params, callback ) { path2Value : function ( params, callback ) {
mylog.log("path2value > params", params); mylog.log("path2value > params", params);
bootbox.confirm("confirm please !!", bootbox.confirm("confirm please !!",
function(result) function(result)
{ {
if (!result) { if (!result) {
btnClick.empty().html('<i class="fa fa-thumbs-down"></i>'); btnClick.empty().html('<i class="fa fa-thumbs-down"></i>');
return; return;
} else { } else {
mylog.log("path2Value", baseUrl+"/"+moduleId+"/element/updatepathvalue",params); mylog.log("path2Value", baseUrl+"/"+moduleId+"/element/updatepathvalue",params);
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: baseUrl+"/"+moduleId+"/element/updatepathvalue", url: baseUrl+"/"+moduleId+"/element/updatepathvalue",
data: params, data: params,
dataType: "json", dataType: "json",
success: function(data){ success: function(data){
mylog.log("success path2Value : ",data); mylog.log("success path2Value : ",data);
if(data.result){ if(data.result){
toastr.success(data.msg); toastr.success(data.msg);
if(typeof callback == "function") if(typeof callback == "function")
callback(); callback();
else else
urlCtrl.loadByHash(location.hash); urlCtrl.loadByHash(location.hash);
}else{ }else{
toastr.error(data.msg); toastr.error(data.msg);
} }
}, },
error: function(data){ error: function(data){
toastr.error("Something went really bad ! Please contact the administrator."); toastr.error("Something went really bad ! Please contact the administrator.");
} }
}); });
} }
}); });
} }
} }
dynForm = {
jsonSchema : {
title : "Add a Costum",
icon : " photo",
type : "object",
onLoads : {
onload : function(){
dyFInputs.setSub("bg-dark");
}
},
beforeBuild : function(){
//alert("before Build orga");
dyFObj.setMongoId('costum', function(){
uploadObj.gotoUrl = '/costum';
});
dyFObj.deepPropertyBuild(dyFObj.elementData.map);
},
afterSave : function(data,callB){
if( $(uploadObj.domTarget).fineUploader('getUploads').length > 0 ){
$(uploadObj.domTarget).fineUploader('uploadStoredFiles');
}
window.location.reload();
},
properties : {
slug : dyFInputs.inputText("Slug", "Must correspond to an existing element ", { required : true }),
}
}
};
\ No newline at end of file
...@@ -36,7 +36,9 @@ class DocsController extends CommunecterController { ...@@ -36,7 +36,9 @@ class DocsController extends CommunecterController {
//if(@$_GET["network"] ){ //if(@$_GET["network"] ){
//$this->redirect(Yii::app()->createUrl("/network/default/index?src=".$_GET["network"])); //$this->redirect(Yii::app()->createUrl("/network/default/index?src=".$_GET["network"]));
//} //}
$url=(!empty($dir)) ? $dir."/".$page : $page; $url= $page;
if(!empty($dir))
$url = $dir."/".$page;
echo $this->renderPartial($url, null,true); echo $this->renderPartial($url, null,true);
} }
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
---------------------------------------------------- ----------------------------------------------------
---------------------------------------------------- ----------------------------------------------------
---------------------------------------------------- ----------------------------------------------------
http://127.0.0.1/ph/co2/default/sitemap/host/coco.fr/sourceKey/ctenat
---------------------------------------------------- ----------------------------------------------------
* rajouter les update elemnt sur les slugs (SEO) * rajouter les update elemnt sur les slugs (SEO)
http://127.0.0.1/ph/co2/test/updateslugs http://127.0.0.1/ph/co2/test/updateslugs
......
...@@ -329,8 +329,14 @@ function buildDirectoryLine( e, collection, type, icon/* tags, scopes*/ ){ ...@@ -329,8 +329,14 @@ function buildDirectoryLine( e, collection, type, icon/* tags, scopes*/ ){
if(isSuperAdmin) if(isSuperAdmin)
actions += '<li><a href="javascript:;" data-id="'+id+'" data-type="'+type+'" class="margin-right-5 deleteThisBtn"><i class="fa fa-trash text-red"></i>Delete!</a> </li>'; actions += '<li><a href="javascript:;" data-id="'+id+'" data-type="'+type+'" class="margin-right-5 deleteThisBtn"><i class="fa fa-trash text-red"></i>Delete!</a> </li>';
var criteria = null;
if(isSuperAdmin && type == "<?php echo Project::COLLECTION ?>" ){ if(isSuperAdmin && type == "<?php echo Project::COLLECTION ?>" ){
var privateLabel = ( typeof e.preferences != "undefined" && (e.preferences.private == "false" || typeof e.preferences.private == "undefined" ) ) ? '<i class="fa fa-thumbs-up text-green"> Make Public' : '<i class="fa fa-thumbs-down text-red"></i></i> Make Private'; var criteria = "<span id='private"+id+"' class='label label-danger'> privé </span>";
var privateLabel = '<i class="fa fa-thumbs-up text-green"></i> Make Public';
if( typeof e.preferences != "undefined" && (e.preferences.private == "false" || e.preferences.private == false || typeof e.preferences.private == "undefined" ) ) {
privateLabel = '<i class="fa fa-thumbs-down text-red"></i> Make Private';
criteria = "<span id='private"+id+"' class='label label-success'> public </span>";
}
actions += '<li><a href="javascript:;" data-id="'+id+'" data-type="'+type+'" data-private="'+e.preferences.private+'" data-path="preferences.private" class="margin-right-5 privatePublicThisBtn"> '+privateLabel+' </a> </li>'; actions += '<li><a href="javascript:;" data-id="'+id+'" data-type="'+type+'" data-private="'+e.preferences.private+'" data-path="preferences.private" class="margin-right-5 privatePublicThisBtn"> '+privateLabel+' </a> </li>';
...@@ -420,13 +426,18 @@ function buildDirectoryLine( e, collection, type, icon/* tags, scopes*/ ){ ...@@ -420,13 +426,18 @@ function buildDirectoryLine( e, collection, type, icon/* tags, scopes*/ ){
} }
strHTML += '</td>'; strHTML += '</td>';
strHTML += '<td class="center status">'; strHTML += '<td class="center status">';
console.log(status); if(criteria){
if(notEmpty(status)){ strHTML += criteria;
$.each(status,function(e,v){ }
strHTML+="<span class='badge bg-primary "+v.key+"'>"+v.label+"</span>"; else{
}); console.log(status);
}else{ if(notEmpty(status)){
strHTML += "No status"; $.each(status,function(e,v){
strHTML+="<span class='badge bg-primary "+v.key+"'>"+v.label+"</span>";
});
}else{
strHTML += "No status";
}
} }
strHTML += '</td>'; strHTML += '</td>';
/* ************************************** /* **************************************
...@@ -750,10 +761,12 @@ function bindAdminBtnEvents(){ ...@@ -750,10 +761,12 @@ function bindAdminBtnEvents(){
}); });
var clickedBtn = null; var clickedBtn = null;
var globalCtx = null;
$(".privatePublicThisBtn").off().on("click",function () { $(".privatePublicThisBtn").off().on("click",function () {
clickedBtn = $(this); clickedBtn = $(this);
mylog.log("privatePublicThisBtn click"); mylog.log("privatePublicThisBtn click",$(this).data("private"));
var value = ($(this).data("private")) ? "false" : "true"; //if private doesn't exist then == not private == fasle > switch to true
var value = ($(this).data("private") && $(this).data("private") != "undefined") ? null : true;
var params = { var params = {
collection : dyFInputs.get( $(this).data("type") ).col, collection : dyFInputs.get( $(this).data("type") ).col,
id : $(this).data("id"), id : $(this).data("id"),
...@@ -761,8 +774,18 @@ function bindAdminBtnEvents(){ ...@@ -761,8 +774,18 @@ function bindAdminBtnEvents(){
path : $(this).data("path"), path : $(this).data("path"),
value : value value : value
}; };
globalCtx = params;
dataHelper.path2Value( params, function() { clickedBtn.parent().html("Changed to "+value); } );
dataHelper.path2Value( params, function(params) {
clickedBtn.parent().html("Changed to "+value);
str = "public";
$("#private"+globalCtx.id).removeClass("label-success").removeClass("label-danger").addClass("label-success");
if(globalCtx.value) {
str = "privé";
$("#private"+globalCtx.id).addClass("label-danger");
}
$("#private"+globalCtx.id).html(str);;
} );
}); });
<?php } ?> <?php } ?>
......
...@@ -48,13 +48,13 @@ ...@@ -48,13 +48,13 @@
} }
#menu-left > ul > li > a.active, #menu-left > ul > li > a:hover{ #menu-left > ul > li > a.active, #menu-left > ul > li > a:hover{
text-decoration: none; text-decoration: none;
background-color:#E5344D; background-color:#65BA91;
color: white; color: white;
font-size: 22px; font-size: 22px;
} }
ul.subMenu > li > a.active, ul.subMenu > li > a:hover{ ul.subMenu > li > a.active, ul.subMenu > li > a:hover{
border-left: 4px solid #E5344D; border-left: 4px solid #65BA91;
color: #E5344D; color: #65BA91;
font-size:18px; font-size:18px;
text-decoration: none; text-decoration: none;
} }
...@@ -150,11 +150,18 @@ ...@@ -150,11 +150,18 @@
</style> </style>
<div id="header-doc" class="shadow2"> <div id="header-doc" class="shadow2">
<a href='javascript:;' id="show-menu-xs" class="visible-xs visible-sm pull-left" data-placement="bottom" data-title="Menu"><i class="fa fa-bars"></i></a> <a href='javascript:;' id="show-menu-xs" class="visible-xs visible-sm pull-left" data-placement="bottom" data-title="Menu"><i class="fa fa-bars"></i></a>
<h2 class="elipsis no-margin"><i class="fa fa-book hidden-xs"></i> <?php echo Yii::t("docs", "All <span class='hidden-xs'>you need to know</span> about") ?></h2> <h2 class="elipsis no-margin"><i class="fa fa-book hidden-xs"></i> <?php echo Yii::t("docs", "All <span class='hidden-xs'>you need to know</span> about") ?> LE <span style="color:#65BA91">CONTRAT DE TRANSITION ÉCOLOGIQUE</span></h2>
<img src="<?php echo Yii::app()->theme->baseUrl; ?>/assets/img/LOGOS/CO2/logo-head-search.png"
class="logo-menutop main pull-left" height=30>
<a href='javascript:;' class="lbh pull-right" id="close-docs"><span><i class="fa fa-sign-out"></i> <?php echo Yii::t("common","Back") ?></span></a> <a href='javascript:;' class="lbh pull-right" id="close-docs"><span><i class="fa fa-sign-out"></i> <?php echo Yii::t("common","Back") ?></span></a>
</div> </div>
<?php
if(@Yii::app()->session["costum"] && @Yii::app()->session["costum"]["docTpl"]){
$this->renderPartial(Yii::app()->session["costum"]["docTpl"]);
} else { ?>
<div id="menu-left" class="col-md-3 col-sm-2 col-xs-12 shadow2"> <div id="menu-left" class="col-md-3 col-sm-2 col-xs-12 shadow2">
<ul class="col-md-12 col-sm-12 col-xs-12 no-padding"> <ul class="col-md-12 col-sm-12 col-xs-12 no-padding">
<li class="col-xs-12 no-padding"> <li class="col-xs-12 no-padding">
...@@ -309,6 +316,8 @@ ...@@ -309,6 +316,8 @@
</li> </li>
</ul> </ul>
</div> </div>
<?php } ?>
<div id="container-docs" class="col-md-offset-3 col-md-9 col-sm-12 col-xs-12 no-padding text-center"> <div id="container-docs" class="col-md-offset-3 col-md-9 col-sm-12 col-xs-12 no-padding text-center">
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
...@@ -343,7 +352,10 @@ jQuery(document).ready(function() { ...@@ -343,7 +352,10 @@ jQuery(document).ready(function() {
if(notNull($(this).data("dir")) && $(this).data("dir") != "") if(notNull($(this).data("dir")) && $(this).data("dir") != "")
hashDocs+= ".dir."+$(this).data("dir"); hashDocs+= ".dir."+$(this).data("dir");
location.hash=hashDocs; location.hash=hashDocs;
navInDocs($(this).data("type"), $(this).data("dir"), $(this).data("get")); if(moduleId == activeModuleId)
moduleInDocs($(this).data("type"), $(this).data("dir"), $(this).data("get"));
else
navInDocs($(this).data("type"), $(this).data("dir"), $(this).data("get"));
}); });
$("#show-menu-xs").click(function(){ $("#show-menu-xs").click(function(){
if(!$(this).hasClass("show-dir")){ if(!$(this).hasClass("show-dir")){
......
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