diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 43f32fbc7..1a2b44ff2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -690,7 +690,7 @@ module ApplicationHelper end def authoring(created, author, options={}) - l(options[:label] || :label_added_time_by, :author => link_to_user(author), :age => time_tag(created)).html_safe + l(options[:label] || :label_added_time_by, :author => link_to_user(author), :badge => options[:badge], :age => time_tag(created)).html_safe end def time_tag(time) diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb index c8a771d81..7d8fb0386 100644 --- a/app/helpers/journals_helper.rb +++ b/app/helpers/journals_helper.rb @@ -84,4 +84,15 @@ module JournalsHelper content_tag('span', "ยท #{l(:label_edited)}", :title => l(:label_time_by_author, :time => format_time(journal.updated_on), :author => journal.updated_by), :class => 'update-info') end + + def journal_user_badge(journal) + return '' if journal.nil? + + issue = journal&.journalized + if journal.user == issue&.author + content_tag('span', l(:field_author), class: 'badge badge-user-author') + else + '' + end + end end diff --git a/app/helpers/messages_helper.rb b/app/helpers/messages_helper.rb index d1caad5ad..ec938b2fc 100644 --- a/app/helpers/messages_helper.rb +++ b/app/helpers/messages_helper.rb @@ -18,4 +18,13 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. module MessagesHelper + def message_user_badge(message) + return '' if message&.parent.nil? + + if message.parent.author == message.author + content_tag('span', l(:field_author), class: 'badge badge-user-author') + else + '' + end + end end diff --git a/app/helpers/news_helper.rb b/app/helpers/news_helper.rb index 1dc2b3079..5d5cc7e53 100644 --- a/app/helpers/news_helper.rb +++ b/app/helpers/news_helper.rb @@ -18,4 +18,13 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. module NewsHelper + def news_comment_user_badge(comment) + return '' if comment&.commented.nil? + + if comment.commented.author == comment.author + content_tag('span', l(:field_author), class: 'badge badge-user-author') + else + '' + end + end end diff --git a/app/helpers/wiki_helper.rb b/app/helpers/wiki_helper.rb index 0b5f3b8f4..97df2c37e 100644 --- a/app/helpers/wiki_helper.rb +++ b/app/helpers/wiki_helper.rb @@ -73,6 +73,6 @@ module WikiHelper end def wiki_content_update_info(content) - l(:label_updated_time_by, :author => link_to_user(content.author), :age => time_tag(content.updated_on)).html_safe + l(:label_updated_time_by, :author => link_to_user(content.author), :age => time_tag(content.updated_on), :badge => '').html_safe end end diff --git a/app/views/issues/tabs/_history.html.erb b/app/views/issues/tabs/_history.html.erb index 8c6f6d31b..a739f7e15 100644 --- a/app/views/issues/tabs/_history.html.erb +++ b/app/views/issues/tabs/_history.html.erb @@ -13,7 +13,7 @@