]> source.dussan.org Git - redmine.git/commitdiff
Use tabs to switch between file changes and diff of a commit.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 29 Jul 2017 12:10:23 +0000 (12:10 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 29 Jul 2017 12:10:23 +0000 (12:10 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@16911 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/repositories/_changeset.html.erb
app/views/repositories/revision.html.erb

index 26ca1556e9fc1935fe52ae2d440d1e7157ecf13d..5809be241d05f0ea4056622f703b92d1e6d6bdc6 100644 (file)
 <% if @changeset.issues.visible.any? || User.current.allowed_to?(:manage_related_issues, @repository.project) %>
   <%= render :partial => 'related_issues' %>
 <% end %>
+
+<% if User.current.allowed_to?(:browse_repository, @repository.project) %>
+<%
+tabs = []
+tabs << { name: 'revision', label: :label_change_plural,
+          url: { :action => 'revision',
+                 :id     => @project,
+                 :repository_id => @repository.identifier_param,
+                 :path   => nil,
+                 :rev    => @changeset.identifier}
+        }
+
+tabs << { name: 'diff', label: :label_view_diff,
+          url: { :action => 'diff',
+                 :id     => @project,
+                 :repository_id => @repository.identifier_param,
+                 :path   => "",
+                 :rev    => @changeset.identifier }
+        } if action_name == 'diff' || @changeset.filechanges.any?
+%>
+
+<%= render :partial => 'common/tabs', :locals => {:tabs => tabs, :selected_tab => action_name} %>
+<% end %>
index 9d6116f5ffe986cd6148bb2a67f5a3051600899d..5c215c0ebe95e97e42476c23a533abd0f642d11d 100644 (file)
@@ -29,7 +29,6 @@
 <%= render :partial => 'changeset' %>
 
 <% if User.current.allowed_to?(:browse_repository, @project) %>
-<h3><%= l(:label_attachment_plural) %></h3>
 <ul id="changes-legend">
 <li class="change change-A"><%= l(:label_added)    %></li>
 <li class="change change-M"><%= l(:label_modified) %></li>
 <li class="change change-D"><%= l(:label_deleted)  %></li>
 </ul>
 
-<p><%= link_to(l(:label_view_diff),
-               :action => 'diff',
-               :id     => @project,
-               :repository_id => @repository.identifier_param,
-               :path   => "",
-               :rev    => @changeset.identifier) if @changeset.filechanges.any? %></p>
-
 <div class="changeset-changes">
 <%= render_changeset_changes %>
 </div>