From 0b5ceb1bdb799af65bd4e09b604a1ef742a4a5ef Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Sun, 3 Dec 2023 15:21:27 -0600 Subject: [PATCH] Make the footer width adjustable per page. This sets a default `footerWidthClass` stash value to `col-12` in the ContentGenerator `go` method. Any module or template can modify that as needed to match its layout. This is done in `templates/ContentGenerator/Instructor/Index.html.ep`, `templates/ContentGenerator/Instructor/Stats/index.html.ep`, and `templates/ContentGenerator/Problem.html.ep`. Note that this can also be done directly in the perl code for any package that derives from the ContentGenerator as well (i.e., in a `.pm` file). To do so call `$c->stash->{footerWidthClass} = '...'`. I have left the remaining pages for you to determine, since I am uncertain what you will want on some of them. --- htdocs/themes/math4/system.html.ep | 2 +- lib/WeBWorK/ContentGenerator.pm | 2 ++ .../ContentGenerator/Base/footer.html.ep | 24 ++++++++++--------- .../ContentGenerator/Instructor/Index.html.ep | 2 ++ .../Instructor/Stats/index.html.ep | 2 ++ templates/ContentGenerator/Problem.html.ep | 2 ++ 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/htdocs/themes/math4/system.html.ep b/htdocs/themes/math4/system.html.ep index f4a9be8c2d..7720f30c13 100644 --- a/htdocs/themes/math4/system.html.ep +++ b/htdocs/themes/math4/system.html.ep @@ -172,7 +172,7 @@ % } % % # Footer - + <%= include 'ContentGenerator/Base/footer' =%> % diff --git a/lib/WeBWorK/ContentGenerator.pm b/lib/WeBWorK/ContentGenerator.pm index 992597c747..fa6e2fec75 100644 --- a/lib/WeBWorK/ContentGenerator.pm +++ b/lib/WeBWorK/ContentGenerator.pm @@ -122,6 +122,8 @@ async sub go ($c) { my $tx = $c->render_later->tx; + $c->stash->{footerWidthClass} = 'col-12'; + if ($c->can('pre_header_initialize')) { my $pre_header_initialize = $c->pre_header_initialize; await $pre_header_initialize diff --git a/templates/ContentGenerator/Base/footer.html.ep b/templates/ContentGenerator/Base/footer.html.ep index f7d702f285..1a77d2f32a 100644 --- a/templates/ContentGenerator/Base/footer.html.ep +++ b/templates/ContentGenerator/Base/footer.html.ep @@ -1,13 +1,15 @@ -
-
<%= maketext('Page generated at [_1]', $c->timestamp) %>
-