summaryrefslogtreecommitdiff
path: root/app/views/dashboard/projects.html.haml
blob: 9b16db340b2fa226577adab172aae976c894d4c5 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
%h3.page_title
  Projects
  %span
    (#{@projects.total_count})
  - if current_user.can_create_project?
    %span.pull-right
      = link_to new_project_path, class: "btn btn-tiny info" do
        %i.icon-plus
        New Project


%hr
.row
  .span3
    %ul.nav.nav-pills.nav-stacked
      = nav_tab :scope, nil do
        = link_to "All", projects_dashboard_path
      = nav_tab :scope, 'personal' do
        = link_to "Personal", projects_dashboard_path(scope: 'personal')
      = nav_tab :scope, 'joined' do
        = link_to "Joined", projects_dashboard_path(scope: 'joined')

    %p.light Filter by label:
    %ul.bordered-list
      - @labels.each do |label|
        %li{ class: (label.name == params[:label]) ? 'active' : 'light' }
          = link_to projects_dashboard_path(scope: params[:scope], label: label.name) do
            %i.icon-tag
            = label.name


  .span9
    = form_tag projects_dashboard_path, method: 'get' do
      %fieldset.dashboard-search-filter
        = hidden_field_tag "scope", params[:scope]
        = search_field_tag "search", params[:search], { id: 'dashboard_projects_search', placeholder: 'Search', class: 'left input-xxlarge'}
        = button_tag type: 'submit', class: 'btn' do
          %i.icon-search

    %ul.bordered-list
      - @projects.each do |project|
        %li.clearfix
          .clearfix
            %h5
              = link_to project_path(project), class: dom_class(project) do
                - if project.namespace
                  = project.namespace.human_name
                  %span= "/"
                %strong
                  = truncate(project.name, length: 45)
              .pull-right.light
                - if project.owner == current_user
                  %i.icon-wrench
                - tm = project.team.get_tm(current_user.id)
                - if tm
                  %strong= tm.project_access_human
          .clearfix
            .left
              - if project.description.present?
                %span.light= project.description
              - project.labels.each do |label|
                %span.label.label-info
                  %i.icon-tag
                  = label.name

            .pull-right.light
              %small.light
                Last activity #{project_last_activity(project)}

      - if @projects.blank?
        %li
          %h3.nothing_here_message There are no projects here.
    .bottom
      %hr
      = paginate @projects, theme: "gitlab"