diff --git a/app/controllers/dmsf_controller.rb b/app/controllers/dmsf_controller.rb index 0ca22843..52807f0b 100644 --- a/app/controllers/dmsf_controller.rb +++ b/app/controllers/dmsf_controller.rb @@ -35,7 +35,6 @@ class DmsfController < ApplicationController before_action :find_folder_by_title, only: [:show] before_action :get_query, only: [:expand_folder, :show, :trash, :empty_trash, :index] before_action :get_project_roles, only: [:new, :edit, :create, :save] - before_action :text_formating, only: [:show, :edit, :edit_root] accept_api_auth :show, :create, :save, :delete @@ -709,8 +708,4 @@ class DmsfController < ApplicationController members: { project_id: @project.id }).distinct end - def text_formating - @wiki = Setting.text_formatting != 'HTML' - end - end diff --git a/app/controllers/dmsf_files_controller.rb b/app/controllers/dmsf_files_controller.rb index 0f6e2afb..12d821ed 100644 --- a/app/controllers/dmsf_files_controller.rb +++ b/app/controllers/dmsf_files_controller.rb @@ -83,7 +83,6 @@ class DmsfFilesController < ApplicationController @file_manipulation_allowed = User.current.allowed_to?(:file_manipulation, @project) @revision_count = @file.dmsf_file_revisions.visible.all.size @revision_pages = Paginator.new @revision_count, params['per_page'] ? params['per_page'].to_i : 25, params['page'] - @wiki = Setting.text_formatting != 'HTML' respond_to do |format| format.html { diff --git a/app/controllers/dmsf_upload_controller.rb b/app/controllers/dmsf_upload_controller.rb index 63d2a44c..4e4313c1 100644 --- a/app/controllers/dmsf_upload_controller.rb +++ b/app/controllers/dmsf_upload_controller.rb @@ -29,7 +29,6 @@ class DmsfUploadController < ApplicationController before_action :authorize_global, only: [:upload, :delete_dmsf_attachment, :delete_dmsf_link_attachment] before_action :find_folder, except: [:upload, :commit, :delete_dmsf_attachment, :delete_dmsf_link_attachment] before_action :permissions, except: [:upload, :commit, :delete_dmsf_attachment, :delete_dmsf_link_attachment] - before_action :wiki, only: [:multi_upload, :upload_files] helper :all helper :dmsf_workflows @@ -145,8 +144,4 @@ class DmsfUploadController < ApplicationController render_403 end - def wiki - @wiki = Setting.text_formatting != 'HTML' - end - end diff --git a/app/views/dmsf/_description.html.erb b/app/views/dmsf/_description.html.erb index 654805c0..e4e1004f 100644 --- a/app/views/dmsf/_description.html.erb +++ b/app/views/dmsf/_description.html.erb @@ -22,14 +22,8 @@ <% if @project %>
- <% if @wiki %> -
+
<%= textilizable @folder ? @folder.description : @project.dmsf_description %>
- <% else %> -
- <%= h @folder ? @folder.description : @project.dmsf_description %> -
- <% end %>
<% end %> diff --git a/app/views/dmsf/edit.html.erb b/app/views/dmsf/edit.html.erb index 5542ebd7..b400e8db 100644 --- a/app/views/dmsf/edit.html.erb +++ b/app/views/dmsf/edit.html.erb @@ -81,7 +81,7 @@ <%= f.text_field :title, required: true %>

- <%= f.text_area :description, rows: 8, class: @wiki ? 'wiki-edit' : 'dmsf-description' %> + <%= f.text_area :description, rows: 8, class: 'wiki-edit dmsf-description' %>

<% dir = @folder.inherited_permissions_from %> @@ -140,6 +140,6 @@

<% end %> -<% if @wiki %> +<% if Setting.text_formatting != 'HTML' %> <%= wikitoolbar_for 'dmsf_folder_description' %> <% end %> diff --git a/app/views/dmsf/edit_root.html.erb b/app/views/dmsf/edit_root.html.erb index cad7d056..2d629729 100644 --- a/app/views/dmsf/edit_root.html.erb +++ b/app/views/dmsf/edit_root.html.erb @@ -45,8 +45,7 @@ <%= labelled_form_for(@project, url: { action: 'save_root', id: @project }, html: { method: :post }) do |f| %>

- <%= f.text_area :dmsf_description, rows: 8, class: @wiki ? 'wiki-edit' : 'dmsf-description', - label: l(:field_description) %> + <%= f.text_area :dmsf_description, rows: 8, class: 'wiki-edit dmsf-description', label: l(:field_description) %>

<%= f.submit l(:submit_save), class: 'button-positive' %> @@ -54,6 +53,6 @@
<% end %> -<% if @wiki %> +<% if Setting.text_formatting != 'HTML' %> <%= wikitoolbar_for 'project_dmsf_description' %> <% end %> diff --git a/app/views/dmsf_files/_file_new_revision.html.erb b/app/views/dmsf_files/_file_new_revision.html.erb index 7c6a3404..ac5dd6a0 100644 --- a/app/views/dmsf_files/_file_new_revision.html.erb +++ b/app/views/dmsf_files/_file_new_revision.html.erb @@ -44,7 +44,7 @@

- <%= f.text_area :description, rows: 6, class: wiki ? 'wiki-edit' : 'dmsf-description' %> + <%= f.text_area :description, rows: 6, class: 'wiki-edit dmsf-description' %>

@@ -86,7 +86,7 @@

- <%= f.text_area :comment, rows: 2, label: l(:label_comment), class: wiki ? 'wiki-edit' : 'dmsf-description' %> + <%= f.text_area :comment, rows: 2, label: l(:label_comment), class: 'wiki-edit dmsf-description' %>

<%= f.submit l(:button_create), class: 'button-positive' %> @@ -96,7 +96,7 @@
-<% if wiki %> +<% if Setting.text_formatting != 'HTML' %> <%= wikitoolbar_for 'dmsf_file_revision_description' %> <%= wikitoolbar_for 'dmsf_file_revision_comment' %> <% end %> diff --git a/app/views/dmsf_files/show.html.erb b/app/views/dmsf_files/show.html.erb index 059ae3e1..e04521d4 100644 --- a/app/views/dmsf_files/show.html.erb +++ b/app/views/dmsf_files/show.html.erb @@ -61,7 +61,7 @@ <% if @file_manipulation_allowed && !@file.locked_for_user? %> <%= error_messages_for 'file' %> <%= error_messages_for 'revision' %> - <%= render partial: 'file_new_revision', locals: { wiki: @wiki } %> + <%= render partial: 'file_new_revision' %> <% end %>
diff --git a/app/views/dmsf_upload/_upload_file.html.erb b/app/views/dmsf_upload/_upload_file.html.erb index e1813bc2..2f621477 100644 --- a/app/views/dmsf_upload/_upload_file.html.erb +++ b/app/views/dmsf_upload/_upload_file.html.erb @@ -46,7 +46,7 @@

<%= label_tag "commited_files[#{i}][description]", l(:label_description) %> <%= text_area_tag "commited_files[#{i}][description]", upload.description, rows: 6, - class: wiki ? 'wiki-edit' : 'dmsf-description' %> + class: 'wiki-edit dmsf-description' %>

@@ -93,12 +93,11 @@

<%= label_tag "commited_files[#{i}][comment]", l(:label_comment) %> - <%= text_area_tag "commited_files[#{i}][comment]", upload.comment, rows: 2, - class: wiki ? 'wiki-edit' : 'dmsf-description' %> + <%= text_area_tag "commited_files[#{i}][comment]", upload.comment, rows: 2, class: 'wiki-edit dmsf-description' %>

-<% if wiki %> +<% if Setting.text_formatting != 'HTML' %> <%= wikitoolbar_for "commited_files_#{i}_description" %> <%= wikitoolbar_for "commited_files_#{i}_comment" %> <% end %> diff --git a/app/views/dmsf_upload/upload_files.html.erb b/app/views/dmsf_upload/upload_files.html.erb index 55eac3a8..670a896b 100644 --- a/app/views/dmsf_upload/upload_files.html.erb +++ b/app/views/dmsf_upload/upload_files.html.erb @@ -41,7 +41,7 @@ <% if upload.locked %> <%= render partial: 'upload_file_locked', locals: { upload: upload, i: i } %> <% else %> - <%= render partial: 'upload_file', locals: { upload: upload, i: i, wiki: @wiki } %> + <%= render partial: 'upload_file', locals: { upload: upload, i: i } %> <% end %> <% end %>
diff --git a/test/functional/dmsf_files_controller_test.rb b/test/functional/dmsf_files_controller_test.rb index b1795366..16b6294f 100644 --- a/test/functional/dmsf_files_controller_test.rb +++ b/test/functional/dmsf_files_controller_test.rb @@ -41,14 +41,14 @@ class DmsfFilesControllerTest < RedmineDmsf::Test::TestCase get :show, params: { id: @file1.id } assert_response :success assert_include 'dmsf-description', response.body, 'dmsf-description class not found' - assert_not_include 'wiki-edit', response.body, 'wiki-edit class found' + assert_include 'wiki-edit', response.body, 'wiki-edit class not found' end def test_show_formatting_textile Setting.text_formatting = 'Textile' get :show, params: { id: @file1.id } assert_response :success - assert_not_include 'dmsf-description', response.body, 'dmsf-description class found' + assert_include 'dmsf-description', response.body, 'dmsf-description class not found' assert_include 'wiki-edit', response.body, 'wiki-edit class not found' end