-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html.erb
More file actions
61 lines (53 loc) · 2.14 KB
/
Copy pathindex.html.erb
File metadata and controls
61 lines (53 loc) · 2.14 KB
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
<%# Index view for displaying a list of application forms
Required locals:
- title: String - Page title
- intro: String - Introduction text
- new_button_text: String - Text for the "New" button
- new_path: String - Path for the "New" button
- in_progress_applications_heading: String - Heading for the in-progress section
- application_forms: Array<Hash> - List of application form data with keys:
- created_at: String
- path: String
- status: Symbol
Example usage:
render template: "strata/application_forms/index", locals: {
title: t(".title"),
intro: t(".intro"),
new_button_text: t(".new_button"),
in_progress_applications_heading: t(".in_progress_applications.heading"),
application_forms: @application_forms.map { |form| {
created_at: form.created_at.strftime("%B %d, %Y at %I:%M %p"),
path: application_form_path(form),
status: form.status
}}
}
%>
<% content_for :title, title %>
<h1>
<%= title %>
</h1>
<p class="usa-intro">
<%= intro %>
</p>
<%= strata_link_to new_button_text, new_path, as: :button %>
<% if not application_forms.empty? %>
<h2 class="margin-top-6"><%= in_progress_applications_heading %></h2>
<section class="d-flex flex-column flex-md-row gap-4 align-items-start justify-content-between">
<%= render Strata::US::TableComponent.new(borderless: true, classes: "width-full") do |table| %>
<% table.with_header { t("strata.application_forms.index.col_created_at") } %>
<% table.with_header { t("strata.application_forms.index.col_status") } %>
<% table.with_header { t("strata.application_forms.index.col_actions") } %>
<% application_forms.each do |application_form| %>
<% table.with_row do |row| %>
<% row.with_cell do %>
<%= link_to application_form[:created_at], application_form[:path] %>
<% end %>
<% row.with_cell do %>
<%= t("strata.application_forms.statuses.#{application_form[:status]}") %>
<% end %>
<% row.with_cell { "TODO" } %>
<% end %>
<% end %>
<% end %>
</section>
<% end %>