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