Commit 61e6751ea676d23f5ef88de6d0bf9c273f785516

Authored by Sairam Kunala
1 parent edeb20e9

bug fix: history in commit history not working as expected for tags and branches

app/views/projects/_tree.html.haml
@@ -30,15 +30,15 @@ @@ -30,15 +30,15 @@
30 %th Last Update 30 %th Last Update
31 %th 31 %th
32 Last commit 32 Last commit
33 - = link_to "history", project_commits_path(@project, :path => params[:path]), :class => "right" 33 + = link_to "history", project_commits_path(@project, :path => params[:path], :branch => params[:branch],:tag => params[:tag]), :class => "right"
34 - if params[:path] 34 - if params[:path]
35 - file = File.join(params[:path], "..") 35 - file = File.join(params[:path], "..")
36 %tr{ :class => "tree-item", :url => tree_file_project_path(@project, @commit.id, file) } 36 %tr{ :class => "tree-item", :url => tree_file_project_path(@project, @commit.id, file) }
37 %td.tree-item-file-name 37 %td.tree-item-file-name
38 = image_tag "dir.png" 38 = image_tag "dir.png"
39 = link_to "..", tree_file_project_path(@project, @commit.id, file, :branch => @branch, :tag => @tag), :remote => :true 39 = link_to "..", tree_file_project_path(@project, @commit.id, file, :branch => @branch, :tag => @tag), :remote => :true
40 - %td  
41 - %td 40 + %td
  41 + %td
42 42
43 - contents.select{ |i| i.is_a?(Grit::Tree)}.each do |content| 43 - contents.select{ |i| i.is_a?(Grit::Tree)}.each do |content|
44 = render :partial => "projects/tree_item", :locals => { :content => content } 44 = render :partial => "projects/tree_item", :locals => { :content => content }
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 }); 52 });
53 53
54 - if params[:path] && request.xhr? 54 - if params[:path] && request.xhr?
55 - :javascript 55 + :javascript
56 $(window).unbind('popstate'); 56 $(window).unbind('popstate');
57 $(window).bind('popstate', function() { 57 $(window).bind('popstate', function() {
58 if(location.pathname.search("tree") != -1) { 58 if(location.pathname.search("tree") != -1) {
app/views/projects/_tree_file.html.haml
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 %strong 4 %strong
5 = name 5 = name
6 = link_to "raw", blob_project_path(@project, :commit_id => @commit.id, :path => params[:path] ), :class => "right", :target => "_blank" 6 = link_to "raw", blob_project_path(@project, :commit_id => @commit.id, :path => params[:path] ), :class => "right", :target => "_blank"
7 - = link_to "history", project_commits_path(@project, :path => params[:path]), :class => "right", :style => "margin-right:10px;" 7 + = link_to "history", project_commits_path(@project, :path => params[:path], :branch => params[:branch], :tag => params[:tag] ), :class => "right", :style => "margin-right:10px;"
8 %br/ 8 %br/
9 - if file.text? 9 - if file.text?
10 .view_file_content 10 .view_file_content
@@ -14,6 +14,6 @@ @@ -14,6 +14,6 @@
14 .view_file_content_image 14 .view_file_content_image
15 %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} 15 %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
16 - else 16 - else
17 - %p 17 + %p
18 %center No preview for this file type 18 %center No preview for this file type
19 19