parent
							
								
									37be85593b
								
							
						
					
					
						commit
						291b545915
					
				| 
						 | 
					@ -42,7 +42,9 @@
 | 
				
			||||||
  </ul>
 | 
					  </ul>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <div class="grid-container">
 | 
					  <div class="grid-container">
 | 
				
			||||||
    {{ section("Accommodation", items) }}
 | 
					    {{ section("Past", past) }}
 | 
				
			||||||
 | 
					    {{ section("Current", current) }}
 | 
				
			||||||
 | 
					    {{ section("Future", future) }}
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								web_view.py
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								web_view.py
									
									
									
									
									
								
							| 
						 | 
					@ -21,7 +21,7 @@ import agenda.error_mail
 | 
				
			||||||
import agenda.holidays
 | 
					import agenda.holidays
 | 
				
			||||||
import agenda.thespacedevs
 | 
					import agenda.thespacedevs
 | 
				
			||||||
import agenda.trip
 | 
					import agenda.trip
 | 
				
			||||||
from agenda import format_list_with_ampersand, travel
 | 
					from agenda import format_list_with_ampersand, travel, uk_tz
 | 
				
			||||||
from agenda.types import StrDict
 | 
					from agenda.types import StrDict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
app = flask.Flask(__name__)
 | 
					app = flask.Flask(__name__)
 | 
				
			||||||
| 
						 | 
					@ -206,9 +206,17 @@ def accommodation_list() -> str:
 | 
				
			||||||
        if this_trip := trip_lookup.get(key):
 | 
					        if this_trip := trip_lookup.get(key):
 | 
				
			||||||
            item["linked_trip"] = this_trip
 | 
					            item["linked_trip"] = this_trip
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    now = uk_tz.localize(datetime.now())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    past = [conf for conf in items if conf["to"] < now]
 | 
				
			||||||
 | 
					    current = [conf for conf in items if conf["from"] <= now and conf["to"] >= now]
 | 
				
			||||||
 | 
					    future = [conf for conf in items if conf["from"] > now]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return flask.render_template(
 | 
					    return flask.render_template(
 | 
				
			||||||
        "accommodation.html",
 | 
					        "accommodation.html",
 | 
				
			||||||
        items=items,
 | 
					        past=past,
 | 
				
			||||||
 | 
					        current=current,
 | 
				
			||||||
 | 
					        future=future,
 | 
				
			||||||
        total_nights_2024=total_nights_2024,
 | 
					        total_nights_2024=total_nights_2024,
 | 
				
			||||||
        nights_abroad_2024=nights_abroad_2024,
 | 
					        nights_abroad_2024=nights_abroad_2024,
 | 
				
			||||||
        get_country=agenda.get_country,
 | 
					        get_country=agenda.get_country,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue