diff options
Diffstat (limited to 'app/views/shared/snippets')
-rw-r--r-- | app/views/shared/snippets/_embed.html.haml | 10 | ||||
-rw-r--r-- | app/views/shared/snippets/_form.html.haml | 3 | ||||
-rw-r--r-- | app/views/shared/snippets/_header.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/snippets/_snippet.html.haml | 6 | ||||
-rw-r--r-- | app/views/shared/snippets/show.js.haml | 2 |
5 files changed, 12 insertions, 11 deletions
diff --git a/app/views/shared/snippets/_embed.html.haml b/app/views/shared/snippets/_embed.html.haml index f1abd3a2ce4..f698e1a301b 100644 --- a/app/views/shared/snippets/_embed.html.haml +++ b/app/views/shared/snippets/_embed.html.haml @@ -5,17 +5,17 @@ %strong.file-title-name %a.gitlab-embedded-snippets-title{ href: url_for(only_path: false, overwrite_params: nil) } - = @blob.name + = blob.name %small - = number_to_human_size(@blob.raw_size) + = number_to_human_size(blob.size) %a.gitlab-logo-wrapper{ href: url_for(only_path: false, overwrite_params: nil), title: 'view on gitlab' } %img.gitlab-logo{ src: image_url('ext_snippet_icons/logo.svg'), alt: "GitLab logo" } .file-actions.d-none.d-sm-block .btn-group{ role: "group" }< - = embedded_raw_snippet_button + = embedded_raw_snippet_button(@snippet, blob) - = embedded_snippet_download_button + = embedded_snippet_download_button(@snippet, blob) %article.file-holder.snippet-file-content - = render 'projects/blob/viewer', viewer: @blob.simple_viewer, load_async: false, external_embed: true + = render 'projects/blob/viewer', viewer: blob.simple_viewer, load_async: false, external_embed: true diff --git a/app/views/shared/snippets/_form.html.haml b/app/views/shared/snippets/_form.html.haml index 7f307f33b51..81277b50d13 100644 --- a/app/views/shared/snippets/_form.html.haml +++ b/app/views/shared/snippets/_form.html.haml @@ -29,7 +29,8 @@ .js-file-title.file-title-flex-parent = f.text_field :file_name, placeholder: s_("Snippets|Give your file a name to add code highlighting, e.g. example.rb for Ruby"), class: 'form-control js-snippet-file-name', data: { qa_selector: 'file_name_field' } .file-content.code - %pre#editor{ data: { 'editor-loading': true } }= @snippet.content + #editor{ data: { 'editor-loading': true } }< + %pre.editor-loading-content= @snippet.content = f.hidden_field :content, class: 'snippet-file-content' .form-group diff --git a/app/views/shared/snippets/_header.html.haml b/app/views/shared/snippets/_header.html.haml index 36b6bfd061f..d6019e45b25 100644 --- a/app/views/shared/snippets/_header.html.haml +++ b/app/views/shared/snippets/_header.html.haml @@ -3,7 +3,7 @@ .snippet-box.has-tooltip.inline.gl-mr-2{ title: snippet_visibility_level_description(@snippet.visibility_level, @snippet), data: { container: "body" } } %span.sr-only = visibility_level_label(@snippet.visibility_level) - = visibility_level_icon(@snippet.visibility_level, fw: false) + = visibility_level_icon(@snippet.visibility_level) %span.creator Authored = time_ago_with_tooltip(@snippet.created_at, placement: 'bottom', html_class: 'snippet_updated_ago') diff --git a/app/views/shared/snippets/_snippet.html.haml b/app/views/shared/snippets/_snippet.html.haml index b2c9a74b177..25e31fd519b 100644 --- a/app/views/shared/snippets/_snippet.html.haml +++ b/app/views/shared/snippets/_snippet.html.haml @@ -10,13 +10,13 @@ %ul.controls %li - = link_to gitlab_snippet_path(snippet, anchor: 'notes'), class: ('no-comments' if notes_count.zero?) do - = sprite_icon('comments', size: 16, css_class: 'gl-vertical-align-text-bottom') + = link_to gitlab_snippet_path(snippet, anchor: 'notes'), class: ('no-comments' if notes_count == 0) do + = sprite_icon('comments', css_class: 'gl-vertical-align-text-bottom') = notes_count %li %span.sr-only = visibility_level_label(snippet.visibility_level) - = visibility_level_icon(snippet.visibility_level, fw: false) + = visibility_level_icon(snippet.visibility_level) .snippet-info #{snippet.to_reference} · diff --git a/app/views/shared/snippets/show.js.haml b/app/views/shared/snippets/show.js.haml index d552c1a723b..23cebc97f63 100644 --- a/app/views/shared/snippets/show.js.haml +++ b/app/views/shared/snippets/show.js.haml @@ -1,2 +1,2 @@ document.write('#{escape_javascript(stylesheet_link_tag("#{stylesheet_url 'snippets'}"))}'); -document.write('#{escape_javascript(render('shared/snippets/embed'))}'); +document.write('#{escape_javascript(render(partial: 'shared/snippets/embed', collection: @blobs, as: :blob))}'); |