summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-05-14 14:01:12 -0500
committerDouwe Maan <douwe@selenight.nl>2017-05-17 13:33:39 -0500
commit82c2296a1274b6e7c3bb3031a7e903c01bc8a3c4 (patch)
tree792f348e0561a7c28219a71a409c51eb1d30989b /app/views
parentd4d9b731c41cdb4a8b933edff34bd9c9ddf1403a (diff)
downloadgitlab-ce-82c2296a1274b6e7c3bb3031a7e903c01bc8a3c4.tar.gz
Add auxiliary viewer for READMEdm-readme-viewer
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 8af945ddb2c..f5cf8514df2 100644
--- a/app/views/projects/blob/_blob.html.haml
+++ b/app/views/projects/blob/_blob.html.haml
@@ -6,10 +6,7 @@
- blob_commit = @repository.last_commit_for_path(@commit.id, blob.path)
= render blob_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)