Leadership Guide
Imports: 7

I put together this bulletin-type report for our worship leaders (pastor, assisting minister, lector, etc.). It should be pretty straight forward, except for the People portion. We have two services with different people volunteering at each, and I had to do some funky variable manipulation to separate out the list of people by service time. I've added several custom fields to the Items in Services, including one to identify which elements of the service are standing. For hymns/songs, if we're skipping verses, I will take the lyrics and paste only the relevant ones in the Details box. If the report sees data in that box and it's a song, it will print that. Otherwise it prints the Lyrics. I've got a lot more in this vein that I've done. LMK if anyone is interested. Dr. Gus

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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<html>
	<head>
		<title>{{ plan.ministry.name }}:: {{ plan.dates }}</title>
		<style>
			* { font-family: noto sans; font-size: 16pt; }
			body { padding:0; margin:0; }
			sup { vertical-align: top; font-size: 0.6em; }
			label { font-weight: bold; font-style: normal; }
		  	table#notes { width: 100%; padding-top: 10px; padding-bottom: 10px; border-bottom: solid 1px black; }
			table#notes td { vertical-align: top; border-bottom: solid 1px black; font-size: 0.75em; }
			table#notes .category { text-align: right; font-size: 0.75em; font-weight: bold; }
			table#plan { width: 100%; border-top: solid 3px black; border-bottom: solid 3px black; padding: 0; border-collapse: collapse;}
			table#plan thead { display: table-header-group; }
			table#plan tr { page-break-inside: ; }
			table#plan th { vertical-align: bottom; border-bottom: solid 1px black; border-top: solid 2px black; }
			table#plan td { padding: 2px; vertical-align: top; border-bottom: solid .5px #dbdbdb; }
			table#plan .time { width: 35px; text-align: center; }
			table#plan .length { width: 55px; text-align: center; font-weight: bold; }
			table#plan .notes { width: 150px; text-align: left; }
			table#plan .person { font-size: 1em; width: 20%; padding-top: 6px; text-align: left; font-weight: bold; font-style: normal; }
			table#plan .header { font-size: 1.5em; height: 20px; background-color: #a1bfb9; color: #f6f7f8; font-weight: bold; padding-left: 5px; border-bottom: solid 1px black; border-top: solid 2px black; }
			table#plan .section_header { font-size: 1.2em; height: 18px; background-color: #bb9b9b; color: #f6f7f8; font-weight: bold; padding-top: 6px; padding-bottom: 4px; padding-left: 5px; border-bottom: solid 1px black; border-top: solid 1px black; }
			table#plan .item { font-size: 1em;  padding-top: 6px; padding-bottom: 4px; }
			table#plan .item_title { font-size: 1em; font-weight: bold; font-style: normal; width: 60%; padding-bottom: .2em; }
			table#plan .song { font-style: italic; }
			table#plan .arrangement { font-size: .9em; }
			table#plan .key { font-size: .9em; }
			table#plan .bpm { font-size: .9em; }
			table#plan .sequence { font-size: .9em; }
			table#plan .description { font-size: 1em; white-space: normal; font-style: italic; padding-bottom: .2em; }
			table#plan .stand_sit { float: right; font-size: 1em; font-style: normal; font-weight: bold; }
			table#plan .even { background-color: #f2f2f2; }
			table#header { width: 100%; border: none; padding: 0; border-collapse: collapse;}
			table#header td { vertical-align: top; }
			PRE { margin: 0; padding: 0; white-space: pre-wrap; }
			.plan_dates { height: 75px; font-size: 1.5em; font-weight: bold; }
			.report_title_block { font-weight: bold; text-align: center; border-bottom: solid 2px black; background-color: #6c7393; color: #f6f7f8 }
			.ministry_title { text-align: left; font-weight: bold; font-size: .75em; }
			.plan_title { float: right; font-weight: bold; font-size: .75em; }
			.series_title { float: left; font-weight: bold; font-size: .75em; }
			.service_time { text-align: left; font-weight: bold; font-size: .5em; }
			.currentdate { font-size: .5em; white-space: normal; font-style: italic; text-align: right; }
			.times_section { padding: 10px; width: 150px; border-right: dotted 2px black; vertical-align: top; }
			.time_heading { clear: both; border-bottom: solid 1px lightgrey; padding-top: 10px; font-weight: bold; font-size: 1.2em; }
			.time { padding-top: 0px; }
			.people_section { vertical-align: top; border-bottom: solid 1px lightgrey; font-weight: bold; padding-left: 3px; }
			.people_category { font-weight: normal; font-size: .7em; }
			.person { font-size: .6em; font-weight: bold; }
			.other { font-size: .9em; font-style: italic; color: #0000ff; }
			.lyrics { font-style: normal; margin-top: 10px; padding-left: 25px; }
		</style>
	</head>

	<body>
		<!-- HEADER TITLES TABLE -->
		<table width="100%" class="report_title_block">
			<tr>
				<td colspan=3 class="plan_dates">
				<img style="float: left; margin-right: 15px; height: 75px; " src="{{ plan.series_artwork_url }}" />
					Leadership Guide for {{ plan.dates }}
				<br />
					<span class="series_title">{{ plan.series_title }}</span>
					<span class="plan_title">{{ plan.plan_title }}</span>
				</td>
			</tr>
		</table>
		<!-- END HEADER TITLES TABLE -->


		<!-- People Table -->
		{% for time in plan.plan_times%}
			<table width="100%">
				<tr><td class="person"> {{ time.starts_at | date: '%l:%M' }} </td></tr>
				<tr class="people_section">
					{% for plan_person in plan.plan_people %}
						{% for position_time in plan_person.service_times %}
							{% assign plan_start_time_id = position_time.id %}
							{% assign plan_start_time = position_time.starts_at | date: '%l:%M' | downcase %}
							{% if plan_start_time_id == time.id %} {% assign id_match = 'YES' %}{% else %} {% assign id_match = 'NO' %}{% endif %}
							{% if plan_person.category.name contains plan_start_time %} {% assign name_match = 'YES' %}{% else %} {% assign name_match = 'NO' %}{% endif %}
							{% if id_match == 'YES' and name_match == 'YES' %}
								{% if last_category != plan_person.category.id%}
									{% assign current_position = '' %}
								{% endif %}
								{% assign last_category = plan_person.category.id %}
                  				{% unless plan_person.status == 'D' %}
								<td class="people_section">
									{% if current_position != plan_person.position %}
										<div class="people_category">{{ plan_person.position }} </div>
									{% endif %}
									<div class="person">{{ plan_person.person.name }} </div>
								</td>
								{% assign current_position = plan_person.position %}
                  				{% endunless %}
							{% endif %}
						{% endfor %}
					{% endfor %}
				</tr>
			</table>
		{% endfor %}
		<!-- END PEOPLE TABLE -->
	  
		<!-- PLAN NOTES -->
			<table id="notes" width="100%" >
					{% for note in plan.notes %}
						<tr>
							<td class="category">{{ note.category_name }}: </td>
							<td> {{ note.note }}</td>
						</tr>
					{% endfor %}
		</table>
		<!-- END PLAN NOTES -->

		<!-- PLAN TABLE -->
			<table id="plan">
				<tbody>
					{% for item in plan.items %}
						{% case item.item_type %}
						{% when 'Header' %}
							<tr style="page-break-after: avoid;">
								<td colspan="2" class="section_header">
									{{ item.title }}
								</td>
							</tr>
						{% else %}
							{% if item.title != 'Start Stream' and item.title != 'End Stream' %}
								{% assign loop_count = 0 %}
								{% for item_time in item.times %}
									{% assign loop_count = loop_count | plus: 1 %} 
									{% if loop_count == 1 %} 
										{% if item_time.excluded? == true %}
											{% assign both_services = false %}
										{% else %}
											{% assign both_services = true %}
											{% assign service_time = item_time.time_id %} 
										{% endif %} 
									{% else %}
										{% if item_time.excluded? == true %}
											{% assign both_services = false %}
										{% else %}
											{% assign service_time = item_time.time_id %} 
										{% endif %}
									{% endif %} 
								{% endfor %}
								<tr class="item {% cycle 'odd', 'even'%}"> 
									<td class="person">
										{% for note in item.notes %}
											{% if note.category_name == 'Person' %}{{ note.note }}{% endif %}
										{% endfor %}
									</td>
									<td class="item {% if item.song %}song{% endif %}">
										<span class="stand_sit">{% for note in item.notes %}{% if note.category_name == "Stand" %} {{ note.note }} {% endif %}{% endfor %} </span>
										{% if item.song %}
											<div class="item_title">{{ item.description }}
											{% if both_services == false %} 
												{% for time in plan.plan_times %} 
													{% if service_time == time.id %} 
														&emsp; ({{ time.starts_at | date: '%I:%M%p' }})
													{% endif%} 
												{% endfor %} 
											{% endif %}
											<span class="description">"{{ item.title }}"</span></div> 
											<span class="arrangement">{{ item.arrangement.name }}
												{% for note in item.notes %}{% if note.category_name == "Verses" %} --- Verses: {{ note.note }} {% endif %}{% endfor %}
											</span>
											{% for note in item.notes %}{% if note.category_name == "Other Notes" %} <span class="other">Note: {{ note.note }}</span>{% endif %}{% endfor %}
											<div class="lyrics"> <!-- If there is text in the Item Details, print that. Otherwise print the Lyrics -->
												{% if item.details !="" %} 
													{{ item.details }}
												{% else %}
													{{ item.arrangement.lyrics }}
												{% endif %}
											</div>
										{% else %}
											<div class="item_title">{{ item.title }} 
												{% if both_services == false %} 
													{% for time in plan.plan_times %} 
														{% if service_time == time.id %}
															&emsp; ({{ time.starts_at | date: '%I:%M%p' }}) 
														{% endif%} 
													{% endfor %} 
												{% endif %}
											</div>
											{% if item.description %}<div>{{ item.description }}</div>{% endif %}
											{% for note in item.notes %}{% if note.category_name == "Other Notes" %} <span class="other">Notes: {{ note.note }}</span>{% endif %}{% endfor %}
											<div class="lyrics">{{ item.details }}</div>
										{% endif %}
									</td>
								</tr>
							{% endif %}
						{% endcase %}
					{% endfor %}
				</tbody>
			</table>
		<!-- END PLAN TABLE -->

	</body>
</html>