/**
* Pages User Profile (jquery)
*/
'use strict';
$(function () {
// Projects table
var dt_projects_table = $('.datatables-projects');
if (dt_projects_table.length) {
var dt_project = dt_projects_table.DataTable({
ajax: assetsPath + 'json/user-profile.json',
columns: [
{ data: '' },
{ data: 'id' },
{ data: 'project_name' },
{ data: 'project_leader' },
{ data: '' },
{ data: 'status' },
{ data: '' }
],
columnDefs: [
{
// For Responsive
className: 'control',
searchable: false,
orderable: false,
responsivePriority: 2,
targets: 0,
render: function (data, type, full, meta) {
return '';
}
},
{
// For Checkboxes
targets: 1,
orderable: false,
searchable: false,
responsivePriority: 3,
checkboxes: true,
render: function () {
return '';
},
checkboxes: {
selectAllRender: ''
}
},
{
// Avatar image/badge, Name and post
targets: 2,
responsivePriority: 4,
render: function (data, type, full, meta) {
var $user_img = full['project_img'],
$name = full['project_name'],
$date = full['date'];
if ($user_img) {
// For Avatar image
var $output =
'';
} else {
// For Avatar badge
var stateNum = Math.floor(Math.random() * 6);
var states = ['success', 'danger', 'warning', 'info', 'primary', 'secondary'];
var $state = states[stateNum],
$name = full['project_name'],
$initials = $name.match(/\b\w/g) || [];
$initials = (($initials.shift() || '') + ($initials.pop() || '')).toUpperCase();
$output = '' + $initials + '';
}
// Creates full output for row
var $row_output =
'