Extract tree/readme partial
This commit is contained in:
parent
5cff72ad1e
commit
1f4d8eac24
10
app/views/tree/_readme.html.haml
Normal file
10
app/views/tree/_readme.html.haml
Normal 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)
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue