gitlab-org--gitlab-foss/app/models/blob_viewer
2017-07-06 16:19:10 -05:00
..
auxiliary.rb
balsamiq.rb
base.rb Detect if file that appears to be text in the first 1024 bytes is actually binary afer loading all data 2017-06-08 12:49:03 -05:00
binary_stl.rb
cartfile.rb
changelog.rb
client_side.rb
composer_json.rb
contributing.rb
dependency_manager.rb
download.rb
empty.rb Empty blob viewer isn’t binary-only 2017-06-07 14:31:05 -05:00
gemfile.rb
gemspec.rb
gitlab_ci_yml.rb
godeps_json.rb
image.rb
license.rb
markup.rb
notebook.rb
package_json.rb
pdf.rb
podfile.rb
podspec.rb
podspec_json.rb
readme.rb Don't show auxiliary blob viewer for README when there is no wiki 2017-07-06 16:19:10 -05:00
requirements_txt.rb
rich.rb
route_map.rb
server_side.rb Implement diff viewers 2017-06-14 10:12:21 -05:00
simple.rb
sketch.rb
static.rb
svg.rb
text.rb
text_stl.rb
video.rb
yarn_lock.rb

module BlobViewer
  class Readme < Base
    include Auxiliary
    include Static

    self.partial_name = 'readme'
    self.file_types = %i(readme)
    self.binary = false

    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