Merge branch '6941-docs-fix-www-data' closes #6941
[arvados.git] / apps / workbench / app / controllers / repositories_controller.rb
index 5dd9288e121e6f355b4ef8dfbe97832ed25b9a8e..c5b3501b328e1214cc00c292c19f61d0be07312f 100644 (file)
@@ -7,9 +7,29 @@ class RepositoriesController < ApplicationController
 
   def show_pane_list
     if @user_is_manager
-      super | %w(Sharing)
+      panes = super | %w(Sharing)
+      panes.insert(panes.length-1, panes.delete_at(panes.index('Advanced'))) if panes.index('Advanced')
+      panes
     else
-      super
+      panes = super
     end
+    panes.delete('Attributes') if !current_user.is_admin
+    panes
+  end
+
+  def show_tree
+    @commit = params[:commit]
+    @path = params[:path] || ''
+    @subtree = @object.ls_subtree @commit, @path.chomp('/')
+  end
+
+  def show_blob
+    @commit = params[:commit]
+    @path = params[:path]
+    @blobdata = @object.cat_file @commit, @path
+  end
+
+  def show_commit
+    @commit = params[:commit]
   end
 end