diff --git a/CHANGES.md b/CHANGES.md index 90e725979fd..cc6c468cecb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2022-07-06 - Feature: Built-in imprint, solves #32 * 2022-07-05 - Feature: Configurable favicon, solves #34 * 2022-07-05 - Feature: Allow non-admins to edit theme settings, solves #28 * 2022-07-05 - Feature: Back to top button, solves #7 diff --git a/README.md b/README.md index a533826ddd3..89ab1d91f28 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,14 @@ In this tab there are the following settings: Whatever you add to this textarea will be displayed at the end of a page, in the footer. Refer to the setting description on the settings page for further instructions. +### Tab "Static pages" + +In this tab there are the following settings: + +#### Imprint + +With these settings, you can add rich text content which will be shown on the imprint page. + Capabilities ------------ diff --git a/lang/en/theme_boost_union.php b/lang/en/theme_boost_union.php index 9ef0ba74c11..6062f28046f 100644 --- a/lang/en/theme_boost_union.php +++ b/lang/en/theme_boost_union.php @@ -91,6 +91,27 @@ $string['footnotesetting'] = 'Footnote'; $string['footnotesetting_desc'] = 'Whatever you add to this textarea will be displayed at the end of a page, in the footer (not the floating footer) on every page which uses the layouts "drawers", "columns2" or "login". Content in this area could be for example the copyright, the terms of use or the name of your organisation.
If you want to remove the footnote again, just empty the text area.'; +// Settings: Static pages tab. +$string['staticpagestab'] = 'Static pages'; +$string['imprintheading'] = 'Imprint'; +// ... Setting: Enable imprint: +$string['enableimprintsetting'] = 'Enable imprint'; +$string['imprintdisabled'] = 'The imprint is disabled for this site. There is nothing to see here.'; +// ... Setting: Imprint content: +$string['imprintcontentsetting'] = 'Imprint content'; +$string['imprintcontentsetting_desc'] = 'In this setting, you can add rich text content which will be shown on the imprint page.'; +// ... Setting: Imprint page title: +$string['imprintpagetitledefault'] = 'Imprint'; +$string['imprintpagetitlesetting'] = 'Imprint page title'; +$string['imprintpagetitlesetting_desc'] = 'In this setting, you can define the title of the imprint page. This text will be used as link text to the imprint page as well if you configure \'Imprint link position\' accordingly.'; +// ... Setting: Imprint link position: +$string['imprintlinkpositionnone'] = 'Do not automatically show a link to the imprint page'; +$string['imprintlinkpositionfootnote'] = 'Add a link to the imprint page to the footnote'; +$string['imprintlinkpositionfooter'] = 'Add a link to the imprint page to the footer (questionmark) icon'; +$string['imprintlinkpositionboth'] = 'Add a link to the imprint page to the footnote and to the footer (questionmark) icon'; +$string['imprintlinkpositionsetting'] = 'Imprint link position'; +$string['imprintlinkpositionsetting_desc'] = 'In this setting, you can configure if a link to the imprint page should be added automatically to the Moodle page. If you do not want to show a link automatically, you can add a link to {$a->url} from anywhere in Moodle manually.'; + // Privacy API. $string['privacy:metadata'] = 'The Boost Union theme does not store any personal data about any user.'; diff --git a/layout/columns2.php b/layout/columns2.php index f592d77da44..722d73e3c2a 100644 --- a/layout/columns2.php +++ b/layout/columns2.php @@ -95,5 +95,8 @@ // Include the template content for the footnote. require_once(__DIR__ . '/includes/footnote.php'); +// Include the template content for the static pages. +require_once(__DIR__ . '/includes/staticpages.php'); + // Render columns2.mustache from boost_union. echo $OUTPUT->render_from_template('theme_boost_union/columns2', $templatecontext); diff --git a/layout/drawers.php b/layout/drawers.php index 8365033a0bb..26b2ab3cf1f 100644 --- a/layout/drawers.php +++ b/layout/drawers.php @@ -134,5 +134,8 @@ // Include the template content for the footnote. require_once(__DIR__ . '/includes/footnote.php'); +// Include the template content for the static pages. +require_once(__DIR__ . '/includes/staticpages.php'); + // Render drawers.mustache from boost_union. echo $OUTPUT->render_from_template('theme_boost_union/drawers', $templatecontext); diff --git a/layout/includes/footnote.php b/layout/includes/footnote.php index bd056e1d65c..b0e0588e960 100644 --- a/layout/includes/footnote.php +++ b/layout/includes/footnote.php @@ -32,6 +32,9 @@ // Use format_text function to enable multilanguage filtering. $footnotesetting = format_text($footnotesetting); + // Add marker to show the footnote to templatecontext. + $templatecontext['showfootnote'] = true; + // Add footnote to templatecontext. $templatecontext['footnotesetting'] = $footnotesetting; } diff --git a/layout/includes/staticpages.php b/layout/includes/staticpages.php new file mode 100644 index 00000000000..0ccc4cdc59a --- /dev/null +++ b/layout/includes/staticpages.php @@ -0,0 +1,57 @@ +. + +/** + * Theme Boost Union - Static pages layout include. + * + * @package theme_boost_union + * @copyright 2022 Moodle an Hochschulen e.V. + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +// Require the necessary libraries. +require_once($CFG->dirroot.'/theme/boost_union/locallib.php'); + +$config = get_config('theme_boost_union'); + +// If the imprint is enabled. +if ($config->enableimprint == THEME_BOOST_UNION_SETTING_SELECT_YES) { + // If the admin wants to show a link in the footnote or in both locations. + if ($config->imprintlinkposition == THEME_BOOST_UNION_SETTING_IMPRINTLINKPOSITION_FOOTNOTE || + $config->imprintlinkposition == THEME_BOOST_UNION_SETTING_IMPRINTLINKPOSITION_BOTH) { + // If the footnote is empty and not configured to be shown yet. + if (isset($templatecontext['showfootnote']) == false || $templatecontext['showfootnote'] == false) { + // Add marker to show the footnote to templatecontext. + $templatecontext['showfootnote'] = true; + } + + // Add marker to show the imprint link in the footnote to templatecontext. + $templatecontext['imprintlinkpositionfootnote'] = true; + } + + // If the admin wants to show a link in the footer or in both locations. + if ($config->imprintlinkposition == THEME_BOOST_UNION_SETTING_IMPRINTLINKPOSITION_FOOTER || + $config->imprintlinkposition == THEME_BOOST_UNION_SETTING_IMPRINTLINKPOSITION_BOTH) { + // Add marker to show the imprint link in the footer to templatecontext. + $templatecontext['imprintlinkpositionfooter'] = true; + } + + // Add the imprint link and page title to the templatecontext. + $templatecontext['imprintlink'] = theme_boost_union_get_imprint_link(); + $templatecontext['imprintpagetitle'] = theme_boost_union_get_imprint_pagetitle(); +} diff --git a/layout/login.php b/layout/login.php index b6fbe54bea7..b7f81c611dc 100644 --- a/layout/login.php +++ b/layout/login.php @@ -42,5 +42,8 @@ // Include the template content for the footnote. require_once(__DIR__ . '/includes/footnote.php'); +// Include the template content for the static pages. +require_once(__DIR__ . '/includes/staticpages.php'); + // Render login.mustache from boost_union. echo $OUTPUT->render_from_template('theme_boost_union/login', $templatecontext); diff --git a/lib.php b/lib.php index aed682f37f6..ad77b8ccd24 100644 --- a/lib.php +++ b/lib.php @@ -26,6 +26,11 @@ define('THEME_BOOST_UNION_SETTING_SELECT_YES', 'yes'); define('THEME_BOOST_UNION_SETTING_SELECT_NO', 'no'); +define('THEME_BOOST_UNION_SETTING_IMPRINTLINKPOSITION_NONE', 'none'); +define('THEME_BOOST_UNION_SETTING_IMPRINTLINKPOSITION_FOOTNOTE', 'footnote'); +define('THEME_BOOST_UNION_SETTING_IMPRINTLINKPOSITION_FOOTER', 'footer'); +define('THEME_BOOST_UNION_SETTING_IMPRINTLINKPOSITION_BOTH', 'both'); + /** * Returns the main SCSS content. diff --git a/locallib.php b/locallib.php index 5fcdc5d1daf..6733aeee0b4 100644 --- a/locallib.php +++ b/locallib.php @@ -277,3 +277,37 @@ function theme_boost_union_get_course_related_hints() { // Return HTML code. return $html; } + +/** + * Build the link to the imprint page. + * + * @return string. + */ +function theme_boost_union_get_imprint_link() { + // Compose the URL object. + $url = new moodle_url('/theme/boost_union/pages/imprint.php'); + + // Return the string representation of the URL. + return $url->out(); +} + +/** + * Build the page title of the imprint page. + * + * @return string. + */ +function theme_boost_union_get_imprint_pagetitle() { + // Get the configured page title. + $imprintpagetitleconfig = get_config('theme_boost_union', 'imprintpagetitle'); + + // If there is a string configured. + if ($imprintpagetitleconfig) { + // Return this setting. + return $imprintpagetitleconfig; + + // Otherwise. + } else { + // Return the default string. + return get_string('imprintpagetitledefault', 'theme_boost_union'); + } +} diff --git a/pages/imprint.php b/pages/imprint.php new file mode 100644 index 00000000000..11fd6f58ba8 --- /dev/null +++ b/pages/imprint.php @@ -0,0 +1,75 @@ +. + +/** + * Theme Boost Union - Imprint page. + * + * @package theme_boost_union + * @copyright 2022 Moodle an Hochschulen e.V. + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// Include config.php. +// @codingStandardsIgnoreStart +// Let codechecker ignore the next line because otherwise it would complain about a missing login check +// after requiring config.php which is really not needed. +require(__DIR__ . '/../../../config.php'); +// @codingStandardsIgnoreEnd + +// Require the necessary libraries. +require_once($CFG->dirroot.'/theme/boost_union/lib.php'); +require_once($CFG->dirroot.'/theme/boost_union/locallib.php'); + +// Set page URL. +$PAGE->set_url('/theme/boost_union/pages/imprint.php'); + +// Set page layout. +$PAGE->set_pagelayout('standard'); + +// Set page context. +$PAGE->set_context(context_system::instance()); + +// Add page name as body class. +$PAGE->add_body_class('theme_boost_union-imprint'); + +// Get theme config. +$config = get_config('theme_boost_union'); + +// If the imprint is disabled, we just show a short friendly warning page and are done. +if ($config->enableimprint != THEME_BOOST_UNION_SETTING_SELECT_YES) { + echo $OUTPUT->header(); + $notification = new \core\output\notification(get_string('imprintdisabled', 'theme_boost_union'), + \core\output\notification::NOTIFY_INFO); + $notification->set_show_closebutton(false); + echo $OUTPUT->render($notification); + echo $OUTPUT->footer(); + die; +} + +// Set page title. +$PAGE->set_title(theme_boost_union_get_imprint_pagetitle()); + +// Start page output. +echo $OUTPUT->header(); + +// Show page heading. +echo $OUTPUT->heading(theme_boost_union_get_imprint_pagetitle()); + +// Output imprint content. +echo format_text($config->imprintcontent); + +// Finish page. +echo $OUTPUT->footer(); diff --git a/settings.php b/settings.php index f525d90aa94..645aecff1d4 100644 --- a/settings.php +++ b/settings.php @@ -26,6 +26,7 @@ // Require the necessary libraries. require_once($CFG->dirroot.'/theme/boost_union/lib.php'); +require_once($CFG->dirroot.'/theme/boost_union/locallib.php'); if ($ADMIN->fulltree) { @@ -273,6 +274,64 @@ // Add tab to settings page. $settings->add($page); + + + // Create static pages tab. + $page = new admin_settingpage('theme_boost_union_staticpages', get_string('staticpagestab', 'theme_boost_union', null, true)); + + // Create imprint heading. + $name = 'theme_boost_union/imprintheading'; + $title = get_string('imprintheading', 'theme_boost_union', null, true); + $setting = new admin_setting_heading($name, $title, null); + $page->add($setting); + + // Setting: Enable imprint. + $name = 'theme_boost_union/enableimprint'; + $title = get_string('enableimprintsetting', 'theme_boost_union', null, true); + $description = ''; + $setting = new admin_setting_configselect($name, $title, $description, THEME_BOOST_UNION_SETTING_SELECT_NO, $yesnooption); + $page->add($setting); + + // Setting: Imprint content. + $name = 'theme_boost_union/imprintcontent'; + $title = get_string('imprintcontentsetting', 'theme_boost_union', null, true); + $description = get_string('imprintcontentsetting_desc', 'theme_boost_union', null, true); + $setting = new admin_setting_confightmleditor($name, $title, $description, ''); + $page->add($setting); + $settings->hide_if('theme_boost_union/imprintcontent', 'theme_boost_union/enableimprint', 'neq', 'yes'); + + // Setting: Imprint page title. + $name = 'theme_boost_union/imprintpagetitle'; + $title = get_string('imprintpagetitlesetting', 'theme_boost_union', null, true); + $description = get_string('imprintpagetitlesetting_desc', 'theme_boost_union', null, true); + $default = get_string('imprintpagetitledefault', 'theme_boost_union', null, true); + $setting = new admin_setting_configtext($name, $title, $description, $default); + $page->add($setting); + $settings->hide_if('theme_boost_union/imprintpagetitle', 'theme_boost_union/enableimprint', 'neq', 'yes'); + + // Setting: Imprint link position. + $name = 'theme_boost_union/imprintlinkposition'; + $title = get_string('imprintlinkpositionsetting', 'theme_boost_union', null, true); + $imprinturl = theme_boost_union_get_imprint_link(); + $description = get_string('imprintlinkpositionsetting_desc', 'theme_boost_union', array('url' => $imprinturl), true); + $imprintlinkpositionoption = + // Don't use string lazy loading (= false) because the string will be directly used and would produce a + // PHP warning otherwise. + array(THEME_BOOST_UNION_SETTING_IMPRINTLINKPOSITION_NONE => + get_string('imprintlinkpositionnone', 'theme_boost_union', null, false), + THEME_BOOST_UNION_SETTING_IMPRINTLINKPOSITION_FOOTNOTE => + get_string('imprintlinkpositionfootnote', 'theme_boost_union', null, false), + THEME_BOOST_UNION_SETTING_IMPRINTLINKPOSITION_FOOTER => + get_string('imprintlinkpositionfooter', 'theme_boost_union', null, false), + THEME_BOOST_UNION_SETTING_IMPRINTLINKPOSITION_BOTH => + get_string('imprintlinkpositionboth', 'theme_boost_union', null, false)); + $default = 'none'; + $setting = new admin_setting_configselect($name, $title, $description, $default, $imprintlinkpositionoption); + $page->add($setting); + $settings->hide_if('theme_boost_union/imprintlinkposition', 'theme_boost_union/enableimprint', 'neq', 'yes'); + + // Add tab to settings page. + $settings->add($page); } // Above, we made the theme setting not only available to admins but also diff --git a/templates/columns2.mustache b/templates/columns2.mustache index 96d0b70382e..dd60ca6061f 100644 --- a/templates/columns2.mustache +++ b/templates/columns2.mustache @@ -51,6 +51,7 @@ Modifications compared to this template: * Include theme_boost_union/footnote template + * Include theme_boost_union/footer template instead of theme_boost/footer * Added the possibility to show course related hints. }} {{> theme_boost/head }} @@ -106,7 +107,7 @@ {{{ output.standard_after_main_region_html }}} - {{> theme_boost/footer }} + {{> theme_boost_union/footer }} {{> theme_boost_union/footnote }} diff --git a/templates/drawers.mustache b/templates/drawers.mustache index 2389f668b21..877af010639 100644 --- a/templates/drawers.mustache +++ b/templates/drawers.mustache @@ -54,6 +54,7 @@ Modifications compared to this template: * Include theme_boost_union/footnote template + * Include theme_boost_union/footer template instead of theme_boost/footer * Added the possibility to show course related hints. }} {{> theme_boost/head }} @@ -171,7 +172,7 @@ - {{> theme_boost/footer }} + {{> theme_boost_union/footer }} {{> theme_boost_union/footnote }} {{{ output.standard_after_main_region_html }}} diff --git a/templates/footer.mustache b/templates/footer.mustache new file mode 100644 index 00000000000..a450c9a5e51 --- /dev/null +++ b/templates/footer.mustache @@ -0,0 +1,102 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template theme_boost_union/footer + + Boost Union page footer template. + + Example context (json): + { + "output": { + "page_doc_link": "Help and documentation", + "supportemail": "Contact site support", + "has_popover_links": true, + "services_support": "Services and support", + "login_info": "You are logged in as cute kitten", + "moodle_release": "90210" + }, + "imprintlinkpositionfooter": true, + "imprintlink": "https://localhost/theme/boost_union/pages/imprint.php", + "imprintpagetitle": "Imprint" + } +}} +{{! + This template is based on theme_boost/footer + + Modifications compared to this template: + * Added the possibility to show the imprint page link. +}} + +
+
+ +
+ + + +
+{{#js}} +require(['theme_boost/footer-popover'], function(FooterPopover) { + FooterPopover.init(); +}); +{{/js}} diff --git a/templates/footer.mustache.original b/templates/footer.mustache.original new file mode 100644 index 00000000000..dfa932b0233 --- /dev/null +++ b/templates/footer.mustache.original @@ -0,0 +1,87 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template theme_boost/footer + + Page footer. + + Example context (json): + { + "output": { + "page_doc_link": "Help and documentation", + "supportemail": "Contact site support", + "has_popover_links": true, + "services_support": "Services and support", + "login_info": "You are logged in as cute kitten", + "moodle_release": "90210" + } + } +}} + +
+
+ +
+ + + +
+{{#js}} +require(['theme_boost/footer-popover'], function(FooterPopover) { + FooterPopover.init(); +}); +{{/js}} diff --git a/templates/footnote.mustache b/templates/footnote.mustache index 185fde6765d..519a08200f4 100644 --- a/templates/footnote.mustache +++ b/templates/footnote.mustache @@ -20,20 +20,29 @@ Boost Union footnote layout template. Context variables required for this template: - * footnotesetting - The text entered in the setting widget. + * showfootnote - The fact if the footnote should be shown or not Example context (json): { - "footnotesetting": "Moodle" + "showfootnote": true, + "footnotesetting": "This is my nice footnote", + "imprintlinkpositionfootnote": true, + "imprintlink": "https://localhost/theme/boost_union/pages/imprint.php", + "imprintpagetitle": "Imprint" } }} -{{# footnotesetting }} +{{# showfootnote }}
{{{ footnotesetting }}}
+ {{# imprintlinkpositionfootnote }} + + {{/ imprintlinkpositionfootnote }}
-{{/ footnotesetting }} +{{/ showfootnote }} diff --git a/templates/login.mustache b/templates/login.mustache index 9b14a3c226f..8a51d91bf63 100644 --- a/templates/login.mustache +++ b/templates/login.mustache @@ -34,6 +34,7 @@ Modifications compared to this template: * Include theme_boost_union/footnote template + * Include theme_boost_union/footer template instead of theme_boost/footer }} {{> theme_boost/head }} @@ -57,7 +58,7 @@ - {{> theme_boost/footer }} + {{> theme_boost_union/footer }} {{> theme_boost_union/footnote }} diff --git a/tests/behat/behat_theme_boost_union.php b/tests/behat/behat_theme_boost_union.php index 0f9d3ab8d40..7e0182734a3 100644 --- a/tests/behat/behat_theme_boost_union.php +++ b/tests/behat/behat_theme_boost_union.php @@ -51,4 +51,14 @@ public function i_scroll_page_to_x_y_coordinates_of_page($posx, $posy) { throw new \Exception("Scrolling the page to given coordinates failed"); } } + + /** + * Open the imprint page. + * + * @Given /^I am on imprint page$/ + */ + public function i_am_on_imprint_page() { + $this->execute('behat_general::i_visit', ['/theme/boost_union/pages/imprint.php']); + } + } diff --git a/tests/behat/theme_boost_union_staticpages_settings.feature b/tests/behat/theme_boost_union_staticpages_settings.feature new file mode 100644 index 00000000000..3d35319e3f8 --- /dev/null +++ b/tests/behat/theme_boost_union_staticpages_settings.feature @@ -0,0 +1,154 @@ +@theme @theme_boost_union @theme_boost_union_staticpages_settings +Feature: Configuring the theme_boost_union plugin for the "Static pages" tab + In order to use the features + As admin + I need to be able to configure the theme Boost Union plugin + + @javascript + Scenario: Do not enable the imprint page + Given the following config values are set as admin: + | config | value | plugin | + | enableimprint | no | theme_boost_union | + # The footnote is just filled to make sure it is displayed at all and we can check for the .imprintlink within it later. + | footnote |

My little footnote

| theme_boost_union | + When I log in as "admin" + Then ".imprintlink" "css_element" should not exist + And I am on imprint page + Then I should see "The imprint is disabled for this site. There is nothing to see here." + And ".imprintlink" "css_element" should not exist in the "#footnote" "css_element" + And I click on ".btn-footer-popover" "css_element" in the "#page-footer" "css_element" + And ".imprintlink" "css_element" should not exist in the ".footer .popover-body" "css_element" + + Scenario: Enable and fill the imprint page with content + Given the following config values are set as admin: + | config | value | plugin | + | enableimprint | yes | theme_boost_union | + | imprintcontent |

Lorem ipsum

| theme_boost_union | + When I log in as "admin" + And I am on imprint page + Then I should see "Lorem ipsum" in the "div[role='main']" "css_element" + And I should see "Imprint" in the "title" "css_element" + And I should see "Imprint" in the "div[role='main'] h2" "css_element" + + @javascript + Scenario: Do not automatically add the imprint link + Given the following config values are set as admin: + | config | value | plugin | + | enableimprint | yes | theme_boost_union | + | imprintcontent |

Lorem ipsum

| theme_boost_union | + | imprintlinkposition | none | theme_boost_union | + # The footnote is just filled to make sure it is displayed at all and we can check for the .imprintlink within it later. + | footnote |

My little footnote

| theme_boost_union | + When I log in as "admin" + And I am on imprint page + Then I should see "Lorem ipsum" in the "div[role='main']" "css_element" + And ".imprintlink" "css_element" should not exist in the "#footnote" "css_element" + And I click on ".btn-footer-popover" "css_element" in the "#page-footer" "css_element" + And ".imprintlink" "css_element" should not exist in the ".footer .popover-body" "css_element" + + @javascript + Scenario: Add the imprint link to the footnote automatically (even if the footnote is empty otherwise) + Given the following config values are set as admin: + | config | value | plugin | + | enableimprint | yes | theme_boost_union | + | imprintcontent |

Lorem ipsum

| theme_boost_union | + | imprintlinkposition | footnote | theme_boost_union | + | footnote | | theme_boost_union | + When I log in as "admin" + Then "#footnote" "css_element" should exist + And ".imprintlink" "css_element" should exist in the "#footnote" "css_element" + And I should see "Imprint" in the ".imprintlink" "css_element" + And I click on ".btn-footer-popover" "css_element" in the "#page-footer" "css_element" + And ".imprintlink" "css_element" should not exist in the ".footer .popover-body" "css_element" + + @javascript + Scenario: Add the imprint link to the footnote automatically (if the footnote contains some content already) + Given the following config values are set as admin: + | config | value | plugin | + | enableimprint | yes | theme_boost_union | + | imprintcontent |

Lorem ipsum

| theme_boost_union | + | imprintlinkposition | footnote | theme_boost_union | + | footnote |

My little footnote

| theme_boost_union | + When I log in as "admin" + Then "#footnote" "css_element" should exist + And ".imprintlink" "css_element" should exist in the "#footnote" "css_element" + And I should see "Imprint" in the ".imprintlink" "css_element" + And ".imprintlink" "css_element" should appear after "My little footnote" "text" + And I click on ".btn-footer-popover" "css_element" in the "#page-footer" "css_element" + And ".imprintlink" "css_element" should not exist in the ".footer .popover-body" "css_element" + + @javascript + Scenario: Add the imprint link to the footer automatically + Given the following config values are set as admin: + | config | value | plugin | + | enableimprint | yes | theme_boost_union | + | imprintcontent |

Lorem ipsum

| theme_boost_union | + | imprintlinkposition | footer | theme_boost_union | + # The footnote is just filled to make sure it is displayed at all and we can check for the .imprintlink within it later. + | footnote |

My little footnote

| theme_boost_union | + When I log in as "admin" + And I click on ".btn-footer-popover" "css_element" in the "#page-footer" "css_element" + Then ".imprintlink" "css_element" should exist in the ".footer .popover-body" "css_element" + And I should see "Imprint" in the ".imprintlink" "css_element" + And ".imprintlink" "css_element" should not exist in the "#footnote" "css_element" + + @javascript + Scenario: Add the imprint link to the footnote and the footer automatically + Given the following config values are set as admin: + | config | value | plugin | + | enableimprint | yes | theme_boost_union | + | imprintcontent |

Lorem ipsum

| theme_boost_union | + | imprintlinkposition | both | theme_boost_union | + # The footnote is just filled to make sure it is displayed at all and we can check for the .imprintlink within it later. + | footnote |

My little footnote

| theme_boost_union | + When I log in as "admin" + And I click on ".btn-footer-popover" "css_element" in the "#page-footer" "css_element" + Then ".imprintlink" "css_element" should exist in the ".footer .popover-body" "css_element" + And I should see "Imprint" in the ".imprintlink" "css_element" + And ".imprintlink" "css_element" should exist in the "#footnote" "css_element" + + @javascript + Scenario: Set an empty imprint page title (and trigger the fallback string) + Given the following config values are set as admin: + | config | value | plugin | + | enableimprint | yes | theme_boost_union | + | imprintcontent |

Lorem ipsum

| theme_boost_union | + | imprintpagetitle | | theme_boost_union | + When I log in as "admin" + And I am on imprint page + Then I should see "Imprint" in the "div[role='main'] h2" "css_element" + And "//title[contains(text(),'Imprint')]" "xpath_element" should exist + And the following config values are set as admin: + | config | value | plugin | + | imprintlinkposition | footnote | theme_boost_union | + And I reload the page + Then I should see "Imprint" in the "#footnote .imprintlink" "css_element" + And the following config values are set as admin: + | config | value | plugin | + | imprintlinkposition | footer | theme_boost_union | + And I reload the page + And I click on ".btn-footer-popover" "css_element" in the "#page-footer" "css_element" + Then I should see "Imprint" in the ".footer .popover-body .imprintlink" "css_element" + + @javascript + Scenario: Set a custom imprint page title + Given the following config values are set as admin: + | config | value | plugin | + | enableimprint | yes | theme_boost_union | + | imprintcontent |

Lorem ipsum

| theme_boost_union | + | imprintpagetitle | Custom | theme_boost_union | + When I log in as "admin" + And I am on imprint page + Then I should see "Custom" in the "div[role='main'] h2" "css_element" + And "//title[contains(text(),'Custom')]" "xpath_element" should exist + And the following config values are set as admin: + | config | value | plugin | + | imprintlinkposition | footnote | theme_boost_union | + And I reload the page + Then I should see "Custom" in the "#footnote .imprintlink" "css_element" + And the following config values are set as admin: + | config | value | plugin | + | imprintlinkposition | footer | theme_boost_union | + And I reload the page + And I click on ".btn-footer-popover" "css_element" in the "#page-footer" "css_element" + Then I should see "Custom" in the ".footer .popover-body .imprintlink" "css_element" diff --git a/version.php b/version.php index aa315efd8b0..897c5bb6087 100644 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'theme_boost_union'; -$plugin->version = 2022031708; +$plugin->version = 2022031709; $plugin->release = 'v4.0-r1'; $plugin->requires = 2022041900; $plugin->supported = [400, 400];