default message on empty profile

This commit is contained in:
2015-07-09 19:49:06 +02:00
parent 725aa63d49
commit 608edb7a1a

View File

@@ -31,30 +31,24 @@ databap.pageInit = function()
//user history
$UserHistory = databap.getMainElem('#user_history');
if(profile.history!= null && typeof profile.history != 'undefined')
{
$.each
(
profile.history,
function(led, item)
{
var iItemId = item.id;
var sUrl = databap.getInternalLink(item.type, iItemId);
var $Code = $('<p>', {'class':'history_line'})
.append(item.date+' - '+item.action+' :')
.append($('<a>', {href:sUrl, title:'Lien vers le document', target:'_blank'})
.append($('<i>', {'class':'fa fa-c-'+item.type}))
.append(item.title));
$UserHistory.append($Code);
}
);
databap.getMainElem('#history_subbox').show('fast', function(){databap.setInitEnd(true);});
}
else
{
databap.setInitEnd(true);
}
if(typeof profile.history == 'undefined') profile.history = {{type:'', id:0, action:'', date:'', title:'Va donc contribuer !'}};
$.each
(
profile.history,
function(led, item)
{
var iItemId = item.id;
var sUrl = databap.getInternalLink(item.type, iItemId);
var $Code = $('<p>', {'class':'history_line'})
.append(item.date+' - '+item.action+' :')
.append($('<a>', {href:sUrl, title:'Lien vers le document', target:'_blank'})
.append($('<i>', {'class':'fa fa-c-'+item.type}))
.append(item.title));
$UserHistory.append($Code);
}
);
databap.getMainElem('#history_subbox').show('fast', function(){databap.setInitEnd(true);});
},
{id:databap.vars.id},
'json'