Files

60 lines
2.0 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}Tasks
{% endblock %}
{% block body %}
<a class="user" href="{{ path('app_user_index') }}">
{% if user.username != "" %} {{ user.username|first }}{% endif %}
</a>
<div class="container">
<div class="task-list-header">
<button class="weather-location" type="button" data-weather-location data-location-url="{{ path('app_task_location') }}" data-location-token="{{ csrf_token('weather_location') }}">
<span class="material-symbols-outlined" aria-hidden="true">my_location</span>
{{ has_saved_location ? 'Update weather location' : 'Use my location for weather' }}
</button>
{# <p class="weather-location__status" data-weather-location-status aria-live="polite"></p> #}
{% if weather_forecast %}
{{ include('task/_weather_forecast.html.twig', {forecast: weather_forecast}) }}
{% endif %}
<nav class="day-picker" aria-label="Choose task day">
<a href="{{ path('app_task_index', {date: selected_date|date_modify('-1 day')|date('Y-m-d')}) }}" aria-label="Previous day">
<span class="material-symbols-outlined">
chevron_backward
</span>
</a>
<div>
<strong>{{ selected_date|date('l, j F') }}</strong>
{% if selected_date|date('Y-m-d') != 'now'|date('Y-m-d') %}
<a href="{{ path('app_task_index') }}">Today</a>
{% endif %}
</div>
<a href="{{ path('app_task_index', {date: selected_date|date_modify('+1 day')|date('Y-m-d')}) }}" aria-label="Next day">
<span class="material-symbols-outlined">
chevron_forward
</span>
</a>
</nav>
<form method="post" action="{{ path('weather_refresh') }}" class="weather-refresh">
<button type="submit" class="btn btn-primary">
Update weather
</button>
</form>
</div>
<h1>Tasks</h1>
{{ include('task/_task_composer.html.twig', {form: form}) }}
{{ include('task/_task_recommendations.html.twig', {
tasks: tasks,
battery_level: battery_level,
battery_budget: battery_budget,
selected_date: selected_date
}) }}
</div>
{% endblock %}