Fix displaying projects when all are archived [SCI-2787]

This commit is contained in:
Matej Zrimšek 2018-10-24 03:34:13 +02:00
parent 43fdab561f
commit c89488e105
2 changed files with 12 additions and 4 deletions

View file

@ -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();
},

View file

@ -29,7 +29,7 @@
<div class="content-pane" id="projects-index">
<% if @projects_tree.empty? %>
<div id="projects-absent" style="<%= 'display:none' if @projects_tree.any? %>">
<div class="jumbotron text-center" style="margin-top:12%">
<strong><%=t 'projects.index.no_projects.text' %></strong>
<% if @teams.exists? && can_create_projects?(current_team) %>
@ -44,7 +44,8 @@
<p><strong><%=t 'projects.index.no_projects.no_permission_title' %></strong></p>
<% end %>
</div>
<% else %>
</div>
<div id="projects-present" style="<%= 'display:none' if @projects_tree.empty? %>">
<!-- Edit project modal -->
<div class="modal" id="edit-project-modal" tabindex="-1" role="dialog" aria-labelledby="edit-project-modal-label">
<div class="modal-dialog" role="document">
@ -146,7 +147,7 @@
<%= render partial: "projects/index/team_projects_table" %>
</div>
</div>
<% end %>
</div>
</div>