JD2022-TU1/data/EngineData/SubmitAssistant/util/datatables_conf.js

149 lines
No EOL
4.8 KiB
JavaScript

/**
* DataTables configuration file
*/
define({
/**
* Return the configuration JSON object for dataTables, to display files
* (see dataTables documentation for more informations).
*
* @param data - the data to display in the table
*/
fileOptions: function(data){
return {
"sDom": "lfrt<'row'<'span6'i><'span6'p>>",
"aaData": data,
"aoColumns": [
{
"sTitle": "<input type='checkbox' id='check_all_files' checked='checked'>",
"mData": function(source, type, val){
return "<input type='checkbox' name='file[]' class='files_ck' "
+ "value='" + source.cid + "' checked='checked'>";
},
"bSortable": false,
"sClass": "center",
"sWidth": "6%",
},
{
"sTitle": "Name",
"mData": function(source, type, val){
var file = source.depotFile;
var lastSlashIndex = file.lastIndexOf("/");
return file.substr(lastSlashIndex + 1, file.length);
},
"sWidth": "17%",
},
{
"sTitle": "In Folder",
"mData": function(source, type, val){
var file = source.depotFile;
var lastSlashIndex = file.lastIndexOf("/");
return file.substr(0, lastSlashIndex);
},
},
{
"sTitle": "Status",
"mData": function(source, type, val){
var resolveStatus = "";
if (source.resolved == "true"){
resolveStatus = "resolved";
}
else if (source.unresolved == "true"){
resolveStatus = "unresolved";
}
return resolveStatus;
},
"sClass": "center",
"sWidth": "12%",
},
{
"sTitle": "Type",
"mData": "type",
"sClass": "center",
"sWidth": "12%",
},
{
"sTitle": "Action",
"mData": "action",
"sClass": "center",
"sWidth": "12.5%",
}
],
"aaSorting": [[ 1, "asc" ]],
"sScrollY": "230px",
"bScrollCollapse": true,
"bFilter": false,
"bLengthChange": false,
"iDisplayLength": 50,
};
},
/**
* Return the configuration JSON object for dataTables, to display bugs
* (see dataTables documentation for more informations).
*
* @param data - the data to display in the table
*/
bugOptions: function(data){
return {
"sDom": "lfrt<'row'<'span6'i><'span6'p>>",
"aaData": data,
"aoColumns": [
{
"sTitle": "<input type='checkbox' id='check_all_bugs'>",
"mData": function(source, type, val){
return "<input type='checkbox' name='bug[]' class='bugs_ck' "
+ "value='" + source.key + "'>";
},
"bSortable": false,
"sClass": "center",
"sWidth": "6%",
},
{
"sTitle": "Key",
"mData": function(source, type, val){
return "<a class='jira_link'>" + source.key + "</a>";
},
"sWidth": "15%",
},
{
"sTitle": "Summary",
"mData": "fields.summary"
},
{
"sTitle": "Milestone",
"mData": function(source, type, val){
if(source.fields.customfield_10160){
var milestone = source.fields.customfield_10160.value;
}
else{
var milestone = "None";
}
return milestone;
},
"sWidth": "35%",
},
],
"aaSorting": [[ 1, "asc" ]],
"sScrollY": "230px",
"bScrollCollapse": true,
"bFilter": false,
"bLengthChange": false,
"iDisplayLength": 50,
}
},
});