diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-07-06 22:21:08 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-07-07 00:19:10 +0300 |
commit | d195db17e9ff62c3dbfb8ba03dacadf965b1fb8b (patch) | |
tree | 58157f1909c4f04306d10be5b842f99a79f9b809 /app/models/blob_viewer | |
parent | bb918a2fd98136c232baa34104c357f3716f8842 (diff) |
Don't show auxiliary blob viewer for README when there is no wiki
Diffstat (limited to 'app/models/blob_viewer')
-rw-r--r-- | app/models/blob_viewer/readme.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/blob_viewer/readme.rb b/app/models/blob_viewer/readme.rb index 75c373a03bb..4604a9934a0 100644 --- a/app/models/blob_viewer/readme.rb +++ b/app/models/blob_viewer/readme.rb @@ -10,5 +10,11 @@ module BlobViewer def visible_to?(current_user) can?(current_user, :read_wiki, project) end + + def render_error + return if project.has_external_wiki? || (project.wiki_enabled? && project.wiki.has_home_page?) + + :no_wiki + end end end |