Merge branch 'master' into 8876-work-unit
[arvados.git] / apps / workbench / app / controllers / repositories_controller.rb
1 class RepositoriesController < ApplicationController
2   before_filter :set_share_links, if: -> { defined? @object }
3
4   def index_pane_list
5     %w(recent help)
6   end
7
8   def show_pane_list
9     if @user_is_manager
10       panes = super | %w(Sharing)
11       panes.insert(panes.length-1, panes.delete_at(panes.index('Advanced'))) if panes.index('Advanced')
12       panes
13     else
14       panes = super
15     end
16     panes.delete('Attributes') if !current_user.is_admin
17     panes
18   end
19
20   def show_tree
21     @commit = params[:commit]
22     @path = params[:path] || ''
23     @subtree = @object.ls_subtree @commit, @path.chomp('/')
24   end
25
26   def show_blob
27     @commit = params[:commit]
28     @path = params[:path]
29     @blobdata = @object.cat_file @commit, @path
30   end
31
32   def show_commit
33     @commit = params[:commit]
34   end
35 end