BigW Consortium Gitlab

index.html.haml 2.27 KB
Newer Older
1 2 3 4 5 6 7 8
%h3.page-title
  Projects (#{@projects.total_count})
.light
  You can browse public projects in read-only mode until signed in.
%hr
.clearfix
  .pull-left
    = form_tag public_projects_path, method: :get, class: 'form-inline form-tiny' do |f|
Dmitriy Zaporozhets committed
9 10 11
      .form-group
        = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input", id: "projects_search"
      .form-group
12 13 14 15 16 17 18
        = submit_tag 'Search', class: "btn btn-primary wide"

  .pull-right
    .dropdown.inline
      %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
        %span.light sort:
        - if @sort.present?
19
          = @sort.humanize
20
        - else
21
          Name
22 23 24
        %b.caret
      %ul.dropdown-menu
        %li
25 26
          = link_to public_projects_path(sort: nil) do
            Name
27 28 29 30 31 32 33 34
          = link_to public_projects_path(sort: 'newest') do
            Newest
          = link_to public_projects_path(sort: 'oldest') do
            Oldest
          = link_to public_projects_path(sort: 'recently_updated') do
            Recently updated
          = link_to public_projects_path(sort: 'last_updated') do
            Last updated
35 36

%hr
37
.public-projects
38
  %ul.bordered-list.top-list
39
    - @projects.each do |project|
40
      %li
41
        %h4
42
          = link_to project_path(project) do
43
            = project.name_with_namespace
44 45 46 47
          - if project.internal?
            %small.access-icon
              = internal_icon
              Internal
48
          .pull-right
49 50 51
            %pre.public-clone git clone #{project.http_url_to_repo}

        - if project.description.present?
52
          %p
53
            = project.description
54 55 56 57 58 59 60 61 62 63 64

        .repo-info
          - unless project.empty_repo?
            = link_to pluralize(project.repository.round_commit_count, 'commit'), project_commits_path(project, project.default_branch)
            ·
            = link_to pluralize(project.repository.branch_names.count, 'branch'), project_branches_path(project)
            ·
            = link_to pluralize(project.repository.tag_names.count, 'tag'), project_tags_path(project)
          - else
            %i.icon-warning-sign
            Empty repository
65 66
    - unless @projects.present?
      %h3.nothing_here_message No public projects
67

68
  = paginate @projects, theme: "gitlab"