diff options
-rw-r--r-- | app/views/tree/_readme.html.haml | 10 | ||||
-rw-r--r-- | app/views/tree/_tree.html.haml | 15 |
2 files changed, 13 insertions, 12 deletions
diff --git a/app/views/tree/_readme.html.haml b/app/views/tree/_readme.html.haml new file mode 100644 index 00000000000..4e5f4b403c5 --- /dev/null +++ b/app/views/tree/_readme.html.haml @@ -0,0 +1,10 @@ +.file_holder#README + .file_title + %i.icon-file + = readme.name + .file_content.wiki + - if gitlab_markdown?(readme.name) + = preserve do + = markdown(readme.data) + - else + = raw GitHub::Markup.render(readme.name, readme.data)
\ No newline at end of file diff --git a/app/views/tree/_tree.html.haml b/app/views/tree/_tree.html.haml index 57d04071205..08a83b9b272 100644 --- a/app/views/tree/_tree.html.haml +++ b/app/views/tree/_tree.html.haml @@ -12,7 +12,7 @@ %div#tree-content-holder.tree-content-holder - if tree.is_blob? - = render partial: "tree/blob", object: tree + = render "tree/blob", blob: tree - else %table#tree-slider{class: "table_#{@hex_path} tree-table" } %thead @@ -32,17 +32,8 @@ = render_tree(tree.contents) - - if content = tree.contents.find { |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i } - .file_holder#README - .file_title - %i.icon-file - = content.name - .file_content.wiki - - if gitlab_markdown?(content.name) - = preserve do - = markdown(content.data) - - else - = raw GitHub::Markup.render(content.name, content.data) + - if readme = tree.contents.find { |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i } + = render "tree/readme", readme: readme - unless tree.is_blob? :javascript |