Multiple Households
Imports: 23

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


<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>