summaryrefslogtreecommitdiff
path: root/app/views/projects/forks/new.html.haml
blob: 008de97d6d3e2b7f6c8d85f15ccba0be9fc4cbd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
- page_title "Fork project"
- can_create_project = current_user.can_create_project?

.row.prepend-top-default
  .col-lg-3
    %h4.prepend-top-0
      Fork project
    %p
      A fork is a copy of a project.
      %br
      Forking a repository allows you to make changes without affecting the original project.
  .col-lg-9
    .fork-namespaces
      - if @namespaces.present?
        %label.label-light
          %span
            #{ "Click to fork the project to a #{'user or' if can_create_project} group" }
          - @namespaces.in_groups_of(6, false) do |group|
            .row
              - group.each do |namespace|
                - avatar = namespace_icon(namespace, 100)
                - if fork = namespace.find_fork_of(@project)
                  .fork-thumbnail.forked
                    = link_to project_path(fork) do
                      - if /no_((\w*)_)*avatar/.match(avatar)
                        .no-avatar
                          = icon 'question'
                      - else
                        = image_tag avatar
                      .caption
                        = namespace.human_name
                - else
                  - is_disabled = namespace.kind === 'user' && !can_create_project
                  .fork-thumbnail{ class: ("disabled" if is_disabled) }
                    = link_to project_forks_path(@project, namespace_key: namespace.id),
                        method: "POST",
                        class: ("disabled has-tooltip" if is_disabled),
                        title: (_('You have reached your project limit') if is_disabled) do
                      - if /no_((\w*)_)*avatar/.match(avatar)
                        .no-avatar
                          = icon 'question'
                      - else
                        = image_tag avatar
                      .caption
                        = namespace.human_name
      - else
        %label.label-light
          %span
            No available namespaces to fork the project.
            %br
            %small
              You must have permission to create a project in a namespace before forking.

    .save-project-loader.hide
      .center
        %h2
          %i.fa.fa-spinner.fa-spin
          Forking repository
        %p Please wait a moment, this page will automatically refresh when ready.