BigW Consortium Gitlab

_project.html.haml 2.35 KB
Newer Older
1 2
- avatar = true unless local_assigns[:avatar] == false
- stars = true unless local_assigns[:stars] == false
3
- forks = false unless local_assigns[:forks] == true
4
- ci = false unless local_assigns[:ci] == true
5
- skip_namespace = false unless local_assigns[:skip_namespace] == true
6
- css_class = '' unless local_assigns[:css_class]
James Lopez committed
7
- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && project.commit
8
- css_class += " no-description" if project.description.blank? && !show_last_commit_as_description
9
- cache_key = [project.namespace, project, controller.controller_name, controller.action_name, current_application_settings, 'v2.3']
Kamil Trzcinski committed
10
- cache_key.push(project.commit.status) if project.commit.try(:status)
11

12
%li.project-row{ class: css_class }
13
  = cache(cache_key) do
14
    .controls
15 16
      - if project.archived
        %span.label.label-warning archived
Kamil Trzcinski committed
17
      - if project.commit.try(:status)
18
        %span
19
          = render_commit_status(project.commit)
20 21
      - if forks
        %span
22
          = icon('code-fork')
23
          = number_with_delimiter(project.forks_count)
24
      - if stars
25
        %span
26
          = icon('star')
27
          = number_with_delimiter(project.star_count)
28
      %span.visibility-icon.has-tooltip{ data: { container: 'body', placement: 'left' }, title: visibility_icon_description(project) }
29
        = visibility_level_icon(project.visibility_level, fw: true)
30 31 32 33 34

    .title
      = link_to project_path(project), class: dom_class(project) do
        - if avatar
          .dash-project-avatar
35
            .avatar-container.s40
36 37 38 39
              - if use_creator_avatar
                = image_tag avatar_icon(project.creator.email, 40), class: "avatar s40", alt:''
              - else
                = project_icon(project, alt: '', class: 'avatar project-avatar s40')
40 41 42 43 44 45 46 47
        %span.project-full-name
          %span.namespace-name
            - if project.namespace && !skip_namespace
              = project.namespace.human_name
              \/
          %span.project-name.filter-title
            = project.name

48
    - if show_last_commit_as_description
49
      .description
50 51 52
        = link_to_gfm project.commit.title, namespace_project_commit_path(project.namespace, project, project.commit),
          class: "commit-row-message"
    - elsif project.description.present?
53
      .description
54
        = markdown_field(project, :description)