-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new: usr: support Redmine 5.0 (refs #110)
- Loading branch information
Showing
10 changed files
with
83 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# encoding: utf-8 | ||
require_dependency 'redmine_drawio' | ||
require File.expand_path('../lib/redmine_drawio', __FILE__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
# encoding: UTF-8 | ||
|
||
class RedmineDrawioHookListener < Redmine::Hook::ViewListener | ||
include DrawioSettingsHelper | ||
|
||
module RedmineDrawio | ||
module Hooks | ||
class MacroDialog < Redmine::Hook::ViewListener | ||
def view_layouts_base_body_bottom(context = {}) | ||
html = context[:controller].send(:render_to_string, | ||
{ partial: 'redmine_drawio/macro_dialog', | ||
locals: { svg_enabled: svg_enabled? } }) | ||
locals: { svg_enabled: RedmineDrawio::Helpers::DrawioSettingsHelper.svg_enabled? } }) | ||
html.html_safe | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
# encoding: UTF-8 | ||
|
||
# Add to_bool method to String class; this makes source more readable | ||
class String | ||
module RedmineDrawio | ||
module Patches | ||
module StringPatch | ||
def to_bool | ||
return true if self =~ (/^(true|t|yes|y|1)$/i) | ||
return false if self.empty? || self =~ (/^(false|f|no|n|0)$/i) | ||
|
||
raise ArgumentError.new "invalid value: #{self}" | ||
end | ||
end | ||
end | ||
end | ||
|
||
String.prepend(RedmineDrawio::Patches::StringPatch) |