summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-10-09 07:44:21 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-10-09 07:44:21 +0000
commit6ba1e17c44f9567cd00591bcbabf75fe6786ebac (patch)
treed2f3d88eface84ad98a9d72948cf73ca2147a8d7
parent63adaacdc85bbde4e51f612012249c1d499ca181 (diff)
parentfce4f1380319d3436e66cc530f272e25350c3cf9 (diff)
downloadgitlab-ce-6ba1e17c44f9567cd00591bcbabf75fe6786ebac.tar.gz
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
-rw-r--r--app/views/projects/forks/new.html.haml63
1 files changed, 34 insertions, 29 deletions
diff --git a/app/views/projects/forks/new.html.haml b/app/views/projects/forks/new.html.haml
index cd5f3a5d39e..f0b0a11c04a 100644
--- a/app/views/projects/forks/new.html.haml
+++ b/app/views/projects/forks/new.html.haml
@@ -1,36 +1,41 @@
- page_title "Fork project"
-%h3.page-title Fork project
-%p.lead
- Click to fork the project to a user or group
-%hr
+- if @namespaces.present?
+ %h3.page-title Fork project
+ %p.lead
+ Click to fork the project to a user or group
+ %hr
-.fork-namespaces
- - @namespaces.in_groups_of(6, false) do |group|
- .row
- - group.each do |namespace|
- .col-md-2.col-sm-3
- - if fork = namespace.find_fork_of(@project)
- .fork-thumbnail
- = link_to project_path(fork), title: "Visit project fork", class: 'has_tooltip' do
- = image_tag namespace_icon(namespace, 100)
- .caption
- %strong
- = namespace.human_name
- %div.text-primary
- Already forked
+ .fork-namespaces
+ - @namespaces.in_groups_of(6, false) do |group|
+ .row
+ - group.each do |namespace|
+ .col-md-2.col-sm-3
+ - if fork = namespace.find_fork_of(@project)
+ .fork-thumbnail
+ = link_to project_path(fork), title: "Visit project fork", class: 'has_tooltip' do
+ = image_tag namespace_icon(namespace, 100)
+ .caption
+ %strong
+ = namespace.human_name
+ %div.text-primary
+ Already forked
- - else
- .fork-thumbnail
- = 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)
- .caption
- %strong
- = namespace.human_name
+ - else
+ .fork-thumbnail
+ = 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)
+ .caption
+ %strong
+ = namespace.human_name
- %p.light
- Fork is a copy of a project repository.
- %br
- Forking a repository allows you to do changes without affecting the original project.
+ %p.light
+ Fork is a copy of a project repository.
+ %br
+ 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
.center