diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-11-13 23:06:19 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-11-13 23:06:19 +0300 |
commit | e08e405ac4c448d8b720ed2ef6181c15e3f3dfc1 (patch) | |
tree | 93776fa4469dd70beae8da621805a5c9a0c9cfb7 /app/views/projects/forks | |
parent | 18c8226566edb1c7fa43ccc1bf7a1db33f91489f (diff) |
Select namespace where to fork project
Now you can fork project into group or personal namespace.
Also I moved fork logic from ProjectsController to own fork resource
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/projects/forks')
-rw-r--r-- | app/views/projects/forks/error.html.haml | 20 | ||||
-rw-r--r-- | app/views/projects/forks/new.html.haml | 19 |
2 files changed, 39 insertions, 0 deletions
diff --git a/app/views/projects/forks/error.html.haml b/app/views/projects/forks/error.html.haml new file mode 100644 index 00000000000..76d3aa5bf00 --- /dev/null +++ b/app/views/projects/forks/error.html.haml @@ -0,0 +1,20 @@ +- if @forked_project && !@forked_project.saved? + .alert.alert-danger.alert-block + %h4 + %i.fa.fa-code-fork + Fork Error! + %p + You tried to fork + = link_to_project @project + but it failed for the following reason: + + + - if @forked_project && @forked_project.errors.any? + %p + – + = @forked_project.errors.full_messages.first + + %p + = link_to new_project_fork_path(@project), title: "Fork", class: "btn" do + %i.fa.fa-code-fork + Try to Fork again diff --git a/app/views/projects/forks/new.html.haml b/app/views/projects/forks/new.html.haml new file mode 100644 index 00000000000..db7486b00e8 --- /dev/null +++ b/app/views/projects/forks/new.html.haml @@ -0,0 +1,19 @@ +%h3.page-title Fork project +%p.lead Select namespace where to fork this project +%hr + +- @namespaces.in_groups_of(6, false) do |group| + .row + - group.each do |namespace| + .col-md-2.col-sm-3 + .thumbnail + = link_to project_fork_path(@project, namespace_id: namespace.id), title: "Fork here", method: "POST" do + - if namespace.kind_of?(Group) + = image_tag group_icon(namespace.path) + - else + = image_tag avatar_icon(namespace.owner.email, 200) + .caption + %h4=namespace.human_name + %p + = namespace.path + |