Commit c00917e48fcfb45c686a164fe706a9c17e6797da

Authored by Jack Weeden
1 parent 82271e78

Don't show 'Filter by labels' text if there are no labels

Don't show project search form if there are no projects
Showing 1 changed file with 15 additions and 13 deletions   Show diff stats
app/views/dashboard/projects.html.haml
... ... @@ -20,22 +20,24 @@
20 20 = nav_tab :scope, 'joined' do
21 21 = link_to "Joined", projects_dashboard_path(scope: 'joined')
22 22  
23   - %p.light Filter by label:
24   - %ul.bordered-list
25   - - @labels.each do |label|
26   - %li{ class: (label.name == params[:label]) ? 'active' : 'light' }
27   - = link_to projects_dashboard_path(scope: params[:scope], label: label.name) do
28   - %i.icon-tag
29   - = label.name
  23 + - if @labels.any?
  24 + %p.light Filter by label:
  25 + %ul.bordered-list
  26 + - @labels.each do |label|
  27 + %li{ class: (label.name == params[:label]) ? 'active' : 'light' }
  28 + = link_to projects_dashboard_path(scope: params[:scope], label: label.name) do
  29 + %i.icon-tag
  30 + = label.name
30 31  
31 32  
32 33 .span9
33   - = form_tag projects_dashboard_path, method: 'get' do
34   - %fieldset.dashboard-search-filter
35   - = hidden_field_tag "scope", params[:scope]
36   - = search_field_tag "search", params[:search], { id: 'dashboard_projects_search', placeholder: 'Search', class: 'left input-xxlarge'}
37   - = button_tag type: 'submit', class: 'btn' do
38   - %i.icon-search
  34 + - if @projects.any?
  35 + = form_tag projects_dashboard_path, method: 'get' do
  36 + %fieldset.dashboard-search-filter
  37 + = hidden_field_tag "scope", params[:scope]
  38 + = search_field_tag "search", params[:search], { id: 'dashboard_projects_search', placeholder: 'Search', class: 'left input-xxlarge'}
  39 + = button_tag type: 'submit', class: 'btn' do
  40 + %i.icon-search
39 41  
40 42 %ul.bordered-list
41 43 - @projects.each do |project|
... ...