-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshephard_report.liquid
124 lines (110 loc) · 3.39 KB
/
shephard_report.liquid
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<html lang="en">
<head>
<meta charset="utf-8">
<style>
@page {
margin: .25in;
}
/*-- PDF margin reset --*/
.container {
width: 800;
margin: 5px auto;
columns: 2;
column-gap: 10px;
padding-top: 15px;
}
.box {
width: 350px;
padding: 5px;
background-color: #ffffff;
border: .5px solid grey;
margin-bottom: 0px;
break-inside: avoid;
}
.box table {
width: 100%;
height: auto;
object-fit: contain;
}
.commission {
font-size: large;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<div class="box">
<div class="commission">{{ list.name | remove: "AUTO: " }}</div>
{{ organization.name }}<br>
Report Date: {{ list.updated_at | date: "%B %e, %Y" }}
- {{ people.size }} {{ people.size | pluralize: "person", "people" }}<br>
</div>
<!-- Create an array of '!' separated shepherds -->
{% assign households_by_shepherd = households | sort_natural: "primary_contact.custom_tabs.shepherding.shepherd" | reverse %}
{% assign current_shepherd = "" %}
{% assign new_list = true %}
{% for household in households_by_shepherd %}
{% if current_shepherd != household.primary_contact.custom_tabs.shepherding.shepherd.value %}
{% assign current_shepherd = household.primary_contact.custom_tabs.shepherding.shepherd.value %}
{% assign new_list = true %}
</tbody>
</table>
</div>
{% endif %}
{% if new_list %}
<div class="box">
<table class="table table-sm">
<thead>
<tr>
{% if current_shepherd == "" %}
<th>Orphan</th>
{% else %}
<th>{{ current_shepherd }}</th>
{% endif %}
<th></th>
<th>Female Shephard</th>
</tr>
</thead>
<tbody>
<tr>
<td>
{% for person in household.active_adults %}
{{ person.first_name }},
{% endfor %}
</td>
<td>{{ household.primary_contact.last_name }}
</td>
<td>
{% for person in household.active_adults %}
{% if person.custom_tabs.shepherding.woman_shepherd.value %}
{{ household.primary_contact.custom_tabs.shepherding.woman_shepherd }}
{% endif %}
{% endfor %}
</td>
</tr>
{% assign new_list = false %}
{% else %}
<tr>
<td>
{% for person in household.active_adults %}
{{ person.first_name }},
{% endfor %}
</td>
<td>{{ household.active_adults.first.last_name }}
</td>
<td>
{% for person in household.active_adults %}
{% if person.custom_tabs.shepherding.woman_shepherd.value %}
{{ person.custom_tabs.shepherding.woman_shepherd }}
{% endif %}
{% endfor %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
</body>
</html>