Commit 0e4ee500 authored by thomas craipeau's avatar thomas craipeau
parents a5cedcf1 ef519f77
......@@ -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();
......
......@@ -282,13 +282,17 @@ var adminDirectory = {
aObj.panelAdmin.table != null ){
//mylog.log("adminDirectory.initTable table ", aObj.panelAdmin.table);
$.each(aObj.panelAdmin.table, function(key, value){
//mylog.log("adminDirectory.initTable each ", key, value);
if(value === "true")
str +="<th>"+key+"</th>";
else if(typeof value != "undefined" && typeof value.name != "undefined"){
var classCol = ((typeof value.class != "undefined") ? value.class : " text-center ");
str +="<th class='"+classCol+"'>"+value.name+"</th>";
mylog.log("adminDirectory.initTable each ", key, value, (key != "actions"));
if(key != "actions"){
mylog.log("adminDirectory.initTable if ");
if(value === "true")
str +="<th>"+key+"</th>";
else if(typeof value != "undefined" && typeof value.name != "undefined"){
var classCol = ((typeof value.class != "undefined") ? value.class : " text-center ");
str +="<th class='"+classCol+"'>"+value.name+"</th>";
}
}
});
}
......@@ -296,7 +300,12 @@ var adminDirectory = {
if( typeof aObj.panelAdmin.table != "undefined" &&
aObj.panelAdmin.actions != null &&
aObj.actionsStr === true) {
str +="<th class='col-xs-1'>Actions</th>";
var classCol = 'col-xs-1 text-center';
if(typeof aObj.panelAdmin.table.actions != "undefined" ){
if(typeof aObj.panelAdmin.table.actions.class != "undefined")
classCol = aObj.panelAdmin.table.actions.class ;
}
str +="<th class='"+classCol+"'>Actions</th>";
}
$("#"+aObj.container+" #headerTable").append(str) ;
},
......@@ -306,21 +315,24 @@ var adminDirectory = {
var aObj = this ;
if( typeof aObj.panelAdmin.table != "undefined" &&
aObj.panelAdmin.table != null ){
$.each(aObj.panelAdmin.table, function(key, value){
str += '<td class="center '+key+'">';
// if(key == "pdf" && value === "true"){
//
// } else if(key == "validated" && value === "true") {
// str += aObj.values.validated(e, id, type, aObj);
// } else if(key == "status" && value === "true") {
// str += aObj.values.status(e, id, type, aObj);
// } else
if(typeof aObj.values[key] != "undefined" && value === "true") {
str += aObj.values[key](e, id, collection, aObj);
} else if(typeof aObj.values[key] != "undefined") {
str += aObj.values[key](e, id, collection, aObj, value);
if(key != "actions"){
str += '<td class="center '+key+'">';
// if(key == "pdf" && value === "true"){
//
// } else if(key == "validated" && value === "true") {
// str += aObj.values.validated(e, id, type, aObj);
// } else if(key == "status" && value === "true") {
// str += aObj.values.status(e, id, type, aObj);
// } else
if(typeof aObj.values[key] != "undefined" && value === "true") {
str += aObj.values[key](e, id, collection, aObj);
} else if(typeof aObj.values[key] != "undefined") {
str += aObj.values[key](e, id, collection, aObj, value);
}
str += '</td>';
}
str += '</td>';
});
}
//mylog.log("adminDirectory.columTable ", str);
......@@ -616,7 +628,6 @@ var adminDirectory = {
return '<a href="'+baseUrl+'/co2/export/pdfelement/id/'+id+'/type/'+type+'/" data-id="'+id+'" data-type="'+type+'" class="col-xs-12 btn bg-green-k" target="_blank"> <i class="fa fa-file-pdf-o text-red" ></i> PDF </a> ';
},
validated : function(e, id, type, aObj){
//mylog.log("adminDirectory.actions.validated", e, id, type);
var str = "" ;
var isValidated=( typeof e.source != "undefined" && typeof e.source.toBeValidated != "undefined" && typeof e.source.toBeValidated[costum.slug] != "undefined" && e.source.toBeValidated[costum.slug] == true) ? false : true;
if(!isValidated){
......
......@@ -47,9 +47,9 @@ var calendar = {
onchangeClick=false;
link = "#page.type.events.id."+calEvent.id;
// previewHash=link.split(".");
// hashT=location.hash.split("?");
hashT=location.hash.split("?");
getStatus=searchInterface.getUrlSearchParams();
urlHistoric="?preview=events."+calEvent.id;
urlHistoric=hashT[0]+"?preview=events."+calEvent.id;
// if($("#entity"+previewHash[4]).length > 0) setTimeout(function(){$("#entity"+previewHash[4]).addClass("active");},200);
if(getStatus != "") urlHistoric+="&"+getStatus;
history.replaceState({}, null, urlHistoric);
......
......@@ -68,25 +68,26 @@ function startSearch(indexMin, indexMax, callBack){
}
}*/
function initCountType(){
if(searchObject.initType=="all"){
if(isCustom("types")){
searchObject.countType = [];
$.each(costum.app[appParamsKey].filters.types, function(e, v){
if(v=="organizations")
searchObject.countType=searchObject.countType.concat("NGO", "Group", "GovernmentOrganization", "LocalBusiness");
else
searchObject.countType.push(v);
});
}
else{
searchObject.countType=["NGO", "Group", "GovernmentOrganization", "LocalBusiness", "citoyens", "projects", "events", "poi", "classifieds"];
}
}
//else if(searchObject.initType=="ressources") searchObject.countType=["ressources"];
else if(searchObject.initType=="classifieds") searchObject.countType=["classifieds"];
else if(searchObject.initType=="events") searchObject.countType=["events"];
else if(searchObject.initType=="proposals") searchObject.countType=["proposals"];
}
mylog.log("initCountType ", searchObject.initType);
if(searchObject.initType=="all"){
if(isCustom("types")){
searchObject.countType = [];
$.each(costum.app[appParamsKey].filters.types, function(e, v){
if(v=="organizations")
searchObject.countType=searchObject.countType.concat("NGO", "Group", "GovernmentOrganization", "LocalBusiness");
else
searchObject.countType.push(v);
});
}
else{
searchObject.countType=["NGO", "Group", "GovernmentOrganization", "LocalBusiness", "citoyens", "projects", "events", "poi", "classifieds"];
}
}
//else if(searchObject.initType=="ressources") searchObject.countType=["ressources"];
else if(searchObject.initType=="classifieds") searchObject.countType=["classifieds"];
else if(searchObject.initType=="events") searchObject.countType=["events"];
else if(searchObject.initType=="proposals") searchObject.countType=["proposals"];
}
function removeSearchType(type){
var index = searchObject.types.indexOf(type);
......@@ -179,9 +180,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>");
}
......
function eltImgPreview($this){
hImg=$($this).outerHeight();
$(".content-img-profil-preview").css({"margin-top": -(hImg/2)+"px"});
}
function resizeContainer(){
heightModal=$("#modal-preview-coop").outerHeight();
heightToolsMenu=$("#modal-preview-coop .toolsMenu").outerHeight();
if(heightModal != 0)
$("#modal-preview-coop .container-preview").css({"height": (heightModal-heightToolsMenu)+"px"});
else
setTimeout(function(){ resizeContainer(); }, 200);
}
\ No newline at end of file
......@@ -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
}
......
......@@ -5,6 +5,10 @@
}
</style>
<?php
$cssAnsScriptFilesModule = array(
'/js/default/preview.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->getParentAssetsUrl());
// $typeItemHead = $type;
// if($type == Organization::COLLECTION && @$element["type"]) $typeItemHead = $element["type"];
// $icon = Element::getFaIcon($typeItemHead) ? Element::getFaIcon($typeItemHead) : "";
......@@ -12,7 +16,7 @@
?>
<div id="preview-elt-<?php echo $type ?>-<?php echo (string)$element["_id"] ?>">
<?php
if( isset(Yii::app()->session['costum']["htmlConstruct"])
/*if( isset(Yii::app()->session['costum']["htmlConstruct"])
&& isset(Yii::app()->session['costum']["htmlConstruct"]["preview"])
&& isset(Yii::app()->session['costum']["htmlConstruct"]["preview"]["element"])){
$params = array("element"=>$element ,
......@@ -36,71 +40,72 @@ if( isset(Yii::app()->session['costum']["htmlConstruct"])
"pageConfig" => $pageConfig,
"addConfig" => $addConfig );
$this->renderPartial( Yii::app()->session["costum"]["htmlConstruct"]["preview"]["element"], $params );
}else{ ?>
<div class="col-xs-12 padding-10">
<button class="btn btn-default pull-right btn-close-preview">
<i class="fa fa-times"></i>
</button>
<a href="#@<?php echo $element["slug"] ?>" class="lbh btn btn-primary pull-right margin-right-10"><?php echo Yii::t("common", "Go to the item") ?></a>
}else{ */?>
<div class="col-xs-12 padding-10 toolsMenu">
<button class="btn btn-default pull-right btn-close-preview">
<i class="fa fa-times"></i>
</button>
<a href="#@<?php echo $element["slug"] ?>" class="lbh btn btn-primary pull-right margin-right-10"><?php echo Yii::t("common", "Go to the item") ?></a>
</div>
<?php
if (!@$element["profilBannereUrl"] || (@$element["profilBannereUrl"] && empty($element["profilBannereUrl"]))){
if(!empty(Yii::app()->session["costum"]) && isset(Yii::app()->session["costum"]["htmlConstruct"])
&& isset(Yii::app()->session["costum"]["htmlConstruct"]["element"])
&& isset(Yii::app()->session["costum"]["htmlConstruct"]["element"]["banner"]["img"]))
$url=Yii::app()->getModule( "costum" )->assetsUrl.Yii::app()->session["costum"]["htmlConstruct"]["element"]["banner"]["img"];
else
$url=Yii::app()->theme->baseUrl.'/assets/img/background-onepage/connexion-lines.jpg';
}else
$url=Yii::app()->createUrl('/'.$element["profilBannerUrl"]);
?>
<div class="col-xs-12 no-padding" style="border-top: 1px solid #e7e7e7;border-bottom: 1px solid #e7e7e7;">
<div class="container-preview col-xs-12 no-padding margin-bottom-20" style="overflow-y: scroll">
<?php
$imgHtml='<img class="col-md-12 col-sm-12 col-xs-12 no-padding img-responsive"
alt="'.Yii::t("common","Banner").'"
src="'.$url.'">';
if (@$element["profilRealBannerUrl"] && !empty($element["profilRealBannerUrl"])){
$imgHtml='<a href="'.Yii::app()->createUrl('/'.$element["profilRealBannerUrl"]).'"
class="thumb-info"
data-title="'.Yii::t("common","Cover image of")." ".$element["name"].'"
data-lightbox="all">'.
$imgHtml.
'</a>';
}
echo $imgHtml;
?>
</div>
<div class="content-img-profil-preview col-xs-8 col-xs-offset-2 col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4">
<?php if(isset($element["profilMediumImageUrl"])){ ?>
<a href="<?php echo Yii::app()->createUrl('/'.$element["profilImageUrl"]) ?>"
class="thumb-info"
data-title="<?php echo Yii::t("common","Profil image of")." ".$element["name"] ?>"
data-lightbox="all">
<img class="img-responsive" onload='eltImgPreview(this)' style="box-shadow: 0px 0px 8px 2px rgba(0,0,0,0.5);" src="<?php echo Yii::app()->createUrl('/'.$element["profilMediumImageUrl"]) ?>" />
</a>
<?php }else{ ?>
<img class="img-responsive shadow2 thumbnail" onload='eltImgPreview(this)' style="box-shadow: 0px 0px 8px 2px rgba(0,0,0,0.5);" src="<?php echo $this->module->assetsUrl ?>/images/thumbnail-default.jpg"/>
<?php } ?>
</div>
<div class="preview-element-info col-xs-12">
<h3 class="text-center"><?php echo $element["name"] ?></h3>
<span class="col-xs-12 text-center blockFontPreview">
<span class="text-<?php echo $iconColor; ?>"><?php echo strtoupper(Yii::t("common", Element::getControlerByCollection($type))); ?></span>
<?php if(($type==Organization::COLLECTION || $type==Event::COLLECTION) && @$element["type"]){
if($type==Organization::COLLECTION)
$typesList=Organization::$types;
else
$typesList=Event::$types;
?>
<i class="fa fa-x fa-angle-right margin-left-10"></i>
<span class="margin-left-10"><?php echo Yii::t("category", $typesList[$element["type"]]) ?></span>
if (!@$element["profilBannereUrl"] || (@$element["profilBannereUrl"] && empty($element["profilBannereUrl"]))){
if(!empty(Yii::app()->session["costum"]) && isset(Yii::app()->session["costum"]["htmlConstruct"])
&& isset(Yii::app()->session["costum"]["htmlConstruct"]["element"])
&& isset(Yii::app()->session["costum"]["htmlConstruct"]["element"]["banner"]["img"]))
$url=Yii::app()->getModule( "costum" )->assetsUrl.Yii::app()->session["costum"]["htmlConstruct"]["element"]["banner"]["img"];
else
$url=Yii::app()->theme->baseUrl.'/assets/img/background-onepage/connexion-lines.jpg';
}else
$url=Yii::app()->createUrl('/'.$element["profilBannerUrl"]);
?>
<div class="col-xs-12 no-padding" style="border-top: 1px solid #e7e7e7;border-bottom: 1px solid #e7e7e7;">
<?php
$imgHtml='<img class="col-md-12 col-sm-12 col-xs-12 no-padding img-responsive"
alt="'.Yii::t("common","Banner").'"
src="'.$url.'">';
if (@$element["profilRealBannerUrl"] && !empty($element["profilRealBannerUrl"])){
$imgHtml='<a href="'.Yii::app()->createUrl('/'.$element["profilRealBannerUrl"]).'"
class="thumb-info"
data-title="'.Yii::t("common","Cover image of")." ".$element["name"].'"
data-lightbox="all">'.
$imgHtml.
'</a>';
}
echo $imgHtml;
?>
</div>
<div class="content-img-profil-preview col-xs-8 col-xs-offset-2 col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4">
<?php if(isset($element["profilMediumImageUrl"])){ ?>
<a href="<?php echo Yii::app()->createUrl('/'.$element["profilImageUrl"]) ?>"
class="thumb-info"
data-title="<?php echo Yii::t("common","Profil image of")." ".$element["name"] ?>"
data-lightbox="all">
<img class="img-responsive" onload='eltImgPreview(this)' style="box-shadow: 0px 0px 8px 2px rgba(0,0,0,0.5);" src="<?php echo Yii::app()->createUrl('/'.$element["profilMediumImageUrl"]) ?>" />
</a>
<?php }else{ ?>
<img class="img-responsive shadow2 thumbnail" onload='eltImgPreview(this)' style="box-shadow: 0px 0px 8px 2px rgba(0,0,0,0.5);" src="<?php echo $this->module->assetsUrl ?>/images/thumbnail-default.jpg"/>
<?php } ?>
</span>
</div>
<div class="preview-element-info col-xs-12">
<h3 class="text-center"><?php echo $element["name"] ?></h3>
<span class="col-xs-12 text-center blockFontPreview">
<span class="text-<?php echo $iconColor; ?>"><?php echo strtoupper(Yii::t("common", Element::getControlerByCollection($type))); ?></span>
<?php if(($type==Organization::COLLECTION || $type==Event::COLLECTION) && @$element["type"]){
if($type==Organization::COLLECTION)
$typesList=Organization::$types;
else
$typesList=Event::$types;
$typeCat=(isset($typesList[$element["type"]])) ? $typesList[$element["type"]] : $element["type"];
?>
<i class="fa fa-x fa-angle-right margin-left-10"></i>
<span class="margin-left-10"><?php echo $typeCat ?></span>
<?php } ?>
</span>
<?php
<?php
if(!empty($element["address"]["addressLocality"])){ ?>
<div class="header-address col-xs-12 text-center blockFontPreview">
<i class="fa fa-map-marker"></i>
......@@ -113,14 +118,15 @@ if( isset(Yii::app()->session['costum']["htmlConstruct"])
</div>
<?php } ?>
<div class="header-tags col-xs-12 text-center blockFontPreview">
<?php
if(@$element["tags"]){
foreach ($element["tags"] as $key => $tag) { ?>
<a href="javascript:;" class="letter-red" style="vertical-align: top;">#<?php echo $tag; ?></a>
<?php }
} ?>
</div>
<?php
if(@$element["tags"]){
foreach ($element["tags"] as $key => $tag) { ?>
<a href="javascript:;" class="letter-red" style="vertical-align: top;">#<?php echo $tag; ?></a>
<?php }
} ?>
</div>
</div>
<?php if($type==Event::COLLECTION){ ?>
<div class="event-infos-header text-center margin-top-10 col-xs-12 blockFontPreview" style="font-size: 14px;font-weight: none;"></div>
<?php } ?>
......@@ -129,22 +135,22 @@ if( isset(Yii::app()->session['costum']["htmlConstruct"])
<span class="pull-left text-white" id="shortDescriptionHeader"><?php echo ucfirst(substr(trim(@$element["shortDescription"]), 0, 180)); ?>
</span>
</div>
<div class="social-share-button-preview col-xs-12 text-center margin-bottom-20"></div>
</div>
<?php } ?>
<?php //} ?>
</div>
<script type="text/javascript">
var eltPreview=<?php echo json_encode($element); ?>;
var typePreview=<?php echo json_encode($type); ?>;
var idPreview=<?php echo json_encode($id); ?>;
jQuery(document).ready(function() {
var str = directory.getDateFormated(eltPreview);
$(".event-infos-header").html(str);
$(".social-share-button-preview").html(directory.socialBarHtml({"socialBarConfig":{"btnList" : [{"type":"co"},{"type":"facebook"}, {"type":"twitter"} ], "btnSize": 40 }, "type": typePreview, "id" : idPreview }));
coInterface.bindLBHLinks();
resizeContainer();
});
function eltImgPreview($this){
hImg=$($this).outerHeight();
$(".content-img-profil-preview").css({"margin-top": -(hImg/2)+"px"});
}
</script>
\ No newline at end of file
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