From 96d49bf04ce77c975fe500f4d961e4a1ffed4c26 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 30 Dec 2012 14:43:00 +0200 Subject: Use sdoc to generate application code documentation --- doc/code/classes/TreeController.html | 264 +++++++++++++++++++++++++++++++++++ 1 file changed, 264 insertions(+) create mode 100644 doc/code/classes/TreeController.html (limited to 'doc/code/classes/TreeController.html') diff --git a/doc/code/classes/TreeController.html b/doc/code/classes/TreeController.html new file mode 100644 index 00000000000..35c99bc09e4 --- /dev/null +++ b/doc/code/classes/TreeController.html @@ -0,0 +1,264 @@ + + + + + TreeController + + + + + + + + + + + + + +
+
+ +
+ +

Controller for viewing a repository’s file structure

+ +
+ + + + + + + + + + + + + + + +
Methods
+
+ +
E
+
+
    + + +
  • + edit +
  • + +
+
+ +
S
+
+
    + + +
  • + show +
  • + +
+
+ +
U
+
+ +
+ +
+ + + + +
Included Modules
+ + + + + + + + + + + + + + + + + + + +
Instance Public methods
+ +
+
+ + edit() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/tree_controller.rb, line 24
+def edit
+  @last_commit = @project.last_commit_for(@ref, @path).sha
+end
+
+
+ +
+ +
+
+ + show() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/tree_controller.rb, line 13
+def show
+  @hex_path  = Digest::SHA1.hexdigest(@path)
+  @logs_path = logs_file_project_ref_path(@project, @ref, @path)
+
+  respond_to do |format|
+    format.html
+    # Disable cache so browser history works
+    format.js { no_cache_headers }
+  end
+end
+
+
+ +
+ +
+
+ + update() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/tree_controller.rb, line 28
+def update
+  edit_file_action = Gitlab::Satellite::EditFileAction.new(current_user, @project, @ref, @path)
+  updated_successfully = edit_file_action.commit!(
+    params[:content],
+    params[:commit_message],
+    params[:last_commit]
+  )
+
+  if updated_successfully
+    redirect_to project_tree_path(@project, @id), notice: "Your changes have been successfully commited"
+  else
+    flash[:notice] = "Your changes could not be commited, because the file has been changed"
+    render :edit
+  end
+end
+
+
+ +
+
+ +
+ + \ No newline at end of file -- cgit v1.2.1