From f02363dfceae30eee12bad5ed33fc8a5052cb212 Mon Sep 17 00:00:00 2001 From: mlorb Date: Fri, 25 May 2018 17:14:22 +0200 Subject: [PATCH] fix error if user is not assigned to any teams --- app/views/layouts/application.html.erb | 13 +- app/views/projects/index.html.erb | 184 ++++++++++++------------- app/views/protocols/index.html.erb | 18 +-- app/views/repositories/index.html.erb | 6 - config/locales/en.yml | 14 +- 5 files changed, 105 insertions(+), 130 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 507624b79..22228e44b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -41,9 +41,18 @@ locals: { flash: flash, notice: notice, alert: alert } %> <% end %> - <%= render "shared/left_menu_bar" if user_signed_in? %> + <%= render "shared/left_menu_bar" if user_signed_in? && current_user.teams.length > 0 %> +
- <%= yield :content %> + <% if current_user.teams.length == 0 %> + +
+

<%=t 'general.no_teams.title' %>

+

<%=t 'general.no_teams.text' %>

+
+ <% else %> + <%= yield :content %> + <% end %>