tree_controller.rb 574 Bytes
Newer Older
1
# Controller for viewing a repository's file structure
2
class TreeController < ProjectResourceController
3
  include ExtractsPath
4 5 6 7 8 9

  # Authorize
  before_filter :authorize_read_project!
  before_filter :authorize_code_access!
  before_filter :require_non_empty_project

10
  before_filter :assign_ref_vars
11 12

  def show
13 14
    @hex_path  = Digest::SHA1.hexdigest(@path)
    @logs_path = logs_file_project_ref_path(@project, @ref, @path)
15

16 17 18 19 20 21 22
    respond_to do |format|
      format.html
      # Disable cache so browser history works
      format.js { no_cache_headers }
    end
  end
end