Commit f97ce0e4 authored by Laurent Després's avatar Laurent Després

lien doc gitlab

parent 233d0094
......@@ -208,7 +208,7 @@ var pageProfil = {
//$("#central-container").append(loading);
ajaxPost("#central-container",
baseUrl+"/interop/mediawiki/index",
{id: contextData.id, name: contextData.slug, type: contextData.type , for:"index"},
{id: contextData.id, name: contextData.name, type: contextData.type , for:"index"},
function(){}, "html");
},
bookmarks : function(){
......
......@@ -215,7 +215,7 @@ class AppController extends CommunecterController {
"page" => @$page,
"dir"=>@$dir,
);
echo $this->renderPartial("../docs/index", $params, true);
echo $this->renderPartial("co2.views.docs.index", $params, true);
}
......
......@@ -17,17 +17,17 @@ HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->getModule(Yii::app()-
<?php
if (@Yii::app()->session["costum"] && @Yii::app()->session["costum"]["docTpl"]) {
$this->renderPartial(Yii::app()->session["costum"]["docTpl"], true);
} else {
$curl = curl_init();
/////////////////!!!!!!!!!!!!!!!attention ici il faudrat changerl'url
curl_setopt($curl, CURLOPT_URL, "http://192.168.0.15:5080/interop/gitlab/tree?url=https://gitlab.adullact.net/&repo=pixelhumain/codoc");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, 0);
$ret = curl_exec($curl);
$dataDecode = json_decode($ret, true);
curl_close($curl);
//var_dump($dataDecode);exit;?>
$this->renderPartial(Yii::app()->session["costum"]["docTpl"], true);
} else {
$curl = curl_init();
/////////////////!!!!!!!!!!!!!!!attention ici il faudrat changerl'url
curl_setopt($curl, CURLOPT_URL, "http://192.168.0.11:5080/interop/gitlab/tree?url=https://gitlab.adullact.net/&repo=pixelhumain/codoc");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, 0);
$ret = curl_exec($curl);
$dataDecode = json_decode($ret, true);
curl_close($curl);
//var_dump($dataDecode);exit;?>
<style type="text/css">
#docs-main-container{
......@@ -167,6 +167,39 @@ if (@Yii::app()->session["costum"] && @Yii::app()->session["costum"]["docTpl"])
left:0 !important;
}
}
/* container-docs css */
#container-docs>h1 {
text-align: center;
border-radius: 3px;
background-color: whitesmoke;
margin-left: 5%;
max-width: 90%;
}
#container-docs>h2, #container-docs>h3 {
text-align: center;
border-radius: 3px;
background-color: whitesmoke;
margin-left: 2%;
max-width: 95%;
}
#container-docs>table {
border: 3px solid black;
border-radius: 5px;
margin: 4px;
border-collapse: unset;
background-color: rgb(145, 156, 151);
}
/* #container-docs>table>thead {
background-color: rgb(145, 156, 151);
} */
#container-docs>table>tbody>tr>td {
border: 2px solid grey;
border-radius: 3px;
padding-right: 2px;
margin-left: 3px;
background-color:aliceblue;
}
</style>
<div id="docs-main-container">
<div id="header-doc" class="shadow2">
......@@ -279,7 +312,7 @@ jQuery(document).ready(function() {
$("#container-docs").text();
$('#container-docs').html(gitlabMdToHtml(readme));
dir=(dir=="") ? mainLanguage : dir;
if(costum == null){
if(page != "")
initDocs(page, dir);
......@@ -288,7 +321,7 @@ jQuery(document).ready(function() {
}
bindLinkDocs()
$("#show-menu-xs").click(function(){
if(!$(this).hasClass("show-dir")){
$(this).addClass("show-dir").data("title", "<?php echo Yii::t("common", "Close") ?>").find("i").removeClass("fa-chevron-right").addClass("fa-times");
......@@ -317,7 +350,7 @@ function initDocs(page, dir){
}
function bindLinkDocs() {
$(".link-docs-menu").off().on("click",function(){
$(".link-docs-menu").off().on("click", async function(){
if($(this).hasClass("down-menu") && !$(this).hasClass("active")){
$(this).parent().siblings().children("a").removeClass("active").find("i").removeClass("fa-angle-down").addClass("fa-angle-right");
......@@ -343,18 +376,25 @@ function bindLinkDocs() {
if ($(this).hasClass("gitlab")) {
$(".gitlab").removeClass('active');
$(this).addClass('active');
showLoader('#container-docs');
//showLoader('#container-docs');
var titleH = $(this).data("path");
var headContent = "<span><h1 class='head-content-title'>"+titleH.slice(0,-3)+
"<a href='"+urlGit+repoGit+"/-/blob/master/"+$(this).data("path")+"' class='lbh pull-right' target='_blank' id='edit'>"+
"<span><i class='fa fa-edit'></i></span></a></h1></span>";
var urlInterop = baseUrl+"/interop/gitlab/page?url="+urlGit+repoGit+"/-/blob/master/"+$(this).data('path');
getAjax('', urlInterop, function (data) {
descHtml = gitlabMdToHtml(data.content);
$("#container-docs").html(headContent+descHtml).removeClass("text-center").attr("style", "margin-left: 27%; max-width: 72%");
bindLinkDocs();
}
, "html");
var urlInterop = "http://localhost:5080/interop/gitlab/page?url="+urlGit+repoGit+"/-/blob/master/"+$(this).data('path');
var data = await fetch("http://localhost:5080/interop/gitlab/page?url="+urlGit+repoGit+"/-/blob/master/"+$(this).data('path'))
.then(response => response.json())
.then(data => gitlabMdToHtml(data.content))
.then(str => $("#container-docs").html(headContent+descHtml).removeClass("text-center").attr("style", "margin-left: 27%; max-width: 72%"));
// getAjax('', urlInterop, function (data) {
// console.log(data.content)
// descHtml = gitlabMdToHtml(data.content);
// console.log("tesst")
// $("#container-docs").html(headContent+descHtml).removeClass("text-center").attr("style", "margin-left: 27%; max-width: 72%");
// bindLinkDocs();
// }
// , "html");
}
// hashDocs="#docs.page."+$(this).data("type");
// if(notNull($(this).data("dir")) && $(this).data("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