Extract tree/readme partial

This commit is contained in:
Riyad Preukschas 2012-10-15 20:51:03 +02:00
parent 5cff72ad1e
commit 1f4d8eac24
2 changed files with 13 additions and 12 deletions

View file

@ -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)

View file

@ -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