_fork_button.html.haml 1.29 KB
Newer Older
1 2 3 4 5 6 7
- avatar = namespace_icon(namespace, 100)
- can_create_project = current_user.can?(:create_projects, namespace)

- if forked_project = namespace.find_fork_of(@project)
  .bordered-box.fork-thumbnail.text-center.prepend-left-default.append-right-default.prepend-top-default.append-bottom-default.forked
    = link_to project_path(forked_project) do
      - if /no_((\w*)_)*avatar/.match(avatar)
8
        = group_icon(namespace, class: "avatar s100 identicon")
9 10 11 12 13 14 15 16 17 18 19 20
      - else
        .avatar-container.s100
          = image_tag(avatar, class: "avatar s100")
      %h5.prepend-top-default
        = namespace.human_name
- else
  .bordered-box.fork-thumbnail.text-center.prepend-left-default.append-right-default.prepend-top-default.append-bottom-default{ class: ("disabled" unless can_create_project) }
    = link_to project_forks_path(@project, namespace_key: namespace.id),
        method: "POST",
        class: ("disabled has-tooltip" unless can_create_project),
        title: (_('You have reached your project limit') unless can_create_project) do
      - if /no_((\w*)_)*avatar/.match(avatar)
21
        = group_icon(namespace, class: "avatar s100 identicon")
22 23 24 25 26
      - else
        .avatar-container.s100
          = image_tag(avatar, class: "avatar s100")
      %h5.prepend-top-default
        = namespace.human_name