diff --git a/app/assets/javascripts/global_activities/side_pane.js b/app/assets/javascripts/global_activities/side_pane.js index 8698fd86a..1156711fc 100644 --- a/app/assets/javascripts/global_activities/side_pane.js +++ b/app/assets/javascripts/global_activities/side_pane.js @@ -124,6 +124,7 @@ $(function() { // update_filter function reloadActivities() { var moreButton = $('.btn-more-activities'); + var noActivitiesMessage = $('.no-activities-message'); if (updateRunning) return false; updateRunning = true; $('.ga-activities-list .activities-day').remove(); @@ -141,6 +142,11 @@ $(function() { } else { moreButton.addClass('hidden'); } + if (json.activities_html === "") { + noActivitiesMessage.removeClass('hidden'); + } else { + noActivitiesMessage.addClass('hidden'); + } updateRunning = false; animateSpinner(null, false); }, diff --git a/app/assets/stylesheets/global_activities.scss b/app/assets/stylesheets/global_activities.scss index d2121bdd8..d9f61fa7f 100644 --- a/app/assets/stylesheets/global_activities.scss +++ b/app/assets/stylesheets/global_activities.scss @@ -77,6 +77,9 @@ } } } + .no-activities-message { + margin-top: 20px; + } } } diff --git a/app/views/global_activities/index.html.erb b/app/views/global_activities/index.html.erb index 239571cfe..8a1729cb8 100644 --- a/app/views/global_activities/index.html.erb +++ b/app/views/global_activities/index.html.erb @@ -11,6 +11,9 @@
+
+

<%= t('activities.index.no_activities_message') %>

+
<%= render partial: "activity_list.html.erb" %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 0820c43c8..365e30096 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1309,6 +1309,7 @@ en: today: "Today" more_activities: "Show more activities" no_activities: "No activities!" + no_activities_message: "No activities could be displayed. Update filters or start using SciNote to generate your first activities." activity_counter_label: " activity" activities_counter_label: " activities" expand_all: "Expand all"