Commit 899afd0067065be6b15d7b737100b82757421828

Authored by Dmitriy Zaporozhets
1 parent 29636d4d

Fix snippet render issue cause of haml preserve

app/views/snippets/_blob.html.haml 0 → 100644
... ... @@ -0,0 +1,13 @@
  1 +.file_holder
  2 + .file_title
  3 + %i.icon-file
  4 + %strong= @snippet.file_name
  5 + %span.options
  6 + = link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn very_small", target: "_blank"
  7 + .file_content.code
  8 + - unless @snippet.content.empty?
  9 + %div{class: current_user.dark_scheme ? "black" : "white"}
  10 + :preserve
  11 + #{raw @snippet.colorize(formatter: :gitlab)}
  12 + - else
  13 + %p.nothing_here_message Empty file
... ...
app/views/snippets/show.html.haml
... ... @@ -7,24 +7,5 @@
7 7 = link_to "Edit", edit_project_snippet_path(@project, @snippet), class: "btn small right"
8 8  
9 9 %br
10   -
11   -%div
12   - .file_holder
13   - .file_title
14   - %i.icon-file
15   - %strong= @snippet.file_name
16   - %span.options
17   - = link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn very_small", target: "_blank"
18   - .file_content.code
19   - - unless @snippet.content.empty?
20   - %div{class: current_user.dark_scheme ? "black" : "white"}
21   - = preserve do
22   - = raw Pygments.highlight(@snippet.content, formatter: :gitlab)
23   - - else
24   - %h4.nothing_here_message Empty file
25   -
26   -
27   -.clearfix
28   -
29   -%div#notes
30   - = render "notes/notes_with_form", tid: @snippet.id, tt: "snippet"
  10 +%div= render 'blob'
  11 +%div#notes= render "notes/notes_with_form", tid: @snippet.id, tt: "snippet"
... ...
app/views/tree/blob/_text.html.haml
... ... @@ -12,4 +12,4 @@
12 12 = preserve do
13 13 = raw blob.colorize(formatter: :gitlab)
14 14 - else
15   - %h4.nothing_here_message Empty file
  15 + %p.nothing_here_message Empty file
... ...