diff options
author | Robert Speicher <robert@gitlab.com> | 2017-05-18 14:53:29 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-05-18 14:53:29 +0000 |
commit | a30aa411a7163377d528ae18aa8706c23e2c6f03 (patch) | |
tree | 6d7cdbd5e8b8a8a7d7bc840c6f4b5f4cedbd04ad | |
parent | 6319ca271cd8de4595af136542b79367f28d211f (diff) | |
parent | 162f6f53630f383cd811c86b02c7c1019e9fa6c9 (diff) | |
download | gitlab-ce-a30aa411a7163377d528ae18aa8706c23e2c6f03.tar.gz |
Merge branch 'dm-empty-tree-readme' into 'master'
Don't blow up when a tree readme is empty and consequently has no rich viewer
Closes #32396
See merge request !11459
-rw-r--r-- | app/views/projects/tree/_readme.html.haml | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/app/views/projects/tree/_readme.html.haml b/app/views/projects/tree/_readme.html.haml index 2c2f64283f5..de57cd4ba00 100644 --- a/app/views/projects/tree/_readme.html.haml +++ b/app/views/projects/tree/_readme.html.haml @@ -1,8 +1,9 @@ -%article.file-holder.readme-holder - .js-file-title.file-title - = blob_icon readme.mode, readme.name - = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@ref, readme.path)) do - %strong - = readme.name +- if readme.rich_viewer + %article.file-holder.readme-holder + .js-file-title.file-title + = blob_icon readme.mode, readme.name + = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@ref, readme.path)) do + %strong + = readme.name - = render 'projects/blob/viewer', viewer: readme.rich_viewer, viewer_url: namespace_project_blob_path(@project.namespace, @project, tree_join(@ref, readme.path), viewer: :rich, format: :json) + = render 'projects/blob/viewer', viewer: readme.rich_viewer, viewer_url: namespace_project_blob_path(@project.namespace, @project, tree_join(@ref, readme.path), viewer: :rich, format: :json) |