diff --git a/www/src/Controller/TodayController.php b/www/src/Controller/TodayController.php index ef5b9be..d72cd7a 100644 --- a/www/src/Controller/TodayController.php +++ b/www/src/Controller/TodayController.php @@ -21,6 +21,7 @@ class TodayController extends AbstractController $this->connection = $connection; $date = date('Y-m-d'); return $this->render('today/index.html.twig', [ + "date" => $date, "species" => $this->recorded_species_by_date($date), ]); } @@ -33,6 +34,7 @@ class TodayController extends AbstractController $this->connection = $connection; $date = date('Y-m-d'); return $this->render('today/index.html.twig', [ + "date" => $date, "species" => $this->recorded_species_by_date($date) ]); } @@ -45,6 +47,7 @@ class TodayController extends AbstractController $this->connection = $connection; $date = date('Y-m-d'); return $this->render('today/species.html.twig', [ + "date" => $date, "results" => $this->recorded_species_by_id_and_date($id, $date) ]); } diff --git a/www/templates/today/index.html.twig b/www/templates/today/index.html.twig index f4e1937..d4c760c 100644 --- a/www/templates/today/index.html.twig +++ b/www/templates/today/index.html.twig @@ -1,17 +1,27 @@ {% extends "base.html.twig" %} {% block content %} -

{{ "Today's Detected Species" | trans }}

- {# Display a list of records if any, else, print message #} - {% if results[0] is defined and results[0] | length > 0 %} - - {% endif %} -{% endblock %} \ No newline at end of file +

+ {% set today = "now" | date("Y-m-d") %} + {% if today == date %} + {{ "Today's detected species" | trans }} + {% else %} + {{ "Detected species on" | trans }} + {{ date | format_datetime("full", "none") }} + {% endif %} +

+ {# Display a list of records if any, else, print message #} + {% if results[0] is defined and results[0] | length > 0 %} + + {% endif %} +{% endblock %}