include mixins
doctype html
html
	include header
	body(style="overflow: hidden;")

		div(style="display: box; height: 100%;")

			div(style="-moz-box-flex:  0; box-flex:  0;")

				+nav("PfarrInfoSystem", "dropdown_menu")
					+nav_item( "/" ) Tag
					+nav_item( "#", "active" ) Woche
					+nav_item( "/select_punits_for_view?u=/week" ) Angezeigte Orte konfigurieren
					+nav_item( "/info" ) Info

				.container-fluid(style="margin-bottom: 18px; box-flex: 0;")

					table(width="100%")
						tr
							td(colspan=2, width="20%")
								a(href="/week/-1", class="litpanel_arrow") ←
							td(colspan=2, style="text-align: center; width: 60%;")
								a(href="/week/picker?d="+ basedate + "&u=/week", style="color: black;")
									span(class="litpanel_day_mobile") #{interval}
							td(colspan=2, style="text-align: right; width: 20%;")
								a(href="/week/+1", class="litpanel_arrow") →

			//-main(style="overflow: scroll; -moz-box-flex: 1; box-flex: 1; padding-left: 15pt; padding-right: 15pt;")
			div(style="-moz-box-flex:  1; box-flex:  1;")
				div(style="overflow: scroll; height: 100%;")

					- var celebration_printed = false;
					table(width="100%")
						each day in days
							- var red_class = day.litinfo.decoration_hint_red ? "litpanel_red" : "";
							- var celebration_class = "";
							- if(day.litinfo.decoration_hint == 2) celebration_class = "week_celebration_stage2";
							- if(day.litinfo.decoration_hint == 1) celebration_class = "week_celebration_stage1";
							- var the_date = day.date.weekday_short + ",&nbsp;" + day.date.day + ".&nbsp;" + day.date.month_short + "&nbsp;" + day.date.year;
							if( ! celebration_printed)
								tr(style="border-bottom:1px solid #000;")
									td(valign='top', colspan=2)
										span(class=["week_celebration", celebration_class, red_class]) !{the_date}
									td(valign='top')
										span(class=["week_celebration", celebration_class, red_class]) #{day.litinfo.celebration}
										if day.litinfo.celebration_add != ""
											br
											span(class="litpanel_celebration_add") !{day.litinfo.celebration_add}
										if day.litinfo.infos != ""
											br
											span(class="litpanel_infos") !{day.litinfo.infos}
							else
								tr
									td(colspan=2, valign='top', style="border-bottom:1px solid #000;")
										span(class=["week_celebration", celebration_class, red_class]) !{the_date}
									td
							each event in day.parishcal.events.today
								+week_event_mobile(event)
							if(day.parishcal.tomorrow)
								tr
									td &nbsp;
									td &nbsp;
									td &nbsp;
								- celebration_printed = true;
								- var red_class_tomorrow = day.parishcal.tomorrow.decoration_hint_red ? "litpanel_red" : "";
								- var celebration_class_tomorrow = "";
								- if(day.parishcal.tomorrow.decoration_hint == 2) celebration_class_tomorrow = "week_celebration_stage2";
								- if(day.parishcal.tomorrow.decoration_hint == 1) celebration_class_tomorrow = "week_celebration_stage1";
								tr(style="border-bottom:1px solid #000;")
									td
									td
									td
										span(class=["week_celebration", celebration_class_tomorrow, red_class_tomorrow]) #{day.parishcal.tomorrow.celebration}
										if day.parishcal.tomorrow.celebration_add != ""
											br
											span(class="litpanel_celebration_add") !{day.parishcal.tomorrow.celebration_add}
										if day.parishcal.tomorrow.infos != ""
											br
											span(class="litpanel_infos") !{day.parishcal.tomorrow.infos}
								tr
									td(valign='top', colspan=2, style="border-bottom:1px solid #000;")
										span(class=["week_celebration", celebration_class, red_class]) !{the_date}
									td
								each event in day.parishcal.events.tomorrow
									+week_event_mobile(event)
							else
								- celebration_printed = false;
								tr
									td &nbsp;
									td &nbsp;
									td &nbsp;
