index.html.haml 1.66 KB
Newer Older
Kamil Trzcinski's avatar
Kamil Trzcinski committed
1
- page_title "Builds"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
2
= render "header_title"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
3

Kamil Trzcinski's avatar
Kamil Trzcinski committed
4 5
.project-issuable-filter
  .controls
Kamil Trzcinski's avatar
Kamil Trzcinski committed
6
    - if @ci_project && current_user && can?(current_user, :manage_builds, @project)
Kamil Trzcinski's avatar
Kamil Trzcinski committed
7
      .pull-left.hidden-xs
Kamil Trzcinski's avatar
Kamil Trzcinski committed
8
        - if @all_builds.running_or_pending.any?
Kamil Trzcinski's avatar
Kamil Trzcinski committed
9
          = link_to 'Cancel all', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post
Kamil Trzcinski's avatar
Kamil Trzcinski committed
10

Kamil Trzcinski's avatar
Kamil Trzcinski committed
11 12 13 14
  %ul.center-top-menu
    %li{class: ('active' if @scope.nil?)}
      = link_to project_builds_path(@project) do
        Running
15
        %span.badge.js-running-count= @all_builds.running_or_pending.count(:id)
Kamil Trzcinski's avatar
Kamil Trzcinski committed
16 17 18 19

    %li{class: ('active' if @scope == 'finished')}
      = link_to project_builds_path(@project, scope: :finished) do
        Finished
20
        %span.badge.js-running-count= @all_builds.finished.count(:id)
Kamil Trzcinski's avatar
Kamil Trzcinski committed
21 22 23 24

    %li{class: ('active' if @scope == 'all')}
      = link_to project_builds_path(@project, scope: :all) do
        All
25
        %span.badge.js-totalbuilds-count= @all_builds.count(:id)
Kamil Trzcinski's avatar
Kamil Trzcinski committed
26 27

.gray-content-block
Kamil Trzcinski's avatar
Kamil Trzcinski committed
28
  #{(@scope || 'running').capitalize} builds from this project
Kamil Trzcinski's avatar
Kamil Trzcinski committed
29

Kamil Trzcinski's avatar
Kamil Trzcinski committed
30 31 32 33 34
%ul.content-list
  - if @builds.blank?
    %li
      .nothing-here-block No builds to show
  - else
Douwe Maan's avatar
Douwe Maan committed
35 36 37 38 39 40 41 42
    .table-holder
      %table.table.builds
        %thead
          %tr
            %th Status
            %th Build ID
            %th Commit
            %th Ref
Kamil Trzcinski's avatar
Kamil Trzcinski committed
43
            %th Stage
Douwe Maan's avatar
Douwe Maan committed
44 45 46 47 48 49
            %th Name
            %th Duration
            %th Finished at
            %th

        - @builds.each do |build|
Kamil Trzcinski's avatar
Kamil Trzcinski committed
50
          = render 'projects/commit_statuses/commit_status', commit_status: build, commit_sha: true, stage: true, allow_retry: true
Kamil Trzcinski's avatar
Kamil Trzcinski committed
51

Kamil Trzcinski's avatar
Kamil Trzcinski committed
52
    = paginate @builds, theme: 'gitlab'
Kamil Trzcinski's avatar
Kamil Trzcinski committed
53