diff --git a/app/assets/javascripts/projects/index.js b/app/assets/javascripts/projects/index.js index 3eb1798e0..14bf901a8 100644 --- a/app/assets/javascripts/projects/index.js +++ b/app/assets/javascripts/projects/index.js @@ -598,8 +598,12 @@ $('#breadcrumbsWrapper').html(data.breadcrumbs_html); $('#toolbarWrapper').html(data.toolbar_html); viewContainer.data('projects-cards-url', data.projects_cards_url); - viewContainer.find('.card, .projects-group').remove(); + viewContainer.removeClass('no-results'); + viewContainer.find('.card, .projects-group, .no-results-container').remove(); viewContainer.append(data.cards_html); + if (viewContainer.find('.no-results-container').length) { + viewContainer.addClass('no-results'); + } selectedProjects.length = 0; selectedProjectFolders.length = 0; updateProjectsToolbar(); @@ -756,7 +760,6 @@ $(e.target).closest('.dropdown').removeClass('open'); - createdOnFromFilter = $createdOnFromFilter.val(); createdOnToFilter = $createdOnToFilter.val(); membersFilter = dropdownSelector.getValues($('.members-filter')); diff --git a/app/assets/stylesheets/projects.scss b/app/assets/stylesheets/projects.scss index 182faf4d8..50b480f5c 100644 --- a/app/assets/stylesheets/projects.scss +++ b/app/assets/stylesheets/projects.scss @@ -775,6 +775,30 @@ li.module-hover { grid-template-columns: repeat(auto-fill, minmax(291px, 1fr)); width: 100%; + &.no-results { + display: block; + margin-top: 100px; + + .no-results-img { + display: block; + margin: auto; + max-height: 230px; + } + + .no-results-title { + @include font-h1; + margin-bottom: .25em; + margin-top: 1.25em; + text-align: center; + } + + .no-results-description { + @include font-main; + color: $color-silver-chalice; + text-align: center; + } + } + .table-header { display: none; } @@ -1219,4 +1243,3 @@ li.module-hover { margin: 1em 0; } } - diff --git a/app/views/projects/index/_team_projects_grouped_by_folder.html.erb b/app/views/projects/index/_team_projects_grouped_by_folder.html.erb index b052401d5..38fcceb0d 100644 --- a/app/views/projects/index/_team_projects_grouped_by_folder.html.erb +++ b/app/views/projects/index/_team_projects_grouped_by_folder.html.erb @@ -1,10 +1,18 @@ -<% projects_by_folder.each do |folder, projects| %> -
- <%= render partial: 'projects/index/breadcrumbs', locals: { target_folder: folder } %> +<% if projects_by_folder.blank? %> +
+ <%= image_tag('/images/no_search_results.png', class: 'no-results-img') %> +
<%= t('projects.index.no_results_found') %>
+
<%= t('projects.index.no_results_description') %>
- <% projects.each do |project| %> - <% cache [current_user, project] do %> - <%= render partial: 'projects/index/project_card', locals: { project: project } %> +<% else %> + <% projects_by_folder.each do |folder, projects| %> +
+ <%= render partial: 'projects/index/breadcrumbs', locals: { target_folder: folder } %> +
+ <% projects.each do |project| %> + <% cache [current_user, project] do %> + <%= render partial: 'projects/index/project_card', locals: { project: project } %> + <% end %> <% end %> <% end %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 877d7ae0a..1a4aa5f91 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -341,6 +341,8 @@ en: no_users: "No users!" manage_users: "Manage users" no_notifications: "There are no overdue tasks at the moment" + no_results_found: "No results found..." + no_results_description: "Try resetting your filter or choose a different search querry" module_overdue_html: "Task %{module} is overdue (%{days})." module_overdue_days: one: "1 day" diff --git a/public/images/no_search_results.png b/public/images/no_search_results.png new file mode 100644 index 000000000..0dd9dc489 Binary files /dev/null and b/public/images/no_search_results.png differ