summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-23 13:06:32 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-23 13:06:32 +0000
commitde7d93e31fd2a35488113cac7d6f56c2c2a88306 (patch)
tree824104c4645fc81a63db17145b3986e0f44019b8 /app
parentd906f19c5ba961f34dad995d65494c5fec7bd3f4 (diff)
parent484c09792c5c6b4f8f1111978a82cf080a31a920 (diff)
downloadgitlab-ce-de7d93e31fd2a35488113cac7d6f56c2c2a88306.tar.gz
Merge branch 'branch-creation-flow' into 'master'
Branch creation flow To improve user experience with web editing I did next improvements: * when create branch via ui - redirect to tree view so you start add/edit files * when click on branch name - redirect to tree view instead of commits so you can immedialty add/edit files
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/branches_controller.rb4
-rw-r--r--app/views/projects/branches/_branch.html.haml2
-rw-r--r--app/views/projects/tree/show.html.haml2
3 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index 8c70ae45f06..ab8892bbf0b 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -17,9 +17,9 @@ class Projects::BranchesController < Projects::ApplicationController
end
def create
- CreateBranchService.new.execute(project, params[:branch_name], params[:ref], current_user)
+ @branch = CreateBranchService.new.execute(project, params[:branch_name], params[:ref], current_user)
- redirect_to project_branches_path(@project)
+ redirect_to project_tree_path(@project, @branch.name)
end
def destroy
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml
index a5f382c9a5c..2abcd00ee81 100644
--- a/app/views/projects/branches/_branch.html.haml
+++ b/app/views/projects/branches/_branch.html.haml
@@ -1,7 +1,7 @@
- commit = @repository.commit(branch.target)
%li
%h4
- = link_to project_commits_path(@project, branch.name) do
+ = link_to project_tree_path(@project, branch.name) do
%strong= truncate(branch.name, length: 60)
- if branch.name == @repository.root_ref
%span.label.label-info default
diff --git a/app/views/projects/tree/show.html.haml b/app/views/projects/tree/show.html.haml
index 6b33493b7d2..735ffae9e2c 100644
--- a/app/views/projects/tree/show.html.haml
+++ b/app/views/projects/tree/show.html.haml
@@ -1,6 +1,6 @@
%div.tree-ref-holder
= render 'shared/ref_switcher', destination: 'tree', path: @path
- if can? current_user, :download_code, @project
- = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-small tree-ref-holder pull-right', split_button: true
+ = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-small pull-right', split_button: true
%div#tree-holder.tree-holder
= render "tree", tree: @tree