scinote-web/app/views/shared/_invite_users_modal_results.html.erb

63 lines
2.2 KiB
Text
Raw Normal View History

2016-11-06 18:29:00 +08:00
<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>
2017-01-25 19:01:23 +08:00
<% elsif result[:status] == :user_exists_and_in_team %>
2016-11-06 18:29:00 +08:00
<div class="alert alert-info" role="alert">
<strong><%= result[:email] %></strong>
&nbsp;-&nbsp;
2017-01-25 19:01:23 +08:00
<%= t('invite_users.results.user_exists_and_in_team',
team: @team.name,
role: t("user_teams.enums.role.#{result[:user_team].role}")) %>
2016-11-06 18:29:00 +08:00
</div>
2017-01-25 19:01:23 +08:00
<% elsif result[:status] == :user_exists_unconfirmed_invited_to_team %>
2016-11-06 18:29:00 +08:00
<div class="alert alert-info" role="alert">
<strong><%= result[:email] %></strong>
&nbsp;-&nbsp;
2017-01-25 19:01:23 +08:00
<%= t('invite_users.results.user_exists_unconfirmed_invited_to_team',
team: @team.name,
role: t("user_teams.enums.role.#{result[:user_team].role}")) %>
2016-11-06 18:29:00 +08:00
</div>
2017-01-25 19:01:23 +08:00
<% elsif result[:status] == :user_exists_invited_to_team %>
2016-11-06 18:29:00 +08:00
<div class="alert alert-info" role="alert">
<strong><%= result[:email] %></strong>
&nbsp;-&nbsp;
2017-01-25 19:01:23 +08:00
<%= t('invite_users.results.user_exists_invited_to_team',
team: @team.name,
role: t("user_teams.enums.role.#{result[:user_team].role}")) %>
2016-11-06 18:29:00 +08:00
</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>
2017-01-25 19:01:23 +08:00
<% elsif result[:status] == :user_created_invited_to_team %>
2016-11-06 18:29:00 +08:00
<div class="alert alert-success" role="alert">
<strong><%= result[:email] %></strong>
&nbsp;-&nbsp;
2017-01-25 19:01:23 +08:00
<%= t('invite_users.results.user_created_invited_to_team',
team: @team.name,
role: t("user_teams.enums.role.#{result[:user_team].role}")) %>
2016-11-06 18:29:00 +08:00
</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 %>
2017-01-25 19:01:23 +08:00
</div>