diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/blob/_header.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/blob/viewers/_markup.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/snippets/show.html.haml | 2 | ||||
-rw-r--r-- | app/views/search/results/_snippet_blob.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/snippets/_blob.html.haml | 29 | ||||
-rw-r--r-- | app/views/snippets/show.html.haml | 2 |
6 files changed, 18 insertions, 22 deletions
diff --git a/app/views/projects/blob/_header.html.haml b/app/views/projects/blob/_header.html.haml index b89cd460455..638f8cef3bd 100644 --- a/app/views/projects/blob/_header.html.haml +++ b/app/views/projects/blob/_header.html.haml @@ -16,7 +16,7 @@ .btn-group{ role: "group" }< = copy_blob_source_button(blob) if !blame && blob.rendered_as_text?(ignore_errors: false) - = open_raw_file_button(namespace_project_raw_path(@project.namespace, @project, @id)) + = open_raw_blob_button = view_on_environment_button(@commit.sha, @path, @environment) if @environment .btn-group{ role: "group" }< diff --git a/app/views/projects/blob/viewers/_markup.html.haml b/app/views/projects/blob/viewers/_markup.html.haml index b9a998d96ff..230305b488d 100644 --- a/app/views/projects/blob/viewers/_markup.html.haml +++ b/app/views/projects/blob/viewers/_markup.html.haml @@ -1,3 +1,4 @@ - blob = viewer.blob +- rendered_markup = blob.rendered_markup if blob.respond_to?(:rendered_markup) .file-content.wiki - = markup(blob.name, blob.data) + = markup(blob.name, blob.data, rendered: rendered_markup) diff --git a/app/views/projects/snippets/show.html.haml b/app/views/projects/snippets/show.html.haml index 7c6be003d4c..7a175f63eeb 100644 --- a/app/views/projects/snippets/show.html.haml +++ b/app/views/projects/snippets/show.html.haml @@ -4,7 +4,7 @@ .project-snippets %article.file-holder.snippet-file-content - = render 'shared/snippets/blob', raw_path: raw_namespace_project_snippet_path(@project.namespace, @project, @snippet) + = render 'shared/snippets/blob' .row-content-block.top-block.content-component-block = render 'award_emoji/awards_block', awardable: @snippet, inline: true diff --git a/app/views/search/results/_snippet_blob.html.haml b/app/views/search/results/_snippet_blob.html.haml index f2fe5742c12..c4a5131c1a7 100644 --- a/app/views/search/results/_snippet_blob.html.haml +++ b/app/views/search/results/_snippet_blob.html.haml @@ -39,7 +39,7 @@ .blob-content - snippet_chunks.each do |chunk| - unless chunk[:data].empty? - = highlight(snippet.file_name, chunk[:data], repository: nil, plain: snippet.no_highlighting?) + = highlight(snippet.file_name, chunk[:data], repository: nil, plain: snippet.blob.no_highlighting?) - else .file-content.code .nothing-here-block Empty file diff --git a/app/views/shared/snippets/_blob.html.haml b/app/views/shared/snippets/_blob.html.haml index 37c66ff2595..0c481120969 100644 --- a/app/views/shared/snippets/_blob.html.haml +++ b/app/views/shared/snippets/_blob.html.haml @@ -1,29 +1,24 @@ +- blob = @snippet.blob .js-file-title.file-title-flex-parent .file-header-content - = blob_icon @snippet.mode, @snippet.path + = blob_icon blob.mode, blob.path %strong.file-title-name - = @snippet.path + = blob.path - = copy_file_path_button(@snippet.path) + = copy_file_path_button(blob.path) + + %small + = number_to_human_size(blob.raw_size) .file-actions.hidden-xs + = render 'projects/blob/viewer_switcher', blob: blob + .btn-group{ role: "group" }< - = copy_blob_source_button(@snippet) - = open_raw_file_button(raw_path) + = copy_blob_source_button(blob) + = open_raw_blob_button - if defined?(download_path) && download_path = link_to icon('download'), download_path, class: "btn btn-sm has-tooltip", title: 'Download', data: { container: 'body' } -- if @snippet.content.empty? - .file-content.code - .nothing-here-block Empty file -- else - - if markup?(@snippet.file_name) - .file-content.wiki - - if gitlab_markdown?(@snippet.file_name) - = preserve(markdown_field(@snippet, :content)) - - else - = markup(@snippet.file_name, @snippet.content) - - else - = render 'shared/file_highlight', blob: @snippet += render 'projects/blob/content', blob: blob diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml index e5711ca79c7..8a80013bbfd 100644 --- a/app/views/snippets/show.html.haml +++ b/app/views/snippets/show.html.haml @@ -3,7 +3,7 @@ = render 'shared/snippets/header' %article.file-holder.snippet-file-content - = render 'shared/snippets/blob', raw_path: raw_snippet_path(@snippet), download_path: download_snippet_path(@snippet) + = render 'shared/snippets/blob', download_path: download_snippet_path(@snippet) .row-content-block.top-block.content-component-block = render 'award_emoji/awards_block', awardable: @snippet, inline: true |