Commit 3547b84c authored by Clément Damiens's avatar Clément Damiens

parent c6d093dc
......@@ -363,6 +363,7 @@ function loadSettings(hash){
var CoAllReadyLoad = false;
var coInterface = {
showMapOnLoad : false,
init : function(){
coInterface.initHtmlPosition();
coInterface.scrollTo(".main-container");
......@@ -474,7 +475,7 @@ var coInterface = {
$("#btn-apropos").click(function(){
urlCtrl.loadByHash("#info.p.apropos")
});
//alert("init");
$(".btn-show-map").off().click(function(){
if(typeof mapCO != "undefined")
showMap();
......@@ -606,6 +607,7 @@ var coInterface = {
mylog.log("coInterface.setTopPosition", bool);
headerScaling=bool;
heightPos=$("#mainNav").outerHeight();
leftPos=(notNull($("#menuApp.menuLeft").outerWidth())) ? $("#menuApp.menuLeft").outerWidth() : 0;
if(coInterface.menu.initTopPostion!=0)
heightPos=heightPos+coInterface.menu.initTopPostion;
if($("#affix-sub-menu").is(":visible"))
......@@ -620,7 +622,8 @@ var coInterface = {
$("#filters-nav").css("top",heightPos);
if($("#filters-nav").is(":visible"))
heightPos=heightPos+$("#filters-nav").outerHeight();
$("#mapContent").css("top",heightPos);
$("#mapContent").css("top",heightPos);
$("#mapContent").css("left",0);
if($(".main-container.vertical .headerSearchContainer").hasClass("affix")){
mylog.log("coInterface.setTopPosition headerSearchContainer heightPos", heightPos);
$(".main-container.vertical .headerSearchContainer").css("top",heightPos);
......@@ -798,6 +801,7 @@ var coInterface = {
mainTitle = (typeof themeParams.pages[pageMenu] != "undefined" && typeof themeParams.pages[pageMenu].mainTitle != "undefined") ? themeParams.pages[pageMenu].mainTitle : themeParams.metaTitle;
dropdownResult = (typeof themeParams.pages[pageMenu] != "undefined" && typeof themeParams.pages[pageMenu].dropdownResult != "undefined") ? themeParams.pages[pageMenu].dropdownResult : false;
useFooter = (typeof themeParams.pages[pageMenu] != "undefined" && typeof themeParams.pages[pageMenu].useFooter != "undefined") ? themeParams.pages[pageMenu].useFooter : true;
coInterface.showMapOnLoad = (typeof themeParams.pages[pageMenu] != "undefined" && typeof themeParams.pages[pageMenu].showMap != "undefined") ? themeParams.pages[pageMenu].showMap : false;
if(typeof themeParams.pages[pageMenu] != "undefined"
&& typeof themeParams.pages[pageMenu].useMapBtn != "undefined" && !themeParams.pages[pageMenu].useMapBtn)
$("#mainNav .btn-show-map").addClass("forcedHide");
......@@ -1724,7 +1728,6 @@ function showAjaxPanel (url,title,icon, mapEnd , urlObj) {
//alert("showAjaxPanel"+dest);
showNotif(false);
$(".hover-info,.hover-info2").hide();
showMap(false);
$(".box").hide(200);
icon = (icon) ? " <i class='fa fa-"+icon+"'></i> " : "";
$(".panelTitle").html(icon+title).fadeIn();
......@@ -1733,6 +1736,10 @@ function showAjaxPanel (url,title,icon, mapEnd , urlObj) {
userIdBefore = userId;
coInterface.simpleScroll(0,300);
$(".progressTop").show().val(30);
if(coInterface.showMapOnLoad)
showMap(true);
else
showMap(false);
setTimeout(function(){
if( $(dest).length )
{
......@@ -1749,7 +1756,7 @@ function showAjaxPanel (url,title,icon, mapEnd , urlObj) {
if( dest != themeObj.mainContainer )
$(".subModuleTitle").html("");
//showMap(false);
$(".modal-backdrop").hide();
if(coInterface.menu.showFilters) $("#filters-nav").show();
coInterface.setTopPosition();
......
......@@ -179,9 +179,13 @@ function autoCompleteSearch(indexMin, indexMax, callBack){
refreshCountBadge();
//parcours la liste des résultats de la recherche
str += directory.showResultsDirectoryHtml(results);
if((typeof themeParams.pages[appParamsKey] != "undefined" && typeof themeParams.pages[appParamsKey].showMap != "undefined") || location.hash.indexOf("onMap=true")>=1)
showMap(true);
//else
//showMap(false);
if(str == "") {
$.unblockUI();
showMap(false);
$(".btn-start-search").html("<i class='fa fa-refresh'></i>");
str=directory.endOfResult(true);
if(indexMin == 0){
......
......@@ -80,7 +80,7 @@ function autoCompleteSearchGS(search, indexMin, indexMax, input, callB){
data.searchType = [ "citoyens", "organizations", "projects", "events" ];
}
if(typeof costum != "undefined" && notNull(costum) && typeof costum.filters != "undefined" && (!notNull(input) || $.inArray(input, ["#filter-scopes-menu", "#scopes-news-form"]) < 0)){
if(typeof costum.filters.searchTypeGS != "undefined"){
if(typeof costum.filters.searchTypeGS != "undefined" && !notNull(input)){
data.countType = costum.filters.searchTypeGS;
data.searchType = costum.filters.searchTypeGS;
}
......@@ -469,11 +469,11 @@ function autoCompleteSearchGS(search, indexMin, indexMax, input, callB){
scrollEndGS = false;
}
if(isMapEnd){
//if(isMapEnd){
//affiche les éléments sur la carte
showDropDownGS(false);
Sig.showMapElements(Sig.map, mapElementsGS, "globe", "Recherche globale");
}
//showDropDownGS(false);
//Sig.showMapElements(Sig.map, mapElementsGS, "globe", "Recherche globale");
//}
//$("#footerDropdownGS").append("<br><a class='btn btn-default' href='javascript:' onclick='urlCtrl.loadByHash("+'"#default.directory"'+")'><i class='fa fa-plus'></i></a>");
}
......
......@@ -347,105 +347,6 @@
} ?>
</div>
</div>
<!--<div class="col-md-12 col-sm-12 col-xs-12 contentInformation no-padding">
<div class="col-md-4 col-sm-4 col-xs-4 hidden-xs labelAbout padding-10">
<span><i class="fa fa-child"></i></span> <?php echo Yii::t("common","Gamification"); ?>
</div>
<div id="tgamificationAbout" class="col-md-8 col-sm-8 col-xs-12 valueAbout padding-10">
<span class="visible-xs pull-left margin-right-5">
<i class="fa fa-child"></i> <?php echo Yii::t("common","Gamification"); ?> :
</span>
<?php
echo Gamification::calcPoints( $type,(string)$element["_id"] ).Yii::t("common","pts , based on Links and Posts popularity");
?>
</div>
</div>-->
<!--<div class="col-md-12 col-sm-12 col-xs-12 contentInformation no-padding">
<div class="col-md-4 col-sm-4 col-xs-4 hidden-xs labelAbout padding-10">
<a href="/co2/badges"><span><i class="fa fa-bookmark"></i></span> <?php echo Yii::t("common","Badge"); ?></a>
</div>
<div id="tbadgeAbout" class="col-md-8 col-sm-8 col-xs-12 valueAbout padding-10">
<span class="visible-xs pull-left margin-right-5">
<a href="/co2/badges"><i class="fa fa-bookmark"></i> <?php echo Yii::t("common","Badge"); ?></a> :
</span>
<style type="text/css">
.badgePH{
cursor: pointer;
display: inline-block;
margin-right: 10px;
border: 1px solid #666;
}
.badgePH .fa-stack .main { font-size:2.2em}
.badgePH .fa-stack .mainTop { margin-top:-3px}
.badgePH .fa-stack .fa-circle-o{ font-size:4em;}
/* Tooltip container */
.opendata .mainTop{
color: black;
font-size: 1.3em;
padding: 5px;
}
.opendata .main{
color: #00cc00;
}
</style>
<?php
if( $type==Person::COLLECTION && !empty($element["tags"])){
$badges = PHDB::find("badges",array("tag" => array('$in' =>$element["tags"])));
foreach ($badges as $k => $v) {
//keep only badge definitions used
if(in_array( $v["tag"], $element["tags"]))
$badges[$v["tag"]] = $v;
unset($badges[$k]);
}
if(count($badges)){
foreach ($element["tags"] as $k => $v) {
?>
<div class="badgePH pull-left" data-title="<?php echo @$value["name"] ?>">
<span class="fa-stack tooltips" style="margin-bottom:5px" data-toggle="tooltip" data-placement="bottom" title='<?php echo Yii::t("badge",@$value["name"], null, Yii::app()->controller->module->id)?>'>
<?php if( @$badges[$v]["profilThumbImageUrl"] != "" ){ ?>
<img class="img-responsive" src="<?php echo @$badges[$v]["profilThumbImageUrl"] ?>">
<?php } else if(is_array(@$badges[$v]["icon"]) && count($badges[$v]["icon"]) == 1 ){ ?>
<i class="fa <?php echo $badges[$v]["icon"][0] ?> main fa-2x fa-stack-1x" style="color:<?php echo (@$badges[$v]["color"]) ? $badges[$v]["color"] : "red" ?>"></i>
<?php } else if(is_array(@$badges[$v]["icon"]) && count($badges[$v]["icon"]) == 2 ){ ?>
<i class="fa <?php echo $badges[$v]["icon"][0] ?> main fa-2x fa-stack-1x" style="color:<?php echo (@$badges[$v]["color"]) ? $badges[$v]["color"] : "red"?>"></i>
<i class="fa <?php echo $badges[$v]["icon"][0] ?> mainTop fa-stack-1x text-white"></i>
<?php } else {?>
<i class="fa <?php echo @$badges[$v]["icon"] ?> main fa-2x fa-stack-1x " style="color:<?php echo (@$badges[$v]["color"]) ? $badges[$v]["color"] : "red"?>"></i>
<?php } ?>
</span>
</div>
<?php
}
}
// if( $badges = Badge::getBadgesByLinks($element["links"]) ){
// foreach ($badges as $key => $b) {
/* ?>
<div class="badgePH pull-left">
<span class="fa-stack tooltips" style="margin-bottom:5px" data-toggle="tooltip" data-placement="bottom" title='<?php echo $b["name"]?>'>
<?php if(@$b["img"]){ ?>
<img src="<?php echo $b["img"]?>" class="img-circle" style="height:40px" >
<?php } else { ?>
<i class="fa fa-<?php echo Element::getFaIcon ( $b["type"] ) ?> main fa-2x fa-stack-1x text-red"></i>
<?php } ?>
</span>
</div>
<?php */
// }
// }
?>
<?php } ?>
</div>
</div>-->
</div>
</div>
......
......@@ -28,13 +28,13 @@
<?php
}else{
$visibleXsLinks.='<li class="text-left visible-xs">'.
'<a href="javascript:links.follow(\''.$elementType.'\',\''.$elementId.'\',\''.Yii::app()->session["userId"].'\',\''.Person::COLLECTION.'\')" class="bg-white">'.
'<a href="javascript:links.follow(\''.$elementType.'\',\''.$elementId.'\',\''.Yii::app()->session["userId"].'\',\''.Person::COLLECTION.'\')" class="bg-white menu-btn-follow">'.
'<i class="fa fa-rss"></i> '.Yii::t("common", "Follow this page").
'</a>'.
'</li>';
?>
<?php if(!@$xsView){ ?>
<a href="javascript:links.follow('<?php echo $elementType ?>','<?php echo $elementId ?>','<?php echo Yii::app()->session["userId"] ?>','<?php echo Person::COLLECTION ?>')" class="btn-o menu-linksBtn"> <i class="fa fa-rss"></i> <?php echo Yii::t("common","Follow") ?> </a>
<a href="javascript:links.follow('<?php echo $elementType ?>','<?php echo $elementId ?>','<?php echo Yii::app()->session["userId"] ?>','<?php echo Person::COLLECTION ?>')" class="btn-o menu-linksBtn menu-btn-follow"> <i class="fa fa-rss"></i> <?php echo Yii::t("common","Follow") ?> </a>
<?php } ?>
<?php
}
......
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