-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html.erb
66 lines (61 loc) · 3.51 KB
/
index.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<% content_for :title, "Envoyer des invitations - #{structure_name_with_context(@user_list_upload.structure)} - rdv-insertion" %>
<div class="container px-5 py-3" data-controller="submit-selected-ids">
<div class="row text-dark-blue ">
<div class="col text-center align-items-center my-1">
<div>
<h1 class="h1-title">Envoyer des invitations</h1>
<p class="text-muted mb-4">au niveau de « <%= structure_name_with_context(@user_list_upload.structure) %> »<%= ", sur « #{@category_configuration.motif_category.name} »" if @category_configuration %></p>
</div>
</div>
</div>
<%= turbo_frame_tag "user_collection", data: { turbo_action: "advance" } do %>
<div class="row justify-content-center">
<div class="col-md-10">
<% if @all_invitations_attempted %>
<%= render "all_invitations_sent_status", user_rows_with_invitation_errors: @user_rows_with_invitation_errors %>
<% else %>
<%= render "invitations_in_progress_status", current_count: @user_rows_with_invitation_attempted.count, total_count: @user_rows.count %>
<% end %>
<div class="d-flex border-bottom align-items-center">
<ul class="nav nav-tabs flex-grow-1 border-bottom-0 align-self-end">
<li class="nav-item">
<%= link_to user_list_upload_invitation_attempts_path(user_list_upload_id: @user_list_upload.id, search_query: params[:search_query]), class: "nav-link #{rows_with_errors? ? 'text-light-blue' : 'active text-dark-blue fw-bold' }", data: { turbo_frame: "user_collection" } do %>
Tous les dossiers
<%= render "user_list_uploads/user_count_badge", user_count: @user_rows.count, active: !rows_with_errors? %>
<% end %>
</li>
<li class="nav-item">
<%= link_to user_list_upload_invitation_attempts_path(user_list_upload_id: @user_list_upload.id, rows_with_errors: true, search_query: params[:search_query]), class: "nav-link #{rows_with_errors? ? 'active text-dark-blue fw-bold' : 'text-light-blue' }", data: { turbo_frame: "user_collection" } do %>
Dossiers avec erreurs
<%= render "user_list_uploads/user_count_badge", user_count: @user_rows_with_invitation_errors.count, active: rows_with_errors? %>
<% end %>
</li>
</ul>
<div class="d-flex me-2">
<% if @all_invitations_attempted %>
<%= render "user_list_uploads/search_form" %>
<% end %>
</div>
</div>
</div>
<% if rows_with_errors? && @user_rows_with_invitation_errors.empty? %>
<%= render "user_list_uploads/no_errors_user_rows" %>
<% else %>
<%= render "user_rows_after_invitation", user_rows: rows_with_errors? ? @user_rows_with_invitation_errors : @user_rows %>
<% end %>
<div class="col-md-10 sticky-footer">
<div class="py-3 bg-white border-top d-flex justify-content-between">
<div>
</div>
<div>
<% if @all_invitations_attempted %>
<%= link_to "Terminer", @user_list_upload.structure_users_path, class: "btn btn-primary d-block mx-auto", data: { turbo_frame: "_top", controller: "tally", "tally-form-id": "nWjZGj", "tally-delay-in-ms": 1000, action: "click->tally#showPopup" } %>
<% else %>
<%= link_to "Terminer", "#", class: "btn btn-primary d-block mx-auto disabled" %>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
</div>