diff options
author | Robert Speicher <robert@gitlab.com> | 2017-03-16 23:03:37 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-03-16 23:03:37 +0000 |
commit | 0c8a2edfab91d098cf586a4c0d4a7fdc87aff670 (patch) | |
tree | 90fd24fd574496104d077695dfa3559d6b186cb5 /app/views/shared | |
parent | bd2b76cecac2aeda67b998a36e6a739d632bb824 (diff) | |
parent | 82cc38d7d871f70ba5ee5a8848c471490da3b40d (diff) | |
download | gitlab-ce-0c8a2edfab91d098cf586a4c0d4a7fdc87aff670.tar.gz |
Merge branch 'add-blob-copy-button' into 'master'
Add copy button to blob header and use icon for Raw button
See merge request !9878
Diffstat (limited to 'app/views/shared')
-rw-r--r-- | app/views/shared/snippets/_blob.html.haml | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/app/views/shared/snippets/_blob.html.haml b/app/views/shared/snippets/_blob.html.haml index ad5c0c2d8c8..74f71e6cbd1 100644 --- a/app/views/shared/snippets/_blob.html.haml +++ b/app/views/shared/snippets/_blob.html.haml @@ -1,7 +1,25 @@ -- unless @snippet.content.empty? +.js-file-title.file-title-flex-parent + .file-header-content + = blob_icon @snippet.mode, @snippet.path + + %strong.file-title-name + = @snippet.path + + = copy_file_path_button(@snippet.path) + + .file-actions.hidden-xs + .btn-group{ role: "group" }< + = copy_blob_content_button(@snippet) + = open_raw_file_button(raw_path) + + - 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) - %textarea.markdown-snippet-copy.blob-content{ data: { blob_id: @snippet.id } } - = @snippet.content .file-content.wiki - if gitlab_markdown?(@snippet.file_name) = preserve(markdown_field(@snippet, :content)) @@ -9,6 +27,3 @@ = render_markup(@snippet.file_name, @snippet.content) - else = render 'shared/file_highlight', blob: @snippet -- else - .file-content.code - .nothing-here-block Empty file |