From 9f8a24bdc97b549c0c1e6303b771ee1544f93a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Tue, 14 Mar 2023 13:11:47 +0100 Subject: [PATCH] Code cleanup --- README.md | 17 ++++++++--------- app/views/dmsf_files/_version_selector.html.erb | 6 +++--- assets/javascripts/attachments_dmsf.js | 2 +- assets/javascripts/redmine_dmsf.js | 2 +- assets/stylesheets/easy_extensions.css | 10 +++++----- test/functional/dmsf_files_controller_test.rb | 2 +- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 9a9ef0f0..675727e1 100644 --- a/README.md +++ b/README.md @@ -215,26 +215,25 @@ instance is stopped. `cd redmine` -3. Install dependencies: +4. Install dependencies: `bundle install` - -4. Initialize/Update database: +5. Initialize/Update database: `RAILS_ENV=production bundle exec rake redmine:plugins:migrate NAME=redmine_dmsf` -5. The access rights must be set for web server, e.g.: +6. The access rights must be set for web server, e.g.: `chown -R www-data:www-data plugins/redmine_dmsf`. -6. Restart the web server, e.g.: +7. Restart the web server, e.g.: `systemctl restart apache2` -7. You should configure the plugin via Redmine interface: Administration -> Plugins -> DMSF -> Configure. (You should check and then save the plugin's configuration after each upgrade.) -8. Don't forget to grant permissions for DMSF in Administration -> Roles and permissions -9. Assign DMSF permissions to appropriate roles. -10. There are a few rake tasks: +8. You should configure the plugin via Redmine interface: Administration -> Plugins -> DMSF -> Configure. (You should check and then save the plugin's configuration after each upgrade.) +9. Don't forget to grant permissions for DMSF in Administration -> Roles and permissions +10. Assign DMSF permissions to appropriate roles. +11. There are a few rake tasks: I) To convert documents from the standard Redmine document module diff --git a/app/views/dmsf_files/_version_selector.html.erb b/app/views/dmsf_files/_version_selector.html.erb index 9d6fd65c..540a67d1 100644 --- a/app/views/dmsf_files/_version_selector.html.erb +++ b/app/views/dmsf_files/_version_selector.html.erb @@ -26,12 +26,12 @@ <%= select_tag select_tag_name_major, options_for_select(DmsfUploadHelper::major_version_select_options, DmsfUploadHelper::gui_version(revision_or_upload.major_version)), class: 'dmsf-select-version' %> -. +. <% if revision_or_upload.patch_version.present? && (DmsfUploadHelper::gui_version(revision_or_upload.patch_version) != ' ') %> <%= select_tag select_tag_name_minor, options_for_select(DmsfUploadHelper::minor_version_select_options, DmsfUploadHelper::gui_version(revision_or_upload.minor_version)), class: 'dmsf-select-version' %> - . + . <%= select_tag select_tag_name_patch, options_for_select(DmsfUploadHelper::patch_version_select_options, DmsfUploadHelper::gui_version(DmsfUploadHelper.increase_version(revision_or_upload.patch_version))), class: 'dmsf-select-version' %> @@ -44,7 +44,7 @@ <%= select_tag select_tag_name_minor, options_for_select(DmsfUploadHelper::minor_version_select_options, minor_version), class: 'dmsf-select-version' %> - . + . <%= select_tag select_tag_name_patch, options_for_select(DmsfUploadHelper::patch_version_select_options, [h(' '), '']), class: 'dmsf-select-version' %> <% end %> diff --git a/assets/javascripts/attachments_dmsf.js b/assets/javascripts/attachments_dmsf.js index 42f90733..e4e30cdb 100644 --- a/assets/javascripts/attachments_dmsf.js +++ b/assets/javascripts/attachments_dmsf.js @@ -52,7 +52,7 @@ function dmsfAddFile(inputEl, file, eagerUpload) { let attachments = $('#dmsf_attachments_fields'); let max = ($(inputEl).attr('multiple') == 'multiple') ? 10 : 1 - if (attachments.children().length < max) { + if (attachments.children.length < max) { let attachmentId = dmsfAddFile.nextAttachmentId++; let fileSpan = $('', { id: 'dmsf_attachments_' + attachmentId, 'class': 'attachment' }); diff --git a/assets/javascripts/redmine_dmsf.js b/assets/javascripts/redmine_dmsf.js index 6e814cd6..214e848a 100644 --- a/assets/javascripts/redmine_dmsf.js +++ b/assets/javascripts/redmine_dmsf.js @@ -57,7 +57,7 @@ function dmsfToggle(el, project_id, folder_id, url) if (expand) { // Display only children with expanded parent - m = $(tr).attr('class').match(/(\d+(p|f)) idnt/); + let m = $(tr).attr('class').match(/(\d+(p|f)) idnt/); if(m){ diff --git a/assets/stylesheets/easy_extensions.css b/assets/stylesheets/easy_extensions.css index 476a485e..1f46f8d2 100644 --- a/assets/stylesheets/easy_extensions.css +++ b/assets/stylesheets/easy_extensions.css @@ -54,16 +54,16 @@ table.dmsf a.sort.asc.icon.icon-sorted-desc { .dmsf-tree.dmsf-expanded span.dmsf-expander { background: none !important; - padding-left: 0px !important; + padding-left: 0 !important; } .dmsf-tree.dmsf-collapsed span.dmsf-expander { background: none !important; - padding-left: 0px !important; + padding-left: 0 !important; } table.dmsf td.dmsf-title { - padding-left: 0px; + padding-left: 0; } td.dmsf-title a.icon::before { @@ -130,9 +130,9 @@ td.dmsf-title a.icon-folder::before { } #sidebar ul > li > a.icon-only.icon-clear-query { - font-size: 0px; + font-size: 0; display: inline-block; overflow: hidden; - width: 0px; + width: 0; height: 16px; } diff --git a/test/functional/dmsf_files_controller_test.rb b/test/functional/dmsf_files_controller_test.rb index 88cd0f32..ea154bcb 100644 --- a/test/functional/dmsf_files_controller_test.rb +++ b/test/functional/dmsf_files_controller_test.rb @@ -126,7 +126,7 @@ class DmsfFilesControllerTest < RedmineDmsf::Test::TestCase params: { id: @file1.id, version_major: @file1.last_revision.major_version, - version_major: @file1.last_revision.minor_version + 1, + version_minor: @file1.last_revision.minor_version + 1, dmsf_file_revision: { title: @file1.last_revision.title, name: @file1.last_revision.name,