include mixins

doctype html
html
	include header
	body(style="overflow: hidden;")
	
		- var red_class = litinfo.decoration_hint_red ? "litpanel_red" : "";
		- litinfo.celebration = litinfo.celebration.replace("\\n", "<br/>");
		- litinfo.celebration_add = litinfo.celebration_add.replace("\n", "<br/>");
		- litinfo.infos = litinfo.infos.replace("\\n","<br/>");
		- var celebration_class = "";
		- if(litinfo.decoration_hint == 2) celebration_class = "litpanel_bold";
		- if(litinfo.decoration_hint == 1) celebration_class = "litpanel_italic";
		
		if can_go_back === false
			script.
				history.pushState(null, null, location.href);
				window.onpopstate = function(event) {
					history.go(1);
				};
		
		.container-horizontal(style="overflow: hidden;")
		
			.flex-one(style="overflow: hidden; height: 100%;")
			
				.container-vertical
				
					.flex-zero
						+nav("PfarrInfoSystem", "dropdown_menu")
							+nav_item( "#", "active" ) Tag
							+nav_item( "/week/" + date.date) Woche
							+nav_item( "/day/select_punits_for_view" ) Angezeigte Orte konfigurieren
							+nav_item( "/info" ) Info
							
							
						input(type="checkbox" id="refreshCheck")
						script.
							
							$(function () {
								if ($('#refreshCheck')[0].checked)
									window.location.reload();

								$('#refreshCheck')[0].checked = true;
							});
							
						.container-fluid(style="margin-bottom: 18px;")
							form(id="control", action="/adjust_date" method="POST")
								input(type="hidden" name="adjust_date" id="adjust_date")
								table(width="100%")
									tr
										td(colspan=2, width="20%")
											a(href="/day/#{last_week}", class="litpanel_arrow") ⇐
											a(href="/day/#{yesterday}", class="litpanel_arrow") ←
										td(colspan=2, style="text-align: center; width: 60%;")
											a(href="/day/picker?start="+ date.date, style="color: black;")
												span(class=["litpanel_day_mobile", red_class]) #{date.weekday_short},&nbsp;#{date.day}.&nbsp;#{date.month_short}&nbsp;#{date.year} 
												span(class=["litpanel_day_mobile_littime", red_class]) [#{litinfo.time}]
										td(colspan=2, style="text-align: right; width: 20%;")
											a(href="/day/#{tomorrow}", class="litpanel_arrow") →
											a(href="/day/#{next_week}", class="litpanel_arrow") ⇒
		
									tr
										td(colspan=6, class="litpanel_month_week_weekday litpanel_celebration_parent")
											span(class=["litpanel_celebration", celebration_class, red_class]) !{litinfo.celebration}
									if litinfo.celebration_add != ""
										tr
											td(colspan=6, class=["litpanel_month_week_weekday", "litpanel_celebration_parent", red_class])
												span(class="litpanel_celebration_add") !{litinfo.celebration_add}
									if litinfo.infos != ""
										tr
											td(colspan=6, class="litpanel_month_week_weekday litpanel_celebration_parent")
												span(class="litpanel_infos") !{litinfo.infos}		
												
							+messageview(messages)
					
					.flex-one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
						.row
							.col-xs-12.col-sm-6
								fieldset(style="margin-bottom: 20px;")
									legend
										table(width="100%")
											tr
												td.
													Meine Termine & Co.
												td(align="right")
													+dropdown_button("Neu erstellen", "new_own", "right")
														-var link = "/" + date.date + "/new/edit";
														+dropdown_button_element_href("Ereignis", "/event" + link)
														+dropdown_button_element_href("Zu-Beachten", "#")
														+dropdown_button_element_href("Zu-Tun", "#")
														+dropdown_button_element_href("Abwesenheit", "#")
														+dropdown_button_element_href("Fahrzeugenutzung", "#")
										
									each a in parishcal.away.own
										+day_away(a)
								
									each t in parishcal.todo.own
										+day_todo(t)
								
									each k in parishcal.keep_in_mind.own
										+day_keep_in_mind(k)
								
									each v in parishcal.vehicle_use.own
										+day_vehicle_use(v)
							
									each event in parishcal.events.own
										+pevent_with_thereafter(date.date, event)
							
							.col-xs-12.col-sm-6
								fieldset(style="margin-bottom: 20px;")
									legend Andere Termine & Co.
							
									each a in parishcal.away.other
										+day_away(a)
								
									each t in parishcal.todo.other
										+day_todo(t)
								
									each k in parishcal.keep_in_mind.other
										+day_keep_in_mind(k)
								
									each v in parishcal.vehicle_use.other
										+day_vehicle_use(v)
							
									each event in parishcal.events.other
										+pevent_with_thereafter(date.date, event)
