summaryrefslogtreecommitdiff
path: root/app/views/shared/projects/_list.html.haml
blob: 2446e6c30ae33f424266f2121b9681d62b854a36 (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
- projects_limit = 20 unless local_assigns[:projects_limit]
- avatar = true unless local_assigns[:avatar] == false
- use_creator_avatar = false unless local_assigns[:use_creator_avatar] == true
- stars = true unless local_assigns[:stars] == false
- forks = false unless local_assigns[:forks] == true
- ci = false unless local_assigns[:ci] == true
- skip_namespace = false unless local_assigns[:skip_namespace] == true
- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true

%ul.projects-list.content-list
  - if projects.any?
    - projects.each_with_index do |project, i|
      - css_class = (i >= projects_limit) ? 'hide' : nil
      = render "shared/projects/project", project: project, skip_namespace: skip_namespace,
        avatar: avatar, stars: stars, css_class: css_class, ci: ci, use_creator_avatar: use_creator_avatar,
        forks: forks, show_last_commit_as_description: show_last_commit_as_description

    - if projects.size > projects_limit && projects.kind_of?(Array)
      %li.bottom.center
        .light
          #{projects_limit} of #{pluralize(projects.count, 'project')} displayed.
          = link_to '#', class: 'js-expand' do
            Show all
    = paginate projects, theme: "gitlab" if projects.respond_to? :total_pages
  - else
    .nothing-here-block No projects found

:javascript
  new ProjectsList();
  Dashboard.init();