Commit 6ba1e17c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'improve_empty_fork' into 'master'

Show message if user tries to fork and has no available namespaces

This merge request improves the UX when users try to fork a project and have no eligible namespaces. 

### Current behavior

![Screen_Shot_2015-09-25_at_1.39.45_PM](https://gitlab.com/dblessing/gitlab-ce/uploads/45a303703a0197e78f7f9bdbea8718b5/Screen_Shot_2015-09-25_at_1.39.45_PM.png)

### Proposed behavior

![Screen_Shot_2015-09-25_at_1.38.57_PM](https://gitlab.com/dblessing/gitlab-ce/uploads/613c53bcfb52d79fdf8bd1d09410c152/Screen_Shot_2015-09-25_at_1.38.57_PM.png)

### Things to check

I'm not exactly loving the wording I have here. I'm open to improvements.


See merge request !1441
parents 63adaacd fce4f138
- page_title "Fork project" - page_title "Fork project"
%h3.page-title Fork project - if @namespaces.present?
%p.lead %h3.page-title Fork project
Click to fork the project to a user or group %p.lead
%hr Click to fork the project to a user or group
%hr
.fork-namespaces .fork-namespaces
- @namespaces.in_groups_of(6, false) do |group| - @namespaces.in_groups_of(6, false) do |group|
.row .row
- group.each do |namespace| - group.each do |namespace|
.col-md-2.col-sm-3 .col-md-2.col-sm-3
- if fork = namespace.find_fork_of(@project) - if fork = namespace.find_fork_of(@project)
.fork-thumbnail .fork-thumbnail
= link_to project_path(fork), title: "Visit project fork", class: 'has_tooltip' do = link_to project_path(fork), title: "Visit project fork", class: 'has_tooltip' do
= image_tag namespace_icon(namespace, 100) = image_tag namespace_icon(namespace, 100)
.caption .caption
%strong %strong
= namespace.human_name = namespace.human_name
%div.text-primary %div.text-primary
Already forked Already forked
- else - else
.fork-thumbnail .fork-thumbnail
= link_to namespace_project_fork_path(@project.namespace, @project, namespace_key: namespace.id), title: "Fork here", method: "POST", class: 'has_tooltip' do = link_to namespace_project_fork_path(@project.namespace, @project, namespace_key: namespace.id), title: "Fork here", method: "POST", class: 'has_tooltip' do
= image_tag namespace_icon(namespace, 100) = image_tag namespace_icon(namespace, 100)
.caption .caption
%strong %strong
= namespace.human_name = namespace.human_name
%p.light %p.light
Fork is a copy of a project repository. Fork is a copy of a project repository.
%br %br
Forking a repository allows you to do changes without affecting the original project. Forking a repository allows you to do changes without affecting the original project.
- else
%h3 No available namespaces to fork the project
%p.slead
You must have permission to create a project in a namespace before forking.
.save-project-loader.hide .save-project-loader.hide
.center .center
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment