mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-11 06:16:32 +08:00
Refactor inline events [SCI-8434] (#5403)
Refactor inline events in task results [SCI-8434]
This commit is contained in:
parent
df8a380a87
commit
c28f86d46d
35 changed files with 215 additions and 64 deletions
7
app/assets/javascripts/assets/asset_inline.js
Normal file
7
app/assets/javascripts/assets/asset_inline.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/* global ActiveStoragePreviews */
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
$('.attachment-preview .asset-inline-image')
|
||||||
|
.on('load', (event) => ActiveStoragePreviews.showPreview(event))
|
||||||
|
.on('error', (event) => ActiveStoragePreviews.reCheckPreview(event));
|
||||||
|
}());
|
7
app/assets/javascripts/assets/asset_thumbnail.js
Normal file
7
app/assets/javascripts/assets/asset_thumbnail.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/* global ActiveStoragePreviews */
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
$('.attachment-preview .asset-thumbnail-image')
|
||||||
|
.on('load', (event) => ActiveStoragePreviews.showPreview(event))
|
||||||
|
.on('error', (event) => ActiveStoragePreviews.reCheckPreview(event));
|
||||||
|
}());
|
|
@ -181,6 +181,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initArchive() {
|
||||||
|
$('#results').on('click', '.form-submit-link', function(event) {
|
||||||
|
archive(event, this);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
initHandsOnTables($(document));
|
initHandsOnTables($(document));
|
||||||
expandAllResults();
|
expandAllResults();
|
||||||
|
@ -200,6 +206,8 @@
|
||||||
let target = '#' + getParam('ctarget');
|
let target = '#' + getParam('ctarget');
|
||||||
$(target).find('a.comment-tab-link').click();
|
$(target).find('a.comment-tab-link').click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initArchive();
|
||||||
}
|
}
|
||||||
|
|
||||||
let publicAPI = Object.freeze({
|
let publicAPI = Object.freeze({
|
||||||
|
|
|
@ -741,7 +741,7 @@ var RepositoryDatatable = (function(global) {
|
||||||
return TABLE;
|
return TABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
global.onClickDeleteRecord = function() {
|
function onClickDeleteRecord() {
|
||||||
animateSpinner();
|
animateSpinner();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: $('table' + TABLE_ID).data('delete-record'),
|
url: $('table' + TABLE_ID).data('delete-record'),
|
||||||
|
@ -880,6 +880,8 @@ var RepositoryDatatable = (function(global) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#deleteRepositoryRecord').on('click', '.delete-record-modal-button', onClickDeleteRecord);
|
||||||
|
|
||||||
// Handle enter key
|
// Handle enter key
|
||||||
$(document).off('keypress').keypress(function(event) {
|
$(document).off('keypress').keypress(function(event) {
|
||||||
var keycode = (event.keyCode ? event.keyCode : event.which);
|
var keycode = (event.keyCode ? event.keyCode : event.which);
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
//= require repositories/import/records_importer.js
|
//= require repositories/import/records_importer.js
|
||||||
|
|
||||||
/*
|
/*
|
||||||
global pageReload animateSpinner repositoryRecordsImporter I18n
|
global animateSpinner repositoryRecordsImporter I18n
|
||||||
RepositoryDatatable PerfectScrollbar HelperModule repositoryFilterObject
|
RepositoryDatatable PerfectScrollbar HelperModule repositoryFilterObject
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function(global) {
|
(function(global) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
global.pageReload = function() {
|
function pageReload() {
|
||||||
animateSpinner();
|
animateSpinner();
|
||||||
location.reload();
|
location.reload();
|
||||||
};
|
}
|
||||||
|
|
||||||
function handleErrorSubmit(XHR) {
|
function handleErrorSubmit(XHR) {
|
||||||
var formGroup = $('#form-records-file').find('.form-group');
|
var formGroup = $('#form-records-file').find('.form-group');
|
||||||
|
@ -42,8 +42,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function initParseRecordsModal() {
|
function initParseRecordsModal() {
|
||||||
|
var modal = $('#parse-records-modal');
|
||||||
var form = $('#form-records-file');
|
var form = $('#form-records-file');
|
||||||
var submitBtn = form.find('input[type="submit"]');
|
var submitBtn = form.find('input[type="submit"]');
|
||||||
|
var closeBtn = modal.find('.close-button');
|
||||||
form.on('ajax:success', function(ev, data) {
|
form.on('ajax:success', function(ev, data) {
|
||||||
$('#modal-import-records').modal('hide');
|
$('#modal-import-records').modal('hide');
|
||||||
$(data.html).appendTo('body').promise().done(function() {
|
$(data.html).appendTo('body').promise().done(function() {
|
||||||
|
@ -78,6 +80,8 @@
|
||||||
contentType: false
|
contentType: false
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
closeBtn.on('click', pageReload);
|
||||||
}
|
}
|
||||||
|
|
||||||
function initImportRecordsModal() {
|
function initImportRecordsModal() {
|
||||||
|
@ -85,6 +89,9 @@
|
||||||
$('#modal-import-records').modal('show');
|
$('#modal-import-records').modal('show');
|
||||||
initParseRecordsModal();
|
initParseRecordsModal();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const closeBtn = $('#modal-import-records').find('.close-button');
|
||||||
|
closeBtn.on('click', pageReload);
|
||||||
}
|
}
|
||||||
|
|
||||||
function initShareModal() {
|
function initShareModal() {
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
/* global numberMinMaxValidator */
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
const field = $('#decimals.number-column');
|
||||||
|
|
||||||
|
const minValue = Number(field.data('min'));
|
||||||
|
const maxValue = Number(field.data('max'));
|
||||||
|
|
||||||
|
field.on('input', () => {
|
||||||
|
field.val(numberMinMaxValidator(field.val(), minValue, maxValue));
|
||||||
|
});
|
||||||
|
}());
|
|
@ -0,0 +1,12 @@
|
||||||
|
/* global numberMinMaxValidator */
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
const field = $('#decimals.stock-column');
|
||||||
|
|
||||||
|
const minValue = Number(field.data('min'));
|
||||||
|
const maxValue = Number(field.data('max'));
|
||||||
|
|
||||||
|
field.on('input', () => {
|
||||||
|
field.val(numberMinMaxValidator(field.val(), minValue, maxValue));
|
||||||
|
});
|
||||||
|
}());
|
7
app/assets/javascripts/results/result_assets/edit.js
Normal file
7
app/assets/javascripts/results/result_assets/edit.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/* global Results */
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
$('.edit-result-assets-buttons').on('click', '.save-result', (event) => {
|
||||||
|
Results.processResult(event, Results.ResultTypeEnum.FILE);
|
||||||
|
});
|
||||||
|
}());
|
15
app/assets/javascripts/results/result_assets/new.js
Normal file
15
app/assets/javascripts/results/result_assets/new.js
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/* global DragNDropResults */
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
$('.new-result-assets-buttons')
|
||||||
|
.on('click', '.save-result', (event) => {
|
||||||
|
DragNDropResults.processResult(event);
|
||||||
|
})
|
||||||
|
.on('click', '.cancel-new', () => {
|
||||||
|
DragNDropResults.destroyAll();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#new-result-assets-select').on('change', '#drag-n-drop-assets', function() {
|
||||||
|
DragNDropResults.init(this.files);
|
||||||
|
});
|
||||||
|
}());
|
7
app/assets/javascripts/results/result_tables/edit.js
Normal file
7
app/assets/javascripts/results/result_tables/edit.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/* global Results */
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
$('.edit-result-tables-buttons').on('click', '.save-result', (event) => {
|
||||||
|
Results.processResult(event, Results.ResultTypeEnum.TABLE);
|
||||||
|
});
|
||||||
|
}());
|
7
app/assets/javascripts/results/result_tables/new.js
Normal file
7
app/assets/javascripts/results/result_tables/new.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/* global Results */
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
$('.new-result-tables-buttons').on('click', '.save-result', (event) => {
|
||||||
|
Results.processResult(event, Results.ResultTypeEnum.TABLE);
|
||||||
|
});
|
||||||
|
}());
|
7
app/assets/javascripts/results/result_texts/edit.js
Normal file
7
app/assets/javascripts/results/result_texts/edit.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/* global Results */
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
$('.edit-result-texts-buttons').on('click', '.save-result', (event) => {
|
||||||
|
Results.processResult(event, Results.ResultTypeEnum.TEXT);
|
||||||
|
});
|
||||||
|
}());
|
7
app/assets/javascripts/results/result_texts/new.js
Normal file
7
app/assets/javascripts/results/result_texts/new.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/* global Results */
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
$('.new-result-texts-buttons').on('click', '.save-result', (event) => {
|
||||||
|
Results.processResult(event, Results.ResultTypeEnum.TEXT);
|
||||||
|
});
|
||||||
|
}());
|
7
app/assets/javascripts/shared/file_preview.js
Normal file
7
app/assets/javascripts/shared/file_preview.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/* global ActiveStoragePreviews */
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
$('.asset-image')
|
||||||
|
.on('load', (event) => ActiveStoragePreviews.showPreview(event))
|
||||||
|
.on('error', (event) => ActiveStoragePreviews.reCheckPreview(event));
|
||||||
|
}());
|
|
@ -328,7 +328,7 @@
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label">Name</label>
|
<label class="control-label">Name</label>
|
||||||
<input type="text" class="form-control" onChange="DragNDropResults.validateTextSize(this)"
|
<input type="text" class="form-control"
|
||||||
rel="results[name]" name="results[name][${i}]">
|
rel="results[name]" name="results[name][${i}]">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
@ -385,6 +385,9 @@
|
||||||
.promise()
|
.promise()
|
||||||
.done(function() {
|
.done(function() {
|
||||||
removeItemHandler(droppedFiles[i].uuid);
|
removeItemHandler(droppedFiles[i].uuid);
|
||||||
|
$('.panel-result-attachment-new').on('change', 'input[rel="results[name]"]', function() {
|
||||||
|
DragNDropResults.validateTextSize(this);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
validateTotalSize();
|
validateTotalSize();
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
(function() {
|
||||||
|
const linkedinSignInButton = $('.linkedin-signin-button');
|
||||||
|
const hoverSrc = linkedinSignInButton.data('hover-src');
|
||||||
|
const defaultSrc = linkedinSignInButton.data('default-src');
|
||||||
|
const clickSrc = linkedinSignInButton.data('click-src');
|
||||||
|
|
||||||
|
linkedinSignInButton
|
||||||
|
.on('mouseover', () => {
|
||||||
|
linkedinSignInButton.attr('src', hoverSrc);
|
||||||
|
})
|
||||||
|
.on('mouseout', () => {
|
||||||
|
linkedinSignInButton.attr('src', defaultSrc);
|
||||||
|
})
|
||||||
|
.on('click', () => {
|
||||||
|
linkedinSignInButton.attr('src', clickSrc);
|
||||||
|
});
|
||||||
|
}());
|
|
@ -43,10 +43,10 @@
|
||||||
<% elsif asset.previewable? %>
|
<% elsif asset.previewable? %>
|
||||||
<div class="image-container">
|
<div class="image-container">
|
||||||
<%= image_tag asset.large_preview,
|
<%= image_tag asset.large_preview,
|
||||||
onerror: 'ActiveStoragePreviews.reCheckPreview(event)',
|
class: 'asset-inline-image',
|
||||||
onload: 'ActiveStoragePreviews.showPreview(event)',
|
|
||||||
style: 'opacity: 0' %>
|
style: 'opacity: 0' %>
|
||||||
</div>
|
</div>
|
||||||
|
<%= javascript_include_tag 'assets/asset_inline', nonce: true %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="general-file-container">
|
<div class="general-file-container">
|
||||||
<i class="fas <%= file_fa_icon_class(asset) if asset.file_name %>"></i>
|
<i class="fas <%= file_fa_icon_class(asset) if asset.file_name %>"></i>
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
<div class="attachment-preview <%= asset.file.attached? ? asset.file.metadata['asset_type'] : '' %>">
|
<div class="attachment-preview <%= asset.file.attached? ? asset.file.metadata['asset_type'] : '' %>">
|
||||||
<% if asset.previewable? %>
|
<% if asset.previewable? %>
|
||||||
<%= image_tag asset.medium_preview,
|
<%= image_tag asset.medium_preview,
|
||||||
onerror: 'ActiveStoragePreviews.reCheckPreview(event)',
|
class: 'asset-thumbnail-image',
|
||||||
onload: 'ActiveStoragePreviews.showPreview(event)',
|
|
||||||
style: 'opacity: 0' %>
|
style: 'opacity: 0' %>
|
||||||
|
<%= javascript_include_tag 'assets/asset_thumbnail', nonce: true %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<i class="fas <%= file_fa_icon_class(asset) if asset.file_name %>"></i>
|
<i class="fas <%= file_fa_icon_class(asset) if asset.file_name %>"></i>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -21,8 +21,7 @@
|
||||||
class="btn btn-light icon-btn form-submit-link"
|
class="btn btn-light icon-btn form-submit-link"
|
||||||
data-form-id="result-archive-form-<%= result.id %>"
|
data-form-id="result-archive-form-<%= result.id %>"
|
||||||
data-confirm-text="<%= t('my_modules.results.archive_confirm') %>"
|
data-confirm-text="<%= t('my_modules.results.archive_confirm') %>"
|
||||||
title="<%= t'my_modules.results.options.archive_title' %>"
|
title="<%= t'my_modules.results.options.archive_title' %>">
|
||||||
onclick="Results.archive(event, this);">
|
|
||||||
<span class="fas fa-briefcase"></span>
|
<span class="fas fa-briefcase"></span>
|
||||||
</a>
|
</a>
|
||||||
<%= form_for :result, url: result_path_of_type(result), method: :patch, html: {id: 'result-archive-form-' + result.id.to_s } do |f| %>
|
<%= form_for :result, url: result_path_of_type(result), method: :patch, html: {id: 'result-archive-form-' + result.id.to_s } do |f| %>
|
||||||
|
|
|
@ -87,12 +87,12 @@
|
||||||
<!-- Libraries for formulas -->
|
<!-- Libraries for formulas -->
|
||||||
<%= render partial: "shared/formulas_libraries.html.erb" %>
|
<%= render partial: "shared/formulas_libraries.html.erb" %>
|
||||||
|
|
||||||
<%= javascript_include_tag "assets/wopi/create_wopi_file" %>
|
<%= javascript_include_tag "assets/wopi/create_wopi_file", nonce: true %>
|
||||||
<%= javascript_include_tag "my_modules/results" %>
|
<%= javascript_include_tag "my_modules/results", nonce: true %>
|
||||||
<%= javascript_include_tag "results/result_texts" %>
|
<%= javascript_include_tag "results/result_texts", nonce: true %>
|
||||||
<%= javascript_include_tag "results/result_tables" %>
|
<%= javascript_include_tag "results/result_tables", nonce: true %>
|
||||||
<%= javascript_include_tag "results/result_assets" %>
|
<%= javascript_include_tag "results/result_assets", nonce: true %>
|
||||||
<%= javascript_include_tag 'pdf_js' %>
|
<%= javascript_include_tag 'pdf_js', nonce: true %>
|
||||||
<%= stylesheet_link_tag 'pdf_js_styles' %>
|
<%= stylesheet_link_tag 'pdf_js_styles' %>
|
||||||
|
|
||||||
<%= render 'shared/tiny_mce_packs' %>
|
<%= render 'shared/tiny_mce_packs' %>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t("general.cancel")%></button>
|
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t("general.cancel")%></button>
|
||||||
<button type="button" class="btn btn-danger" data-dismiss="modal" onclick="onClickDeleteRecord();">
|
<button type="button" class="btn btn-danger delete-record-modal-button" data-dismiss="modal">
|
||||||
<%= t("repositories.modal_delete_record.delete") %>
|
<%= t("repositories.modal_delete_record.delete") %>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" onClick="pageReload()"><span aria-hidden="true">×</span></button>
|
<button type="button" class="close close-button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title"><%= t('repositories.modal_import.title') %></h4>
|
<h4 class="modal-title"><%= t('repositories.modal_import.title') %></h4>
|
||||||
<%= t("repositories.modal_import.notice") %>
|
<%= t("repositories.modal_import.notice") %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal" onClick="pageReload()"><%= t('general.cancel')%></button>
|
<button type="button" class="btn btn-default close-button" data-dismiss="modal"><%= t('general.cancel')%></button>
|
||||||
<input type="submit" class="btn btn-success" value="<%= t("repositories.modal_import.upload") %>">
|
<input type="submit" class="btn btn-success" value="<%= t("repositories.modal_import.upload") %>">
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<div class="modal-dialog modal-lg">
|
<div class="modal-dialog modal-lg">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" onClick="pageReload()"><span aria-hidden="true">×</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title" id="parse-modal-title"><%= t('repositories.modal_parse.title') %></h4>
|
<h4 class="modal-title" id="parse-modal-title"><%= t('repositories.modal_parse.title') %></h4>
|
||||||
</div>
|
</div>
|
||||||
<%= bootstrap_form_tag(url: import_records_repository_path(@import_data.repository, format: :json),
|
<%= bootstrap_form_tag(url: import_records_repository_path(@import_data.repository, format: :json),
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal" onClick="pageReload()"><%= t('general.cancel')%></button>
|
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t('general.cancel')%></button>
|
||||||
<input type="submit" class="btn btn-success" value="<%= t('repositories.modal_parse.import') %>">
|
<input type="submit" class="btn btn-success" value="<%= t('repositories.modal_parse.import') %>">
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -114,10 +114,10 @@
|
||||||
<%= render partial: 'save_repository_filter_modal' %>
|
<%= render partial: 'save_repository_filter_modal' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= javascript_include_tag 'repositories/edit' %>
|
<%= javascript_include_tag 'repositories/edit', nonce: true %>
|
||||||
<%= javascript_include_tag 'repositories/repository_datatable' %>
|
<%= javascript_include_tag 'repositories/repository_datatable', nonce: true %>
|
||||||
<%= javascript_include_tag "repositories/show" %>
|
<%= javascript_include_tag "repositories/show", nonce: true %>
|
||||||
<%= javascript_include_tag 'inputmask' %>
|
<%= javascript_include_tag 'inputmask', nonce: true %>
|
||||||
<%= javascript_include_tag 'emoji_button' %>
|
<%= javascript_include_tag 'emoji_button', nonce: true %>
|
||||||
<%= javascript_include_tag 'pdf_js' %>
|
<%= javascript_include_tag 'pdf_js', nonce: true %>
|
||||||
<%= stylesheet_link_tag 'pdf_js_styles' %>
|
<%= stylesheet_link_tag 'pdf_js_styles' %>
|
||||||
|
|
|
@ -5,8 +5,12 @@
|
||||||
<%= t('libraries.manange_modal_column.number_type.decimals_label') %>
|
<%= t('libraries.manange_modal_column.number_type.decimals_label') %>
|
||||||
</label>
|
</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<%= number_field_tag('decimals', selected_decimals, between: 0...Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS,
|
<%= number_field_tag('decimals',
|
||||||
class: 'form-control',
|
selected_decimals,
|
||||||
oninput: "this.value = numberMinMaxValidator(this.value, 0, #{Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS})" ) %>
|
between: 0...Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS,
|
||||||
|
class: 'form-control number-column',
|
||||||
|
data: { min: 0, max: Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS }) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= javascript_include_tag 'repository_columns/manage_column_partials/number', nonce: true %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,9 +7,13 @@
|
||||||
<%= t('libraries.manange_modal_column.number_type.decimals_label') %>
|
<%= t('libraries.manange_modal_column.number_type.decimals_label') %>
|
||||||
</label>
|
</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<%= number_field_tag('decimals', selected_decimals, between: 0...Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS,
|
<%= number_field_tag('decimals',
|
||||||
class: 'form-control',
|
selected_decimals,
|
||||||
oninput: "this.value = numberMinMaxValidator(this.value, 0, #{Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS})" ) %>
|
between: 0...Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS,
|
||||||
|
class: 'form-control stock-column',
|
||||||
|
data: { min: 0, max: Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS }) %>
|
||||||
|
|
||||||
|
<%= javascript_include_tag 'repository_columns/manage_column_partials/stock', nonce: true %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
<%= ff.file_field :file, direct_upload: true %>
|
<%= ff.file_field :file, direct_upload: true %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="align-right">
|
<div class="align-right edit-result-assets-buttons">
|
||||||
<button type="button" class="btn btn-secondary cancel-edit">
|
<button type="button" class="btn btn-secondary cancel-edit">
|
||||||
<%= t("general.cancel")%>
|
<%= t("general.cancel")%>
|
||||||
</button>
|
</button>
|
||||||
<%= f.button t("general.save"),
|
<%= f.button t("general.save"),
|
||||||
class: 'btn btn-primary save-result',
|
class: 'btn btn-primary save-result' %>
|
||||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.FILE);" %>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<%= javascript_include_tag 'results/result_assets/edit', nonce: true %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,22 +12,20 @@
|
||||||
id: 'drag-n-drop-assets',
|
id: 'drag-n-drop-assets',
|
||||||
class: 'drag-n-drop-file-input',
|
class: 'drag-n-drop-file-input',
|
||||||
direct_upload: true,
|
direct_upload: true,
|
||||||
multiple: true,
|
multiple: true %>
|
||||||
onchange: "DragNDropResults.init(this.files);" %>
|
|
||||||
</label>
|
</label>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div class="align-right">
|
<div class="align-right new-result-assets-buttons">
|
||||||
<%= f.button t('result_assets.new.create'),
|
<%= f.button t('result_assets.new.create'),
|
||||||
class: 'btn btn-primary save-result',
|
class: 'btn btn-primary save-result',
|
||||||
onclick: 'DragNDropResults.processResult(event);',
|
|
||||||
data: { href: my_module_result_assets_path(page: params[:page], order: params[:order], format: :json) } %>
|
data: { href: my_module_result_assets_path(page: params[:page], order: params[:order], format: :json) } %>
|
||||||
<%= f.button t('general.cancel'),
|
<%= f.button t('general.cancel'),
|
||||||
class: 'btn btn-secondary cancel-new',
|
class: 'btn btn-secondary cancel-new',
|
||||||
onclick: 'DragNDropResults.destroyAll();',
|
|
||||||
type: 'button '%>
|
type: 'button '%>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<%= javascript_include_tag 'results/result_assets/new', nonce: true %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,13 +12,13 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="align-right">
|
<div class="align-right edit-result-tables-buttons">
|
||||||
<button type="button" class="btn btn-secondary cancel-edit">
|
<button type="button" class="btn btn-secondary cancel-edit">
|
||||||
<%= t("general.cancel")%>
|
<%= t("general.cancel")%>
|
||||||
</button>
|
</button>
|
||||||
<%= f.button t("general.save"),
|
<%= f.button t("general.save"),
|
||||||
class: 'btn btn-primary save-result',
|
class: 'btn btn-primary save-result' %>
|
||||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.TABLE);" %>
|
<%= javascript_include_tag 'results/result_tables/edit', nonce: true %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="align-right">
|
<div class="align-right new-result-tables-buttons">
|
||||||
<button type="button" class="btn btn-secondary cancel-new">
|
<button type="button" class="btn btn-secondary cancel-new">
|
||||||
<%= t("general.cancel")%>
|
<%= t("general.cancel")%>
|
||||||
</button>
|
</button>
|
||||||
<%= f.button t("result_tables.new.create"),
|
<%= f.button t("result_tables.new.create"),
|
||||||
class: 'btn btn-primary save-result',
|
class: 'btn btn-primary save-result' %>
|
||||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.TABLE);" %>
|
<%= javascript_include_tag 'results/result_tables/new', nonce: true %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,13 +12,13 @@
|
||||||
object_id: @result.result_text.id,
|
object_id: @result.result_text.id,
|
||||||
last_updated: @result.updated_at.to_i * 1000 }) %>
|
last_updated: @result.updated_at.to_i * 1000 }) %>
|
||||||
<% end %><br />
|
<% end %><br />
|
||||||
<div class="align-right">
|
<div class="align-right edit-result-texts-buttons'">
|
||||||
<button type="button" class="btn btn-secondary cancel-edit">
|
<button type="button" class="btn btn-secondary cancel-edit">
|
||||||
<%= t("general.cancel")%>
|
<%= t("general.cancel")%>
|
||||||
</button>
|
</button>
|
||||||
<%= f.button t("general.save"),
|
<%= f.button t("general.save"),
|
||||||
class: 'btn btn-primary save-result',
|
class: 'btn btn-primary save-result' %>
|
||||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.TEXT);" %>
|
<%= javascript_include_tag 'results/result_texts/edit', nonce: true %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
object_id: @result.result_text.id,
|
object_id: @result.result_text.id,
|
||||||
last_updated: @result.updated_at.to_i * 1000 }) %>
|
last_updated: @result.updated_at.to_i * 1000 }) %>
|
||||||
<% end %><br />
|
<% end %><br />
|
||||||
<div class="align-right">
|
<div class="align-right new-result-texts-buttons'">
|
||||||
<button type="button" class="btn btn-secondary cancel-new">
|
<button type="button" class="btn btn-secondary cancel-new">
|
||||||
<%= t("general.cancel")%>
|
<%= t("general.cancel")%>
|
||||||
</button>
|
</button>
|
||||||
<%= f.button t("result_texts.new.create"),
|
<%= f.button t("result_texts.new.create"),
|
||||||
class: 'btn btn-primary save-result',
|
class: 'btn btn-primary save-result' %>
|
||||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.TEXT);" %>
|
<%= javascript_include_tag 'results/result_texts/new', nonce: true %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -71,8 +71,7 @@
|
||||||
<%= render partial: 'shared/pdf_viewer.html.erb', locals: { asset: asset, report_document: false } %>
|
<%= render partial: 'shared/pdf_viewer.html.erb', locals: { asset: asset, report_document: false } %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= image_tag asset.large_preview,
|
<%= image_tag asset.large_preview,
|
||||||
onerror: 'ActiveStoragePreviews.reCheckPreview(event)',
|
class: 'asset-image',
|
||||||
onload: 'ActiveStoragePreviews.showPreview(event)',
|
|
||||||
style: 'opacity: 0' %>
|
style: 'opacity: 0' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -91,8 +90,7 @@
|
||||||
data: {id: previous_asset.id, gallery_elements: gallery} do %>
|
data: {id: previous_asset.id, gallery_elements: gallery} do %>
|
||||||
<% if previous_asset.previewable? %>
|
<% if previous_asset.previewable? %>
|
||||||
<%= image_tag previous_asset.medium_preview,
|
<%= image_tag previous_asset.medium_preview,
|
||||||
onerror: 'ActiveStoragePreviews.reCheckPreview(event)',
|
class: 'asset-image',
|
||||||
onload: 'ActiveStoragePreviews.showPreview(event)',
|
|
||||||
style: 'opacity: 0' %>
|
style: 'opacity: 0' %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<i class="fas <%= file_fa_icon_class(previous_asset) if previous_asset.file_name %>"></i>
|
<i class="fas <%= file_fa_icon_class(previous_asset) if previous_asset.file_name %>"></i>
|
||||||
|
@ -112,8 +110,7 @@
|
||||||
<i class="fas fa-angle-right"></i>
|
<i class="fas fa-angle-right"></i>
|
||||||
<% if next_asset.previewable? %>
|
<% if next_asset.previewable? %>
|
||||||
<%= image_tag next_asset.medium_preview,
|
<%= image_tag next_asset.medium_preview,
|
||||||
onerror: 'ActiveStoragePreviews.reCheckPreview(event)',
|
class: 'asset-image',
|
||||||
onload: 'ActiveStoragePreviews.showPreview(event)',
|
|
||||||
style: 'opacity: 0' %>
|
style: 'opacity: 0' %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<i class="fas <%= file_fa_icon_class(next_asset) if next_asset.file_name %>"></i>
|
<i class="fas <%= file_fa_icon_class(next_asset) if next_asset.file_name %>"></i>
|
||||||
|
@ -123,3 +120,5 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= javascript_include_tag 'shared/file_preview', nonce: true %>
|
||||||
|
|
|
@ -3,8 +3,11 @@
|
||||||
<%= image_tag('linkedin/Sign-in-Large---Default.png',
|
<%= image_tag('linkedin/Sign-in-Large---Default.png',
|
||||||
class: 'linkedin-signin-button',
|
class: 'linkedin-signin-button',
|
||||||
alt: "Sign in with LinkedIn",
|
alt: "Sign in with LinkedIn",
|
||||||
onmouseover: "src='#{image_path('linkedin/Sign-in-Large---Hover.png')}'",
|
data: {
|
||||||
onmouseout: "src='#{image_path('linkedin/Sign-in-Large---Default.png')}'",
|
'hover-src': image_path('linkedin/Sign-in-Large---Hover.png'),
|
||||||
onclick: "src='#{image_path('linkedin/Sign-in-Large---Active.png')}'") %>
|
'default-src': image_path('linkedin/Sign-in-Large---Default.png'),
|
||||||
|
'click-src': image_path('linkedin/Sign-in-Large---Active.png')
|
||||||
|
}) %>
|
||||||
|
<%= javascript_include_tag 'users/shared/linkedin_sign_in_links', nonce: true %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
|
@ -111,6 +111,18 @@ Rails.application.config.assets.precompile += %w(users/registrations/team_errors
|
||||||
Rails.application.config.assets.precompile += %w(users/registrations/resource_errors.js)
|
Rails.application.config.assets.precompile += %w(users/registrations/resource_errors.js)
|
||||||
Rails.application.config.assets.precompile += %w(users/registrations/new_with_provider.js)
|
Rails.application.config.assets.precompile += %w(users/registrations/new_with_provider.js)
|
||||||
Rails.application.config.assets.precompile += %w(team_zip_exports/load_handson.js)
|
Rails.application.config.assets.precompile += %w(team_zip_exports/load_handson.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(repository_columns/manage_column_partials/number.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(repository_columns/manage_column_partials/stock.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(assets/asset_inline.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(assets/asset_thumbnail.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(results/result_assets/new.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(results/result_assets/edit.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(results/result_tables/new.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(results/result_tables/edit.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(results/result_texts/new.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(results/result_texts/edit.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(shared/file_preview.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(users/shared/linkedin_sign_in_links.js)
|
||||||
|
|
||||||
# Libraries needed for Handsontable formulas
|
# Libraries needed for Handsontable formulas
|
||||||
Rails.application.config.assets.precompile += %w(jquery.js)
|
Rails.application.config.assets.precompile += %w(jquery.js)
|
||||||
|
|
Loading…
Add table
Reference in a new issue