62 lines
2.2 KiB
HTML
Executable File
62 lines
2.2 KiB
HTML
Executable File
<div id="profile">
|
|
<div id="avatar" class="clickable round"></div>
|
|
<div class="user round">
|
|
<p><i class="fa fa-fw fa-c-name"></i>Nom : <span id="profile_name"></span></p>
|
|
<p><i class="fa fa-fw fa-c-company"></i>Société : <img id="profile_company_logo" /><span id="profile_company"></span></p>
|
|
<p><i class="fa fa-fw fa-c-assignment"></i>Mission actuelle : <span id="profile_assignment"></span></p>
|
|
</div>
|
|
<p class="user_history_title">Historique</p>
|
|
<div>
|
|
<div id="history_box"><div id="history_subbox" class="round"><div id="user_history"></div></div></div>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
databap.pageInit = function()
|
|
{
|
|
databap.initScrollBar('#history_box', '#history_subbox', '#user_history');
|
|
|
|
databap.getInfo
|
|
(
|
|
'profile',
|
|
function(profile)
|
|
{
|
|
//user info
|
|
databap.getMainElem('#profile_name').text(profile.user.name);
|
|
databap.getMainElem('#profile_company').text(profile.user.company);
|
|
databap.getMainElem('#profile_company_logo').attr('src', databap.consts.app_image_folder+profile.user.logo).attr('alt', profile.user.logo);
|
|
databap.getMainElem('#profile_assignment').text(profile.user.status || 'Aucune');
|
|
|
|
//Profile link
|
|
databap.getMainElem('#avatar').click(function(){alert(databap.getInternalLink('p', profile.user.nickname, true));});
|
|
|
|
//user history
|
|
$UserHistory = databap.getMainElem('#user_history');
|
|
if(!profile.history) profile.history = {1:{type:'', id:'', action:'', date:'(', title:'Je ne vois rien à ton nom, 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'
|
|
);
|
|
};
|
|
|
|
databap.onResize = function()
|
|
{
|
|
self.setScrollBarSize('optimize');
|
|
}
|
|
</script> |