Note Contents
Imports: 142

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


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

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