diff options
author | Rubén Dávila <rdavila84@gmail.com> | 2016-01-12 03:16:29 +0300 |
---|---|---|
committer | Rubén Dávila <rdavila84@gmail.com> | 2016-01-20 08:14:58 +0300 |
commit | b2e5b57fab4d73a5ad043d82457268fdb3864a89 (patch) | |
tree | 0af9e6ba08d6d119ed34f84a9635a65088f85287 /app/views/projects/forks/index.html.haml | |
parent | 2b05bf4be5c01c2b6b09a8c0792d1c9dd8afe6e7 (diff) |
Add fork button and implement ability to distinguish between public and protected forks. #2406
Diffstat (limited to 'app/views/projects/forks/index.html.haml')
-rw-r--r-- | app/views/projects/forks/index.html.haml | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/app/views/projects/forks/index.html.haml b/app/views/projects/forks/index.html.haml index 8ae7fe22e1e..d050b2f735a 100644 --- a/app/views/projects/forks/index.html.haml +++ b/app/views/projects/forks/index.html.haml @@ -1,3 +1,24 @@ +.gray-content-block.top-block.white + - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2 + = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: 'Go to your fork', class: 'pull-right btn btn-new' do + = icon('code-fork fw') + Fork + - else + = link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'pull-right btn btn-new' do + = icon('code-fork fw') + Fork + + .oneline + - public_count = @public_forks.size + - protected_count = @protected_forks.size + - full_count_title = ["#{public_count} public", "#{protected_count} protected"].join(' and ') + == #{pluralize(@all_forks.size, 'fork')}: #{full_count_title} + .projects-list-holder + = render 'shared/projects/list', projects: @public_forks, use_creator_avatar: true - = render 'shared/projects/list', projects: @forked_projects, use_creator_avatar: true + - if protected_count > 0 + %ul.projects-list + %li.project-row + %strong= pluralize(protected_count, 'protected fork') + %span you have no access to. |