Commit 944d9315 authored by Laurent Després's avatar Laurent Després
Browse files

merge lotik

parents b2e6eace cc2a72f9
.env.php
......@@ -90,6 +90,7 @@ class InteropModule extends CWebModule {
$this->id.'.models.*',
$this->id.'.components.*',
$this->id.'.messages.*',
$this->id.'./.env'
));
}
......
......@@ -21,4 +21,43 @@ Quand on lance le search
# Mediawiki
##Introduction
## MediawikiController
### /interop/mediaWiki/index
Si pas de mediawiki connécté =>
`return $this->renderPartial("interop.views.create.index");` =>
dynForm insertWikiForm (assets/forms/insertWiki.js). =>
**/interop/mediaWiki/chooseCategory** qui insert nom du wiki et url du wiki en db
Sinon
`return $this->renderPartial("interop.views.default.indexMediaWiki");`
### /interop/mediaWiki/chooseCategory
Ici on vérifie qu'un médiawiki avec l'url rentré par l'utilisateur n'existe pas deja en db
`return $this->renderPartial("interop.views.create.index");`
dynForm insertCatWikiForm (assets/forms/chooseCat.js) =>
**/interop/mediaWiki/insertCat** qui insert le choix de l'user des catégorie en fonctions des élément acteurs(person, organization), ressources, projets.
Sinon
`return $this->renderPartial("interop.views.default.indexMediaWiki");`
### /interop/mediaWiki/menuLeft
Comme son nom l'indique cette route s'occupe de chercher la data pour le menuleft
et renvoie la vue avec les differente page en accordeon dans menu left.
`return $this->renderPartial("interop.views.menus.pages");`
### /interop/mediaWiki/page
Cette fois c'est pour la data d'une page spécifique.
Tout un process est en route dans les models afin de cherché la data
sur le wiki et la trier pour la rendre a la celon toujours le méme schema.
Un tour est fait dans citizenToolKit pour le convert et translate de la data du wiki.
`return $this->renderPartial("interop.views.menus.pages");`
### /interop/mediaWiki/edit
Ici la route est appelé en cas de page communecter au méme nom que sur le wiki,
et choix de l'user de marquer la page du wiki ce cette présence.
!! Attention ici un réglage sur le wiki est a faire afin d'intégrer
la propriétés `|pageCo=` dans le modéle des pages du wiki.
renvoi une string message sur le succés ou non de l'opération
\ No newline at end of file
......@@ -9,10 +9,10 @@
/*Style for welcome page of module interop*/
#header-interop {
display: flex;
justify-content: space-between;
margin-left: 5px;
.central-section {
margin-bottom: 5px;
}
.error-message {
......@@ -24,24 +24,36 @@
}
/*Style for menu-left of module interop*/
#header-interop>h4 {
margin: auto;
}
#header-interop {
margin-bottom: 5px;
padding-bottom: 5px;
}
#search-bar-wiki {
font-size: 16px;
}
#menu-left {
border-radius: 6px;
max-width: 250px;
max-height: 600px;
overflow: auto;
margin-top: 5px;
}
#pageWiki {
border-radius: 6px;
overflow: auto;
margin-top: 5px;
}
#loading {
border-radius: 6px;
max-width: 250px;
max-height: 600px;
}
#loading>ul{
#loading>ul {
position: relative;
background-color: rgb(151, 151, 151);
}
#loading>ul{
#loading>ul {
border-radius: 3px;
content: '';
display: block;
......@@ -64,93 +76,57 @@
left: 50%;
}
}
.link-docs-menu.active {
background-color: whitesmoke !important;
}
#menu-left>ul, #loading>ul {
border-bottom: 1px solid #ccc;
list-style: none;
}
#central-container #title-menu, #loading>p {
font-size: 2em;
text-align: center;
}
#accordion>li, #loading>ul>li {
text-align: center;
margin: auto;
width: 85%;
}
#accordion>li>div>ul>li, .subMenu>li {
text-align: left;
padding-left: 3px;
}
#accordion>li.active, #accordion>li:hover, #accordion>li.active, #accordion>li>a:hover, .subMenu>li:active, .subMenu>li:hover {
border-left: 2px solid #65BA91;
color: #65BA91;
background-color: whitesmoke;
text-decoration: none;
border-bottom: 1px solid #ccc;
list-style: none;
}
.subMenu>li {
display: block;
overflow-wrap: break-word;
}
#menu-left-page {
display: flex;
flex-direction: column;
border-radius: 6px;
margin-right: 10px;
margin-top: 5px;
max-height: 600px;
overflow: auto;
}
.btn-actor, .card {
margin: 5px;
border-radius: 6px;
}
.text-red, .card-header {
text-align: center;
font-size: 1.8em;
word-wrap: break-word;
}
.text, .card-body>p {
font-size: 1.1em;
}
#body-actors {
border-radius: 6px;
margin-top: 5px;
}
.card-community, .card-defis, .card-ressources {
margin: 5px 15% 5px 15%;
width: 70%;
background-color: #f8f8f8;
}
.c-actor {
margin-top: 5px;
}
.collapse>ul>li, .card-defis>ul>li {
margin-bottom: 3px;
margin-left: 5px;
list-style: none;
}
.collapse>ul {
background-color: #f8f8f8;
}
.badge-primary {
background-color: #65BA91;
font-size: 1.5em;
margin: 2px 2px;
}
#btw>div>div>img {
margin-right: 10px;
}
.btn-lg:hover, .btn-lg:active {
background-color: #f8f8f8;
}
.badge-secondary {
background-color: rgb(134, 199, 167);
font-size: 1.2em;
margin: 2px 2px;
}
\ No newline at end of file
.link-docs-menu.active {
background-color: whitesmoke !important;
}
#menu-left>ul, #loading>ul {
border-bottom: 1px solid #ccc;
list-style: none;
}
#title-menu {
font-size: 1.5em;
}
#central-container, #loading>p {
font-size: 2em;
text-align: center;
}
#accordion>li, #loading>ul>li {
text-align: center;
margin: auto;
width: 85%;
}
#accordion>li>div>ul>li, .subMenu>li {
text-align: left;
padding-left: 3px;
}
#accordion>li.active, #accordion>li:hover, #accordion>li.active, #accordion>li>a:hover, .subMenu>li:active, .subMenu>li:hover {
border-left: 2px solid #65BA91;
color: #65BA91;
background-color: whitesmoke;
text-decoration: none;
border-bottom: 1px solid #ccc;
list-style: none;
}
.subMenu>li {
display: block;
overflow-wrap: break-word;
}
#nameEl {
text-align: center;
}
#menu-top-page>.nav {
display: flex;
flex-direction: row;
justify-content: space-around;
padding-bottom: 5px;
}
/**
* styleInteropMod.css
*
* stylesheets for interop module
*
* @author: Després Laurent <laurentd@netc.fr>
* date: 04/2020
*/
/*Style for welcome page of module interop*/
#header-interop {
display: flex;
justify-content: space-between;
margin-left: 5px;
}
.error-message {
margin: auto;
font-size: 2em;
text-align: center;
border-radius: 6px;
border: 2px solid #65BA91;
}
/*Style for menu-left of module interop*/
#menu-left {
border-radius: 6px;
max-width: 250px;
max-height: 600px;
overflow: auto;
}
#loading {
border-radius: 6px;
max-width: 250px;
max-height: 600px;
}
#loading>ul{
position: relative;
background-color: rgb(151, 151, 151);
}
#loading>ul{
border-radius: 3px;
content: '';
display: block;
position: absolute;
background: rgba(255, 255, 255, 0.20);
background: linear-gradient(to right, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0) 100%);
animation: shine;
animation-duration: 2s;
animation-iteration-count: infinite;
animation-timing-function: ease-out;
}
@keyframes shine {
from {
opacity: 0.5;
left: 15%;
}
to {
opacity: 1;
left: 50%;
}
}
.link-docs-menu.active {
background-color: whitesmoke !important;
}
#menu-left>ul, #loading>ul {
border-bottom: 1px solid #ccc;
list-style: none;
}
#central-container #title-menu, #loading>p {
font-size: 2em;
text-align: center;
}
#accordion>li, #loading>ul>li {
text-align: center;
margin: auto;
width: 85%;
}
#accordion>li>div>ul>li, .subMenu>li {
text-align: left;
padding-left: 3px;
}
#accordion>li.active, #accordion>li:hover, #accordion>li.active, #accordion>li>a:hover, .subMenu>li:active, .subMenu>li:hover {
border-left: 2px solid #65BA91;
color: #65BA91;
background-color: whitesmoke;
text-decoration: none;
border-bottom: 1px solid #ccc;
list-style: none;
}
.subMenu>li {
display: block;
overflow-wrap: break-word;
}
#menu-left-page {
display: flex;
flex-direction: column;
border-radius: 6px;
margin-right: 10px;
margin-top: 5px;
max-height: 600px;
overflow: auto;
}
.btn-actor, .card {
margin: 5px;
border-radius: 6px;
}
.text-red, .card-header {
text-align: center;
font-size: 1.8em;
word-wrap: break-word;
}
.text, .card-body>p {
font-size: 1.1em;
}
#body-actors {
border-radius: 6px;
margin-top: 5px;
}
.card-community, .card-defis, .card-ressources {
margin: 5px 15% 5px 15%;
width: 70%;
background-color: #f8f8f8;
}
.c-actor {
margin-top: 5px;
}
.collapse>ul>li, .card-defis>ul>li {
margin-bottom: 3px;
margin-left: 5px;
list-style: none;
}
.collapse>ul {
background-color: #f8f8f8;
}
.badge-primary {
background-color: #65BA91;
font-size: 1.5em;
margin: 2px 2px;
}
#btw>div>div>img {
margin-right: 10px;
}
.btn-lg:hover, .btn-lg:active {
background-color: #f8f8f8;
}
.badge-secondary {
background-color: rgb(134, 199, 167);
font-size: 1.2em;
margin: 2px 2px;
}
\ No newline at end of file
......@@ -7,29 +7,32 @@ function show(id) {
$("#" + id).show();
}
$(document).ready(function () {
$('#block-interop').show();
$(".c-actor").hide();
$("#btw").show();
$(".btw").attr("style", "background-color:#65BA91");
$("#dropdown_search").hide();
$(".btn-sm").click(function () {
$("#body-actors").hide();
$("#subContent").show();
interopMW.objType.categorie = $(this).data("categorie");
if (interopMW.objType.categorie == "utilisateur") {
interopMW.objType.page = "Utilisateur:" + $(this).text();
interopMW.mediaWiki.categorie = $(this).data("categorie");
if ($(this).data("categorie") == "utilisateurs") {
pageName = "Utilisateur:" + $(this).text();
} else {
interopMW.objType.page = $(this).text();
pageName = $(this).text();
}
$("#block-doc-content").html("<i class='fa fa-spin fa-spinner'></i>");
$("#block-doc-content").load("/interop/mediawiki/page", interopMW.objType);
interopMW.showLoader();
$('#loading>p').text($(this).text());
interopMW.pageContent(pageName);
});
$("#edit-wiki").click(function () {
interopMW.objType.currentSlug = $(this).data('slug');
$("#mark-on-wiki").load("/interop/mediawiki/edit", interopMW.objType);
interopMW.mediaWiki.currentSlug = $(this).data('slug');
$(this).remove();
$("#mark-on-wiki").load("/interop/mediawiki/edit", interopMW.mediaWiki);
});
$("#create-in-co").click(function () {
var data = {};
var typeForm = $("#create-in-co").data('type');
console.log(typeForm);
if (typeForm === 'ressources') {
data.section = "offer";
data.category = "service";
......@@ -59,6 +62,9 @@ $(document).ready(function () {
if (typeof $('#urlEl').attr("href") != undefined) {
data.url = $('#urlEl').attr("href");
}
//if (typeForm === 'projets') {
dyFObj.openForm(typeForm, null, data);
});
$('#loading').hide();
});
\ No newline at end of file
......@@ -5,6 +5,7 @@ $(document).ready(function () {
var actorsData = [];
var classifiedsData = [];
var projectsData = [];
var id = document.getElementById("idWiki").getAttribute('data-value');
document.querySelectorAll("#data-block>div[data-name=acteurs]").forEach(function (element) { actorsData.push($(element).data('value')) });
document.querySelectorAll("#data-block>div[data-name=ressources]").forEach(function (element) { classifiedsData.push($(element).data('value')) });
document.querySelectorAll("#data-block>div[data-name=projets]").forEach(function (element) { projectsData.push($(element).data('value')) });
......@@ -26,9 +27,9 @@ $(document).ready(function () {
//$("#central-container").load("interop/mediawiki/insert", { name: contextName, id: contextId, type: contextType, dataForm });
ajaxPost(".central-section",
baseUrl+"/interop/mediaWiki/insertCat",
{ name: contextName,
id: contextId,
type: contextType,
{ name: "",
id: id,
type: "",
actors: dataForm.acteurs,
classifieds: dataForm.classifieds,
projects: dataForm.projects,
......
......@@ -43,6 +43,7 @@ insertWikiForm = {
$("#central-section").html(dyFObj.openForm(insertWikiForm));
$("#btn-submit-form").click(function () {
insertWikiForm.save()
});
......
......@@ -108,26 +108,6 @@ var interopObj = {
interop.startSearch(indexMin, indexStep);
}
},
mediaWiki: {
id: "",
type: "",
categorie: "",
page: "",
currentSlug: "",
pathLogo: "",////////n'est pas encore set
urlImg: "",////////n'est pas encore set
getUrlApi: function (params) {
if (params == "menu") {
var url = baseUrl + "/interop/mediawiki/menuleft";
} else {
var url = baseUrl + "/interop/mediawiki/page";
}
return url;
},
// getUrlApiCo: function (params) {
// var url = baseUrl + "/api/convert/fabmob?url=https://wiki.lafabriquedesmobilites.fr/api.php"
// },
}
};
function initRangeInterop(){
......
var interopMW = {
var interopMW = {
objType: "",
urlSearch: {menu: "",create: "",delete: "",content: ""},
urlSearch: {
menu: baseUrl + "/interop/mediawiki/menuleft",
content: baseUrl + "/interop/mediawiki/page",
create: "",
delete: ""
},
mediaWiki: {
id: "",
type: "",
categorie: "",
page: "",
currentSlug: "",
pathLogo: "",////////n'est pas encore set
urlImg: "",////////n'est pas encore set
},
initObj: function (id, name, categorie) {
this.objType = interopObj.mediaWiki;
this.objType.id = id;
this.objType.categorie = categorie;
this.objType.name = name;
this.mediaWiki.id = id;
this.mediaWiki.categorie = categorie;
this.mediaWiki.name = name;
},
initMenu: function () {
this.urlSearch.menu = this.objType.getUrlApi("menu");
this.menuInterop(this.urlSearch.menu, this.objType);
console.log(this.mediaWiki)
this.menuInterop(this.urlSearch.menu, this.mediaWiki);
},
pageContent: function (pageName) {
this.urlSearch.content = this.objType.getUrlApi(null);
this.objType.page = pageName;
this.contentInterop(this.urlSearch.content, this.objType);
//this.startSearch("content")
this.mediaWiki.page = pageName;
console.log(this.mediaWiki);
this.contentInterop(this.urlSearch.content, this.mediaWiki);
},
contentInterop: function (url_interop, paramsUrl) {
//$("#block-interop").load(url_interop, paramsUrl);
ajaxPost("#block-interop",url_interop, paramsUrl);
},
menuInterop: function (url_interop, params) {
///voir le loader
$("#btnShowMoreResult").html("");
//$("#dropdown_search").html("<center><span class='search-loaderr text-dark' style='font-size:20px;'><i class='fa fa-spin fa-circle-o-notch'></i> " + trad.currentlyresearching + " ...</span></center>");
$("#block-interop").load(url_interop, params);
$("#dropdown_search").html("");
ajaxPost("#menu-left",url_interop, params);
},
search: function (searchText) {
this.objType.page = searchText;
$("#dropdown_search").html("<center><span class='search-loaderr text-dark' style='font-size:20px;'><i class='fa fa-spin fa-circle-o-notch'></i> " + trad.currentlyresearching + " ...</span></center>");
$("#btnShowMoreResult").html("");
$("#block-interop").load(baseUrl + "/interop/mediawiki/menuleft", this.objType);
this.mediaWiki.page = searchText;
this.initMenu();
},
showLoader: function() {
$("#menu-left-container").hide();
//$("#menu-left").hide();
$("#block-interop").hide();
$('#loading').show();
},
//loader =
// initCreate: function () {
// this.urlSearch.create = this.objType.getUrlApi("menuCreate")
// this.startSearch("create")
......
$(document).ready(function () {
$("#menu-left").show();
$("#accordion>li").click(function () {
$("#accordion>li").removeClass("active");
if ($(this).attr("aria-expanded") == "false") {
......@@ -9,12 +10,15 @@ $(document).ready(function () {