summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-11-10 18:59:06 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-11-10 18:59:06 +0000
commit79c33bbc838fd837e516fd60569dbcf7917bd534 (patch)
tree20695e6f03f08925d6be3c96846668d979b4b3b3 /app/views
parentf6b2be81b9cb09485a08e58fc73d9290fd544148 (diff)
downloadredmine-79c33bbc838fd837e516fd60569dbcf7917bd534.tar.gz
redmine-79c33bbc838fd837e516fd60569dbcf7917bd534.zip
Maps repository users to Redmine users (#1383).
Users with same username or email are automatically mapped. Mapping can be manually adjusted in repository settings. Multiple usernames can be mapped to the same Redmine user. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2006 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r--app/views/issues/_changesets.rhtml2
-rw-r--r--app/views/issues/show.rfpdf2
-rw-r--r--app/views/projects/settings/_repository.rhtml5
-rw-r--r--app/views/repositories/_dir_list_content.rhtml4
-rw-r--r--app/views/repositories/_revisions.rhtml2
-rw-r--r--app/views/repositories/committers.rhtml29
-rw-r--r--app/views/repositories/revision.rhtml2
7 files changed, 39 insertions, 7 deletions
diff --git a/app/views/issues/_changesets.rhtml b/app/views/issues/_changesets.rhtml
index caa983cbf..15b75c61d 100644
--- a/app/views/issues/_changesets.rhtml
+++ b/app/views/issues/_changesets.rhtml
@@ -2,7 +2,7 @@
<div class="changeset <%= cycle('odd', 'even') %>">
<p><%= link_to("#{l(:label_revision)} #{changeset.revision}",
:controller => 'repositories', :action => 'revision', :id => @project, :rev => changeset.revision) %><br />
- <span class="author"><%= authoring(changeset.committed_on, changeset.committer) %></span></p>
+ <span class="author"><%= authoring(changeset.committed_on, changeset.author) %></span></p>
<%= textilizable(changeset, :comments) %>
</div>
<% end %>
diff --git a/app/views/issues/show.rfpdf b/app/views/issues/show.rfpdf
index 73d9d66b5..5926ba89d 100644
--- a/app/views/issues/show.rfpdf
+++ b/app/views/issues/show.rfpdf
@@ -79,7 +79,7 @@
pdf.Ln
for changeset in @issue.changesets
pdf.SetFontStyle('B',8)
- pdf.Cell(190,5, format_time(changeset.committed_on) + " - " + changeset.committer)
+ pdf.Cell(190,5, format_time(changeset.committed_on) + " - " + changeset.author)
pdf.Ln
unless changeset.comments.blank?
pdf.SetFontStyle('',8)
diff --git a/app/views/projects/settings/_repository.rhtml b/app/views/projects/settings/_repository.rhtml
index dcfabbbf0..cdfb7feb4 100644
--- a/app/views/projects/settings/_repository.rhtml
+++ b/app/views/projects/settings/_repository.rhtml
@@ -11,10 +11,13 @@
</div>
<div class="contextual">
+<% if @repository && !@repository.new_record? %>
+<%= link_to(l(:label_user_plural), {:controller => 'repositories', :action => 'committers', :id => @project}, :class => 'icon icon-user') %>
<%= link_to(l(:button_delete), {:controller => 'repositories', :action => 'destroy', :id => @project},
:confirm => l(:text_are_you_sure),
:method => :post,
- :class => 'icon icon-del') if @repository && !@repository.new_record? %>
+ :class => 'icon icon-del') %>
+<% end %>
</div>
<%= submit_tag((@repository.nil? || @repository.new_record?) ? l(:button_create) : l(:button_save), :disabled => @repository.nil?) %>
diff --git a/app/views/repositories/_dir_list_content.rhtml b/app/views/repositories/_dir_list_content.rhtml
index 20473a264..12ee44dbf 100644
--- a/app/views/repositories/_dir_list_content.rhtml
+++ b/app/views/repositories/_dir_list_content.rhtml
@@ -15,10 +15,10 @@
:class => (entry.is_dir? ? 'icon icon-folder' : 'icon icon-file')%>
</td>
<td class="size"><%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>
+<% changeset = @project.repository.changesets.find_by_revision(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %>
<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>
-<% changeset = @project.repository.changesets.find_by_revision(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %>
+<td class="author"><%= changeset.nil? ? h(entry.lastrev.author.to_s.split('<').first) : changeset.author if entry.lastrev %></td>
<td class="comments"><%=h truncate(changeset.comments, 50) unless changeset.nil? %></td>
</tr>
<% end %>
diff --git a/app/views/repositories/_revisions.rhtml b/app/views/repositories/_revisions.rhtml
index d8ca8007a..fb0131c82 100644
--- a/app/views/repositories/_revisions.rhtml
+++ b/app/views/repositories/_revisions.rhtml
@@ -17,7 +17,7 @@
<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 changeset.author %></td>
<td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td>
</tr>
<% line_num += 1 %>
diff --git a/app/views/repositories/committers.rhtml b/app/views/repositories/committers.rhtml
new file mode 100644
index 000000000..6e3ba83b4
--- /dev/null
+++ b/app/views/repositories/committers.rhtml
@@ -0,0 +1,29 @@
+<h2><%= l(:label_repository) %></h2>
+
+<%= simple_format(l(:text_repository_usernames_mapping)) %>
+
+<% if @committers.empty? %>
+<p class="nodata"><%= l(:label_no_data) %></p>
+<% else %>
+
+<% form_tag({}) do %>
+<table class="list">
+<thead>
+ <tr>
+ <th><%= l(:field_login) %></th>
+ <th><%= l(:label_user) %></th>
+ </tr>
+</thead>
+<tbody>
+<% @committers.each do |committer, user_id| -%>
+ <tr class="<%= cycle 'odd', 'even' %>">
+ <td><%=h committer %></td>
+ <td><%= select_tag "committers[#{committer}]", content_tag('option', "-- #{l :actionview_instancetag_blank_option} --", :value => '') + options_from_collection_for_select(@users, 'id', 'name', user_id.to_i) %></td>
+ </tr>
+<% end -%>
+</tbody>
+</table>
+<p><%= submit_tag(l(:button_update)) %></p>
+<% end %>
+
+<% end %> \ No newline at end of file
diff --git a/app/views/repositories/revision.rhtml b/app/views/repositories/revision.rhtml
index 123fccf26..c5bac720b 100644
--- a/app/views/repositories/revision.rhtml
+++ b/app/views/repositories/revision.rhtml
@@ -22,7 +22,7 @@
<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>
+<span class="author"><%= authoring(@changeset.committed_on, @changeset.author) %></span></p>
<%= textilizable @changeset.comments %>