From da36b7268f70a3bd6b80e044db883c3d1fd48718 Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 16 Mar 2023 14:04:25 +0100 Subject: [PATCH] Clean old protocol code [SCI-8154] --- app/assets/javascripts/protocols/index.js | 270 ------------------ app/controllers/protocols_controller.rb | 98 ------- app/views/protocols/_header.html.erb | 57 ---- app/views/protocols/_steps.html.erb | 38 --- app/views/protocols/edit.html.erb | 19 -- .../protocols/header/_authors_label.html.erb | 15 - .../header/_description_label.html.erb | 15 - .../protocols/header/_name_label.html.erb | 13 - .../header/_updated_at_label.html.erb | 1 - app/views/protocols/index.html.erb | 5 - .../index/_archive_results_modal.html.erb | 16 -- .../index/_confirm_archive_modal.html.erb | 19 -- .../_make_private_results_modal.html.erb | 16 -- .../index/_protocol_preview_modal.html.erb | 13 - .../_protocol_preview_modal_body.html.erb | 29 -- .../_protocol_preview_modal_footer.html.erb | 6 - .../index/_publish_results_modal.html.erb | 16 -- .../index/_results_modal_body.html.erb | 55 ---- config/routes.rb | 6 - 19 files changed, 707 deletions(-) delete mode 100644 app/views/protocols/_header.html.erb delete mode 100644 app/views/protocols/_steps.html.erb delete mode 100644 app/views/protocols/edit.html.erb delete mode 100644 app/views/protocols/header/_authors_label.html.erb delete mode 100644 app/views/protocols/header/_description_label.html.erb delete mode 100644 app/views/protocols/header/_name_label.html.erb delete mode 100644 app/views/protocols/header/_updated_at_label.html.erb delete mode 100644 app/views/protocols/index/_archive_results_modal.html.erb delete mode 100644 app/views/protocols/index/_confirm_archive_modal.html.erb delete mode 100644 app/views/protocols/index/_make_private_results_modal.html.erb delete mode 100644 app/views/protocols/index/_protocol_preview_modal.html.erb delete mode 100644 app/views/protocols/index/_protocol_preview_modal_body.html.erb delete mode 100644 app/views/protocols/index/_protocol_preview_modal_footer.html.erb delete mode 100644 app/views/protocols/index/_publish_results_modal.html.erb delete mode 100644 app/views/protocols/index/_results_modal_body.html.erb diff --git a/app/assets/javascripts/protocols/index.js b/app/assets/javascripts/protocols/index.js index 34db0ec52..0004dd710 100644 --- a/app/assets/javascripts/protocols/index.js +++ b/app/assets/javascripts/protocols/index.js @@ -638,41 +638,6 @@ var ProtocolsIndex = (function() { } function initModals() { - function refresh(modal) { - modal.find('.modal-body').html(''); - - // Simply re-render table - reloadTable(); - } - - // Make private modal hidden action - $('#make-private-results-modal').on('hidden.bs.modal', function() { - refresh($(this)); - updateDataTableSelectAllCheckbox(); - updateButtons(); - }); - - // Publish modal hidden action - $('#publish-results-modal').on('hidden.bs.modal', function() { - refresh($(this)); - updateDataTableSelectAllCheckbox(); - updateButtons(); - }); - - // Confirm archive modal hidden action - $('#confirm-archive-modal').on('hidden.bs.modal', function() { - // Unbind from click event on the submit button - $(this).find(".modal-footer [data-action='submit']") - .off('click'); - }); - - // Archive modal hidden action - $('#archive-results-modal').on('hidden.bs.modal', function() { - refresh($(this)); - updateDataTableSelectAllCheckbox(); - updateButtons(); - }); - // Linked children modal close action $('#linked-children-modal').on('hidden.bs.modal', function() { $(this).find('.modal-title').html(''); @@ -680,13 +645,6 @@ var ProtocolsIndex = (function() { $(this).find('.modal-body #linked-children-table').DataTable().destroy(); $(this).find('.modal-body').html(''); }); - - // Protocol preview modal close action - $('#protocol-preview-modal').on('hidden.bs.modal', function() { - $(this).find('.modal-title').html(''); - $(this).find('.modal-body').html(''); - $(this).find('.modal-footer').html(''); - }); } function updateDataTableSelectAllCheckbox() { @@ -734,235 +692,7 @@ var ProtocolsIndex = (function() { actionToolbar.find('.emptyPlaceholder').toggleClass('hidden', actionToolbar.find('.btn:visible').length > 0); } - /* - function updateButtons() { - var cloneBtn = $("[data-action='clone']"); - var makePrivateBtn = $("[data-action='make-private']"); - var publishBtn = $("[data-action='publish']"); - var archiveBtn = $("[data-action='archive']"); - var restoreBtn = $("[data-action='restore']"); - var exportBtn = $("[data-action='export']"); - var row = $("tr[data-row-id='" + rowsSelected[0] + "']"); - var rows = []; - - if (rowsSelected.length === 1) { - // 1 ROW SELECTED - if (row.is('[data-can-clone]')) { - cloneBtn.removeClass('disabled hidden'); - cloneBtn.off('click').on('click', function() { cloneSelectedProtocol(); }); - } else { - cloneBtn.removeClass('hidden').addClass('disabled'); - cloneBtn.off('click'); - } - if (row.is('[data-can-make-private]')) { - makePrivateBtn.removeClass('disabled hidden'); - makePrivateBtn.off('click').on('click', function() { processMoveButtonClick($(this)); }); - } else { - makePrivateBtn.removeClass('hidden').addClass('disabled'); - makePrivateBtn.off('click'); - } - if (row.is('[data-can-publish]')) { - publishBtn.removeClass('disabled hidden'); - publishBtn.off('click').on('click', function() { processMoveButtonClick($(this)); }); - } else { - publishBtn.removeClass('hidden').addClass('disabled'); - publishBtn.off('click'); - } - if (row.is('[data-can-archive]')) { - archiveBtn.removeClass('disabled hidden'); - archiveBtn.off('click').on('click', function() { processMoveButtonClick($(this)); }); - } else { - archiveBtn.removeClass('hidden').addClass('disabled'); - archiveBtn.off('click'); - } - if (row.is('[data-can-restore]')) { - restoreBtn.removeClass('disabled hidden'); - restoreBtn.off('click').on('click', function() { processMoveButtonClick($(this)); }); - } else { - restoreBtn.removeClass('hidden').addClass('disabled'); - restoreBtn.off('click'); - } - if (row.is('[data-can-export]')) { - exportBtn.removeClass('disabled hidden'); - exportBtn.off('click').on('click', function() { exportProtocols(rowsSelected); }); - } else { - exportBtn.removeClass('hidden').addClass('disabled'); - exportBtn.off('click'); - } - } else if (rowsSelected.length === 0) { - // 0 ROWS SELECTED - cloneBtn.addClass('disabled hidden'); - cloneBtn.off('click'); - makePrivateBtn.addClass('disabled hidden'); - makePrivateBtn.off('click'); - publishBtn.addClass('disabled hidden'); - publishBtn.off('click'); - archiveBtn.addClass('disabled hidden'); - archiveBtn.off('click'); - restoreBtn.addClass('disabled hidden'); - restoreBtn.off('click'); - exportBtn.addClass('disabled hidden'); - exportBtn.off('click'); - } else { - // > 1 ROWS SELECTED - _.each(rowsSelected, function(rowId) { - rows.push($("tr[data-row-id='" + rowId + "']")[0]); - }); - rows = $(rows); - - // Only enable button if all selected rows can - // be published/archived/restored/exported - cloneBtn.removeClass('hidden').addClass('disabled'); - cloneBtn.off('click'); - if (!rows.is(':not([data-can-make-private])')) { - makePrivateBtn.removeClass('disabled hidden'); - makePrivateBtn.off('click').on('click', function() { processMoveButtonClick($(this)); }); - } else { - makePrivateBtn.removeClass('hidden').addClass('disabled'); - makePrivateBtn.off('click'); - } - if (!rows.is(':not([data-can-publish])')) { - publishBtn.removeClass('disabled hidden'); - publishBtn.off('click').on('click', function() { processMoveButtonClick($(this)); }); - } else { - publishBtn.removeClass('hidden').addClass('disabled'); - publishBtn.off('click'); - } - if (!rows.is(':not([data-can-archive])')) { - archiveBtn.removeClass('disabled hidden'); - archiveBtn.off('click').on('click', function() { processMoveButtonClick($(this)); }); - } else { - archiveBtn.removeClass('hidden').addClass('disabled'); - archiveBtn.off('click'); - } - if (!rows.is(':not([data-can-restore])')) { - restoreBtn.removeClass('disabled hidden'); - restoreBtn.off('click').on('click', function() { processMoveButtonClick($(this)); }); - } else { - restoreBtn.removeClass('hidden').addClass('disabled'); - restoreBtn.off('click'); - } - if (!rows.is(':not([data-can-export])')) { - exportBtn.removeClass('disabled hidden'); - exportBtn.off('click').on('click', function() { exportProtocols(rowsSelected); }); - } else { - exportBtn.removeClass('hidden').addClass('disabled'); - exportBtn.off('click'); - } - } - } - */ - - /* - function exportProtocols(ids) { - if (ids.length > 0) { - var params = '?protocol_ids[]=' + ids[0]; - for (var i = 1; i < ids.length; i++) { - params += '&protocol_ids[]=' + ids[i]; - } - params = encodeURI(params); - window.location.href = $("[data-action='export']") - .data('export-url') + params; - } - } - - function cloneSelectedProtocol() { - if (rowsSelected.length && rowsSelected.length == 1) { - var row = $("tr[data-row-id='" + rowsSelected[0] + "']"); - - animateSpinner(); - $.ajax({ - url: row.attr("data-clone-url"), - type: "POST", - dataType: "json", - success: function (data) { - animateSpinner(null, false); - // Reload page - location.reload(); - }, - error: function (error) { - animateSpinner(null, false); - // Reload page - location.reload(); - } - }); - } - } - - function processMoveButtonClick(btn) { - var action = btn.attr("data-action"); - var url = btn.attr("data-url"); - - if (action === "archive") { - confirmModal = $("#confirm-archive-modal"); - - confirmModal - .find(".modal-footer [data-action='submit']") - .on("click", function(e) { - confirmModal.modal("hide"); - moveSelectedProtocols(action, url); - }); - - // Show the modal - confirmModal.modal("show"); - } else { - moveSelectedProtocols(action, url); - } - } - - function moveSelectedProtocols(action, url) { - animateSpinner(); - $.ajax({ - url: url, - type: "POST", - dataType: "json", - data: { protocol_ids: rowsSelected }, - success: function (data) { - rowsSelected = []; - - // Display the modal - var modal = $("#" + action + "-results-modal"); - var modalBody = modal.find(".modal-body"); - modalBody.html(data.html); - animateSpinner(null, false); - modal.modal("show"); - }, - error: function (error) { - animateSpinner(null, false); - if (error.status == 401) { - // Unauthorized - alert(I18n.t("protocols.index." + action.replace("-", "_") + "_unauthorized")); - } else { - // Generic error - alert(I18n.t("protocols.index." + action.replace("-", "_") + "_error")); - } - } - }); - } - - */ - - function initLocalFileImport() { - // Some templating code duplication. I know, I hate myself - function newElement(name, values) { - var template = $("[data-template='" + name + "']").clone(); - template.removeAttr('data-template'); - template.show(); - - // Populate values in the template - if (values !== null) { - _.each(values, function(val, key) { - template.find("[data-val='" + key + "']").html(val); - }); - } - - return template; - } - - function addChildToElement(parentEl, name, childEl) { - parentEl.find("[data-hold='" + name + "']").append(childEl); - } let fileInput = $("[data-role='import-file-input']"); diff --git a/app/controllers/protocols_controller.rb b/app/controllers/protocols_controller.rb index f0fb425da..13004916c 100644 --- a/app/controllers/protocols_controller.rb +++ b/app/controllers/protocols_controller.rb @@ -17,8 +17,6 @@ class ProtocolsController < ApplicationController show versions_modal protocol_status_bar - updated_at_label - preview linked_children linked_children_datatable permissions @@ -37,10 +35,6 @@ class ProtocolsController < ApplicationController update_version_comment update_name update_authors - edit_name_modal - edit_keywords_modal - edit_authors_modal - edit_description_modal unlink unlink_modal revert @@ -96,25 +90,6 @@ class ProtocolsController < ApplicationController end end - def preview - respond_to do |format| - format.json do - render json: { - title: I18n.t('protocols.index.preview.title', - protocol: escape_input(@protocol.name)), - html: render_to_string( - partial: 'protocols/index/protocol_preview_modal_body.html.erb', - locals: { protocol: @protocol } - ), - footer: render_to_string( - partial: 'protocols/index/protocol_preview_modal_footer.html.erb', - locals: { protocol: @protocol } - ) - } - end - end - end - def versions_modal return render_403 unless @protocol.in_repository_published_original? || @protocol.initial_draft? @@ -156,10 +131,6 @@ class ProtocolsController < ApplicationController end end - def make_private - move_protocol('make_private') - end - def publish Protocol.transaction do @protocol.update!( @@ -933,75 +904,6 @@ class ProtocolsController < ApplicationController end end - def updated_at_label - respond_to do |format| - format.json do - render json: { - html: render_to_string({ - partial: "protocols/header/updated_at_label.html.erb" - }) - } - end - end - end - - def edit_name_modal - respond_to do |format| - format.json do - render json: { - title: I18n.t('protocols.header.edit_name_modal.title', - protocol: escape_input(@protocol.name)), - html: render_to_string({ - partial: "protocols/header/edit_name_modal_body.html.erb" - }) - } - end - end - end - - def edit_keywords_modal - respond_to do |format| - format.json do - render json: { - title: I18n.t('protocols.header.edit_keywords_modal.title', - protocol: escape_input(@protocol.name)), - html: render_to_string({ - partial: "protocols/header/edit_keywords_modal_body.html.erb" - }), - keywords: @protocol.team.protocol_keywords_list - } - end - end - end - - def edit_authors_modal - respond_to do |format| - format.json do - render json: { - title: I18n.t('protocols.header.edit_authors_modal.title', - protocol: escape_input(@protocol.name)), - html: render_to_string({ - partial: "protocols/header/edit_authors_modal_body.html.erb" - }) - } - end - end - end - - def edit_description_modal - respond_to do |format| - format.json do - render json: { - title: I18n.t('protocols.header.edit_description_modal.title', - protocol: escape_input(@protocol.name)), - html: render_to_string({ - partial: "protocols/header/edit_description_modal_body.html.erb" - }) - } - end - end - end - def update_version_comment respond_to do |format| format.json do diff --git a/app/views/protocols/_header.html.erb b/app/views/protocols/_header.html.erb deleted file mode 100644 index f0545e305..000000000 --- a/app/views/protocols/_header.html.erb +++ /dev/null @@ -1,57 +0,0 @@ -
- <% unless preview %> -

- <%= render partial: "protocols/header/name_label.html.erb" %> -

- <% end %> - -
-
- - - <%= l(@protocol.created_at, format: :full) %> -
- -
- - - <%= render partial: "protocols/header/updated_at_label.html.erb" %> -
- -
- - - <%= @protocol.added_by.full_name %> -
- -
-
- - -
-
- <%= render partial: "protocols/header/authors_label.html.erb", locals: {editable: !preview} %> -
-
- -
-
- - -
-
- <%= select_tag "keyword-input-field", options_for_select(@protocol.protocol_keywords.map{|i| i.name}),{ - 'data-placeholder': t("protocols.no_keywords"), - 'data-update-url': keywords_protocol_path(@protocol, format: :json), - 'data-view-mode': !can_manage_protocol_in_repository?(@protocol) || preview, - class: 'hidden' - } %> -
-
- - -
- <%= render partial: "protocols/header/description_label.html.erb", locals: {edit_mode: !preview} %> -
-
-
diff --git a/app/views/protocols/_steps.html.erb b/app/views/protocols/_steps.html.erb deleted file mode 100644 index e16140441..000000000 --- a/app/views/protocols/_steps.html.erb +++ /dev/null @@ -1,38 +0,0 @@ -
- -
-
- <% @protocol.steps.order(:position).each do |step| %> - <%= render partial: "steps/step.html.erb", locals: { step: step } %> - <% end %> -
-<% if can_manage_protocol_in_module?(@protocol) || can_manage_protocol_in_repository?(@protocol) %> -
- -
-<% end %> - -<%= javascript_include_tag "handsontable.full" %> - - -<%= render partial: "shared/formulas_libraries.html.erb" %> - -<%= javascript_include_tag "assets/wopi/create_wopi_file" %> -<%= javascript_include_tag "protocols/steps" %> - -<%= render partial: "shared/bio_eddie_modal.html.erb" %> diff --git a/app/views/protocols/edit.html.erb b/app/views/protocols/edit.html.erb deleted file mode 100644 index 0b24a3eca..000000000 --- a/app/views/protocols/edit.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<% provide(:head_title, t("protocols.edit.head_title")) %> - -<%= render partial: 'shared/drag_n_drop_overlay' %> - -
- <%= render partial: "protocols/header.html.erb", locals: {preview: false} %> - <%= render partial: "protocols/steps.html.erb" %> - - -
- -<%= javascript_include_tag "protocols/edit" %> - -<%= render partial: 'assets/wopi/create_wopi_file_modal.html.erb' %> - - -<%= render partial: 'assets/asset_delete_modal.html.erb' %> -<%= javascript_pack_tag 'pdfjs/pdf_js' %> -<%= stylesheet_pack_tag 'pdfjs/pdf_js_styles' %> diff --git a/app/views/protocols/header/_authors_label.html.erb b/app/views/protocols/header/_authors_label.html.erb deleted file mode 100644 index 2006a4606..000000000 --- a/app/views/protocols/header/_authors_label.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<% if can_manage_protocol_in_repository?(@protocol) && editable %> - <%= render partial: "shared/inline_editing.html.erb", - locals: { - initial_value: @protocol.authors, - config: { - field_to_udpate: 'authors', - params_group: 'protocol', - placeholder: t("protocols.header.no_authors"), - path_to_update: authors_protocol_path(@protocol) - } - } - %> -<% else %> - <%= @protocol.authors || t("protocols.header.no_authors") %> -<% end %> diff --git a/app/views/protocols/header/_description_label.html.erb b/app/views/protocols/header/_description_label.html.erb deleted file mode 100644 index b05a34b60..000000000 --- a/app/views/protocols/header/_description_label.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<% if can_manage_protocol_in_repository?(@protocol) && edit_mode %> - <%= render partial: "my_modules/protocols/protocol_description_form.html.erb", locals: - { - protocol: @protocol, - update_url: description_protocol_path(@protocol, format: :json) - } - %> -<% elsif @protocol.description.present? %> - <%= custom_auto_link(@protocol.tinymce_render(:description), - simple_format: false, - tags: %w(img), - team: current_team) %> -<% else %> - <%= t('my_modules.protocols.protocol_status_bar.no_description') %> -<% end %> diff --git a/app/views/protocols/header/_name_label.html.erb b/app/views/protocols/header/_name_label.html.erb deleted file mode 100644 index 286b5712a..000000000 --- a/app/views/protocols/header/_name_label.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<% if can_manage_protocol_in_repository?(@protocol) %> - <%= render partial: "shared/inline_editing.html.erb", - locals: { - initial_value: @protocol.name, - config: { - field_to_udpate: 'name', - params_group: 'protocol', - path_to_update: name_protocol_path(@protocol) - } - } %> -<% else %> - <%= @protocol.name %> -<% end %> diff --git a/app/views/protocols/header/_updated_at_label.html.erb b/app/views/protocols/header/_updated_at_label.html.erb deleted file mode 100644 index 4ed9bc0c1..000000000 --- a/app/views/protocols/header/_updated_at_label.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= l(@protocol.updated_at, format: :full) %> \ No newline at end of file diff --git a/app/views/protocols/index.html.erb b/app/views/protocols/index.html.erb index 21c15c58f..638539939 100644 --- a/app/views/protocols/index.html.erb +++ b/app/views/protocols/index.html.erb @@ -35,15 +35,10 @@ <%= render partial: "protocols/index/general_toolbar.html.erb" %> <%= render partial: "protocols/index/action_toolbar.html.erb" %> <%= render partial: "protocols/index/protocol_filters.html.erb" %> -<%= render partial: "protocols/index/make_private_results_modal.html.erb" %> -<%= render partial: "protocols/index/publish_results_modal.html.erb" %> -<%= render partial: "protocols/index/confirm_archive_modal.html.erb" %> -<%= render partial: "protocols/index/archive_results_modal.html.erb" %> <%= render partial: "protocols/index/delete_draft_modal.html.erb" %> <%= render partial: "protocols/index/linked_children_modal.html.erb" %> <%= render partial: "protocols/index/protocolsio_modal.html.erb" %> <%= render partial: "protocols/index/new_protocol_modal.html.erb", locals: {type: 'new'} %> -<%= render partial: "protocols/index/protocol_preview_modal.html.erb" %> <%= render partial: "protocols/import_export/import_elements.html.erb" %> diff --git a/app/views/protocols/index/_archive_results_modal.html.erb b/app/views/protocols/index/_archive_results_modal.html.erb deleted file mode 100644 index e1f6cdd4c..000000000 --- a/app/views/protocols/index/_archive_results_modal.html.erb +++ /dev/null @@ -1,16 +0,0 @@ - \ No newline at end of file diff --git a/app/views/protocols/index/_confirm_archive_modal.html.erb b/app/views/protocols/index/_confirm_archive_modal.html.erb deleted file mode 100644 index 2890b0012..000000000 --- a/app/views/protocols/index/_confirm_archive_modal.html.erb +++ /dev/null @@ -1,19 +0,0 @@ - diff --git a/app/views/protocols/index/_make_private_results_modal.html.erb b/app/views/protocols/index/_make_private_results_modal.html.erb deleted file mode 100644 index 1f89afee6..000000000 --- a/app/views/protocols/index/_make_private_results_modal.html.erb +++ /dev/null @@ -1,16 +0,0 @@ - \ No newline at end of file diff --git a/app/views/protocols/index/_protocol_preview_modal.html.erb b/app/views/protocols/index/_protocol_preview_modal.html.erb deleted file mode 100644 index 5ea63c0cb..000000000 --- a/app/views/protocols/index/_protocol_preview_modal.html.erb +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/app/views/protocols/index/_protocol_preview_modal_body.html.erb b/app/views/protocols/index/_protocol_preview_modal_body.html.erb deleted file mode 100644 index 17b1aded4..000000000 --- a/app/views/protocols/index/_protocol_preview_modal_body.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<%= render partial: "protocols/header.html.erb", locals: {preview: true} %> - -
-
-
-

<%= t("protocols.steps.subtitle") %>

-
-
-
- <% protocol.steps.order(:position).each do |step| %> - <%= render partial: "steps/step.html.erb", locals: { step: step, preview: true } %> - <% end %> -
-
- -<%= javascript_include_tag "handsontable.full" %> -<%= javascript_include_tag "lodash" %> -<%= javascript_include_tag "numeral" %> -<%= javascript_include_tag "numeric" %> -<%= javascript_include_tag "md5" %> -<%= javascript_include_tag "jstat" %> -<%= javascript_include_tag "formula" %> -<%= javascript_include_tag "parser" %> -<%= javascript_include_tag "ruleJS" %> -<%= javascript_include_tag "handsontable.formula" %> -<%= javascript_include_tag "big.min" %> -<%= stylesheet_link_tag "handsontable.formula" %> - -<%= javascript_include_tag "protocols/steps" %> diff --git a/app/views/protocols/index/_protocol_preview_modal_footer.html.erb b/app/views/protocols/index/_protocol_preview_modal_footer.html.erb deleted file mode 100644 index d9878e0ad..000000000 --- a/app/views/protocols/index/_protocol_preview_modal_footer.html.erb +++ /dev/null @@ -1,6 +0,0 @@ - -<% if can_manage_protocol_in_repository?(@protocol) %> - <%= route_to_other_team_btn protocol_path(protocol), - protocol.team, - t('general.edit') %> -<% end %> diff --git a/app/views/protocols/index/_publish_results_modal.html.erb b/app/views/protocols/index/_publish_results_modal.html.erb deleted file mode 100644 index 8e1a160d6..000000000 --- a/app/views/protocols/index/_publish_results_modal.html.erb +++ /dev/null @@ -1,16 +0,0 @@ - \ No newline at end of file diff --git a/app/views/protocols/index/_results_modal_body.html.erb b/app/views/protocols/index/_results_modal_body.html.erb deleted file mode 100644 index fc0f0af78..000000000 --- a/app/views/protocols/index/_results_modal_body.html.erb +++ /dev/null @@ -1,55 +0,0 @@ -<% nr_successful = results.count { |r| r[:success] } %> -<% failed = results.select { |r| !r[:success] } %> -<% unchanged = results.select { |r| r[:success] && r[:name] == r[:new_name] } %> -<% renamed = results.select { |r| r[:success] && r[:name] != r[:new_name] } %> - -<% if failed.count > 0 %> - -<% end %> - -<% if nr_successful > 0 %> -
- <%= t("protocols.index.#{en_action}.message_ok", nr: nr_successful) %> -
-<% end %> - -
- -
diff --git a/config/routes.rb b/config/routes.rb index 55af0f173..b550efbf3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -580,7 +580,6 @@ Rails.application.routes.draw do post 'linked_children_datatable', to: 'protocols#linked_children_datatable' get 'versions_modal', to: 'protocols#versions_modal' - get 'preview', to: 'protocols#preview' patch 'description', to: 'protocols#update_description' put 'name', to: 'protocols#update_name' patch 'authors', to: 'protocols#update_authors' @@ -604,17 +603,12 @@ Rails.application.routes.draw do post 'copy_to_repository', to: 'protocols#copy_to_repository' get 'protocol_status_bar', to: 'protocols#protocol_status_bar' get 'updated_at_label', to: 'protocols#updated_at_label' - get 'edit_name_modal', to: 'protocols#edit_name_modal' - get 'edit_keywords_modal', to: 'protocols#edit_keywords_modal' - get 'edit_authors_modal', to: 'protocols#edit_authors_modal' - get 'edit_description_modal', to: 'protocols#edit_description_modal' post 'delete_steps' get :permissions put :update_version_comment end collection do post 'datatable', to: 'protocols#datatable' - post 'make_private', to: 'protocols#make_private' post 'archive', to: 'protocols#archive' post 'restore', to: 'protocols#restore' post 'clone', to: 'protocols#clone'