aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsobiemir <sobiemir@aculo.pl>2019-01-06 17:38:34 +0100
committersobiemir <sobiemir@aculo.pl>2019-01-06 17:38:34 +0100
commit9f449998ae4514a9c78794e9c0ccf749aec125a1 (patch)
tree9cabe587d1617e3d00a0e16fefd684187621819e
parent81cfcb84f7a84146660ff0240a3a4e2f99f296e7 (diff)
downloadredmine-revision-redirect-9f449998ae4514a9c78794e9c0ccf749aec125a1.tar.gz
redmine-revision-redirect-9f449998ae4514a9c78794e9c0ccf749aec125a1.zip
Add redirect link in repository list settings
-rw-r--r--app/views/projects/settings/_repositories.html.erb45
-rw-r--r--config/locales/en.yml1
2 files changed, 46 insertions, 0 deletions
diff --git a/app/views/projects/settings/_repositories.html.erb b/app/views/projects/settings/_repositories.html.erb
new file mode 100644
index 0000000..8be80cb
--- /dev/null
+++ b/app/views/projects/settings/_repositories.html.erb
@@ -0,0 +1,45 @@
+<% 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 %>
+
+<% if @project.repositories.any? %>
+<div class="autoscroll">
+ <table class="list">
+ <thead>
+ <tr>
+ <th><%= l(:field_identifier) %></th>
+ <th><%= l(:field_repository_is_default) %></th>
+ <th><%= l(:label_scm) %></th>
+ <th><%= l(:label_repository) %></th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ <% @project.repositories.sort.each do |repository| %>
+ <tr>
+ <td class="name">
+ <%= link_to repository.identifier,
+ {:controller => 'repositories', :action => 'show',:id => @project, :repository_id => repository.identifier_param} if repository.identifier.present? %>
+ </td>
+ <td><%= checked_image repository.is_default? %></td>
+ <td><%= repository.scm_name %></td>
+ <td><%= repository.url %></td>
+ <td class="buttons">
+ <% if User.current.allowed_to?(:manage_repository, @project) %>
+ <%= link_to(l(:label_user_plural), committers_repository_path(repository),
+ :class => 'icon icon-user') %>
+ <%= link_to(l(:button_edit), edit_repository_path(repository),
+ :class => 'icon icon-edit') %>
+ <%= link_to(l(:rrr_button_redirect), edit_repository_path(repository),
+ :class => 'icon icon-shared') %>
+ <%= delete_link repository_path(repository) %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+</div>
+<% else %>
+<p class="nodata"><%= l(:label_no_data) %></p>
+<% end %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 642b07f..46c1f56 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1,3 +1,4 @@
# English strings go here for Rails i18n
en:
+ rrr_button_redirect: "Redirects"
# my_label: "My label"