mixin birthdaycards_settings(parishes, parishid, receivers, formats, formats_volunteers, formatid)
	form(class="form-horizontal", role="form", id="form")
		.form-group
			label(for='combo_parish', class="col-sm-2 control-label") Pfarrei
			.col-sm-10
				select(id='combo_parish', class="form-control")
					- var id=0;
					- each parish in parishes
						option(value="#{id}") #{parish.name}
						- id++;
				script.
					$("#combo_parish").val("#{parishid}")	
						
		.form-group
			label(for='combo_receivers', class="col-sm-2 control-label") Adressaten
			.col-sm-10
				select(id='combo_receivers', class="form-control", onchange="update_formats();")
					option(value="0") Gläubige allgemein
					option(value="1") Ehrenamtliche
				script.
					$("#combo_receivers").val("#{receivers}")
					
		.form-group
			label(for='combo_format', class="col-sm-2 control-label") Format
			.col-sm-10
				select(id='combo_format', class="form-control")
					- var id=0;
					- var real_formats = (receivers === 0 ? formats : formats_volunteers)
					- each format in real_formats
						option(value="#{id}") #{format}
						- id++;
				script.
					$("#combo_format").val("#{formatid}")

mixin birthdaycards_persons(omitted_lines, persons, persons_with_information_lock, persons_omitted)
	fieldset(style="margin-bottom: 20px;")
		legend(style="font-size: 120%; margin-bottom: 0px; color: orange;") Personen, die eine Karte bekommen sollten, aber eine Auskunfssperre haben
		p Wählen Sie die Personen aus, die trotzdem eine Karte bekommen sollen!
		table(width='100%', class='table table-condensed', style='margin-bottom: 10px;')
			thead
				tr
					td(width='25%') <b>Name</b>
					td <b>Geburtstag</b>
					td <b>Alter</b>
					td <b>Straße</b>
					td <b>Wohnort</b>
			tbody
				for p in persons_with_information_lock
					- the_class = p.send_card ? 'send_card' : '';
					tr(id="#{p.uuid}", class=[the_class], onclick="$(this).toggleClass('send_card');", style="cursor: pointer;")
						td #{p.surname}, #{p.forename}
						td #{p.birthday}
						td #{p.age}
						td #{p.street} #{p.streetnr}
						td #{p.location}
	fieldset(style="margin-bottom: 20px;")
		legend(style="font-size: 120%; margin-bottom: 0px; color: green;") Personen, die eine Karte bekommen
		table(width='100%', class='table table-condensed', style='margin-bottom: 10px;')
			thead
				tr
					td(width='25%') <b>Name</b>
					td <b>Geburtstag</b>
					td <b>Alter</b>
					td <b>Straße</b>
					td <b>Wohnort</b>
			tbody
				for p in persons
					tr
						td #{p.surname}, #{p.forename}
						td #{p.birthday}
						td #{p.age}
						td #{p.street} #{p.streetnr}
						td #{p.location}
	fieldset(style="margin-bottom: 20px;")
		legend(style="font-size: 120%; margin-bottom: 0px; color: red;") Personen, die KEINE Karte bekommen (nicht das 'richtige' Alter haben)
		table(width='100%', class='table table-condensed', style='margin-bottom: 10px;')
			thead
				tr
					td(width='25%') <b>Name</b>
					td <b>Geburtstag</b>
					td <b>Alter</b>
					td <b>Straße</b>
					td <b>Wohnort</b>
			tbody
				for p in persons_omitted
					tr
						td #{p.surname}, #{p.forename}
						td #{p.birthday}
						td #{p.age}
						td #{p.street} #{p.streetnr}
						td #{p.location}
	fieldset(style="margin-bottom: 20px;")
		legend(style="font-size: 120%; margin-bottom: 0px;") Übersprungene Zeilen
		div(style="margin-left: 10px; background-color: lightgrey;")
			p.
				!{omitted_lines}
