From c89488e105eb4273461cea1008414d93ceab2b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Zrim=C5=A1ek?= Date: Wed, 24 Oct 2018 03:34:13 +0200 Subject: [PATCH] Fix displaying projects when all are archived [SCI-2787] --- app/assets/javascripts/projects/index.js | 9 ++++++++- app/views/projects/index.html.erb | 7 ++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/projects/index.js b/app/assets/javascripts/projects/index.js index 356c3522b..659c06797 100644 --- a/app/assets/javascripts/projects/index.js +++ b/app/assets/javascripts/projects/index.js @@ -435,7 +435,14 @@ sort: projectsViewSort }, success: function(data) { - viewContainer.html(data.html); + if (data.html.search('id="edit-project-cards-form-') > 0) { + $('#projects-absent').hide(); + $('#projects-present').show(); + viewContainer.html(data.html); + } else { + $('#projects-present').hide(); + $('#projects-absent').show(); + } initFormSubmitLinks(viewContainer); init(); }, diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index 675f8cc83..94118b517 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -29,7 +29,7 @@
- <% if @projects_tree.empty? %> +
<%=t 'projects.index.no_projects.text' %> <% if @teams.exists? && can_create_projects?(current_team) %> @@ -44,7 +44,8 @@

<%=t 'projects.index.no_projects.no_permission_title' %>

<% end %>
- <% else %> +
+
- <% end %> +