mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 17:51:13 +08:00
Add no results page for serach on project page [SCI-5333]
This commit is contained in:
parent
e88848cd75
commit
54a5528495
5 changed files with 45 additions and 9 deletions
|
@ -598,8 +598,12 @@
|
||||||
$('#breadcrumbsWrapper').html(data.breadcrumbs_html);
|
$('#breadcrumbsWrapper').html(data.breadcrumbs_html);
|
||||||
$('#toolbarWrapper').html(data.toolbar_html);
|
$('#toolbarWrapper').html(data.toolbar_html);
|
||||||
viewContainer.data('projects-cards-url', data.projects_cards_url);
|
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);
|
viewContainer.append(data.cards_html);
|
||||||
|
if (viewContainer.find('.no-results-container').length) {
|
||||||
|
viewContainer.addClass('no-results');
|
||||||
|
}
|
||||||
selectedProjects.length = 0;
|
selectedProjects.length = 0;
|
||||||
selectedProjectFolders.length = 0;
|
selectedProjectFolders.length = 0;
|
||||||
updateProjectsToolbar();
|
updateProjectsToolbar();
|
||||||
|
@ -756,7 +760,6 @@
|
||||||
|
|
||||||
$(e.target).closest('.dropdown').removeClass('open');
|
$(e.target).closest('.dropdown').removeClass('open');
|
||||||
|
|
||||||
|
|
||||||
createdOnFromFilter = $createdOnFromFilter.val();
|
createdOnFromFilter = $createdOnFromFilter.val();
|
||||||
createdOnToFilter = $createdOnToFilter.val();
|
createdOnToFilter = $createdOnToFilter.val();
|
||||||
membersFilter = dropdownSelector.getValues($('.members-filter'));
|
membersFilter = dropdownSelector.getValues($('.members-filter'));
|
||||||
|
|
|
@ -775,6 +775,30 @@ li.module-hover {
|
||||||
grid-template-columns: repeat(auto-fill, minmax(291px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(291px, 1fr));
|
||||||
width: 100%;
|
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 {
|
.table-header {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -1219,4 +1243,3 @@ li.module-hover {
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,11 @@
|
||||||
<% projects_by_folder.each do |folder, projects| %>
|
<% if projects_by_folder.blank? %>
|
||||||
|
<div class="no-results-container">
|
||||||
|
<%= image_tag('/images/no_search_results.png', class: 'no-results-img') %>
|
||||||
|
<div class="no-results-title"><%= t('projects.index.no_results_found') %></div>
|
||||||
|
<div class="no-results-description"><%= t('projects.index.no_results_description') %></div>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<% projects_by_folder.each do |folder, projects| %>
|
||||||
<div class="projects-group">
|
<div class="projects-group">
|
||||||
<%= render partial: 'projects/index/breadcrumbs', locals: { target_folder: folder } %>
|
<%= render partial: 'projects/index/breadcrumbs', locals: { target_folder: folder } %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,4 +14,5 @@
|
||||||
<%= render partial: 'projects/index/project_card', locals: { project: project } %>
|
<%= render partial: 'projects/index/project_card', locals: { project: project } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -341,6 +341,8 @@ en:
|
||||||
no_users: "No users!"
|
no_users: "No users!"
|
||||||
manage_users: "Manage users"
|
manage_users: "Manage users"
|
||||||
no_notifications: "There are no overdue tasks at the moment"
|
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 <em>%{module}</em> is overdue (%{days})."
|
module_overdue_html: "Task <em>%{module}</em> is overdue (%{days})."
|
||||||
module_overdue_days:
|
module_overdue_days:
|
||||||
one: "1 day"
|
one: "1 day"
|
||||||
|
|
BIN
public/images/no_search_results.png
Normal file
BIN
public/images/no_search_results.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
Loading…
Reference in a new issue