mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Fix rebase conflicts
This commit is contained in:
parent
c2e456aa27
commit
f65b50c6ff
|
@ -38,20 +38,20 @@ var MyModuleRepositories = (function() {
|
||||||
|
|
||||||
function fullViewColumnDefs() {
|
function fullViewColumnDefs() {
|
||||||
let columnDefs = [{
|
let columnDefs = [{
|
||||||
targets: 0,
|
targets: 0,
|
||||||
visible: true,
|
visible: true,
|
||||||
searchable: false,
|
searchable: false,
|
||||||
orderable: false,
|
orderable: false,
|
||||||
className: 'dt-body-center',
|
className: 'dt-body-center',
|
||||||
sWidth: '1%',
|
sWidth: '1%',
|
||||||
render: function(data) {
|
render: function(data) {
|
||||||
var checked = data ? 'checked' : '';
|
var checked = data ? 'checked' : '';
|
||||||
return `<div class="sci-checkbox-container">
|
return `<div class="sci-checkbox-container">
|
||||||
<input class='repository-row-selector sci-checkbox' type='checkbox' ${checked}>
|
<input class='repository-row-selector sci-checkbox' type='checkbox' ${checked}>
|
||||||
<span class='sci-checkbox-label'></span>
|
<span class='sci-checkbox-label'></span>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
if (FULL_VIEW_MODAL.find('.table').data('type') === 'live') {
|
if (FULL_VIEW_MODAL.find('.table').data('type') === 'live') {
|
||||||
columnDefs.push({
|
columnDefs.push({
|
||||||
|
@ -153,7 +153,7 @@ var MyModuleRepositories = (function() {
|
||||||
DataTableHelpers.initSearchField(dataTableWrapper);
|
DataTableHelpers.initSearchField(dataTableWrapper);
|
||||||
dataTableWrapper.find('.main-actions, .pagination-row').removeClass('hidden');
|
dataTableWrapper.find('.main-actions, .pagination-row').removeClass('hidden');
|
||||||
if (options.assign_mode) {
|
if (options.assign_mode) {
|
||||||
renderFullViewActionButtons();
|
renderFullViewAssignButtons();
|
||||||
} else {
|
} else {
|
||||||
$('.table-container .toolbar').html($('#repositoryToolbarButtonsTemplate').html());
|
$('.table-container .toolbar').html($('#repositoryToolbarButtonsTemplate').html());
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ var MyModuleRepositories = (function() {
|
||||||
animateSpinner(null, true);
|
animateSpinner(null, true);
|
||||||
$.get(tableUrl, (data) => {
|
$.get(tableUrl, (data) => {
|
||||||
FULL_VIEW_MODAL.find('.table-container').html(data.html);
|
FULL_VIEW_MODAL.find('.table-container').html(data.html);
|
||||||
renderFullViewTable(FULL_VIEW_MODAL.find('.table'));
|
renderFullViewTable(FULL_VIEW_MODAL.find('.table'), { assigned: true, skipCheckbox: true });
|
||||||
setSelectedItem();
|
setSelectedItem();
|
||||||
animateSpinner(null, false);
|
animateSpinner(null, false);
|
||||||
});
|
});
|
||||||
|
@ -355,7 +355,7 @@ var MyModuleRepositories = (function() {
|
||||||
refreshSelectAllCheckbox();
|
refreshSelectAllCheckbox();
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderFullViewActionButtons() {
|
function renderFullViewAssignButtons() {
|
||||||
var toolbar = FULL_VIEW_MODAL.find('.dataTables_wrapper .toolbar');
|
var toolbar = FULL_VIEW_MODAL.find('.dataTables_wrapper .toolbar');
|
||||||
toolbar.empty();
|
toolbar.empty();
|
||||||
if (FULL_VIEW_MODAL.data('rows-count') === 0) {
|
if (FULL_VIEW_MODAL.data('rows-count') === 0) {
|
||||||
|
@ -380,7 +380,7 @@ var MyModuleRepositories = (function() {
|
||||||
FULL_VIEW_MODAL.data('rows-count', $(this).data('rows-count'));
|
FULL_VIEW_MODAL.data('rows-count', $(this).data('rows-count'));
|
||||||
FULL_VIEW_MODAL.modal('show');
|
FULL_VIEW_MODAL.modal('show');
|
||||||
$.get($(this).data('table-url'), (data) => {
|
$.get($(this).data('table-url'), (data) => {
|
||||||
FULL_VIEW_MODAL.find('.modal-body').html(data.html);
|
FULL_VIEW_MODAL.find('.table-container').html(data.html);
|
||||||
FULL_VIEW_MODAL.data('assign-url-modal', assignUrlModal);
|
FULL_VIEW_MODAL.data('assign-url-modal', assignUrlModal);
|
||||||
FULL_VIEW_MODAL.data('update-url-modal', updateUrlModal);
|
FULL_VIEW_MODAL.data('update-url-modal', updateUrlModal);
|
||||||
renderFullViewTable(FULL_VIEW_MODAL.find('.table'), { assign_mode: true });
|
renderFullViewTable(FULL_VIEW_MODAL.find('.table'), { assign_mode: true });
|
||||||
|
@ -460,7 +460,7 @@ var MyModuleRepositories = (function() {
|
||||||
FULL_VIEW_TABLE.ajax.reload(null, false);
|
FULL_VIEW_TABLE.ajax.reload(null, false);
|
||||||
reloadRepositoriesList();
|
reloadRepositoriesList();
|
||||||
updateFullViewRowsCount(data.rows_count);
|
updateFullViewRowsCount(data.rows_count);
|
||||||
renderFullViewActionButtons();
|
renderFullViewAssignButtons();
|
||||||
},
|
},
|
||||||
error: function(data) {
|
error: function(data) {
|
||||||
UPDATE_REPOSITORY_MODAL.modal('hide');
|
UPDATE_REPOSITORY_MODAL.modal('hide');
|
||||||
|
|
|
@ -73,7 +73,7 @@ class MyModuleRepositoriesController < ApplicationController
|
||||||
)
|
)
|
||||||
render json: {
|
render json: {
|
||||||
html: modal,
|
html: modal,
|
||||||
update_url: my_module_my_module_repository_path(@my_module, @repository)
|
update_url: my_module_repository_path(@my_module, @repository)
|
||||||
}, status: :ok
|
}, status: :ok
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ class MyModuleRepositoriesController < ApplicationController
|
||||||
)
|
)
|
||||||
render json: {
|
render json: {
|
||||||
html: modal,
|
html: modal,
|
||||||
update_url: my_module_my_module_repository_path(@my_module, @repository)
|
update_url: my_module_repository_path(@my_module, @repository)
|
||||||
}, status: :ok
|
}, status: :ok
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<div class="actions-block">
|
<div class="actions-block">
|
||||||
<div class="dropdown repositories-assign-container" data-repositories-url="<%= my_module_repositories_dropdown_list_path(@my_module) %>">
|
<div class="dropdown repositories-assign-container" data-repositories-url="<%= repositories_dropdown_list_my_module_repositories_path(@my_module) %>">
|
||||||
<a href="#" id="repositories-assign-button" class="btn btn-secondary btn-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
<a href="#" id="repositories-assign-button" class="btn btn-secondary btn-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||||
<span class="fas fa-file-signature"></span>
|
<span class="fas fa-file-signature"></span>
|
||||||
<span><%= t('my_modules.assigned_items.assign_from') %></span>
|
<span><%= t('my_modules.assigned_items.assign_from') %></span>
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="collapse panel-group" id="assigned-items-container"
|
<div class="collapse panel-group" id="assigned-items-container"
|
||||||
data-repositories-list-url="<%= repositories_list_html_my_module_my_module_repositories_path(@my_module) %>">
|
data-repositories-list-url="<%= repositories_list_html_my_module_repositories_path(@my_module) %>">
|
||||||
<%= render partial: "my_modules/repositories/repositories_list" %>
|
<%= render partial: "my_modules/repositories/repositories_list" %>
|
||||||
</div>
|
</div>
|
||||||
<%= render partial: "my_modules/repositories/full_view_modal" %>
|
<%= render partial: "my_modules/repositories/full_view_modal" %>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
data-default-order="<%= default_snapshot_table_order_as_js_array %>"
|
data-default-order="<%= default_snapshot_table_order_as_js_array %>"
|
||||||
data-default-table-columns="<%= default_snapshot_table_columns %>"
|
data-default-table-columns="<%= default_snapshot_table_columns %>"
|
||||||
data-load-state-url="<%= repository_load_table_state_path(@repository_snapshot) %>"
|
data-load-state-url="<%= repository_load_table_state_path(@repository_snapshot) %>"
|
||||||
data-versions-sidebar-url="<%= my_module_repository_full_view_versions_sidebar_path(@my_module, @repository) %>"
|
data-versions-sidebar-url="<%= full_view_versions_sidebar_my_module_repository_snapshots_path(@my_module, @repository) %>"
|
||||||
>
|
>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
data-default-order="<%= default_table_order_as_js_array %>"
|
data-default-order="<%= default_table_order_as_js_array %>"
|
||||||
data-default-table-columns="<%= default_table_columns %>"
|
data-default-table-columns="<%= default_table_columns %>"
|
||||||
data-load-state-url="<%= repository_load_table_state_path(@repository) %>"
|
data-load-state-url="<%= repository_load_table_state_path(@repository) %>"
|
||||||
data-versions-sidebar-url="<%= my_module_repository_full_view_versions_sidebar_path(@my_module, @repository) %>"
|
data-versions-sidebar-url="<%= full_view_versions_sidebar_my_module_repository_snapshots_path(@my_module, @repository) %>"
|
||||||
>
|
>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<% @repositories.each do |repository| %>
|
<% @repositories.each do |repository| %>
|
||||||
<% assigned_items_count = @my_module.repository_rows_count(repository) %>
|
<% assigned_items_count = @my_module.repository_rows_count(repository) %>
|
||||||
<li class="repository"
|
<li class="repository"
|
||||||
data-table-url="<%= full_view_table_my_module_my_module_repository_path(@my_module, repository) %>"
|
data-table-url="<%= full_view_table_my_module_repository_path(@my_module, repository) %>"
|
||||||
data-assign-url-modal="<%= assign_repository_records_modal_my_module_my_module_repository_path(@my_module, repository) %>"
|
data-assign-url-modal="<%= assign_repository_records_modal_my_module_repository_path(@my_module, repository) %>"
|
||||||
data-update-url-modal="<%= update_repository_records_modal_my_module_my_module_repository_path(@my_module, repository)%>" data-repository-id="<%= repository.id %>"
|
data-update-url-modal="<%= update_repository_records_modal_my_module_repository_path(@my_module, repository)%>" data-repository-id="<%= repository.id %>"
|
||||||
data-rows-count="<%= assigned_items_count %>" >
|
data-rows-count="<%= assigned_items_count %>" >
|
||||||
<% if repository.shared_with?(current_team) %>
|
<% if repository.shared_with?(current_team) %>
|
||||||
<span class="shared-icon">
|
<span class="shared-icon">
|
||||||
|
|
|
@ -406,6 +406,7 @@ Rails.application.routes.draw do
|
||||||
collection do
|
collection do
|
||||||
get :full_view_versions_sidebar
|
get :full_view_versions_sidebar
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# resources :sample_my_modules, path: '/samples_index', only: [:index]
|
# resources :sample_my_modules, path: '/samples_index', only: [:index]
|
||||||
|
|
Loading…
Reference in a new issue