mixin involved_list_label(name, style_label, style_headline, section_uid)
	//- var link_add = ( section_uid === '' ? '' : '?role='+ section_uid +'' );
	- var glyphicon_class = ( section_uid === '' ? 'glyphicon-thumbs-up' : 'glyphicon-hand-right' );
	legend(style=style_label) 
		table(width="100%")
			tr
				td
					span(class=["glyphicon", glyphicon_class], aria-hidden="true")
					span 
					span(style=style_headline) #{name}
				td(align="right")
					if section_uid !== ""
						button(type="button", class="btn btn-default btn-xs", onclick="pcal_pentry_edit_manager.save_and_goto('edit_role', {'role' : '#{section_uid}'});")
							span(class="glyphicon glyphicon-edit", 	aria-hidden="true", style='color: blue; display: inline;')
						button(	type="button", class="btn btn-default btn-xs", 
							data-toggle="modal", data-target="#confirmDelete", data-delete-type="Dienst", data-delete-name="#{name}")
							span(class="glyphicon glyphicon-trash", aria-hidden="true", style='color: red; display: inline;')
					+dropdown_button("Hinzufügen", "new_involved", "right")
						+dropdown_button_element_href("Von Liste", "javascript: pcal_pentry_edit_manager.save_and_goto('add_actor', {'role': '" + section_uid + "'});")
						+dropdown_button_element_href("Aus Datenbank", "javascript: pcal_pentry_edit_manager.save_and_goto('add_parishdbpersongroup', {'role': '" + section_uid + "'});")
						+dropdown_button_element_href("Manuell", "javascript: pcal_pentry_edit_manager.save_and_goto('add_involved', {'role': '" + section_uid + "'});")

mixin involved_list(the_involved, section_name, section_uid)
	.col-sm-12(style="padding-right: 0px;")
		if the_involved.length === 0
			p Keine Beteiligten ausgewählt.
		else
			table(class="table table-condensed", style="margin-bottom: 5px;")
				thead
					tr
						th 
							span(style="color: grey; font-size: 80%;") Name
						th
				tbody
					each inv in the_involved
						tr(id="#{inv.uid}", data-uid="#{inv.uid}", data-role="#{section_uid}")
							td(width="80%") #{inv.name}
							td(align="right", style="white-space: nowrap;")
								if inv.id === "other"
									span(	class="glyphicon glyphicon-edit"
											aria-hidden="true",
											style="color: blue; cursor: pointer;",
											onclick="pcal_pentry_edit_manager.save_and_goto('edit_involved', {'role': '#{section_uid}', 'involved': '#{inv.uid}'});")
								span(	class="glyphicon glyphicon-trash", 
										aria-hidden="true", 
										style='color: red; padding-right: 10px; padding-left: 10px; cursor: pointer;'
										data-toggle="modal", data-target="#confirmDelete", data-delete-type="Beteiligten aus dem Bereich '#{section_name}'", data-delete-name="#{inv.name}"
										)
