Multiple Households
Imports: 106

Shows people from a list only if they are members of multiple households. Includes the names and members of those households, along with any additional data columns included in the list.

Preview

Report Preview


 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
<html lang="en">
  <head>
    <meta charset="utf-8">
    {{ helpers.bootstrap_3 }}
    <!-- This report is styled using the Bootstrap framework. http://getbootstrap.com/css/ 
				 If you'd rather provide your own styles, add them to the style section below. -->
    
    <style>
      	@page 	{margin: .125in;}   /*-- PDF margin reset --*/
      
      	tr.person > td { 
          padding: 0.25em; }
      	tr:nth-child(even) { background-color: #edf2f7; }
      	thead { 
          border-bottom: 1px solid #bec9d3; }
				th { padding: .5em; }
      	.avatar { 
          width: 50px;
        	height: 50px;
					border-radius: 25px 25px 25px 25px;
          -moz-border-radius: 25px 25px 25px 25px;
          -webkit-border-radius: 25px 25px 25px 25px;
        }
      	.container {
          width: 100%;
          padding-top: 15px;
        }
    </style>
  </head>
  <body>
    <div class="container">
       <div class="pull-right">
        <div class="well well-sm text-right">
          {{ people.size }} {{ people.size | pluralize: "person", "people" }}<br>
          Report Date:  {{ list.updated_at | date: "%B %e, %Y"  }}
        </div>
      </div>
      <h2>
        People in Multiple Households
        <br>
        <small>
          {{ list.name }}
        </small>
      </h2>
      <div class="clearfix"></div>
      <table style="width: 100%">
      <thead>
        <tr>
          <th style="text-align: left">Photo</th>
          <th style="text-align: left">Name</th>
          <th style="text-align: left">Households</th>
          {% for column in list.columns %%}
            {% unless column.identifier == "people.photo" or column.identifier == "people.name" %}
              <th style="text-align: left" data-sortable="true">{{column.name}}</th>
            {% endunless %}
          {% endfor %}
        </tr>
      </thead>
        <tbody>
          {% for result in results %}
            {% if result.person.households.size > 1 %}
              <tr class="person">
                <td><img class="avatar" src="{{ result.person.photo_url | split: "?" | first | append: "?g=50x50%23" }}" /></td>
                <td><a href="https://people.planningcenteronline.com/people/AC{{ result.person.id }} ">{{result.person.name}}</a></td>

                <td>
                  {% for household in result.person.households %}
                    <strong>{{ household.name }}</strong>
                    <ul>
                      {% for adult in household.active_adults %}
                      <li><strong><a href="https://people.planningcenteronline.com/people/AC{{ adult.id }} ">{{adult.name}}</a></strong></li>
                      {% endfor %}
                      {% for child in household.active_children %}
                        {% unless child.id == result.person.id %}
                          <li><a href="https://people.planningcenteronline.com/people/AC{{ child.id }} ">{{child.name}}</a></li>
                        {% endunless %}
                      {% endfor %}
                    </ul>
                  {% endfor %}
                </td>

                {% for column in list.columns %}
                  {% unless column.identifier == "people.photo" or column.identifier == "people.name" %}
                    <td>
                      {{ column | column_detail column, result }}
                    </td>
                  {% endunless %}
                {% endfor %}

            {% endif %}
          
          {% endfor %}
          
        </tbody>
    </table>
    </div>
  </body>
</html>