Read about our upcoming Code of Conduct on this issue

_home_panel.html.haml 2.41 KB
Newer Older
1
2
- empty_repo = @project.empty_repo?
.project-home-panel{:class => ("empty-project" if empty_repo)}
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
3
  .visibility-level-label.has_tooltip{'data-title' => "#{visibility_level_label(@project.visibility_level)} project" }
4
    = visibility_level_icon(@project.visibility_level)
5
  .row
6
    .col-sm-6
7
8
9
      %h4.project-home-title
        = @project.name_with_namespace

10
    .col-sm-6
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
11
      - if current_user && !empty_repo
12
13
        .project-home-dropdown
          = render "dropdown"
14
      = render "shared/clone_panel"
15

16
  .project-home-extra.row
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
17
    .col-md-7
18
19
      .project-home-desc
        - if @project.description.present?
20
          = auto_link ERB::Util.html_escape(@project.description), link: :urls
21
22
23
        - if can?(current_user, :admin_project, @project)
          –
          %strong= link_to 'Edit', edit_project_path
24
        - elsif !@project.empty_repo? && @repository.readme
25
          - readme = @repository.readme
26
          –
27
          = link_to project_blob_path(@project, tree_join(@repository.root_ref, readme.name)) do
28
            = readme.name
29

Ciro Santilli's avatar
Ciro Santilli committed
30
31
32
    .col-md-5
      .project-home-links
        - unless empty_repo
33
34
35
          = link_to pluralize(number_with_delimiter(@repository.commit_count), 'commit'), project_commits_path(@project, @ref || @repository.root_ref)
          = link_to pluralize(number_with_delimiter(@repository.branch_names.count), 'branch'), project_branches_path(@project)
          = link_to pluralize(number_with_delimiter(@repository.tag_names.count), 'tag'), project_tags_path(@project)
36
          %span.light.prepend-left-20= repository_size
Ciro Santilli's avatar
Ciro Santilli committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
        %span.star.js-toggler-container.on
          - if current_user
            = render 'link_to_toggle_star',
                title:   'Star this project.',
                starred: false,
                signed_in: true
            = render 'link_to_toggle_star',
                title:   'Unstar this project.',
                starred: true,
                signed_in: true
            :coffeescript
              $('.star').on 'ajax:success', (e, data, status, xhr) ->
                $(@).toggleClass('on').find('.count').html(data.star_count)
              .on 'ajax:error', (e, xhr, status, error) ->
                new Flash('Star toggle failed. Try again later.', 'alert')
          - else
            = render 'link_to_toggle_star',
                title:   'You must sign in to star a project.',
                starred: false,
                signed_in: false