Commit 6739c48a17058ea752006e152af1539ddec1337f
- Date: Mon Mar 03 22:03:26 +0000 2008
- Committer: Johan Sørensen (johan@johansorensen.com)
- Author: Johan Sørensen (johan@johansorensen.com)
- Commit SHA1: 6739c48a17058ea752006e152af1539ddec1337f
- Tree SHA1: 1bb17679456592e9eb291b49215a5142c009654f
Use the proper sha1'ed path as the blob cache key
Commit diff
| |   |
| 15 | 15 | <small>(<%= link_to "raw blob data", raw_blob_path(@commit.id, current_path) -%>)</small> |
| 16 | 16 | </h1> |
| 17 | 17 | <!-- <%= @blob.mime_type -%> --> |
| 18 | |
| 18 | 19 | <%= breadcrumb_path(@repository.name, @commit.id) -%> |
| 19 | 20 | |
| 20 | 21 | <% if @blob.mime_type =~ /^text/ && !too_big_to_render?(@blob.size) -%> |
| 21 | | <% cache do -%> |
| 22 | <% cache(blob_path(@commit.id, params[:path])) do -%> |
| 22 | 23 | <%= render_highlighted(@blob.data, current_path.last || "") -%> |
| 23 | 24 | <% end -%> |
| 24 | 25 | <% elsif too_big_to_render?(@blob.size) && @blob.mime_type =~ /^text/ -%> |
| … | … | |
| 28 | 28 | <%= link_to "try viewing the raw data", raw_blob_path(@commit.id, current_path) -%> |
| 29 | 29 | </p> |
| 30 | 30 | <% elsif @blob.mime_type =~ /^image/ -%> |
| 31 | | <% cache do -%> |
| 31 | <% cache(blob_path(@commit.id, params[:path])) do -%> |
| 32 | 32 | <%= image_tag raw_blob_path(@commit.id, current_path) -%> |
| 33 | 33 | <% end -%> |
| 34 | 34 | <% else -%> |
| toggle raw diff |
--- a/app/views/browse/blob.html.erb
+++ b/app/views/browse/blob.html.erb
@@ -15,10 +15,11 @@
<small>(<%= link_to "raw blob data", raw_blob_path(@commit.id, current_path) -%>)</small>
</h1>
<!-- <%= @blob.mime_type -%> -->
+
<%= breadcrumb_path(@repository.name, @commit.id) -%>
<% if @blob.mime_type =~ /^text/ && !too_big_to_render?(@blob.size) -%>
- <% cache do -%>
+ <% cache(blob_path(@commit.id, params[:path])) do -%>
<%= render_highlighted(@blob.data, current_path.last || "") -%>
<% end -%>
<% elsif too_big_to_render?(@blob.size) && @blob.mime_type =~ /^text/ -%>
@@ -27,7 +28,7 @@
<%= link_to "try viewing the raw data", raw_blob_path(@commit.id, current_path) -%>
</p>
<% elsif @blob.mime_type =~ /^image/ -%>
- <% cache do -%>
+ <% cache(blob_path(@commit.id, params[:path])) do -%>
<%= image_tag raw_blob_path(@commit.id, current_path) -%>
<% end -%>
<% else -%> |