Commit 615b1501 authored by Clément Damiens's avatar Clément Damiens
Browse files

clean up project costum Mocica & raffinerie
parent 9bc6bdbc
<?php
/**
/* TEMPLATE LA RAFFINERIE
/*
/* */
// ADDITIONAL FILES
// THEME
$cssAndScriptFilesTheme = array(
// SHOWDOWN
'/plugins/showdown/showdown.min.js',
// MARKDOWN
'/plugins/to-markdown/to-markdown.js',
'/plugins/fullcalendar/fullcalendar/fullcalendar.min.js',
'/plugins/fullcalendar/fullcalendar/fullcalendar.css',
'/plugins/fullcalendar/fullcalendar/locale/'.Yii::app()->language.'.js',
);
HtmlHelper::registerCssAndScriptsFiles($cssAndScriptFilesTheme, Yii::app()->request->baseUrl);
// MODULES
$cssAndScriptFilesModule = array('/js/default/calendar.js');
HtmlHelper::registerCssAndScriptsFiles($cssAndScriptFilesModule, $this->module->assetsUrl);
HtmlHelper::registerCssAndScriptsFiles( array('/css/calendar.css'), Yii::app()->theme->baseUrl. '/assets');
// CUSTOM CSS
HtmlHelper::registerCssAndScriptsFiles(array('/css/laRaffinerie.css'), $this->module->assetsUrl);
// CUSTOM VARS
// ELEMENT
// $type = Organization::COLLECTION;
// $elt = PHDB::findOne($type,array("slug" => "laRaffinerie"));
// $idElt = (String)$elt["_id"] ;
// $linksElt = Element::getAllLinks($elt["links"], $type, $idElt);
// $icon = Element::getFaIcon($type) ? Element::getFaIcon($type) : "";
// $iconColor = Element::getColorIcon($type) ? Element::getColorIcon($type) : "";
$edit = false;
// COLORS
$bgColor1 = "#01809b";
$bgColorHover1 = "#01607b";
$projectColorDefault = "rgba(239,42,0, 1)";
$projectColor = [
'rgba(140,87,79, 1)',
'rgba(218,107,15, 1)',
'rgba(100,40,114, 1)',
]
?>
<!-- CUSTOM STYLE -->
<style>
.customBtnTrigger{
background-color: <?php echo $bgColor1 ?>;
}
.customBtnTrigger:hover{
background-color: <?php echo $bgColorHover1 ?>;
}
.projectNavFirstLvl > li a:hover::after{
background-color: <?php echo $projectColorDefault ?>;
}
.projectNavSecondLvl .projectNavThirdLvl a:hover::after{
background-color: <?php echo $projectColorDefault ?>;
}
.projectNavSecondLvl > li a:hover::after{
background-color: <?php echo str_replace('1)','.82)',$projectColorDefault) ?>;
}
<?php
$i=1;
foreach ($projectColor as $key => $value) {
echo "
.projectNavSecondLvl .projectNavThirdLvl:nth-of-type(".$i.") a:hover::after{
background-color: ".str_replace('1)','.82)',$value).";
}
.projectNavSecondLvl > li:nth-of-type(".$i.") a:hover::after{
background-color: ".$value.";
}
";
$i++;
}
?>
</style>
<!-- HTML START -->
<div class="project">
<a href="" class="projectNavTriggerMobile"><i class="fa fa-bars tooltips"></i></a>
<div class="projectNav">
<div class="projectNavContent">
<button class="toggleAllProjects">Ouvrir / Fermer sous-projets</button>
<?php
function getCountMembers($el){
return count(@$el['links']['members']);
}
function getCountEvents($el){
return count(@$el['links']['events']);
}
function getCountProjects($el){
return count(@$el['links']['projects']);
}
function getAllEvents($el){
$arr = [];
if(@$el['links']['events']){
foreach ($el['links']['events'] as $key => $value) {
array_push($arr, $key);
}
}
return $arr;
}
$allProjectsCount = 0;
$allMembersCount = 0;
$projectList = [];
$eventsList = [];
$newsList = [];
$docsList = [];
$toolsList = [];
$allLinksList = [];
$colorCount = 0;
// LEVEL 1
$type = Project::COLLECTION;
$elt = PHDB::findOne($type,array("slug" => "laRaffinerie1"));
$idElt = (String)$elt["_id"] ;
$linksElt = Element::getAllLinks($elt["links"], $type, $idElt);
$allLinksList = array_merge($allLinksList,$linksElt);
array_push($projectList, $idElt);
$hasRC = ( @$elt["hasRC"] ) ? "true" : "false" ;
$canEdit = "false";
$loadChat = StringHelper::strip_quotes($elt["name"]);
if(!empty($elt) && !empty($elt["links"])){
echo "
<ul class='projectNavFirstLvl'>
<li>
<a href='#' class='linkMenu linkOrganization'
data-key='".$idElt."'
data-col='".$type."'
data-countmembers='".getCountMembers($elt)."'
data-countevents='".getCountEvents($elt)."'
data-countprojects='".getCountProjects($elt)."'
data-color='".$projectColorDefault."';
>".$elt["name"]."</a>
</li>";
$eventsList = array_merge($eventsList, getAllEvents($elt));
array_push($projectList, $idElt);
// LEVEL 2
if(!empty($elt["links"]["projects"])){
echo "<ul class='projectNavSecondLvl'>";
foreach ($elt["links"]["projects"] as $idElt2 => $valElt2) {
$elt2 = Element::getElementById($idElt2, "projects");
$linksElt2 = Element::getAllLinks($elt2["links"], $type, $idElt);
$allLinksList = array_merge($allLinksList,$linksElt2);
array_push($projectList, $idElt2);
$allProjectsCount++;
$eventsList = array_merge($eventsList, getAllEvents($elt2));
echo "
<li>
<i class='toggleProjects fa fa-plus' aria-hidden='true'></i>
<a href='#".$elt2["slug"]."' class='linkMenu projectBgColorAfterHover projectBgColorAfterActive'
data-key='".$idElt2."'
data-slug='".$elt2["slug"]."'
data-col='".Project::CONTROLLER."'
data-img='".Yii::app()->createUrl(@$elt2['profilMediumImageUrl'])."'
data-countmembers='".getCountMembers($elt2)."'
data-countevents='".getCountEvents($elt2)."'
data-countprojects='".getCountProjects($elt2)."'
data-color='".$projectColor[$colorCount]."'
>".$elt2["name"]."</a></li>";
// LEVEL 3
if(!empty($elt2["links"]["projects"])){
echo "<ul class='projectNavThirdLvl'>";
foreach ($elt2["links"]["projects"] as $idElt3 => $valElt3) {
$elt3 = Element::getElementById($idElt3, "projects");
$linksElt3 = Element::getAllLinks($elt3["links"], $type, $idElt);
$allLinksList = array_merge($allLinksList,$linksElt3);
array_push($projectList, $idElt3);
$allProjectsCount++;
$eventsList = array_merge($eventsList, getAllEvents($elt3));
echo "
<li>
<a href='#".$elt3["slug"]."' class='linkMenu'
data-key='".$idElt3."'
data-slug='".$elt3["slug"]."'
data-col='".Project::CONTROLLER."'
data-img='".Yii::app()->createUrl(@$elt3['profilMediumImageUrl'])."'
data-countmembers='".getCountMembers($elt3)."'
data-countevents='".getCountEvents($elt3)."'
data-countprojects='".getCountProjects($elt3)."'
data-color='".str_replace('1)','.82)',$projectColor[$colorCount])."'
>".$elt3["name"]."</a></li>";
}
echo "</ul>"; $colorCount++;
}
}
echo "</ul>";
}
echo "</ul>";
}
?>
</div>
</div>
<?php
function getProfilBannerUrl($el){
if ( !@$el["profilBannerUrl"] || (@$el["profilBannerUrl"] && empty($el["profilBannerUrl"]))){
return Yii::app()->theme->baseUrl. '/assets/img/background-onepage/connexion-lines.jpg';
}
else{
return Yii::app()->createUrl($el["profilBannerUrl"]);
}
}
function getProfileThumbUrl($el){
if ( !@$el["profilMediumImageUrl"] || (@$el["profilMediumImageUrl"] && empty($el["profilMediumImageUrl"]))){
return Yii::app()->theme->baseUrl.'/assets/img/background-onepage/connexion-lines.jpg';
}
else{
return Yii::app()->createUrl($el["profilMediumImageUrl"]);
}
}
function getDescription($el){
if ( !@$el["description"] || (@$el["description"] && empty($el["description"]))){
return false;
}
else{
return $el["description"];
}
}
function getShortDescription($el){
if ( !@$el["shortDescription"] || (@$el["shortDescription"] && empty($el["shortDescription"]))){
return false;
}
else{
return $el["shortDescription"];
}
}
$bannerImgUrl = getProfilBannerUrl($elt);
$thumbImgUrl = getProfileThumbUrl($elt);
$shortDescription = getShortDescription($elt);
$nbInscrits = (!empty($elt['links']['members']) ? count(@$elt['links']['members']) : 0);
?>
<div class="projectMask">
<div class="projectMaskContent">
<div class="projectMaskCell">
<img src="https://loading.io/spinners/dual-ring/lg.dual-ring-loader.gif" alt="">
</div>
</div>
</div>
<div class="projectWrapper">
<div class="projectHeader">
<h1 class="projectName"><?php echo $elt["name"]; ?></h1>
<p class="projectShortDescription"><?php echo $shortDescription; ?></p>
<div class="projectBanner" style="background-image: url(<?php //echo $bannerImgUrl; ?>)"></div>
<div class="projectThumb" style="background-image: url(<?php //echo $thumbImgUrl; ?>)"></div>
<div class="projectHeaderOptions">
<div class="row">
<div class="col-xs-12 col-md-4 col-md-offset-2 col-md-push-6 projectHeaderOptionsCont1">
<div class="col-xs-6">
<a href="https://chat.communecter.org/channel/laRaffinerie" target="_blank" class="customBtnFull projectBgColor projectBgColorHover"><?php echo Yii::t("cooperation", "Chat");?></a>
</div>
<div class="col-xs-6">
<a href="javascript:;" class="customBtnFull customTabTrigger projectBgColor projectBgColorHover">S'inscrire</a>
</div>
</div>
<div class="col-xs-12 col-md-6 col-md-pull-6 projectHeaderOptionsCont2">
<div class="col-xs-4 customTabTriggerDescr"><a href="#projectDescription" class="customTabTrigger customBtnLine">À propos</a></div>
<div class="col-xs-4 customTabTriggerProj" ><a href="#projectChildren" class="customTabTrigger customBtnLine">Projets</a></div>
<div class="col-xs-4 customTabTriggerContacts"><a href="#projectContacts" class="customTabTrigger customBtnLine">Contacts</a></div>
</div>
<!-- <div class="col-sm-3"><span class="projectNbMembers"></span> Inscrits</div>
<div class="col-sm-3"><span class="projectNbEvents"></span> Évenements</div>
<div class="col-sm-3"><span class="projectNbProjects"><?php echo $allProjectsCount ?></span> Projets</div> -->
</div>
</div>
</div>
<?php
//var_dump($linksElt);
?>
<?php $description = getDescription($elt);?>
<div id="descriptionMarkdown" class="hidden"><?php echo (empty($description) ? "" : $description ); ?></div>
<div id="projectDescription" class="customBlock customTab">
<button class="closeCustomTab">X</button>
<div id="descriptionAbout"></div>
<button class="customBtnTrigger">Lire la suite <i class="fa fa-angle-down"></i></button>
</div>
<div id="projectChildren" class="customBlock customTab">
<button class="closeCustomTab">X</button>
<!-- <h3>Les Projets de : <b class="projectNameParent"></b></h3> -->
<div class="row"></div>
</div>
<div id="projectContacts" class="customBlock customTab">
<button class="closeCustomTab">X</button>
<div class="row"></div>
</div>
<div class="projectInfos customBlock">
<div class="projectInfosHeader">
<ul class="row nav nav-tabs"">
<li class="nav-tab col-sm-3 active projectBgColorActive projectBgColorHover"><a " data-toggle="tab" href="#journal">Journal</a></li>
<li class="nav-tab col-sm-3 projectBgColorActive projectBgColorHover"><a data-toggle="tab" href="#agenda">Agenda</a></li>
<li class="nav-tab col-sm-3 projectBgColorActive projectBgColorHover"><a data-toggle="tab" href="#documents">Documents</a></li>
<li class="nav-tab col-sm-3 projectBgColorActive projectBgColorHover"><a data-toggle="tab" href="#outils">Outils</a></li>
</div>
</ul>
<style>
.customBlockImg{
padding-bottom: 50%;
background-position: center;
background-size: cover;
}
</style>
<div class="projectInfosContent tab-content">
<div id="journal" class="tab-pane active row">Journal</div>
<div id="agenda" class="tab-pane row">
<!-- <div class='col-xs-12 margin-bottom-10'>
<a href='javascript:;' id='showHideCalendar' class='text-azure' data-hidden='0'><i class='fa fa-caret-up'></i> Hide calendar</a>
</div> -->
<div id='profil-content-calendar' class='col-xs-12 margin-bottom-20'></div>
<?php
$event = array();
foreach ($allLinksList as $keyL => $links){
if(@$allLinksList[$keyL]['type'] == 'events'){
$event = $allLinksList[$keyL];
$events[$keyL] = $allLinksList[$keyL];
?>
<!-- <div class="customBlock customBlockEvent row" style="padding: 20px; border: 1px solid #ddd; margin-bottom: 20px;" data-startDate="<?php //echo $event['startDate']['sec'] ?>">
<div class="col-xs-12 col-md-5">
<div class="customBlockImg" style="background-image: url(<?php //echo Yii::app()->createUrl(@$event['profilImageUrl']) ?>);">
</div>
</div>
<div class="col-xs-12 col-md-7">
<h4 class="date"><?php //echo $event['startDate'] ?> - <?php //echo $event['endDate'] ?></h4>
<h4><?php //echo $event['name'] ?></h4>
<p><?php //echo @$event['shortDescription'] ?></p>
</div>
</div> -->
<?php
}
}
?>
</div>
<div id="documents" class="tab-pane">Documents</div>
<div id="outils" class="tab-pane">Outils</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
urlCtrl.loadByHash = false;
var elt = <?php echo json_encode(@$elt); ?> ;
var type = <?php echo json_encode(@$type); ?> ;
var idElt = <?php echo json_encode(@$idElt); ?> ;
var events = <?php echo json_encode(@$events); ?> ;
var baseUrl = `<?php echo Yii::app()->createUrl("") ?>` ;
var defaultBannerUrl = ` <?php echo Yii::app()->theme->baseUrl. '/assets/img/background-onepage/connexion-lines.jpg';?> `;
//var links = <?php echo json_encode(@$linksElt); ?> ;
</script>
<?php
// CUSTOM JS
HtmlHelper::registerCssAndScriptsFiles(array('/js/laRaffinerie.js'), $this->module->assetsUrl);
?>
<!--
TODO
Connexion automatique à Rocket Chat
Contextualisation agenda et news
Docs et Outils ( Galerie et Espace Co)
Inscription projet
Requete ajax pas acceptée quand user hors ligne
Récupérer contacts du projet
-->
\ No newline at end of file
<div class="pageContent">
<style type="text/css">
.row_title {
margin-top:10px;
}
#bg-homepage {
width:100%;
}
.numberCircle {
font-size: 50px;
font-weight: bold;
margin-right: 15px;
}
p.step {
font-size:30px;
font-weight:bold;
display : flex;
align-items : center;
}
ul {
list-style: none;
margin-left: 0;
padding-left: 1.2em;
text-indent: -1.2em;
}
li:before {
content: "►";
display: block;
float: left;
width: 1.2em;
color: #00B1E4;
}
li {
font-size:1.5em;
margin-bottom:10px;
}
</style>
<div class="row row_title">
<p class="text-center">
<img src='<?php echo Yii::app()->getModule("co2")->assetsUrl ?>/images/custom/mocica/title_mocica3.png' alt="MOCICA" class="mocica" style="width:450px;margin-left:40px;"/>
<img src='<?php echo Yii::app()->getModule("co2")->assetsUrl ?>/images/custom/mocica/title_logo.png' alt="MOCICA" class="logo" style="width:170px;"/>
</p>
<h1 class="phrase text-center">Unis et Libres</h1>
</div>
<div class="container">
<p>
Bienvenue sur la plate-forme du Mocica. Ce mouvement propose, en 3 étapes, le passage à un
modèle de société sans argent, géré par une Organisation Démocratique Globale. Sans
dirigeant, l'ODG permet à chacun de prendre part aux décisions qui le concernent, du niveau
le plus local (son quartier), jusqu'au niveau le plus global (le monde).
</p>
<p class="step" style="color:#F44336;"><span class='numberCircle'><!-- &#x2776; -->&#x2780;</span> Créer des assemblées de quartiers</p>
<p>Permettre aux membres du Mocica de se retrouver et former des assemblées de quartiers,
base de notre gouvernance autogérée ODG (Organisation Démocratique Globale)</p>
<p class="step" style="color:#448AFF;"><span class='numberCircle'><!-- &#x2777; -->&#x2781;</span> Diffuser le projet Mocica</p>
<p>Chaque assemblée a pour objectif de sympathiser et de promouvoir
le projet Mocica afin de multiplier les assemblées à travers le monde.</p>
<p class="step" style="color:#4CAF50;"><span class='numberCircle'><!-- &#x2778; -->&#x2782;</span> Débattre de notre organisation future</p>
<p class="step" style="color:#9A1B7E;"><span class='numberCircle'><!-- &#x2779; -->&#x2783;</span> Concrétiser les 3 étapes du projet Mocica :</p>
<p>
<span style='font-weight:bold;'>Rassemblement – Transition – Organisation</span> <br/> Tous les détails du projet Mocica <a href='https://mocica.org'>ici</a>.
</p>
<p>
<br/>
Vous trouverez sur cette plateforme de nombreux outils :
<ul>
<li>Créer des assemblées</li>
<li>Espace de discussion / débat icônes</li>
<li>Une cartographie</li>
<li>Faire des annonces</li>
<li>Sondage</li>
<li>Un agenda commun</li>
<li>Un espace d’entraide</li>
<li>Télécharger des documents</li>
</p>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
setTitle("Projet MOCICA Unis et Libre");
});
</script>
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