gitlab-org--gitlab-foss/app/models/blob_viewer
2017-09-12 22:32:02 +03:00
..
auxiliary.rb Consistent diff and blob size limit names 2017-05-29 17:02:02 -05:00
balsamiq.rb
base.rb Clean up some backend 2017-08-03 14:29:35 +02:00
binary_stl.rb
cartfile.rb
changelog.rb
client_side.rb Consistent diff and blob size limit names 2017-05-29 17:02:02 -05:00
composer_json.rb Fix external link to Composer website 2017-08-17 12:54:30 +07:00
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 move lib/ci/gitlab_ci_yaml_processor.rb into lib/gitlab/ci/yaml_processor.rb 2017-09-12 22:32:02 +03:00
godeps_json.rb
image.rb
license.rb
markup.rb
notebook.rb Enable Layout/TrailingWhitespace cop and auto-correct offenses 2017-08-15 13:44:37 -04:00
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 Clean up some backend 2017-08-03 14:29:35 +02:00
simple.rb
sketch.rb
static.rb
svg.rb
text.rb Consistent diff and blob size limit names 2017-05-29 17:02:02 -05:00
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