Patch #1796 ยป redmine-map-author-to-name-r1747.patch
| app/models/user.rb (working copy) | ||
|---|---|---|
|
anonymous_user
|
||
|
end
|
||
|
|
||
|
def self.author_to_name(author, formatter = nil)
|
||
|
return author if author == ""
|
||
|
user = find(:first, :conditions => ["login=?", author])
|
||
|
return (user ? user.name(formatter) : author)
|
||
|
end
|
||
|
|
||
|
private
|
||
|
# Return password digest
|
||
|
def self.hash_password(clear_password)
|
||
| app/controllers/repositories_controller.rb (working copy) | ||
|---|---|---|
|
changes_data = changes_data + [0]*(10 - changes_data.length) if changes_data.length<10
|
||
|
|
||
|
# Remove email adress in usernames
|
||
|
fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
|
||
|
fields = fields.collect {|c| User.author_to_name(c.gsub(%r{<.+@.+>}, ''))+" " }
|
||
|
|
||
|
graph = SVG::Graph::BarHorizontal.new(
|
||
|
:height => 400,
|
||
| app/views/repositories/revision.rhtml (working copy) | ||
|---|---|---|
|
<h2><%= l(:label_revision) %> <%= format_revision(@changeset.revision) %></h2>
|
||
|
<p><% if @changeset.scmid %>ID: <%= @changeset.scmid %><br /><% end %>
|
||
|
<em><%= @changeset.committer.to_s.split('<').first %>, <%= format_time(@changeset.committed_on) %></em></p>
|
||
|
<em><%= User.author_to_name(@changeset.committer.to_s.split('<').first) %>, <%= format_time(@changeset.committed_on) %></em></p>
|
||
|
<%= textilizable @changeset.comments %>
|
||
| app/views/repositories/_revisions.rhtml (working copy) | ||
|---|---|---|
|
<td class="checkbox"><%= radio_button_tag('rev', changeset.revision, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('cbto-#{line_num+1}').checked=true;") if show_diff && (line_num < revisions.size) %></td>
|
||
|
<td class="checkbox"><%= radio_button_tag('rev_to', changeset.revision, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('cb-#{line_num}').checked==true) {$('cb-#{line_num-1}').checked=true;}") if show_diff && (line_num > 1) %></td>
|
||
|
<td class="committed_on"><%= format_time(changeset.committed_on) %></td>
|
||
|
<td class="author"><%=h changeset.committer.to_s.split('<').first %></td>
|
||
|
<td class="author"><%=h User.author_to_name(changeset.committer.to_s.split('<').first) %></td>
|
||
|
<td class="comments"><%= textilizable(changeset.comments) %></td>
|
||
|
</tr>
|
||
|
<% line_num += 1 %>
|
||
| app/views/repositories/_dir_list_content.rhtml (working copy) | ||
|---|---|---|
|
<td class="size"><%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>
|
||
|
<td class="revision"><%= link_to(format_revision(entry.lastrev.name), :action => 'revision', :id => @project, :rev => entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %></td>
|
||
|
<td class="age"><%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %></td>
|
||
|
<td class="author"><%=h(entry.lastrev.author.to_s.split('<').first) if entry.lastrev %></td>
|
||
|
<td class="author"><%=h(User.author_to_name(entry.lastrev.author.to_s.split('<').first)) if entry.lastrev %></td>
|
||
|
<% changeset = @project.repository.changesets.find_by_revision(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %>
|
||
|
<td class="comments"><%=h truncate(changeset.comments, 50) unless changeset.nil? %></td>
|
||
|
</tr>
|
||
| app/views/repositories/annotate.rhtml (working copy) | ||
|---|---|---|
|
<th class="line-num"><%= line_num %></th>
|
||
|
<td class="revision">
|
||
|
<%= (revision.identifier ? link_to(format_revision(revision.identifier), :action => 'revision', :id => @project, :rev => revision.identifier) : format_revision(revision.revision)) if revision %></td>
|
||
|
<td class="author"><%= h(revision.author.to_s.split('<').first) if revision %></td>
|
||
|
<td class="author"><%= h(User.author_to_name(revision.author.to_s.split('<').first)) if revision %></td>
|
||
|
<td class="line-code"><pre><%= line %></pre></td>
|
||
|
</tr>
|
||
|
<% line_num += 1 %>
|
||
| app/views/projects/activity.rhtml (working copy) | ||
|---|---|---|
|
<%= content_tag('span', h(e.project), :class => 'project') if @project.nil? || @project != e.project %>
|
||
|
<%= link_to format_activity_title(e.event_title), e.event_url %></dt>
|
||
|
<dd><span class="description"><%= format_activity_description(e.event_description) %></span>
|
||
|
<span class="author"><%= e.event_author if e.respond_to?(:event_author) %></span></dd>
|
||
|
<span class="author"><%= (e.event_type=="changeset" ? User.author_to_name(e.event_author) : e.event_author) if e.respond_to?(:event_author) %></span></dd>
|
||
|
<% end -%>
|
||
|
</dl>
|
||
|
<% end -%>
|
||