Code cleanup

This commit is contained in:
Karel Pičman 2023-03-14 13:11:47 +01:00
parent e40966955f
commit 9f8a24bdc9
6 changed files with 19 additions and 20 deletions

View File

@ -215,26 +215,25 @@ instance is stopped.
`cd redmine` `cd redmine`
3. Install dependencies: 4. Install dependencies:
`bundle install` `bundle install`
5. Initialize/Update database:
4. Initialize/Update database:
`RAILS_ENV=production bundle exec rake redmine:plugins:migrate NAME=redmine_dmsf` `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`. `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` `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. 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. Don't forget to grant permissions for DMSF in Administration -> Roles and permissions
9. Assign DMSF permissions to appropriate roles. 10. Assign DMSF permissions to appropriate roles.
10. There are a few rake tasks: 11. There are a few rake tasks:
I) To convert documents from the standard Redmine document module I) To convert documents from the standard Redmine document module

View File

@ -26,12 +26,12 @@
<%= select_tag select_tag_name_major, options_for_select(DmsfUploadHelper::major_version_select_options, <%= select_tag select_tag_name_major, options_for_select(DmsfUploadHelper::major_version_select_options,
DmsfUploadHelper::gui_version(revision_or_upload.major_version)), DmsfUploadHelper::gui_version(revision_or_upload.major_version)),
class: 'dmsf-select-version' %> class: 'dmsf-select-version' %>
<bold>.</bold> <b>.</b>
<% if revision_or_upload.patch_version.present? && (DmsfUploadHelper::gui_version(revision_or_upload.patch_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, <%= select_tag select_tag_name_minor, options_for_select(DmsfUploadHelper::minor_version_select_options,
DmsfUploadHelper::gui_version(revision_or_upload.minor_version)), DmsfUploadHelper::gui_version(revision_or_upload.minor_version)),
class: 'dmsf-select-version' %> class: 'dmsf-select-version' %>
<bold>.</bold> <b>.</b>
<%= select_tag select_tag_name_patch, options_for_select(DmsfUploadHelper::patch_version_select_options, <%= 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))), DmsfUploadHelper::gui_version(DmsfUploadHelper.increase_version(revision_or_upload.patch_version))),
class: 'dmsf-select-version' %> class: 'dmsf-select-version' %>
@ -44,7 +44,7 @@
<%= select_tag select_tag_name_minor, <%= select_tag select_tag_name_minor,
options_for_select(DmsfUploadHelper::minor_version_select_options, minor_version), options_for_select(DmsfUploadHelper::minor_version_select_options, minor_version),
class: 'dmsf-select-version' %> class: 'dmsf-select-version' %>
<bold>.</bold> <b>.</b>
<%= select_tag select_tag_name_patch, options_for_select(DmsfUploadHelper::patch_version_select_options, <%= select_tag select_tag_name_patch, options_for_select(DmsfUploadHelper::patch_version_select_options,
[h('&nbsp;'), '']), class: 'dmsf-select-version' %> [h('&nbsp;'), '']), class: 'dmsf-select-version' %>
<% end %> <% end %>

View File

@ -52,7 +52,7 @@ function dmsfAddFile(inputEl, file, eagerUpload) {
let attachments = $('#dmsf_attachments_fields'); let attachments = $('#dmsf_attachments_fields');
let max = ($(inputEl).attr('multiple') == 'multiple') ? 10 : 1 let max = ($(inputEl).attr('multiple') == 'multiple') ? 10 : 1
if (attachments.children().length < max) { if (attachments.children.length < max) {
let attachmentId = dmsfAddFile.nextAttachmentId++; let attachmentId = dmsfAddFile.nextAttachmentId++;
let fileSpan = $('<span>', { id: 'dmsf_attachments_' + attachmentId, 'class': 'attachment' }); let fileSpan = $('<span>', { id: 'dmsf_attachments_' + attachmentId, 'class': 'attachment' });

View File

@ -57,7 +57,7 @@ function dmsfToggle(el, project_id, folder_id, url)
if (expand) { if (expand) {
// Display only children with expanded parent // 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){ if(m){

View File

@ -54,16 +54,16 @@ table.dmsf a.sort.asc.icon.icon-sorted-desc {
.dmsf-tree.dmsf-expanded span.dmsf-expander { .dmsf-tree.dmsf-expanded span.dmsf-expander {
background: none !important; background: none !important;
padding-left: 0px !important; padding-left: 0 !important;
} }
.dmsf-tree.dmsf-collapsed span.dmsf-expander { .dmsf-tree.dmsf-collapsed span.dmsf-expander {
background: none !important; background: none !important;
padding-left: 0px !important; padding-left: 0 !important;
} }
table.dmsf td.dmsf-title { table.dmsf td.dmsf-title {
padding-left: 0px; padding-left: 0;
} }
td.dmsf-title a.icon::before { 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 { #sidebar ul > li > a.icon-only.icon-clear-query {
font-size: 0px; font-size: 0;
display: inline-block; display: inline-block;
overflow: hidden; overflow: hidden;
width: 0px; width: 0;
height: 16px; height: 16px;
} }

View File

@ -126,7 +126,7 @@ class DmsfFilesControllerTest < RedmineDmsf::Test::TestCase
params: { params: {
id: @file1.id, id: @file1.id,
version_major: @file1.last_revision.major_version, 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: { dmsf_file_revision: {
title: @file1.last_revision.title, title: @file1.last_revision.title,
name: @file1.last_revision.name, name: @file1.last_revision.name,