diff --git a/conf/defaults.config b/conf/defaults.config index b6f6d1ad82..8a07924a2a 100644 --- a/conf/defaults.config +++ b/conf/defaults.config @@ -130,7 +130,6 @@ $courseURLs{feedbackFormURL} = ""; ################################################################################ $defaultTheme = "math4"; -$defaultThemeTemplate = "system"; # The institution logo should be an image file in the theme's images folder $institutionLogo = 'maa_logo.svg'; diff --git a/conf/localOverrides.conf.dist b/conf/localOverrides.conf.dist index 7a5ffae8df..2ac43a6dbd 100644 --- a/conf/localOverrides.conf.dist +++ b/conf/localOverrides.conf.dist @@ -75,7 +75,6 @@ $mail{feedbackRecipients} = [ ################################################################################ #$defaultTheme = "math4"; -#$defaultThemeTemplate = "system"; # The institution logo should be an image file in the theme's images folder #$institutionLogo = 'my_school_logo.png'; diff --git a/htdocs/themes/layouts b/htdocs/themes/layouts deleted file mode 120000 index 945c9b46d6..0000000000 --- a/htdocs/themes/layouts +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file diff --git a/htdocs/themes/math4-green/system.html.ep b/htdocs/themes/math4-green/system.html.ep deleted file mode 120000 index f7a74c7169..0000000000 --- a/htdocs/themes/math4-green/system.html.ep +++ /dev/null @@ -1 +0,0 @@ -../math4/system.html.ep \ No newline at end of file diff --git a/htdocs/themes/math4-red/system.html.ep b/htdocs/themes/math4-red/system.html.ep deleted file mode 120000 index f7a74c7169..0000000000 --- a/htdocs/themes/math4-red/system.html.ep +++ /dev/null @@ -1 +0,0 @@ -../math4/system.html.ep \ No newline at end of file diff --git a/htdocs/themes/math4-yellow/system.html.ep b/htdocs/themes/math4-yellow/system.html.ep deleted file mode 120000 index f7a74c7169..0000000000 --- a/htdocs/themes/math4-yellow/system.html.ep +++ /dev/null @@ -1 +0,0 @@ -../math4/system.html.ep \ No newline at end of file diff --git a/lib/Mojolicious/WeBWorK.pm b/lib/Mojolicious/WeBWorK.pm index 7db3a0cade..cf249025cc 100644 --- a/lib/Mojolicious/WeBWorK.pm +++ b/lib/Mojolicious/WeBWorK.pm @@ -81,9 +81,6 @@ sub startup ($app) { # url_for_asset controller method. unshift(@{ $app->static->paths }, $webwork_htdocs_dir); - # Add the themes directory to the template search paths. - push(@{ $app->renderer->paths }, $ce->{webworkDirs}{themes}); - # Setup the Minion job queue. Make sure that any task added here is represented in the TASK_NAMES hash in # WeBWorK::ContentGenerator::Instructor::JobManager. $app->plugin(Minion => { $ce->{job_queue}{backend} => $ce->{job_queue}{database_dsn} }); diff --git a/lib/WeBWorK/ContentGenerator.pm b/lib/WeBWorK/ContentGenerator.pm index 6d5b3be00e..ee66307abc 100644 --- a/lib/WeBWorK/ContentGenerator.pm +++ b/lib/WeBWorK/ContentGenerator.pm @@ -437,43 +437,13 @@ Defined in this package. Print the content of the generated page. -This renders a Mojo::Template. - -The defaultThemeTemplate in the course environment is used for the page layout. -If that is not defined, the default "system" template, is used. The location of -the template is looked up in the course environment. +This renders the Mojo::Template corresponding to the called ContentGenerator sub-package. =cut sub content ($c) { my $ce = $c->ce; - - my $theme = $c->param('theme') || $ce->{defaultTheme}; - $theme = $ce->{defaultTheme} if $theme =~ m!(?:^|/)\.\.(?:/|$)!; - - my $layout = $ce->{defaultThemeTemplate} // 'system'; - - my $layoutName = "$theme/$layout"; - - # Attempt to prevent disaster when the theme layout file is missing. - unless (-r "$ce->{webworkDirs}{themes}/$theme/$layout.html.ep") { - if (-r "$ce->{webworkDirs}{themes}/math4/$layout.html.ep") { - $layoutName = "math4/$layout"; - $theme = HTML::Entities::encode_entities($theme); - warn "Theme $theme is not one of the available themes. " - . 'Please check the theme configuration ' - . 'in the files localOverrides.conf, course.conf and ' - . "simple.conf and on the course configuration page.\n"; - } else { - $theme = HTML::Entities::encode_entities($theme); - die "Neither the theme $theme nor the defaultTheme math4 are available. " - . 'Please notify your site administrator that the structure of the ' - . 'themes directory needs attention.'; - - } - } - - return $c->render(template => ((ref($c) =~ s/^WeBWorK:://r) =~ s/::/\//gr), layout => $layoutName); + return $c->render(template => ((ref($c) =~ s/^WeBWorK:://r) =~ s/::/\//gr), layout => 'system'); } =back diff --git a/htdocs/themes/math4/system.html.ep b/templates/layouts/system.html.ep similarity index 100% rename from htdocs/themes/math4/system.html.ep rename to templates/layouts/system.html.ep