Note Contents
Imports: 16

This report adds a column to the default report with the note contents for each person. Notes can be filtered by category and by date range.

Preview

Report Preview


<!--

--- What note categories should be included? (Put each on new line) ---
{% capture noteType %}
Visits
Confidential
{% endcapture %}
{% assign noteType = noteType | newline_to_br | strip_newlines | split: "&amp;lt;br /&amp;gt;" %}


--- What's the earliest note date to include? ---
{% capture startDate %}
2000-01-01
{% endcapture %}


--- What's the latest note date to include? ---
{% capture endDate %}
2050-01-01
{% endcapture %}

-->



<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>
          List Creator: {{ list.created_by.name }}<br>
          Report Date:  {{ list.updated_at | date: "%B %e, %Y"  }}
        </div>
      </div>
      <h2>
        {{ list.name }}
        <br>
        <small>
          {{ organization.name }}
        </small>
      </h2>
      <div class="clearfix"></div>
      <table style="width: 100%">
      <thead>
        <tr>
          {% for column in list.columns %%}
            <th style="text-align: left">{{column.name}}</th>
          {% endfor %}
          <th>Notes</th>
        </tr>
      </thead>
      <tbody>
        {% for result in results %}
          <tr class="person">
            {% for column in list.columns %%}
              <td>
                {% assign detail = column | column_detail column, result %}
                {% if column.identifier == "people.photo" %}
                  <a href="{{detail}}" target="_blank"><img class="avatar" src="{{ detail }}?g=50x50%23" /></a>
                {% elsif detail.filename %}
                  <a href="{{detail.url}}" target="_blank">{{detail.filename}}</a>
                {% elsif column.identifier == "people.name" %}
                  <a href="/people/AC{{result.person.id}}" target="_blank">{{detail}}</a>
                {% elsif column.identifier == "emails.address" %}
                  <a href="mailto:{{detail}}">{{detail}}</a>
                {% elsif column.identifier == "phone_numbers.number" %}
                  <a href="tel:{{detail}}">{{detail}}</a>
                {% else %}
                  {{ detail }}
                {% endif %}
              </td>
            {% endfor %}
            <td>
              <ul>
                {% for note in result.person.notes %}
                  {% if note.date >= startDate and note.date <= endDate and noteType contains note.category %}
                    <li>
                      <strong>{{note.date | date: '%Y-%b-%e' }}</strong>
                      <br />{{ note.message }}
                    </li>
                  {% endif %}
                {% endfor %}
              </ul>
            </td>
          </tr>
        {% endfor %}
      </tbody>
    </table>
    </div>
  </body>
</html>