/**
* Created by markop on 9/29/15.
*/
(function(){
var jqBtnChangePass = $("#change_pass_profile");
codeq.profile = {
};
codeq.globalStateMachine.register('profile',{
'enter': function(){
$("#screen_profile").css('display', '');
$('#disabled').css('display', 'none');
codeq.comms.getUserStat()
.then(function (data) {
if (data.code !== 0) throw new Error('GetUserStat failed, code: ' + data.code + ', message: ' + data.message);
data = data.stat;
var columns = ['language', 'problem_group', 'problems_count', 'done', 'in_progress'],
labels = ['Language', 'Problem group', 'All', 'Done', 'In progress'],
items='',
tr_gui = codeq.tr.getDictionary('gui');
console.log(tr_gui);
$.each(columns, function( key, val ) {
items+=' ';
$.each( data, function( object, row ) {
items+=''+tr_gui[val][codeq.settings['gui_lang']]+' ';
});
items+='