summaryrefslogtreecommitdiff
path: root/app/presenters/snippet_blob_presenter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/presenters/snippet_blob_presenter.rb')
-rw-r--r--app/presenters/snippet_blob_presenter.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/presenters/snippet_blob_presenter.rb b/app/presenters/snippet_blob_presenter.rb
index 0003a13a7bc..ab8fc0f905b 100644
--- a/app/presenters/snippet_blob_presenter.rb
+++ b/app/presenters/snippet_blob_presenter.rb
@@ -17,6 +17,10 @@ class SnippetBlobPresenter < BlobPresenter
snippet_blob_raw_route
end
+ def raw_directory
+ raw_path.rpartition("/").first + "/"
+ end
+
def raw_plain_data
blob.data unless blob.binary?
end
@@ -33,7 +37,7 @@ class SnippetBlobPresenter < BlobPresenter
def render_rich_partial
renderer.render("projects/blob/viewers/_#{blob.rich_viewer.partial_name}",
- locals: { viewer: blob.rich_viewer, blob: blob, blob_raw_path: raw_path, blob_raw_url: raw_url },
+ locals: { viewer: blob.rich_viewer, blob: blob, blob_raw_path: raw_path, blob_raw_url: raw_url, parent_dir_raw_path: raw_directory },
layout: false)
end