Skip to content

Commit 28f872c

Browse files
committed
ApplicationForm table, support a striped/non-striped option?
1 parent 15d60bc commit 28f872c

File tree

2 files changed

+14
-26
lines changed

2 files changed

+14
-26
lines changed

app/views/flex/application_forms/_row.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<tr>
22
<td>
33
<% # TODO show in local time %>
4-
<%= link_to application_form[:created_at], application_form[:path] %>
4+
<%= link_to row[:created_at], row[:path] %>
55
</td>
66
<td>
7-
<%= t("flex.application_forms.statuses.#{application_form[:status]}") %>
7+
<%= t("flex.application_forms.statuses.#{row[:status]}") %>
88
</td>
99
<td>
1010
TODO

app/views/flex/application_forms/index.html.erb

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,17 @@
4040
<h2 class="margin-top-6"><%= in_progress_applications_heading %></h2>
4141

4242
<section class="d-flex flex-column flex-md-row gap-4 align-items-start justify-content-between">
43-
<table class="usa-table usa-table--borderless width-full">
44-
<thead>
45-
<tr>
46-
<th scope="col">
47-
<%= t("flex.application_forms.index.col_created_at") %>
48-
</th>
49-
<th scope="col">
50-
<%= t("flex.application_forms.index.col_status") %>
51-
</th>
52-
<th scope="col">
53-
<%= t("flex.application_forms.index.col_actions") %>
54-
</th>
55-
</tr>
56-
</thead>
57-
<tbody>
58-
<% application_forms.each do |application_form| %>
59-
<% if local_assigns.key?(:row_view) %>
60-
<%= render partial: row_view, locals: { application_form: } %>
61-
<% else %>
62-
<%= render partial: "flex/application_forms/row", locals: { application_form: } %>
63-
<% end %>
64-
<% end %>
65-
</tbody>
66-
</table>
43+
<%= render template: "flex/shared/_table", locals: {
44+
headers: [
45+
t("flex.application_forms.index.col_created_at"),
46+
t("flex.application_forms.index.col_status"),
47+
t("flex.application_forms.index.col_actions")
48+
],
49+
rows: application_forms,
50+
row_view: local_assigns.key?(:row_view) ? row_view : "flex/application_forms/row",
51+
empty_text: "No applications"
52+
}
53+
%>
6754
</section>
55+
6856
<% end %>

0 commit comments

Comments
 (0)