2019-12-20 21:46:36 +08:00
|
|
|
/*
|
2019-12-23 21:40:15 +08:00
|
|
|
global ListColumnHelper ChecklistColumnHelper StatusColumnHelper SmartAnnotation I18n
|
2019-12-20 21:46:36 +08:00
|
|
|
GLOBAL_CONSTANTS DateTimeHelper
|
|
|
|
*/
|
2019-12-05 16:19:19 +08:00
|
|
|
|
|
|
|
$.fn.dataTable.render.newRowName = function(formId, $cell) {
|
|
|
|
$cell.html(`
|
|
|
|
<div class="form-group">
|
|
|
|
<input class="form-control editing"
|
|
|
|
form="${formId}"
|
|
|
|
type="text"
|
2019-12-10 15:41:09 +08:00
|
|
|
name="repository_row[name]"
|
2019-12-05 16:19:19 +08:00
|
|
|
value=""
|
2020-01-09 21:57:37 +08:00
|
|
|
placeholder="${I18n.t('repositories.table.enter_row_name')}"
|
2019-12-05 16:19:19 +08:00
|
|
|
data-type="RowName">
|
|
|
|
</div>
|
|
|
|
`);
|
2019-11-18 21:04:53 +08:00
|
|
|
};
|
|
|
|
|
2019-12-05 16:19:19 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryAssetValue = function(formId, columnId, $cell) {
|
|
|
|
$cell.html(`
|
|
|
|
<div class="file-editing">
|
|
|
|
<div class="file-hidden-field-container hidden"></div>
|
|
|
|
<input class=""
|
|
|
|
id="repository_file_${columnId}"
|
|
|
|
form="${formId}"
|
|
|
|
type="file"
|
|
|
|
data-col-id="${columnId}"
|
|
|
|
data-is-empty="true"
|
|
|
|
value=""
|
|
|
|
data-type="RepositoryAssetValue">
|
|
|
|
<div class="file-upload-button new-file">
|
|
|
|
<label for="repository_file_${columnId}">${I18n.t('repositories.table.assets.select_file_btn', { max_size: GLOBAL_CONSTANTS.FILE_MAX_SIZE_MB })}</label>
|
|
|
|
<span class="icon"><i class="fas fa-paperclip"></i></span><span class="label-asset"></span>
|
|
|
|
<span class="delete-action fas fa-trash"> </span>
|
|
|
|
</div>
|
|
|
|
</div>`);
|
2019-11-18 21:04:53 +08:00
|
|
|
};
|
|
|
|
|
2019-12-05 16:19:19 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryTextValue = function(formId, columnId, $cell) {
|
|
|
|
$cell.html(`
|
|
|
|
<div class="form-group">
|
|
|
|
<input class="form-control editing"
|
|
|
|
form="${formId}"
|
|
|
|
type="text"
|
|
|
|
name="repository_cells[${columnId}]"
|
|
|
|
value=""
|
2020-01-09 21:57:37 +08:00
|
|
|
placeholder="${I18n.t('repositories.table.text.enter_text')}"
|
2019-12-05 16:19:19 +08:00
|
|
|
data-type="RepositoryTextValue">
|
|
|
|
</div>`);
|
|
|
|
|
|
|
|
SmartAnnotation.init($cell.find('input'));
|
2019-11-18 21:04:53 +08:00
|
|
|
};
|
|
|
|
|
2019-12-05 16:19:19 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryListValue = function(formId, columnId, $cell) {
|
2019-12-11 21:49:14 +08:00
|
|
|
ListColumnHelper.initialListEditMode(formId, columnId, $cell);
|
2019-11-18 21:04:53 +08:00
|
|
|
};
|
|
|
|
|
2019-12-05 16:19:19 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryStatusValue = function(formId, columnId, $cell) {
|
2019-12-23 21:40:15 +08:00
|
|
|
StatusColumnHelper.initialStatusEditMode(formId, columnId, $cell);
|
2019-11-18 21:04:53 +08:00
|
|
|
};
|
2019-12-06 20:18:35 +08:00
|
|
|
|
2019-12-10 22:48:53 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryChecklistValue = function(formId, columnId, $cell) {
|
2019-12-11 21:49:14 +08:00
|
|
|
ChecklistColumnHelper.initialChecklistEditMode(formId, columnId, $cell);
|
2019-12-06 20:18:35 +08:00
|
|
|
};
|
2019-12-18 18:55:12 +08:00
|
|
|
|
2020-01-10 17:40:22 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryNumberValue = function(formId, columnId, $cell) {
|
2019-12-18 18:55:12 +08:00
|
|
|
$cell.html(`
|
|
|
|
<div class="form-group">
|
|
|
|
<input class="form-control editing"
|
|
|
|
form="${formId}"
|
|
|
|
type="number"
|
|
|
|
name="repository_cells[${columnId}]"
|
|
|
|
value=""
|
2020-01-09 21:57:37 +08:00
|
|
|
placeholder="${I18n.t('repositories.table.number.enter_number')}"
|
2019-12-18 18:55:12 +08:00
|
|
|
data-type="RepositoryNumberValue">
|
|
|
|
</div>`);
|
|
|
|
|
|
|
|
SmartAnnotation.init($cell.find('input'));
|
|
|
|
};
|
2019-12-16 22:21:50 +08:00
|
|
|
|
|
|
|
$.fn.dataTable.render.newRepositoryDateTimeValue = function(formId, columnId, $cell) {
|
2019-12-20 21:46:36 +08:00
|
|
|
DateTimeHelper.initDateTimeEditMode(formId, columnId, $cell, '', 'RepositoryDateTimeValue');
|
2019-12-16 22:21:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
$.fn.dataTable.render.newRepositoryTimeValue = function(formId, columnId, $cell) {
|
2019-12-20 21:46:36 +08:00
|
|
|
DateTimeHelper.initDateTimeEditMode(formId, columnId, $cell, 'timeonly', 'RepositoryTimeValue');
|
2019-12-16 22:21:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
$.fn.dataTable.render.newRepositoryDateValue = function(formId, columnId, $cell) {
|
2019-12-20 21:46:36 +08:00
|
|
|
DateTimeHelper.initDateTimeEditMode(formId, columnId, $cell, 'dateonly', 'RepositoryDateValue');
|
2019-12-16 22:21:50 +08:00
|
|
|
};
|
|
|
|
|
2019-12-17 18:27:07 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryDateTimeRangeValue = function(formId, columnId, $cell) {
|
2019-12-20 21:46:36 +08:00
|
|
|
DateTimeHelper.initDateTimeRangeEditMode(formId, columnId, $cell, '', 'RepositoryDateTimeRangeValue');
|
2019-12-17 18:27:07 +08:00
|
|
|
};
|
|
|
|
|
2019-12-17 20:42:25 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryDateRangeValue = function(formId, columnId, $cell) {
|
2019-12-20 21:46:36 +08:00
|
|
|
DateTimeHelper.initDateTimeRangeEditMode(formId, columnId, $cell, 'dateonly', 'RepositoryDateRangeValue');
|
2019-12-17 20:42:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
$.fn.dataTable.render.newRepositoryTimeRangeValue = function(formId, columnId, $cell) {
|
2019-12-20 21:46:36 +08:00
|
|
|
DateTimeHelper.initDateTimeRangeEditMode(formId, columnId, $cell, 'timeonly', 'RepositoryTimeRangeValue');
|
2019-12-17 20:42:25 +08:00
|
|
|
};
|
|
|
|
|
2019-12-16 22:21:50 +08:00
|
|
|
$.fn.dataTable.render.newRepositoryCheckboxValue = function(formId, columnId) {
|
|
|
|
return '';
|
|
|
|
};
|