Commit a13b4645 authored by Raph El's avatar Raph El

Merge branch 'development' of https://github.com/pixelhumain/co2 into development

parents 6cb18cb5 2266d93f
......@@ -39,6 +39,7 @@ class Co2Module extends CWebModule {
$this->setImport(array(
'citizenToolKit.models.*',
'ressources.models.*',
//'classifieds.models.*',
$this->id.'.models.*',
$this->id.'.components.*',
$this->id.'.messages.*',
......
......@@ -3012,13 +3012,7 @@ var typeObj = {
services : {sameAs:"service"},
circuit:{ col:"circuits",ctrl:"circuit", titleClass : "bg-orange", color:"green", icon:"ravelry"},
circuits : {sameAs:"circuit"},
classified:{ col:"classified",ctrl:"classified", titleClass : "bg-azure", color:"azure", icon:"bullhorn",
subTypes : [
//FR
"Technologie","Immobilier","Véhicules","Maison","Loisirs","Mode",
//EN
"Technology","Property","Vehicles","Home","Leisure","Fashion"
] },
url : {col : "url" , ctrl : "url",titleClass : "bg-blue",bgClass : "bgPerson",color:"blue",icon:"user",saveUrl : baseUrl+"/" + moduleId + "/element/saveurl", },
bookmark : {col : "bookmarks" , ctrl : "bookmark",titleClass : "bg-dark",bgClass : "bgPerson",color:"blue",icon:"bookmark"},
document : {col : "document" , ctrl : "document",titleClass : "bg-dark",bgClass : "bgPerson",color:"dark",icon:"upload",saveUrl : baseUrl+"/" + moduleId + "/element/savedocument", },
......@@ -3415,8 +3409,10 @@ var CoSigAllReadyLoad = false;
function KScrollTo(target){
mylog.log("KScrollTo target", target);
if($(target).length>=1){
var heightTopBar = 0;
if($("#territorial-menu").length >= 1) heightTopBar = $("#territorial-menu").height() + 20;
$('html, body').stop().animate({
scrollTop: $(target).offset().top - 60
scrollTop: $(target).offset().top - 60 - heightTopBar
}, 500, '');
}
}
......
......@@ -225,7 +225,7 @@ function autoCompleteSearch(name, locality, indexMin, indexMax, callBack){
resultsStr=trad.result;
if(totalData > 1)
resultsStr=trad.results;
if((indexMin == 0 || search.app=="search") && (typeof pageEvent == "undefined" || !pageEvent) ){
if((indexMin == 0 || search.app=="search" || search.app=="social") && (typeof pageEvent == "undefined" || !pageEvent) ){
headerStr = '';
if(typeof pageCount != "undefined" && pageCount)
headerStr += '<div class="pageTable col-md-12 col-sm-12 col-xs-12 text-center"></div>';
......@@ -1003,7 +1003,115 @@ var directory = {
// ********************************
// ELEMENT DIRECTORY PANEL
// ********************************
elementPanelHtml : function(params){
lightPanelHtml : function(params){
var linkAction = ( $.inArray(params.type, ["poi","classified"])>=0 ) ? " lbhp' data-modalshow='"+params.id+"' data-modalshow='"+params.id+"' " : " lbh'";
params.htmlIco ="<i class='fa "+ params.ico +" fa-2x letter-"+params.color+"'></i>";
if(params.targetIsAuthor){
nameAuthor=params.target.name;
authorType=params.target.type;
authorId=params.target.id;
}else if(params.author){
nameAuthor=params.author.name;
authorType="citoyens";
authorId=params.author.id;
}
if(typeof params.fullLocality != "undefined" && params.fullLocality != "" && params.fullLocality != " ")
params.fullLocality = " <small class='lbh letter-red margin-left-10'><i class='fa fa-map-marker'></i> "+params.fullLocality+"</small> ";
if(typeof params.scope != "undefined"){
if(typeof params.scope.localities != "undefined"){
$.each(params.scope.localities, function(key, scope){
params.fullLocality += " <small class='lbh letter-red margin-left-10'><i class='fa fa-bullseye'></i> "+scope.name+"</small> ";
});
}
}
console.log("lightPanel", params);
str = "";
str += "<div class='col-xs-12 searchEntity entityLight no-padding'>";
/*str += "<div class='entityLeft hidden-xs col-sm-1 col-md-1 no-padding text-right'>";
if(typeof params.hash != "undefined" && typeof params.imgProfil != "undefined")
str += "<a href='"+params.hash+"' class='container-img-profil "+linkAction+">" + params.imgProfil + "</a>";
//else if(typeof params.text == "undefined")
// str += "<a href='"+params.hash+"' class='container-img-profil "+linkAction+"><div class='imgEmpty'></div></a>";
str += "</div>";*/
str += "<div class='entityLeft pull-left text-right padding-10'>";
if(typeof params.hash != "undefined" && typeof params.imgProfil != "undefined")
str += "<a href='"+params.hash+"' class='container-img-profil "+linkAction+">" + params.imgProfil + "</a>";
str += "</div>"
str += "<div class='entityCenter col-xs-10 col-sm-8 col-md-7 col-lg-6 no-padding'>";
if(typeof params.hash != "undefined" && typeof params.htmlIco != "undefined")
str += "<a href='"+params.hash+"' class='margin-top-15 iconType "+linkAction+">" + params.htmlIco + "</a>";
if(typeof params.name != "undefined" && params.name != ""){
str += "<a href='"+params.hash+"' class='margin-top-10 lbh letter-blue title'>"+params.name+"</a>";
if(typeof params.price != "undefined" && typeof params.devise != "undefined")
str += " <span class='letter-light bold margin-left-10'>"+
"<i class='fa fa-money'></i> " +
params.price + " " + params.devise +
"</span>";
if(typeof params.fullLocality != "undefined" && params.fullLocality != "")
str += params.fullLocality;
}
if(typeof params.text != "undefined" && typeof params.hash != "undefined"){
str += "<span class='letter-blue'>Message de</span> <a href='#page.type."+authorType+".id."+authorId+"' class='lbh'>"+nameAuthor+"</a>";
if(typeof params.fullLocality != "undefined" && params.fullLocality != "" && params.fullLocality != " ")
str += params.fullLocality;
str += "<br><a href='"+params.hash+"' class='margin-top-10 lbh textNews'><i>"+params.text+"</i></a>";
}
if(typeof params.hash != "undefined")
str += "<br><a href='"+params.hash+"' class='lbh letter-green url'>"+params.hash+"</a>";
if(typeof params.startDate != "undefined")
str += "<br><small class='letter-light'>"+params.startDate+"</small>";
if(typeof params.startDate != "undefined" && typeof params.endDate != "undefined")
str += " <small class='letter-light'><i class='fa fa-angle-double-right'></i></small> ";
if(typeof params.endDate != "undefined")
str += "<small class='letter-light'>"+params.endDate+"</small>";
if(typeof params.updatedLbl != "undefined" && (params.type == "events" || params.type == "classified"))
str += "<br><small class='letter-light bold'><i class='fa fa-clock-o'></i> "+params.updatedLbl+"</small>";
if(typeof params.shortDescription != "undefined" && params.shortDescription != "" && params.shortDescription != null)
str += "<br><span class='description'>"+params.shortDescription+"</span>";
else if(typeof params.description != "undefined" && params.description != "" && params.description != null)
str += "<br><span class='description'>"+params.description+"</span>";
if(typeof params.tagsLbl != "undefined")
str += "<div class='tagsContainer'>"+params.tagsLbl+"</div>";
str += "</div>";
str += "</div>";
return str;
},
// ********************************
// ELEMENT DIRECTORY PANEL
// ********************************
elementPanelHtml : function(params){
if(directory.dirLog) mylog.log("----------- elementPanelHtml",params.type,params.name,params.elTagsList);
mylog.log("----------- elementPanelHtml",params.type,params.name,params.elTagsList);
......@@ -2357,7 +2465,7 @@ var directory = {
if(typeof edit != "undefined" && edit != false)
params.edit = edit;
if ( params.type && $.inArray(params.type, typeObj.classified.subTypes )>=0 ) {
if ( params.type && typeof typeObj.classified != "undefined" && $.inArray(params.type, typeObj.classified.subTypes )>=0 ) {
itemType = "classified";
} else if(typeof( typeObj[itemType] ) == "undefined") {
itemType="poi";
......@@ -2381,7 +2489,7 @@ var directory = {
params.parentIcon = "fa-"+parentObj.icon;
params.parentColor = parentObj.color;
}
if(params.type == "classified" && typeof params.category != "undefined"){
if(params.type == "classified" && typeof params.category != "undefined" && typeof classified != "undefined"){
params.ico = typeof classified.filters[params.category] != "undefined" ?
"fa-" + classified.filters[params.category]["icon"] : "";
}
......@@ -2514,6 +2622,13 @@ var directory = {
//template principal
}else{
mylog.log("template principal",params,params.type, itemType);
if(location.hash == "#territorial" || location.hash == "#search")
str += directory.lightPanelHtml(params);
else
if(params.type == "cities")
str += directory.cityPanelHtml(params);
......
......@@ -76,7 +76,7 @@ function initSearchInterface(){
console.log("typeInit", typeInit);
if(typeInit == "all") initTypeSearch("allSig");
else initTypeSearch(typeInit);
startSearchTerla(0, indexStepInit, searchCallback);
startSearch(0, indexStepInit, searchCallback);
$(".btn-directory-type").removeClass("active");
});
......
This diff is collapsed.
......@@ -40,7 +40,7 @@
'data-target="#modalScopes" data-toggle="modal" '+
'data-toggle="tooltip" data-placement="top" '+
'title="'+trad["selectscopesearch"]+'">'+
'<img src="'+themeUrl+'/assets/img/cible3.png" height=25>'+
'<img src="'+themeUrl+'/assets/img/cible3.png" height=20>'+
'</button>';
if(numberOfScope > 0){
scopeHtml+= trad["searchingon"]+' <i class="fa fa-angle-right"></i>';
......
......@@ -106,7 +106,7 @@
}else if (typeof TPL_IFRAME != "undefined" && TPL_IFRAME==true){
url = "https://www.communecter.org/"+url;
popupContent += "<a href='"+url+"' target='_blank' class='item_map_list popup-marker' id='popup"+id+"'>";
}else if (notNull(networkJson) && notNull(networkJson.dataSrc) && notNull(data.source)){
}else if (typeof networkJson != "undefined" && notNull(networkJson) && notNull(networkJson.dataSrc) && notNull(data.source)){
popupContent += "<a href='"+data.source+"' target='_blank' class='item_map_list popup-marker' id='popup"+id+"'>";
}else{
onclick = 'urlCtrl.loadByHash("'+url+'");';
......
......@@ -30,38 +30,39 @@
"colorBtnCreate" : "green"
},
"#search": {
"#territorial": {
"inMenu" : true,
"useHeader" : true,
"open" : true,
"subdomain" : "search",
"subdomainName" : "Search",
"hash" : "#app.search",
"icon" : "search",
"mainTitle" : "<span class='text-red'>Social</span> connection",
"open" : false,
"subdomain" : "territorial",
"subdomainName" : "All",
"hash" : "#app.territorial",
"icon" : "territorial",
"mainTitle" : "<span class='text-red'>Territorial</span> search engine",
"placeholderMainSearch" : "search a page ...",
"lblBtnCreate" : "Create a page",
"colorBtnCreate" : "green"
},
"#territorial": {
"#search": {
"inMenu" : true,
"useHeader" : true,
"open" : true,
"subdomain" : "territorial",
"subdomainName" : "Territorial",
"hash" : "#app.territorial",
"icon" : "territorial",
"mainTitle" : "<span class='text-red'>Territorial</span> search engine",
"subdomain" : "search",
"subdomainName" : "Tous",
"hash" : "#app.search",
"icon" : "search",
"mainTitle" : "Réseau social <span class='text-red'>citoyen</span>",
"placeholderMainSearch" : "search a page ...",
"lblBtnCreate" : "Create a page",
"colorBtnCreate" : "green"
},
"#web":
{ "inMenu" : true,
"useHeader" : true,
"open" : true,
"open" : false,
"subdomain" : "web",
"subdomainName" : "Web",
"hash" : "#app.web",
......@@ -81,26 +82,24 @@
"placeholderMainSearch" : ""},
"#annonces": {
"#live": {
"inMenu" : true,
"useHeader" : true,
"open" : true,
"subdomain" : "annonces",
"subdomainName" : "Classifieds",
"hash" : "#app.annonces",
"icon" : "bullhorn",
"mainTitle" : "Classified ads",
"placeholderMainSearch" : "search among classifieds ...",
"lblBtnCreate" : "Create a classified ad",
"colorBtnCreate" : "azure"
"subdomain" : "live",
"subdomainName" : "En live",
"hash":"#app.live",
"icon" : "newspaper-o",
"mainTitle" : "<span class='text-red'>CO</span>mmon live",
"placeholderMainSearch" : "search in live ..."
},
"#agenda": {
"inMenu" : true,
"useHeader" : true,
"open" : true,
"subdomain" : "agenda",
"subdomainName" : "Agenda",
"subdomainName" : "Events",
"hash":"#app.agenda",
"icon" : "calendar",
"mainTitle" : "<span class='text-red'>C</span>Ommon agenda",
......@@ -108,19 +107,22 @@
"lblBtnCreate" : "Create an event",
"colorBtnCreate" : "orange"
},
"#live": {
"#annonces": {
"inMenu" : true,
"useHeader" : true,
"open" : true,
"subdomain" : "live",
"subdomainName" : "Live",
"hash":"#app.live",
"icon" : "newspaper-o",
"mainTitle" : "<span class='text-red'>CO</span>mmon live",
"placeholderMainSearch" : "search in live ..."
"subdomain" : "annonces",
"subdomainName" : "Classifieds",
"hash" : "#app.annonces",
"icon" : "bullhorn",
"mainTitle" : "Classified ads",
"placeholderMainSearch" : "search among classifieds ...",
"lblBtnCreate" : "Create a classified ad",
"colorBtnCreate" : "azure"
},
"#place":
{"inMenu" : true,
"useHeader" : true,
......
......@@ -52,6 +52,32 @@
"icon" : "search",
"mainTitle" : "Référencer une page",
"placeholderMainSearch" : ""},
"#social": {
"inMenu" : true,
"useHeader" : true,
"open" : true,
"subdomain" : "social",
"subdomainName" : "Social",
"hash" : "#app.search",
"icon" : "user-circle-o",
"mainTitle" : "Réseau social",
"placeholderMainSearch" : "rechercher une page ...",
"lblBtnCreate" : "Créer une page",
"colorBtnCreate" : "green"},
"#agenda":
{"inMenu" : true,
"useHeader" : true,
"open" : true,
"subdomain" : "agenda",
"subdomainName" : "Events",
"hash" : "#app.agenda",
"icon" : "calendar",
"mainTitle" : "Agenda collaboratif",
"placeholderMainSearch" : "rechercher un événement ...",
"lblBtnCreate" : "Créer un événement",
"colorBtnCreate" : "orange"},
"#actu":
{"inMenu" : true,
......@@ -75,20 +101,7 @@
"mainTitle" : "Fil de discussion commun",
"placeholderMainSearch" : "Rechercher dans le fil de discussion ..."
},
"#social": {
"inMenu" : true,
"useHeader" : true,
"open" : true,
"subdomain" : "social",
"subdomainName" : "Social",
"hash" : "#app.search",
"icon" : "user-circle-o",
"mainTitle" : "Réseau social",
"placeholderMainSearch" : "rechercher une page ...",
"lblBtnCreate" : "Créer une page",
"colorBtnCreate" : "green"},
"#annonces":
{"inMenu" : true,
......@@ -103,18 +116,6 @@
"lblBtnCreate" : "Publier une annonce",
"colorBtnCreate" : "azure"},
"#agenda":
{"inMenu" : true,
"useHeader" : true,
"open" : true,
"subdomain" : "agenda",
"subdomainName" : "Agenda",
"hash" : "#app.agenda",
"icon" : "calendar",
"mainTitle" : "Agenda collaboratif",
"placeholderMainSearch" : "rechercher un événement ...",
"lblBtnCreate" : "Créer un événement",
"colorBtnCreate" : "orange"},
"#power":
{"inMenu" : true,
......@@ -139,7 +140,7 @@
"placeholderMainSearch" : "rechercher parmis les membres du réseau ..."},
"#ressource":
{"inMenu" : true,
{"inMenu" : false,
"useHeader" : true,
"open" : true,
"subdomain" : "ressource",
......
......@@ -151,11 +151,6 @@ class AppController extends CommunecterController {
echo $this->renderPartial("search", $params, true);
}
public function actionAnnonces(){
CO2Stat::incNbLoad("co2-annonces");
$params = array("type" => "classified");
echo $this->renderPartial("search", $params, true);
}
public function actionActivities(){
CO2Stat::incNbLoad("terla-activities");
......@@ -186,11 +181,6 @@ class AppController extends CommunecterController {
$params = array();
echo $this->renderPartial("live", $params, true);
}
public function actionHelp(){
CO2Stat::incNbLoad("co2-help");
$params = array("type"=>"ressources");
echo $this->renderPartial("search", $params, true);
}
public function actionAgenda(){
CO2Stat::incNbLoad("co2-agenda");
......
This diff is collapsed.
......@@ -15,7 +15,7 @@
'/js/default/search.js',
'/js/default/directory.js',
);
HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->assetsUrl);
HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->getParentAssetsUrl());
$layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
......@@ -228,7 +228,9 @@ jQuery(document).ready(function() {
setTitle(titlePage, "", titlePage);
if(typeof search.ranges != "undefined")
delete search.ranges;
initKInterface({"affixTop":100});
var typeUrl = "?nopreload=true";
if(type!='') typeUrl = "?type="+type+"&nopreload=true";
var appUrl = (typeof search.app != "undefined") ? "&app="+search.app : "";
......@@ -256,9 +258,9 @@ jQuery(document).ready(function() {
$(this).addClass("active");
});
$(".btn-open-filliaire").click(function(){
KScrollTo("#content-social");
});
// $(".btn-open-filliaire").click(function(){
// KScrollTo("#content-social");
// });
//anny double section filter directory
<?php if(@$type == "classified" || @$type == "place" ){ ?>
......
......@@ -10,6 +10,7 @@ HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, Yii::app()->get
$cssAnsScriptFilesModule = array(
'/assets/css/default/responsive-calendar.css',
'/assets/css/default/search.css',
'/assets/css/web.css',
);
HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, Yii::app()->theme->baseUrl);
$cssAnsScriptFilesModule = array(
......@@ -130,6 +131,9 @@ $layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
/*display: none!important;*/
}
#dropdown_search{
/*padding-left:5% !important;*/
}
@media (max-width: 768px) {
.btn-select-type-anc.col-xs-5{
......
......@@ -45,6 +45,10 @@
color: <?php echo $params["color1"]; ?>;
}
<?php } ?>
#filters-container{
display: none !important;
}
</style>
......@@ -57,6 +61,8 @@
<button class="hidden btn letter-red btn-link font-montserrat dropdown-toggle" data-toggle="dropdown" id="btn-onepage-main-menu">
<i class='fa fa-angle-right'></i> A propos
</button>
<section class="padding-top-10 text-center margin-bottom-10 hidden-xs" id="section-fav">
......@@ -69,6 +75,7 @@
<i class="fa fa-ellipsis-v btn-fast-access padding-10 letter-yellow hidden-xs hidden"></i>
<?php } ?>
<?php if(false){ ?>
<a href="https://www.youtube.com" target="_blank" class="tooltips btn-fast-access"
data-placement="bottom" data-toggle="tooltip" title="Aller sur YouTube">
<i class="fa fa-youtube-play padding-10 letter-red"></i>
......@@ -82,7 +89,8 @@
data-placement="bottom" data-toggle="tooltip" title="Aller sur Wikipedia">
<i class="fa fa-wikipedia-w padding-10"></i>
</a>
<?php } ?>
<?php if(!empty($myWebFavorites)){ ?>
<i class="fa fa-ellipsis-v btn-fast-access padding-10 letter-yellow hidden-xs hidden"></i>
<?php
......@@ -113,12 +121,12 @@
<section class="no-padding hidden" id="sectionSearchResults">
<div class="row padding-10">
<div class="col-md-1 hidden-sm col-lg-1 text-right" id="sub-menu-left"></div>
<div class="col-md-4 col-sm-4 col-lg-3 text-left padding-25 pull-right" id="sub-menu-right"></div>
<div class="col-md-4 col-sm-4 col-lg-3 col-xs-12 text-left padding-25 pull-right" id="sub-menu-right"></div>
<div class="col-md-7 col-sm-8 col-lg-7 pull-left" id="searchResults"></div>
</div>
</section>
<div id="mainCategories" class="shadow padding-bottom-50"></div>
<div id="mainCategories" class="padding-bottom-50"></div>
<?php $this->renderPartial($layoutPath.'footer.'.Yii::app()->params["CO2DomainName"], array("subdomain"=>"web")); ?>
......@@ -128,7 +136,7 @@ var currentCategory = "";
var titlePage = "<?php echo Yii::app()->params["CO2DomainName"]=="kgougle" ? "Kgougle" : @$paramsApp["pages"]["#web"]["subdomainName"]; ?>";
jQuery(document).ready(function() {
initKInterface();
initKInterface({"affixTop":10});
initWebInterface();
buildListCategories();
......
......@@ -205,7 +205,7 @@
<hr class="margin-top-5">
<span>
<small><b>
Vous connaissez un site qui n'est pas référencé sur kgougle ?<br>
Vous connaissez un site qui n'est pas référencé ?<br>
Ajoutez le <span class="letter-green">gratuitement</span> dans la base de données, et faites-en profiter tout le monde !
</b></small>
</span><br><br>
......
......@@ -237,7 +237,7 @@
</div>
<?php } ?>
<?php if($typeSelected == "all" || (@$_GET["app"] && $_GET["app"]=="search")){ ?>
<?php if($typeSelected == "all" || (@$_GET["app"] && ($_GET["app"]=="search" || $_GET["app"]=="social"))){ ?>
<?php if(Yii::app()->params["CO2DomainName"] != "terla"){ ?>
......@@ -250,12 +250,22 @@
<i class="fa fa-search"></i>
<span class="hidden-xs"><?php echo Yii::t("common","All") ?></span>
</button><hr class="hidden-xs">-->
<button class="btn text-dark border-dark btn-directory-type active padding-10" data-type="organizations"
style="font-size:17px!important;">
<button class="btn text-dark border-dark btn-directory-type active padding-10" data-type="all">
<i class="fa fa-asterisk"></i>
<span class="elipsis label-filter">
<?php echo Yii::t("common", "All") ?>
</span>
<span class="badge count-badge-filter bg-dark" id="countall"></span>
</button><hr class="hidden-xs no-margin" style="margin-top:0px;">
<button class="btn text-dark border-dark btn-directory-type active padding-10" data-type="organizations">
<i class="fa fa-chevron-down"></i>
<span class="elipsis label-filter"><?php echo Yii::t("common", "organizations") ?></span>
<span class="elipsis label-filter">
<?php echo Yii::t("common", "organizations") ?>
</span>
<span class="badge count-badge-filter bg-dark" id="countorganizations"></span>
</button><hr class="hidden-xs no-margin" style="margin-top:0px;">
<button class="btn text-green border-green btn-directory-type padding-10" data-type="NGO">
<i class="fa fa-group"></i>
<span class="elipsis label-filter"><?php echo Yii::t("common", "NGOs") ?></span>
......@@ -284,6 +294,12 @@
<span class="badge count-badge-filter bg-purple" id="countprojects"></span>
</button>
<hr class="hidden-xs no-margin">
<button class="btn text-orange border-orange btn-directory-type padding-10" data-type="events">
<i class="fa fa-calendar"></i>
<span class="elipsis label-filter"><?php echo Yii::t("common","Events") ?></span>
<span class="badge count-badge-filter bg-orange" id="countevents"></span>
</button>
<hr class="hidden-xs no-margin">