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