Skip to content

Commit

Permalink
Add ability to enable/disable the visual editor per project (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
taqueci committed Feb 26, 2021
1 parent ae312cb commit 5445fcd
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ WYSIWYG editor mode.

1. Clone or copy files into the Redmine plugins directory
2. Restart Redmine
3. Enable "Visual editor" in project module settings

## FAQ / Errors

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<%
if content_for(:header_tags).present? && content_for(:header_tags).include?('/jstoolbar/')
if content_for(:header_tags).present? &&
content_for(:header_tags).include?('/jstoolbar/') &&
(@project.nil? || @project.identifier.blank? ||
User.current.allowed_to?(:use_visual_editor, @project))
content_for :header_tags do %>
<%= javascript_include_tag('tinymce/tinymce.min.js', plugin: 'redmine_wysiwyg_editor') %>
<%
Expand Down
1 change: 1 addition & 0 deletions config/locales/cs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cs:
label_visual_editor: Vizuální editor
label_insert_wiki_link: Vložit Wiki odkaz
project_module_visual_editor: Vizuální editor
1 change: 1 addition & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
de:
label_visual_editor: "Visueller Editor"
label_insert_wiki_link: "Wiki-Link einfügen"
project_module_visual_editor: "Visueller Editor"
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
en:
label_visual_editor: "Visual editor"
label_insert_wiki_link: "Insert Wiki link"
project_module_visual_editor: "Visual editor"
option_visual_editor_mode_switch_tab: "Use tabs for mode switch"
1 change: 1 addition & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
fr:
label_visual_editor: "Editeur visuel"
label_insert_wiki_link: "Insérer wiki lien"
project_module_visual_editor: "Editeur visuel"
1 change: 1 addition & 0 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ja:
label_visual_editor: "ビジュアルエディタ"
label_insert_wiki_link: "Wikiリンクの挿入"
project_module_visual_editor: "ビジュアルエディタ"
option_visual_editor_mode_switch_tab: "モード切り替えにタブを使用する"
5 changes: 5 additions & 0 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
url 'https://github.com/taqueci/redmine_wysiwyg_editor'
author_url 'https://github.com/taqueci'

project_module :visual_editor do
permission :use_visual_editor, { :redmine_wysiwyg_editor => [] },
:public => true, :require => :member
end

settings default: { settings_visual_editor_mode_switch_tab: '' },
partial: 'redmine_wysiwyg_editor/setting'
end
Expand Down

0 comments on commit 5445fcd

Please sign in to comment.