Commit eb32abcaba33b5213a71aff3ba3079821299a13f
- Date: Tue Apr 29 05:25:43 +0000 2008
- Committer: David A. Cuadrado (krawek@gmail.com)
- Author: David A. Cuadrado (krawek@gmail.com)
- Commit SHA1: eb32abcaba33b5213a71aff3ba3079821299a13f
- Tree SHA1: 24e1a618b3459776e065d29d0c94255602347fe5
Added method to link file path to blob
Signed-off-by: David A. Cuadrado <krawek@gmail.com>
Commit diff
| |   |
| 235 | 235 | text = repository.git.git.show({}, "master:#{possibilities.first}") |
| 236 | 236 | markdown(text) rescue text.gsub("\n", "<br/>") |
| 237 | 237 | end |
| 238 | |
| 239 | def file_path(repository, filename, head = "master") |
| 240 | project_repository_blob_path(repository.project, repository, head, filename) |
| 241 | end |
| 238 | 242 | end |
| toggle raw diff |
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -235,4 +235,8 @@ module ApplicationHelper
text = repository.git.git.show({}, "master:#{possibilities.first}")
markdown(text) rescue text.gsub("\n", "<br/>")
end
+
+ def file_path(repository, filename, head = "master")
+ project_repository_blob_path(repository.project, repository, head, filename)
+ end
end |
| |   |
| 25 | 25 | <%= render_diffmode_selector -%> |
| 26 | 26 | <% @diffs.each do |file| -%> |
| 27 | 27 | <a name="<%= h(file.a_path) -%>"></a> |
| 28 | | <h4><%=h(file.a_path) -%></h4> |
| 28 | <h4><%=link_to h(file.a_path), file_path(@repository, file.a_path) -%></h4> |
| 29 | 29 | <%= render_diff(file.diff, @diffmode) -%> |
| 30 | 30 | <% end -%> |
| 31 | 31 | <% end -%> |
| toggle raw diff |
--- a/app/views/commits/show.html.erb
+++ b/app/views/commits/show.html.erb
@@ -25,7 +25,7 @@
<%= render_diffmode_selector -%>
<% @diffs.each do |file| -%>
<a name="<%= h(file.a_path) -%>"></a>
- <h4><%=h(file.a_path) -%></h4>
+ <h4><%=link_to h(file.a_path), file_path(@repository, file.a_path) -%></h4>
<%= render_diff(file.diff, @diffmode) -%>
<% end -%>
<% end -%> |