scinote-web/app/views/shared/_invite_users_modal_results.html.erb
2022-04-15 15:31:08 +02:00

62 lines
2.3 KiB
Text

<h5>
<%= t('invite_users.results.heading') %>
</h5>
<hr />
<div class="results-wrap">
<% @invite_results.each do |result| %>
<% if result[:status] == :user_exists %>
<div class="alert alert-info" role="alert">
<strong><%= result[:email] %></strong>
&nbsp;-&nbsp;
<%= t('invite_users.results.user_exists') %>
</div>
<% elsif result[:status] == :user_exists_and_in_team %>
<div class="alert alert-info" role="alert">
<strong><%= result[:email] %></strong>
&nbsp;-&nbsp;
<%= t('invite_users.results.user_exists_and_in_team',
team: result[:team].name,
role: t("user_teams.enums.role.#{result[:user_team].role}")) %>
</div>
<% elsif result[:status] == :user_exists_unconfirmed_invited_to_team %>
<div class="alert alert-info" role="alert">
<strong><%= result[:email] %></strong>
&nbsp;-&nbsp;
<%= t('invite_users.results.user_exists_unconfirmed_invited_to_team',
team: result[:team].name,
role: t("user_teams.enums.role.#{result[:user_team].role}")) %>
</div>
<% elsif result[:status] == :user_exists_invited_to_team %>
<div class="alert alert-info" role="alert">
<strong><%= result[:email] %></strong>
&nbsp;-&nbsp;
<%= t('invite_users.results.user_exists_invited_to_team',
team: result[:team].name,
role: t("user_teams.enums.role.#{result[:user_team].role}")) %>
</div>
<% elsif result[:status] == :user_created %>
<div class="alert alert-success" role="alert">
<strong><%= result[:email] %></strong>
&nbsp;-&nbsp;
<%= t('invite_users.results.user_created') %>
</div>
<% elsif result[:status] == :user_created_invited_to_team %>
<div class="alert alert-success" role="alert">
<strong><%= result[:email] %></strong>
&nbsp;-&nbsp;
<%= t('invite_users.results.user_created_invited_to_team',
team: result[:team].name,
role: t("user_teams.enums.role.#{result[:user_team].role}")) %>
</div>
<% elsif result[:status] == :user_invalid %>
<div class="alert alert-danger" role="alert">
<strong><%= result[:email] %></strong>
&nbsp;-&nbsp;
<%= t('invite_users.results.user_invalid') %>
</div>
<% end %>
<% end %>
<% if @too_many_emails %>
<%= t('invite_users.results.too_many_emails', nr: Constants::INVITE_USERS_LIMIT) %>
<% end %>
</div>