From fb7fffe5d9d9fd2d45ff5228661bb7c627e98510 Mon Sep 17 00:00:00 2001 From: Steve Schwartz Date: Mon, 5 Jan 2015 11:28:47 -0500 Subject: [PATCH 01/11] Updated view and journal_patch to force AR association to array for delete_if method to work. --- app/views/hooks/redmine_mentions/_edit_mentionable.html.erb | 4 ++-- lib/redmine_mentions/journal_patch.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/hooks/redmine_mentions/_edit_mentionable.html.erb b/app/views/hooks/redmine_mentions/_edit_mentionable.html.erb index 91f0248..ba395df 100644 --- a/app/views/hooks/redmine_mentions/_edit_mentionable.html.erb +++ b/app/views/hooks/redmine_mentions/_edit_mentionable.html.erb @@ -4,7 +4,7 @@ <% regex_find = '/\B'+Setting.plugin_redmine_mentions['trigger']+'(\w*)$/i'%> -<%users= @project.users.delete_if{|u| (u.type != 'User' || u.mail.empty?)}%> +<%users= @project.users.to_a.delete_if{|u| (u.type != 'User' || u.mail.empty?)}%> <%users_regex=users.collect{|u| "#{Setting.plugin_redmine_mentions['trigger']}#{u.login}"}.join('|')%> <% regex_highlight = '/\B('+users_regex+')/g' %> \ No newline at end of file + diff --git a/lib/redmine_mentions/journal_patch.rb b/lib/redmine_mentions/journal_patch.rb index 2d227af..899984c 100644 --- a/lib/redmine_mentions/journal_patch.rb +++ b/lib/redmine_mentions/journal_patch.rb @@ -8,7 +8,7 @@ def send_mail if self.journalized.is_a?(Issue) && self.notes.present? issue = self.journalized project=self.journalized.project - users=project.users.delete_if{|u| (u.type != 'User' || u.mail.empty?)} + users=project.users.to_a.delete_if{|u| (u.type != 'User' || u.mail.empty?)} users_regex=users.collect{|u| "#{Setting.plugin_redmine_mentions['trigger']}#{u.login}"}.join('|') regex_for_email = '\B('+users_regex+')' regex = Regexp.new(regex_for_email) @@ -24,4 +24,4 @@ def send_mail end end end -end \ No newline at end of file +end From 62f13bd0225c478d6e6b107b55eb67d3a1aff0ef Mon Sep 17 00:00:00 2001 From: jasonz Date: Mon, 2 Mar 2015 19:35:45 +0800 Subject: [PATCH 02/11] enable search in words, fix uppercase user match --- app/views/hooks/redmine_mentions/_edit_mentionable.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/hooks/redmine_mentions/_edit_mentionable.html.erb b/app/views/hooks/redmine_mentions/_edit_mentionable.html.erb index 91f0248..ec2c893 100644 --- a/app/views/hooks/redmine_mentions/_edit_mentionable.html.erb +++ b/app/views/hooks/redmine_mentions/_edit_mentionable.html.erb @@ -10,11 +10,11 @@ \ No newline at end of file + From 7e235bd9abc02b08231dba0fd663d4e656ede466 Mon Sep 17 00:00:00 2001 From: Mark Biesheuvel Date: Tue, 3 Mar 2015 11:24:24 +0100 Subject: [PATCH 03/11] Also match ending word boundary of mention --- lib/redmine_mentions/journal_patch.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/redmine_mentions/journal_patch.rb b/lib/redmine_mentions/journal_patch.rb index 899984c..d8f3199 100644 --- a/lib/redmine_mentions/journal_patch.rb +++ b/lib/redmine_mentions/journal_patch.rb @@ -10,7 +10,7 @@ def send_mail project=self.journalized.project users=project.users.to_a.delete_if{|u| (u.type != 'User' || u.mail.empty?)} users_regex=users.collect{|u| "#{Setting.plugin_redmine_mentions['trigger']}#{u.login}"}.join('|') - regex_for_email = '\B('+users_regex+')' + regex_for_email = '\B('+users_regex+')\b' regex = Regexp.new(regex_for_email) mentioned_users = self.notes.scan(regex) mentioned_users.each do |mentioned_user| From 7efaa5b37cbfae38b1be1dc1fe4850f98998d5cd Mon Sep 17 00:00:00 2001 From: fredsdc Date: Thu, 27 Aug 2015 11:59:36 -0300 Subject: [PATCH 04/11] Update jquery.overlay.js css fix 1/2 --- assets/javascripts/jquery.overlay.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/jquery.overlay.js b/assets/javascripts/jquery.overlay.js index 37b2c89..8575a5a 100644 --- a/assets/javascripts/jquery.overlay.js +++ b/assets/javascripts/jquery.overlay.js @@ -108,6 +108,7 @@ 'font-family', 'font-weight', 'font-size', + 'width', 'background-color' ]; @@ -244,4 +245,4 @@ }); }; -})(window.jQuery); \ No newline at end of file +})(window.jQuery); From 4faf97332362678aa9b9f550b9a174235802f548 Mon Sep 17 00:00:00 2001 From: fredsdc Date: Thu, 27 Aug 2015 12:05:54 -0300 Subject: [PATCH 05/11] Update jquery.textcomplete.js css fix 2/2 --- assets/javascripts/jquery.textcomplete.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/javascripts/jquery.textcomplete.js b/assets/javascripts/jquery.textcomplete.js index c8af508..795cda5 100644 --- a/assets/javascripts/jquery.textcomplete.js +++ b/assets/javascripts/jquery.textcomplete.js @@ -122,6 +122,8 @@ }; css = { wrapper: { + lineHeight: '1.25em', + clear: 'left', position: 'relative' }, // Removed the 'top' property to support the placement: 'top' option From f58b439f03ed18ecb2997e94f0605993d89f93b1 Mon Sep 17 00:00:00 2001 From: swiatkiewicz Date: Tue, 29 Sep 2015 09:39:47 +0200 Subject: [PATCH 06/11] FIX: Undefined method 'users' for nil An ActionView::Template::Error occurred in issues#new: undefined method `users' for nil:NilClass This error will occurs when you try create issues without project. --- .../hooks/redmine_mentions/_edit_mentionable.html.erb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/hooks/redmine_mentions/_edit_mentionable.html.erb b/app/views/hooks/redmine_mentions/_edit_mentionable.html.erb index f151d1d..02d5a62 100644 --- a/app/views/hooks/redmine_mentions/_edit_mentionable.html.erb +++ b/app/views/hooks/redmine_mentions/_edit_mentionable.html.erb @@ -3,9 +3,12 @@ <%= stylesheet_link_tag 'auto_complete.css', :plugin => 'redmine_mentions' %> <% regex_find = '/\B'+Setting.plugin_redmine_mentions['trigger']+'(\w*)$/i'%> - -<%users= @project.users.to_a.delete_if{|u| (u.type != 'User' || u.mail.empty?)}%> -<%users_regex=users.collect{|u| "#{Setting.plugin_redmine_mentions['trigger']}#{u.login}"}.join('|')%> +<% if @project %> + <% users = @project.users.to_a.delete_if{|u| (u.type != 'User' || u.mail.empty?)}%> +<% else %> + <% users = User.active.to_a.delete_if{|u| (u.type != 'User' || u.mail.empty?)}%> +<% end %> +<% users_regex = users.collect{|u| "#{Setting.plugin_redmine_mentions['trigger']}#{u.login}"}.join('|')%> <% regex_highlight = '/\B('+users_regex+')/g' %>