Open ghost opened 7 years ago
Any plans to implement this feature? Would be really helpful!
I adapted the code so it works for me. Please review and if fine with it, commit to repo. One thing to mention: @username has to be there from current implementation, otherwise email feature will not work!
File /app/views/hooks/redmine_mentions/_edit_mentionable.html.erb, line 24:
replace: function(mention) {
var parts = mention.split(' - ');
var uname = parts[1].substring(parts[1].lastIndexOf("<small>")+7,parts[1].lastIndexOf("</small>"));
var fullname = parts[0];
if ('<%=Setting.plugin_redmine_mentions['print_fullname']%>' == 'Y')
{
return fullname + '(' + '<%=Setting.plugin_redmine_mentions['trigger']%>' + uname + ')';
}
else
{
return '<%=Setting.plugin_redmine_mentions['trigger']%>' + uname;
}
}
Config option:
File app/views/settings/_mention.erb
<p>
<label for="settings[trigger]">Trigger</label>
<%= select_tag('settings[trigger]',
options_for_select(['@',':','~','!','#','%'],settings['trigger'])) %>
</p>
<p>
<label for="settings[print_fullname]">Print fullname</label>
<%= select_tag('settings[print_fullname]',
options_for_select(['Y','N'],settings['print_fullname'])) %>
</p>
Will insert: Firstname Lastname(@username)
See diff: diff.txt
When a user is mentioned within a wiki page or a comment with @user the shown text is generally replaced with the username. Out of social interaktion reasons it would be great if the plugin replaces the text behind the @ with the "@Firstname Lastname". Maybe you can make this an option within the plugin configuration screen to use: