diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-05-14 14:01:12 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-05-17 13:33:39 -0500 |
commit | 82c2296a1274b6e7c3bb3031a7e903c01bc8a3c4 (patch) | |
tree | 792f348e0561a7c28219a71a409c51eb1d30989b /app/views | |
parent | d4d9b731c41cdb4a8b933edff34bd9c9ddf1403a (diff) | |
download | gitlab-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.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 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) |