Skip to content

Instantly share code, notes, and snippets.

@strobelight
Created January 12, 2016 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strobelight/929c6f95bc88b2c9c36e to your computer and use it in GitHub Desktop.
Save strobelight/929c6f95bc88b2c9c36e to your computer and use it in GitHub Desktop.
PlanningCenterOnline Production Grid report
<!--
PRODUCTION NOTES GRID
customized "Planning Center Grid" by Ken Shaffer
Show your appreciation: https://www.paypal.me/KenShaffer.
To make use of this, add Item Note Categories with names
matching names below, with desired print color to use.
To create Item Note Categories, click the pencil icon of
any item, find the "Item Notes" section, and on that same
"Item Notes" line, click the gear icon to the right of its
section (the gear won't show unless your mouse pointer is
on its line).
You can add/remove categories here, then drag in the order you want
printed.
Click Close then Accept when done.
The way this report works is if all the item notes of interest have
nothing in them, the default report is simply the item title with
its description and an empty column for notes. Otherwise, you'll
get the item title and your desired item notes with an optional
blank notes column.
To get some content in your item notes, click the pencil icon
of an item, find the "Item Notes" section, and enter text in
appropriate boxes for the item, then click Accept. Repeat for all
items.
QUICK CUSTOMIZATION:
{% assign CHURCHLINE = 'MY<sup style="font-size:smaller;">&reg;</sup> CHURCH' %}
{% assign TEAMLINE = "[&nbsp;P&nbsp;R&nbsp;O&nbsp;D&nbsp;U&nbsp;C&nbsp;T&nbsp;I&nbsp;O&nbsp;N&nbsp;]" %}
CATEGORY NAME AND COLOR
To tell me what Item Note Categories to use and your desired
color, enter the name of the category and desired color as follows:
name|color,
So, each category name is followed by a vertical bar followed by its color.
After the color, is a comma. It's easier to read if each are on their own
line, but it's not a requirement that they be on their own line. The only
requirement is that names & colors are separated by vertical bars, and
each name|color pair is separated by another name|color pair by a comma.
So, only edit lines containing the names | colors. The line beginning with
a double quote must remain unchanged. See also example if you have another
ministry desiring different names | colors.
You'll have to edit this report to see the values used for defaults and other
campuses. If viewing the source via a web browser (i.e. not editing this report
via a browser), you will see the ministry item note category names and colors
below.
D E F A U L T S
{% assign category_names_colors = "
Audio/Visual | black,
" | strip_newlines | split: "," %}
{% assign show_empty_notes_column_at = 2 %}
{% assign COL1TITLE = "Element"%}
C E N T R A L C A M P U S
{% if plan.ministry.name == 'Central Campus Services'%} {% comment %} Central Campus Services {% endcomment %}
{% assign category_names_colors = "
MACRO | blue,
PGM | red,
M/E 1 | red,
Shader | black,
GFX1 | #00c300,
GFX2 | #00c300,
Thunder | #00c300,
CS-1 | #00c300,
CS-2 | #00c300,
" | strip_newlines | split: "," %}
{% assign show_empty_notes_column_at = 2 %}
{% assign COL1TITLE = "Cue"%}
{% endif %}
S U G A R L O A F C A M P U S
{% if plan.ministry.name == 'Sugarloaf Service'%}
{% assign category_names_colors = "
Audio | black,
M/E 1 | red,
M/E 2 | red,
Video | black,
Lighting | black,
" | strip_newlines | split: "," %}
{% assign show_empty_notes_column_at = 2 %}
{% assign COL1TITLE = "Cue"%}
{% endif %}
K E N S T E S T
{% if plan.ministry.name == 'Kens Test Service'%}
{% assign category_names_colors = "
FOHx | blue,
Lightingx | red,
Green | #00c300,
" | strip_newlines | split: "," %}
{% assign show_empty_notes_column_at = 2 %}
{% assign COL1TITLE = "Column 1 Title"%}
{% endif %}
Here's the item note category names and colors being used for '{{ plan.ministry.name }}' if one or more had content:
{% assign rightbrace = "}" %}{% assign leftbrace = "{" %}{% assign category_names_str = "" %}{% assign category_classes_str = "" %}
{% for cnc in category_names_colors %}{% assign nc = cnc | remove: ' ' | strip | split: "|" %}{% if nc[0] %}{% assign nc0 = nc[0] | strip %}{% assign category_names_str = category_names_str | append: nc0 | append: "," %} name = "{{nc0}}"
color = "{{nc[1] | strip }}"{% assign nc1=nc0
| strip
| remove: '%'
| remove: '/'
| remove: '&'
| remove: ' '
| remove: '~'
| remove: '`'
| remove: '!'
| remove: '@'
| remove: '#'
| remove: '$'
| remove: '^'
| remove: '*'
| remove: '('
| remove: ')'
| remove: '-'
| remove: '+'
| remove: '='
| remove: '['
| remove: ']'
| remove: ';'
| remove: ':'
| remove: "'"
| remove: '"'
| remove: ','
| remove: '<'
| remove: '.'
| remove: '>'
| remove: '?'
| remove: '\'
| remove: leftbrace
| remove: rightbrace
| remove: '£'
%}{% assign category_classes_str = category_classes_str | append: "PNG_" | append: nc1 | append: "," %}
{% endif %}
{% endfor %}
-->
<html>
{% assign category_names = category_names_str|split:"," %}
{% assign category_classes = category_classes_str|split:"," %}
{% assign nbsp = "&nbsp;" %}
{% comment %} Debug code to see category name with its class
{% for cn in category_names %}
{{ cn }} | {{ category_classes[forloop.index0]}}
{% endfor %}
{% endcomment %}
{%comment%}check what item notes match desired ones {%endcomment%}
{% assign havenotes = false %}
{% assign names_to_check_str = "" %}
{% assign classes_to_check_str = "" %}
{% for note in plan.ministry.plan_item_note_categories %}
{% for cn in category_names %}
{% assign nn = note.name | strip %}
{% if cn == nn %}
{% assign names_to_check_str = names_to_check_str | append: cn | append: "," %}
{% assign classes_to_check_str = classes_to_check_str | append: category_classes[forloop.index0] | append: "," %}
{% endif %}
{% endfor %}
{% endfor %}
{% if names_to_check_str.size > 3 %}
{% assign havenotes = true %}
{% endif %}
{%comment%}if have matching notes, check if there's content{%endcomment%}
{% if havenotes %}
{% assign names_to_check = names_to_check_str | split: "," %}
{% assign classes_to_check = classes_to_check_str | split: "," %}
{% assign size_so_far = 0 %}
{% for item in plan.items %}
{% if size_so_far < 10 and item.item_type != 'Header' %}
{% for cn in names_to_check %}
{% for note in item.notes %}
{% assign inn = note.category_name | strip %}
{% if cn == inn %}
{% assign notetext = note.note | remove: ' ' %}
{% assign size_so_far = size_so_far | plus: notetext.size %}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
{% endfor %}
{% if size_so_far == 0 %}
{% assign havenotes = false %}
{% endif %}
{% endif %}
{% if havenotes %}
{% assign number_columns = names_to_check.size %}
{% if show_empty_notes_column_at >= 2 %}
{% assign number_columns = number_columns | plus: 1 %}
{% endif %}
{% assign number_columns = number_columns | plus: 1 %}
{% else %}
{% assign number_columns = 2 %}
{% endif %}
<head>
<title>{{ plan.ministry.name }} {{ plan.dates | date: '%m.%d.%y'}}|Production Flow</title>
<style>
* {
font-family: Arial, Verdana;
font-size: .925em;
}
body {
padding: 0;
margin: 15px;
}
table#plan {
width: 100%;
border-collapse: collapse;
margin-top: 5px;
}
table#plan th {
background-color: #e3f8ff; <!-- #F3F3F3; -->
color: black;
font-size: 1.3em;
border: solid 1pt black;
padding: 2px;
}
table#plan td {
text-align: center;
font-size: 1.3em;
}
table#plan tbody, #plan thead {
border: solid 1pt black;
}
table#plan thead {
display: table-header-group;
}
table#plan tbody td {
border: solid 1pt black;
padding: 2px;
vertical-align: middle;
}
table#plan .header {
text-align: center;
font-weight: bold;
font-size: 1.3em;
background-color: #e3f8ff; <!-- cddbe5 -->
color: black;
}
table#plan .note {
text-align: center;
font-size: 1.3em;
vertical-align: middle;
width: calc(60%/{{names_to_check.size}});
}
table#plan .element {
text-align: left;
font-family: Arial;
font-size: 1.3em;
vertical-align: top;
height: 33px;
padding-top: 0px;
width: 20%;
}
table#plan .element pre {
font-weight: normal;
font-size: 1.1em;
padding-left: 5px;
padding-top: 10px;
padding-bottom: 10px;
padding-right: 3px;
}
table#plan .title {
font-weight: bold;
padding-left: 2px;
padding-top: 2px;
}
table#plan .empty_note_column {
width: 20%;
}
{% for cnc in category_names_colors %}{% assign nc=cnc | remove: ' ' | strip | split: "|" %}{% if nc[0] != nil %}{% assign pngclass=nc[0]
| strip
| remove: '%'
| remove: '/'
| remove: '&'
| remove: ' '
| remove: '~'
| remove: '`'
| remove: '!'
| remove: '@'
| remove: '#'
| remove: '$'
| remove: '^'
| remove: '*'
| remove: '('
| remove: ')'
| remove: '-'
| remove: '+'
| remove: '='
| remove: '['
| remove: ']'
| remove: ';'
| remove: ':'
| remove: "'"
| remove: '"'
| remove: ','
| remove: '<'
| remove: '.'
| remove: '>'
| remove: '?'
| remove: '\'
| remove: leftbrace
| remove: rightbrace
| remove: '£'
%}
table#plan .PNG_{{ pngclass }} {{ leftbrace }}
{% assign pngcolor = nc[1] | strip %}color: {{ pngcolor }};
font-weight: bold;
{{ rightbrace }}
{% endif %}
{% endfor %}
table#plan .footer {
text-align: center;
font-family: Arial Black;
font-size: 1.4em;
vertical-align: middle;
border: solid 3px black;
padding: 0px;
}
table#header {
width: 100%;
border: solid 1pt black;
padding: 0;
border-collapse: collapse;
}
table#header td {
padding: 2px;
vertical-align: top;
}
H1 {
text-align: center;
padding: 0;
margin-top: 10;
margin-bottom: 10;
font-size: 2.4em;
font-family: Impact;
font-weight: normal;
}
H2 {
text-align: center;
padding: 0;
margin: 0;
font-size: 2.1em;
font-style: italic;
font-family: Impact;
font-weight: normal;
}
H3 {
text-align: center;
padding: 0;
margin: 0;
font-size: 1.9em;
font-family: Impact;
font-weight: normal;
}
H4 {
text-align: center;
padding: 0;
margin: 0;
font-size: 1.3em
}
PRE {
margin: 0;
padding: 0;
white-space: pre-wrap;
}
.production_team {
border: solid 1px black;
width: 350px;
border-collapse: collapse;
margin: 5px auto;
}
.production_team TH {
font-size: 1em;
background-color: #eee;
border-right: solid 1px black;
text-align: right;
padding-right: 6px;
width: 140;
padding-top: 0px;
padding-bottom: 0px;
}
.production_team TD {
font-size: 1em;
padding-left: 6px;
}
.times TD {
font-family: arial;
font-size: 1em;
vertical-align: top;
padding: 0px;
}
.times TH {
font-weight: normal;
font-family: impact;
font-size: 1.4em;
text-align: left;
text-decoration: underline;
padding: 0px;
}
</style>
</head>
<body>
<table width="100%">
<tr>
<td width="20%" valign="top">
<h4 style="font-family:Trebuchet MS; font-style:italic">
{{ CHURCHLINE }}
</h4>
<h3 style="font-family:Trebuchet MS;">
{{ TEAMLINE }}
</h3>
</td>
<td valign="middle">
<h4 style="text-align: right; padding-right:3em;">{{ plan.ministry.name }} {{ plan.dates | date: '%m.%d.%y'}} | Production Flow</h4>
</td>
</tr>
</table>
<table id="plan">
<thead>
<tr>
{% if havenotes %}
{% for cn in names_to_check %}
{% if forloop.index == 1 %}
<th align="left">{{COL1TITLE}}</th>
{% assign col = 1 %}
{% endif %}
{% assign col = col | plus: 1 %}
{% if col == show_empty_notes_column_at %}
<th>Notes</th>
{% endif %}
{% assign nbcn = cn | replace: ' ', nbsp %}
<th class="{{ classes_to_check[forloop.index0] }}">{{nbcn}}</th>
{% endfor %}
{% if col < show_empty_notes_column_at %}
<th>Notes</th>
{% endif %}
{% else %}
<th align="left" style="width:70%;">{{COL1TITLE}}</th>
<th>Notes</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for item in plan.items %}
{% case item.item_type %}
{% when 'Header' %}
<tr>
<td colspan="{{number_columns}}" class="header">{{ item.title }}</td>
</tr>
{% else %}
<tr>
{% if havenotes %}
{% for cn in names_to_check %}
{% if forloop.index == 1 %}
<td class="element title">{{ item.title }}</td>
{% assign col = 1 %}
{% endif %}
{% assign col = col | plus: 1 %}
{% if col == show_empty_notes_column_at %}
<td class="empty_note_column">&nbsp;</td>
{% endif %}
{% assign no_td_output = true %}
{% assign cn_idx = forloop.index0 %}
{% for note in item.notes %}
{% assign inn = note.category_name | strip %}
{% if cn == inn %}
<td class="note {{ classes_to_check[cn_idx] }}">
<pre>{{ note.note }}</pre>
</td>{% assign no_td_output = false %}
{% endif %}
{% endfor %}
{% if no_td_output %}
<td>&nbsp;</td>
{% endif %}
{% endfor %}
{% if col < show_empty_notes_column_at %}
<td class="empty_note_column">&nbsp;</td>
{% endif %}
{% else %}
<td class="element title">
{{ item.title }}
<pre>{{ item.description }}</pre>
</td>
<td class="empty_note_column">&nbsp;</td>
{% endif %}
</tr>
{% endcase %}
{% endfor %}
</tbody>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment