summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/issues/_changesets.html.erb2
-rw-r--r--app/views/projects/settings/_repositories.html.erb11
-rw-r--r--app/views/repositories/_breadcrumbs.html.erb6
-rw-r--r--app/views/repositories/_dir_list_content.html.erb5
-rw-r--r--app/views/repositories/_form.html.erb3
-rw-r--r--app/views/repositories/_link_to_functions.html.erb8
-rw-r--r--app/views/repositories/_navigation.html.erb3
-rw-r--r--app/views/repositories/_revisions.html.erb5
-rw-r--r--app/views/repositories/annotate.html.erb2
-rw-r--r--app/views/repositories/revision.html.erb10
-rw-r--r--app/views/repositories/revisions.html.erb2
-rw-r--r--app/views/repositories/show.html.erb16
-rw-r--r--app/views/repositories/stats.html.erb4
13 files changed, 51 insertions, 26 deletions
diff --git a/app/views/issues/_changesets.html.erb b/app/views/issues/_changesets.html.erb
index 76e9a2810..beab65536 100644
--- a/app/views/issues/_changesets.html.erb
+++ b/app/views/issues/_changesets.html.erb
@@ -1,6 +1,6 @@
<% changesets.each do |changeset| %>
<div class="changeset <%= cycle('odd', 'even') %>">
- <p><%= link_to_revision(changeset, changeset.project,
+ <p><%= link_to_revision(changeset, changeset.repository,
:text => "#{l(:label_revision)} #{changeset.format_identifier}") %><br />
<span class="author"><%= authoring(changeset.committed_on, changeset.author) %></span></p>
<div class="wiki">
diff --git a/app/views/projects/settings/_repositories.html.erb b/app/views/projects/settings/_repositories.html.erb
index d74220b9e..fc3fd923e 100644
--- a/app/views/projects/settings/_repositories.html.erb
+++ b/app/views/projects/settings/_repositories.html.erb
@@ -1,16 +1,20 @@
-<% if @project.repository %>
+<% if @project.repositories.any? %>
<table class="list">
<thead>
<tr>
<th><%= l(:label_scm) %></th>
+ <th><%= l(:field_identifier) %></th>
+ <th><%= l(:field_repository_is_default) %></th>
<th><%= l(:label_repository) %></th>
<th></th>
</tr>
</thead>
<tbody>
- <% repository = @project.repository %>
+ <% @project.repositories.each do |repository| %>
<tr class="<%= cycle 'odd', 'even' %>">
<td><%=h repository.scm_name %></td>
+ <td><%=h repository.identifier %></td>
+ <td align="center"><%= checked_image repository.is_default? %></td>
<td><%=h repository.url %></td>
<td class="buttons">
<% if User.current.allowed_to?(:manage_repository, @project) %>
@@ -25,12 +29,13 @@
<% end %>
</td>
</tr>
+ <% end %>
</tbody>
</table>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
-<% if @project.repository.nil? && User.current.allowed_to?(:manage_repository, @project) %>
+<% if User.current.allowed_to?(:manage_repository, @project) %>
<p><%= link_to l(:label_repository_new), new_project_repository_path(@project), :class => 'icon icon-add' %></p>
<% end %>
diff --git a/app/views/repositories/_breadcrumbs.html.erb b/app/views/repositories/_breadcrumbs.html.erb
index 0d548176c..1a610ff6c 100644
--- a/app/views/repositories/_breadcrumbs.html.erb
+++ b/app/views/repositories/_breadcrumbs.html.erb
@@ -1,4 +1,4 @@
-<%= link_to 'root', :action => 'show', :id => @project, :path => '', :rev => @rev %>
+<%= link_to 'root', :action => 'show', :id => @project, :repository_id => @repository.identifier_param, :path => '', :rev => @rev %>
<%
dirs = path.split('/')
if 'file' == kind
@@ -10,12 +10,12 @@ dirs.each do |dir|
link_path << '/' unless link_path.empty?
link_path << "#{dir}"
%>
- / <%= link_to h(dir), :action => 'show', :id => @project,
+ / <%= link_to h(dir), :action => 'show', :id => @project, :repository_id => @repository.identifier_param,
:path => to_path_param(link_path), :rev => @rev %>
<% end %>
<% if filename %>
/ <%= link_to h(filename),
- :action => 'changes', :id => @project,
+ :action => 'changes', :id => @project, :repository_id => @repository.identifier_param,
:path => to_path_param("#{link_path}/#{filename}"), :rev => @rev %>
<% end %>
<%
diff --git a/app/views/repositories/_dir_list_content.html.erb b/app/views/repositories/_dir_list_content.html.erb
index 4a1779e28..057b7dc2e 100644
--- a/app/views/repositories/_dir_list_content.html.erb
+++ b/app/views/repositories/_dir_list_content.html.erb
@@ -11,6 +11,7 @@
:url => {
:action => 'show',
:id => @project,
+ :repository_id => @repository.identifier_param,
:path => to_path_param(ent_path),
:rev => @rev,
:depth => (depth + 1),
@@ -24,13 +25,13 @@
) %>">&nbsp</span>
<% end %>
<%= link_to h(ent_name),
- {:action => (entry.is_dir? ? 'show' : 'changes'), :id => @project, :path => to_path_param(ent_path), :rev => @rev},
+ {:action => (entry.is_dir? ? 'show' : 'changes'), :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(ent_path), :rev => @rev},
:class => (entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(ent_name)}")%>
</td>
<td class="size"><%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>
<% changeset = @project.repository.find_changeset_by_name(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %>
<% if @repository.report_last_commit %>
-<td class="revision"><%= link_to_revision(changeset, @project) if changeset %></td>
+<td class="revision"><%= link_to_revision(changeset, @repository) if changeset %></td>
<td class="age"><%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %></td>
<td class="author"><%= changeset.nil? ? h(Redmine::CodesetUtil.replace_invalid_utf8(entry.lastrev.author.to_s.split('<').first)) : h(changeset.author) if entry.lastrev %></td>
<td class="comments"><%=h truncate(changeset.comments, :length => 50) unless changeset.nil? %></td>
diff --git a/app/views/repositories/_form.html.erb b/app/views/repositories/_form.html.erb
index bd1f61334..b233a13df 100644
--- a/app/views/repositories/_form.html.erb
+++ b/app/views/repositories/_form.html.erb
@@ -9,6 +9,9 @@
<% end %>
</p>
+<p><%= f.text_field :identifier %></p>
+<p><%= f.check_box :is_default, :label => :field_repository_is_default %></p>
+
<% button_disabled = true %>
<% if @repository %>
<% button_disabled = ! @repository.class.scm_available %>
diff --git a/app/views/repositories/_link_to_functions.html.erb b/app/views/repositories/_link_to_functions.html.erb
index 412d5f86f..aed88ebb7 100644
--- a/app/views/repositories/_link_to_functions.html.erb
+++ b/app/views/repositories/_link_to_functions.html.erb
@@ -1,14 +1,14 @@
<% if @entry && @entry.kind == 'file' %>
<p>
-<%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :path => to_path_param(@path), :rev => @rev } %> |
+<%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
<% if @repository.supports_cat? %>
- <%= link_to_if action_name != 'entry', l(:button_view), {:action => 'entry', :id => @project, :path => to_path_param(@path), :rev => @rev } %> |
+ <%= link_to_if action_name != 'entry', l(:button_view), {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
<% end %>
<% if @repository.supports_annotate? %>
- <%= link_to_if action_name != 'annotate', l(:button_annotate), {:action => 'annotate', :id => @project, :path => to_path_param(@path), :rev => @rev } %> |
+ <%= link_to_if action_name != 'annotate', l(:button_annotate), {:action => 'annotate', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
<% end %>
-<%= link_to(l(:button_download), {:action => 'entry', :id => @project, :path => to_path_param(@path), :rev => @rev, :format => 'raw' }) if @repository.supports_cat? %>
+<%= link_to(l(:button_download), {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev, :format => 'raw' }) if @repository.supports_cat? %>
<%= "(#{number_to_human_size(@entry.size)})" if @entry.size %>
</p>
diff --git a/app/views/repositories/_navigation.html.erb b/app/views/repositories/_navigation.html.erb
index 706f06c80..05c19d9be 100644
--- a/app/views/repositories/_navigation.html.erb
+++ b/app/views/repositories/_navigation.html.erb
@@ -3,11 +3,12 @@
<% end %>
<%= link_to l(:label_statistics),
- {:action => 'stats', :id => @project},
+ {:action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
:class => 'icon icon-stats' %>
<% form_tag({:action => controller.action_name,
:id => @project,
+ :repository_id => @repository.identifier_param,
:path => to_path_param(@path),
:rev => ''},
{:method => :get, :id => 'revision_selector'}) do -%>
diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb
index ea55e4bed..3fd1cf690 100644
--- a/app/views/repositories/_revisions.html.erb
+++ b/app/views/repositories/_revisions.html.erb
@@ -1,5 +1,5 @@
<% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %>
-<% form_tag({:controller => 'repositories', :action => 'diff', :id => @project, :path => to_path_param(path)}, :method => :get) do %>
+<% form_tag({:controller => 'repositories', :action => 'diff', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(path)}, :method => :get) do %>
<table class="list changesets">
<thead><tr>
<% if show_revision_graph %>
@@ -23,6 +23,7 @@
<% href_base = Proc.new {|x| url_for(:controller => 'repositories',
:action => 'revision',
:id => project,
+ :repository_id => @repository.identifier_param,
:rev => x) } %>
<%= render :partial => 'revision_graph',
:locals => {
@@ -35,7 +36,7 @@
</td>
<% end %>
<% end %>
-<td class="id"><%= link_to_revision(changeset, project) %></td>
+<td class="id"><%= link_to_revision(changeset, @repository) %></td>
<td class="checkbox"><%= radio_button_tag('rev', changeset.identifier, (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.identifier, (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>
diff --git a/app/views/repositories/annotate.html.erb b/app/views/repositories/annotate.html.erb
index 444ae2a3a..188d9215d 100644
--- a/app/views/repositories/annotate.html.erb
+++ b/app/views/repositories/annotate.html.erb
@@ -19,7 +19,7 @@
<tr class="bloc-<%= revision.nil? ? 0 : colors[revision.identifier || revision.revision] %>">
<th class="line-num" id="L<%= line_num %>"><a href="#L<%= line_num %>"><%= line_num %></a></th>
<td class="revision">
- <%= (revision.identifier ? link_to_revision(revision, @project) : format_revision(revision)) if revision %></td>
+ <%= (revision.identifier ? link_to_revision(revision, @repository) : format_revision(revision)) if revision %></td>
<td class="author"><%= h(revision.author.to_s.split('<').first) if revision %></td>
<td class="line-code"><pre><%= line %></pre></td>
</tr>
diff --git a/app/views/repositories/revision.html.erb b/app/views/repositories/revision.html.erb
index 6163ce17c..7c44cd674 100644
--- a/app/views/repositories/revision.html.erb
+++ b/app/views/repositories/revision.html.erb
@@ -1,13 +1,13 @@
<div class="contextual">
&#171;
<% unless @changeset.previous.nil? -%>
- <%= link_to_revision(@changeset.previous, @project, :text => l(:label_previous)) %>
+ <%= link_to_revision(@changeset.previous, @repository, :text => l(:label_previous)) %>
<% else -%>
<%= l(:label_previous) %>
<% end -%>
|
<% unless @changeset.next.nil? -%>
- <%= link_to_revision(@changeset.next, @project, :text => l(:label_next)) %>
+ <%= link_to_revision(@changeset.next, @repository, :text => l(:label_next)) %>
<% else -%>
<%= l(:label_next) %>
<% end -%>
@@ -16,6 +16,7 @@
<% form_tag({:controller => 'repositories',
:action => 'revision',
:id => @project,
+ :repository_id => @repository.identifier_param,
:rev => nil},
:method => :get) do %>
<%= text_field_tag 'rev', @rev, :size => 8 %>
@@ -37,7 +38,7 @@
<td><%= l(:label_parent_revision) %></td>
<td>
<%= @changeset.parents.collect{
- |p| link_to_revision(p, @project, :text => format_revision(p))
+ |p| link_to_revision(p, @repository, :text => format_revision(p))
}.join(", ").html_safe %>
</td>
</tr>
@@ -47,7 +48,7 @@
<td><%= l(:label_child_revision) %></td>
<td>
<%= @changeset.children.collect{
- |p| link_to_revision(p, @project, :text => format_revision(p))
+ |p| link_to_revision(p, @repository, :text => format_revision(p))
}.join(", ").html_safe %>
</td>
</tr>
@@ -85,6 +86,7 @@
<p><%= link_to(l(:label_view_diff),
:action => 'diff',
:id => @project,
+ :repository_id => @repository.identifier_param,
:path => "",
:rev => @changeset.identifier) if @changeset.changes.any? %></p>
diff --git a/app/views/repositories/revisions.html.erb b/app/views/repositories/revisions.html.erb
index 8974fa788..f1d442f08 100644
--- a/app/views/repositories/revisions.html.erb
+++ b/app/views/repositories/revisions.html.erb
@@ -1,5 +1,5 @@
<div class="contextual">
-<% form_tag({:action => 'revision', :id => @project}) do %>
+<% form_tag({:action => 'revision', :id => @project, :repository_id => @repository.identifier_param}) do %>
<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 8 %>
<%= submit_tag 'OK' %>
<% end %>
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index fc148e8d1..ca64c73f3 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -25,7 +25,7 @@
sep = ''
%>
<% if @repository.supports_all_revisions? && @path.blank? %>
-<%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project %>
+<%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project, :repository_id => @repository.identifier_param %>
<% sep = '|' %>
<% end %>
<%
@@ -38,6 +38,7 @@
:action => 'changes',
:path => to_path_param(@path),
:id => @project,
+ :repository_id => @repository.identifier_param,
:rev => @rev
%>
<% end %>
@@ -52,11 +53,22 @@
<% end %>
<% other_formats_links do |f| %>
- <%= f.link_to 'Atom', :url => {:action => 'revisions', :id => @project, :key => User.current.rss_key} %>
+ <%= f.link_to 'Atom', :url => {:action => 'revisions', :id => @project, :repository_id => @repository.identifier_param, :key => User.current.rss_key} %>
<% end %>
<% end %>
<% end %>
+<% if @repositories.size > 1 %>
+ <% content_for :sidebar do %>
+ <h3><%= l(:label_repository_plural) %></h3>
+ <%= @repositories.sort.collect {|repo|
+ link_to h(repo.name),
+ {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil},
+ :class => 'repository' + (repo == @repository ? ' selected' : '')
+ }.join('<br />').html_safe %></p>
+ <% end %>
+<% end %>
+
<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>
diff --git a/app/views/repositories/stats.html.erb b/app/views/repositories/stats.html.erb
index e5e737506..b9a5d7d6a 100644
--- a/app/views/repositories/stats.html.erb
+++ b/app/views/repositories/stats.html.erb
@@ -1,10 +1,10 @@
<h2><%= l(:label_statistics) %></h2>
<p>
-<%= tag("embed", :width => 800, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :graph => "commits_per_month")) %>
+<%= tag("embed", :width => 800, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %>
</p>
<p>
-<%= tag("embed", :width => 800, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :graph => "commits_per_author")) %>
+<%= tag("embed", :width => 800, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %>
</p>
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>