diff options
author | Rémy Coutable <remy@rymai.me> | 2017-05-18 07:30:11 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-05-18 07:30:11 +0000 |
commit | c9e61fa3cd8eeb63aced9a55039dc4d17616cd42 (patch) | |
tree | 5cacc30a4e206f678263d9f2be4c759879de0aab /app/views | |
parent | 0b946a7bc69058a952a558a9530cd3e8302361e7 (diff) | |
parent | 82c2296a1274b6e7c3bb3031a7e903c01bc8a3c4 (diff) | |
download | gitlab-ce-c9e61fa3cd8eeb63aced9a55039dc4d17616cd42.tar.gz |
Merge branch 'dm-readme-viewer' into 'master'
Add auxiliary blob viewer for README
See merge request !11366
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/blob/_auxiliary_viewer.html.haml | 5 | ||||
-rw-r--r-- | app/views/projects/blob/_blob.html.haml | 5 | ||||
-rw-r--r-- | app/views/projects/blob/viewers/_readme.html.haml | 4 |
3 files changed, 10 insertions, 4 deletions
diff --git a/app/views/projects/blob/_auxiliary_viewer.html.haml b/app/views/projects/blob/_auxiliary_viewer.html.haml new file mode 100644 index 00000000000..9749afdc580 --- /dev/null +++ b/app/views/projects/blob/_auxiliary_viewer.html.haml @@ -0,0 +1,5 @@ +- blob = local_assigns.fetch(:blob) +- auxiliary_viewer = blob.auxiliary_viewer +- if auxiliary_viewer && auxiliary_viewer.render_error.nil? && auxiliary_viewer.visible_to?(current_user) + .well-segment.blob-auxiliary-viewer + = render 'projects/blob/viewer', viewer: auxiliary_viewer diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml index c90a7440480..8bd336269ff 100644 --- a/app/views/projects/blob/_blob.html.haml +++ b/app/views/projects/blob/_blob.html.haml @@ -5,10 +5,7 @@ %ul.blob-commit-info = render 'projects/commits/commit', commit: @last_commit, project: @project, ref: @ref - - auxiliary_viewer = blob.auxiliary_viewer - - if auxiliary_viewer && !auxiliary_viewer.render_error - .well-segment.blob-auxiliary-viewer - = render 'projects/blob/viewer', viewer: auxiliary_viewer + = render "projects/blob/auxiliary_viewer", blob: blob #blob-content-holder.blob-content-holder %article.file-holder diff --git a/app/views/projects/blob/viewers/_readme.html.haml b/app/views/projects/blob/viewers/_readme.html.haml new file mode 100644 index 00000000000..334b33faf48 --- /dev/null +++ b/app/views/projects/blob/viewers/_readme.html.haml @@ -0,0 +1,4 @@ += icon('info-circle fw') += succeed '.' do + To learn more about this project, read + = link_to "the wiki", namespace_project_wikis_path(viewer.project.namespace, viewer.project) |