From 0bc66fe199a284502b5aee80823c39b56a92698a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Pe=CC=81rez=20Crespo?= <jaime.perez@uninett.no> Date: Wed, 28 Nov 2018 14:02:44 +0100 Subject: [PATCH] Make the current year available to twig templates. This way we can forget about updating the copyright notice every year. --- lib/SimpleSAML/XHTML/Template.php | 2 ++ templates/_footer.twig | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php index b055ef4a7..d6f4d836c 100644 --- a/lib/SimpleSAML/XHTML/Template.php +++ b/lib/SimpleSAML/XHTML/Template.php @@ -434,6 +434,8 @@ class Template extends Response if (!isset($this->data['pagetitle'])) { $this->data['pagetitle'] = 'SimpleSAMLphp'; } + + $this->data['year'] = date('Y'); } diff --git a/templates/_footer.twig b/templates/_footer.twig index 432e1daef..505b01e53 100644 --- a/templates/_footer.twig +++ b/templates/_footer.twig @@ -1,13 +1,13 @@ - <div id="footer"> - <div class="wrap"> - <div class="center copyrights dark-bg"> - <br>Copyright © 2007-2018 - <a href="https://simplesamlphp.org/">SimpleSAMLphp</a> - </div> - <div class="logo-footer-right"> - <div class="logo-footer"> - <img class="pure-img" src="/{{ baseurlpath }}resources/icons/ssplogo-fish-small.png" alt="Small fish logo"> - </div> - </div> + <div id="footer"> + <div class="wrap"> + <div class="center copyrights dark-bg"> + <br>Copyright © 2007-{{ year }} + <a href="https://simplesamlphp.org/">SimpleSAMLphp</a> + </div> + <div class="logo-footer-right"> + <div class="logo-footer"> + <img class="pure-img" src="/{{ baseurlpath }}resources/icons/ssplogo-fish-small.png" alt="Small fish logo"> </div> + </div> </div> + </div> -- GitLab