summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-05-18 07:30:11 +0000
committerRémy Coutable <remy@rymai.me>2017-05-18 07:30:11 +0000
commitc9e61fa3cd8eeb63aced9a55039dc4d17616cd42 (patch)
tree5cacc30a4e206f678263d9f2be4c759879de0aab /app/views
parent0b946a7bc69058a952a558a9530cd3e8302361e7 (diff)
parent82c2296a1274b6e7c3bb3031a7e903c01bc8a3c4 (diff)
downloadgitlab-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.haml5
-rw-r--r--app/views/projects/blob/_blob.html.haml5
-rw-r--r--app/views/projects/blob/viewers/_readme.html.haml4
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)