diff --git a/CHANGES.md b/CHANGES.md index 7e71f929fa7..818f6d1153d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2023-08-30 - Improvement: Align actions column on flavours and smart menus settings pages, solves #381. * 2023-08-19 - Improvement: Fix more mustache linter warnings, solves #360. * 2023-08-02 - Improvement: Add 'aboutus', 'offers', 'page1', 'page2' and 'page3' static pages, solves #351. * 2023-08-19 - Bugfix: Fix unparsable example JSON in Mustache template, solves #348. diff --git a/classes/table/flavours_overview.php b/classes/table/flavours_overview.php index a175b00e9a2..a293de6421e 100644 --- a/classes/table/flavours_overview.php +++ b/classes/table/flavours_overview.php @@ -69,6 +69,7 @@ public function __construct() { $this->pageable(false); // Having a pageable table would be nice, but we will keep it simple for now. $this->define_columns($columns); $this->define_headers($headers); + $this->define_header_column('title'); // Initialize values for the updown feature. $this->count = 0; @@ -97,9 +98,9 @@ public function col_updown($data) { if ($this->count > 0) { // Add the up icon. $updown .= \html_writer::link($actionurl->out(false, - array('action' => 'up', 'id' => $data->id)), - $OUTPUT->pix_icon('t/up', get_string('up'), 'moodle', - array('class' => 'iconsmall')), array('class' => 'sort-flavour-up-action')); + array('action' => 'up', 'id' => $data->id, 'sesskey' => sesskey())), + $OUTPUT->pix_icon('t/up', get_string('up'), 'moodle', + array('class' => 'iconsmall')), array('class' => 'sort-flavour-up-action')); // Otherwise, just add a spacer. } else { @@ -111,9 +112,9 @@ public function col_updown($data) { // Add the down icon. $updown .= ' '; $updown .= \html_writer::link($actionurl->out(false, - array('action' => 'down', 'id' => $data->id)), - $OUTPUT->pix_icon('t/down', get_string('down'), 'moodle', - array('class' => 'iconsmall')), array('class' => 'sort-flavour-down-action')); + array('action' => 'down', 'id' => $data->id, 'sesskey' => sesskey())), + $OUTPUT->pix_icon('t/down', get_string('down'), 'moodle', + array('class' => 'iconsmall')), array('class' => 'sort-flavour-down-action')); // Otherwise, just add a spacer. } else { @@ -166,17 +167,46 @@ public function col_appliesto($data) { public function col_actions($data) { global $OUTPUT; - // Compose and return the action buttons. - return - $OUTPUT->single_button( - new \moodle_url('/theme/boost_union/flavours/preview.php', ['id' => $data->id]), - get_string('flavourspreview', 'theme_boost_union'), 'get'). - $OUTPUT->single_button( - new \moodle_url('/theme/boost_union/flavours/edit.php', ['action' => 'edit', 'id' => $data->id]), - get_string('flavoursedit', 'theme_boost_union'), 'get'). - $OUTPUT->single_button( - new \moodle_url('/theme/boost_union/flavours/edit.php', ['action' => 'delete', 'id' => $data->id]), - get_string('flavoursdelete', 'theme_boost_union'), 'get'); + // Initialize actions. + $actions = array(); + + // Preview. + $actions[] = array( + 'url' => new \moodle_url('/theme/boost_union/flavours/preview.php', array('id' => $data->id)), + 'icon' => new \pix_icon('i/search', get_string('flavoursedit', 'theme_boost_union')), + 'attributes' => array('class' => 'action-preview') + ); + + // Edit. + $actions[] = array( + 'url' => new \moodle_url('/theme/boost_union/flavours/edit.php', + array('action' => 'edit', 'id' => $data->id, 'sesskey' => sesskey())), + 'icon' => new \pix_icon('t/edit', get_string('flavoursedit', 'theme_boost_union')), + 'attributes' => array('class' => 'action-edit') + ); + + // Delete. + $actions[] = array( + 'url' => new \moodle_url('/theme/boost_union/flavours/edit.php', + array('action' => 'delete', 'id' => $data->id, 'sesskey' => sesskey())), + 'icon' => new \pix_icon('t/delete', get_string('flavourspreview', 'theme_boost_union')), + 'attributes' => array('class' => 'action-delete') + ); + + // Compose action icons for all actions. + $actionshtml = array(); + foreach ($actions as $action) { + $action['attributes']['role'] = 'button'; + $actionshtml[] = $OUTPUT->action_icon( + $action['url'], + $action['icon'], + ($action['confirm'] ?? null), + $action['attributes'] + ); + } + + // Return all actions. + return \html_writer::span(join('', $actionshtml), 'flavours-actions'); } /** diff --git a/flavours/edit.php b/flavours/edit.php index 813e5707fca..b9395badff5 100644 --- a/flavours/edit.php +++ b/flavours/edit.php @@ -40,6 +40,7 @@ // Access checks. require_login(); +require_sesskey(); require_capability('theme/boost_union:configure', $context); // Prepare the page. diff --git a/flavours/overview.php b/flavours/overview.php index 981a4222549..8cb96e7d3cc 100644 --- a/flavours/overview.php +++ b/flavours/overview.php @@ -36,67 +36,71 @@ require_once($CFG->libdir.'/adminlib.php'); // Get parameters. -$action = optional_param('action', '', PARAM_TEXT); -$flavourid = optional_param('id', '', PARAM_INT); +$action = optional_param('action', null, PARAM_TEXT); +$flavourid = optional_param('id', null, PARAM_INT); // Get system context. $context = context_system::instance(); +// Access checks. +admin_externalpage_setup('theme_boost_union_flavours'); + // Prepare the page (to make sure that all necessary information is already set even if we just handle the actions as a start). $PAGE->set_context($context); $PAGE->set_url(new moodle_url('/theme/boost_union/flavours/overview.php')); $PAGE->set_cacheable(false); -// Process sort action. -if ($action && $flavourid) { +// Process actions. +if ($action !== null && confirm_sesskey()) { + // Every action is based on a flavour, thus the flavour ID param has to exist. + $flavourid = required_param('id', PARAM_INT); + + // The actions might be done with more than one DB statements which should have a monolithic effect, so we use a transaction. + $transaction = $DB->start_delegated_transaction(); + // Sort 'up' action. - if ($action == 'up') { - $currentflavour = $DB->get_record('theme_boost_union_flavours', array('id' => $flavourid)); - $prevflavour = $DB->get_record('theme_boost_union_flavours', array('sort' => $currentflavour->sort - 1)); - if ($prevflavour) { - // The sorting is done with two DB statements which should have a monolithic effect, - // so we use a transaction. - $transaction = $DB->start_delegated_transaction(); - $DB->set_field('theme_boost_union_flavours', 'sort', $prevflavour->sort, - array('id' => $currentflavour->id)); - $DB->set_field('theme_boost_union_flavours', 'sort', $currentflavour->sort, - array('id' => $prevflavour->id)); - $transaction->allow_commit(); - - // Purge the flavours cache as the users might get other flavours which apply after the sorting. - // We would have preferred using cache_helper::purge_by_definition, but this just purges the session cache - // of the current user and not for all users. - cache_helper::purge_by_event('theme_boost_union_flavours_resorted'); - } - - // Sort 'down' action. - } else if ($action = "down") { - $currentflavour = $DB->get_record('theme_boost_union_flavours', array('id' => $flavourid)); - $nextflavour = $DB->get_record('theme_boost_union_flavours', array('sort' => $currentflavour->sort + 1)); - if ($nextflavour) { - // The sorting is done with two DB statements which should have a monolithic effect, - // so we use a transaction. - $transaction = $DB->start_delegated_transaction(); - $DB->set_field('theme_boost_union_flavours', 'sort', $nextflavour->sort, - array('id' => $currentflavour->id)); - $DB->set_field('theme_boost_union_flavours', 'sort', $currentflavour->sort, - array('id' => $nextflavour->id)); - $transaction->allow_commit(); - - // Purge the flavours cache as the users might get other flavours which apply after the sorting. - // We would have preferred using cache_helper::purge_by_definition, but this just purges the session cache - // of the current user and not for all users. - cache_helper::purge_by_event('theme_boost_union_flavours_resorted'); - } + switch ($action) { + case 'up': + // Move the flavour upwards. + $currentflavour = $DB->get_record('theme_boost_union_flavours', array('id' => $flavourid)); + $prevflavour = $DB->get_record('theme_boost_union_flavours', array('sort' => $currentflavour->sort - 1)); + if ($prevflavour) { + $DB->set_field('theme_boost_union_flavours', 'sort', $prevflavour->sort, + array('id' => $currentflavour->id)); + $DB->set_field('theme_boost_union_flavours', 'sort', $currentflavour->sort, + array('id' => $prevflavour->id)); + + // Purge the flavours cache as the users might get other flavours which apply after the sorting. + // We would have preferred using cache_helper::purge_by_definition, but this just purges the session cache + // of the current user and not for all users. + cache_helper::purge_by_event('theme_boost_union_flavours_resorted'); + } + break; + case 'down': + // Move the flavour downwards. + $currentflavour = $DB->get_record('theme_boost_union_flavours', array('id' => $flavourid)); + $nextflavour = $DB->get_record('theme_boost_union_flavours', array('sort' => $currentflavour->sort + 1)); + if ($nextflavour) { + $DB->set_field('theme_boost_union_flavours', 'sort', $nextflavour->sort, + array('id' => $currentflavour->id)); + $DB->set_field('theme_boost_union_flavours', 'sort', $currentflavour->sort, + array('id' => $nextflavour->id)); + + // Purge the flavours cache as the users might get other flavours which apply after the sorting. + // We would have preferred using cache_helper::purge_by_definition, but this just purges the session cache + // of the current user and not for all users. + cache_helper::purge_by_event('theme_boost_union_flavours_resorted'); + } + break; } + // Allow to update the changes to database. + $transaction->allow_commit(); + // Redirect to the same page. redirect($PAGE->url); } -// Access checks. -admin_externalpage_setup('theme_boost_union_flavours'); - // Further prepare the page. $PAGE->set_title(theme_boost_union_get_externaladminpage_title(get_string('flavoursflavours', 'theme_boost_union'))); $PAGE->set_heading(theme_boost_union_get_externaladminpage_heading()); @@ -115,7 +119,7 @@ // Prepare 'Create flavours' button. $createbutton = $OUTPUT->box_start(); $createbutton .= $OUTPUT->single_button( - new \moodle_url('/theme/boost_union/flavours/edit.php', ['action' => 'create']), + new \moodle_url('/theme/boost_union/flavours/edit.php', array('action' => 'create', 'sesskey' => sesskey())), get_string('flavourscreateflavour', 'theme_boost_union'), 'get'); $createbutton .= $OUTPUT->box_end(); diff --git a/smartmenus/items.php b/smartmenus/items.php index 1b1373b6aba..c41b66402ea 100644 --- a/smartmenus/items.php +++ b/smartmenus/items.php @@ -32,7 +32,7 @@ require_once($CFG->libdir.'/adminlib.php'); // Get parameters. -$action = optional_param('action', null, PARAM_ALPHAEXT); +$action = optional_param('action', null, PARAM_TEXT); $menuid = optional_param('menu', null, PARAM_INT); $id = optional_param('id', null, PARAM_INT); @@ -92,23 +92,23 @@ \core\notification::success(get_string('smartmenusmenudeleted', 'theme_boost_union')); } break; - case "down": + case 'down': // Move the item downwards. $item->move_downward(); break; - case "up": + case 'up': // Move the item upwards. $item->move_upward(); break; - case "copy": + case 'copy': // Duplicate the item. $item->duplicate(); break; - case "hide": + case 'hide': // Hide the item from menu. $item->update_field('visible', false); break; - case "show": + case 'show': // Show the item in menu. $item->update_field('visible', true); break; diff --git a/smartmenus/menus.php b/smartmenus/menus.php index 4ae38790a68..99b27b309d1 100644 --- a/smartmenus/menus.php +++ b/smartmenus/menus.php @@ -32,7 +32,7 @@ require_once($CFG->libdir.'/adminlib.php'); // Get parameters. -$action = optional_param('action', null, PARAM_ALPHAEXT); +$action = optional_param('action', null, PARAM_TEXT); $menuid = optional_param('id', null, PARAM_INT); // Get system context. @@ -66,23 +66,23 @@ \core\notification::success(get_string('smartmenusmenudeleted', 'theme_boost_union')); } break; - case "down": + case 'down': // Move the menu downwards. $menu->move_downward(); break; - case "up": + case 'up': // Move the menu upwards. $menu->move_upward(); break; - case "copy": + case 'copy': // Duplicate the menu and its items. $menu->duplicate(); break; - case "hide": + case 'hide': // Disable the menu visibility. $menu->update_visible(false); break; - case "show": + case 'show': // Enable the menu visibility. $menu->update_visible(true); break; diff --git a/tests/behat/theme_boost_union_flavourssettings_application.feature b/tests/behat/theme_boost_union_flavourssettings_application.feature index 51907e81dff..74b5e4cd92f 100644 --- a/tests/behat/theme_boost_union_flavourssettings_application.feature +++ b/tests/behat/theme_boost_union_flavourssettings_application.feature @@ -41,7 +41,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, applyi And I should see "Create flavour" in the "#page-header h1" "css_element" And I set the field "Title" to "My shiny new flavour" And I click on "Save changes" "button" - And I click on "Preview" "button" in the "#region-main table" "css_element" + And I click on ".action-preview" "css_element" in the "My shiny new flavour" "table_row" # Unfortunately, we can't test for the particular flavour ID, we can just check that the class is there. Then the "class" attribute of "body" "css_element" should contain "flavour-" @@ -145,7 +145,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, applyi And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" And I should see "Course categories" in the "Cat 1 flavour" "table_row" - And I click on "Edit" "button" in the "#region-main table" "css_element" + And I click on ".action-edit" "css_element" in the "Cat 1 flavour" "table_row" And I expand all fieldsets And I select "No" from the "Apply to course categories" singleselect And I click on "Save changes" "button" @@ -210,7 +210,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, applyi And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" And I should see "Cohorts" in the "Cohort 1 flavour" "table_row" - And I click on "Edit" "button" in the "#region-main table" "css_element" + And I click on ".action-edit" "css_element" in the "Cohort 1 flavour" "table_row" And I expand all fieldsets And I select "No" from the "Apply to cohorts" singleselect And I click on "Save changes" "button" diff --git a/tests/behat/theme_boost_union_flavourssettings_caching.feature b/tests/behat/theme_boost_union_flavourssettings_caching.feature index f9b470325f7..4d085cc25b2 100644 --- a/tests/behat/theme_boost_union_flavourssettings_caching.feature +++ b/tests/behat/theme_boost_union_flavourssettings_caching.feature @@ -92,7 +92,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, cachin And I am on "Course 1" course homepage And I should not see "Course 1" in the "#page-header .page-header-headings" "css_element" And I navigate to "Appearance > Themes > Boost Union > Flavours" in site administration - And I click on "Edit" "button" in the "#region-main table" "css_element" + And I click on ".action-edit" "css_element" in the "Non-effective flavour" "table_row" And I click on "span.badge" "css_element" in the "#fitem_id_applytocategories_ids .form-autocomplete-selection" "css_element" And I click on ".form-autocomplete-downarrow" "css_element" in the "#fitem_id_applytocategories_ids" "css_element" And I click on "Cat 2" item in the autocomplete list @@ -147,7 +147,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, cachin And I am on "Course 1" course homepage And I should not see "Course 1" in the "#page-header .page-header-headings" "css_element" And I navigate to "Appearance > Themes > Boost Union > Flavours" in site administration - And I click on "Delete" "button" in the "Effective flavour" "table_row" + And I click on ".action-delete" "css_element" in the "Effective flavour" "table_row" And I click on "Delete" "button" And I am on "Course 1" course homepage Then I should see "Course 1" in the "#page-header .page-header-headings" "css_element" diff --git a/tests/behat/theme_boost_union_flavourssettings_look.feature b/tests/behat/theme_boost_union_flavourssettings_look.feature index ca4b75aa07c..bdb5a40db84 100644 --- a/tests/behat/theme_boost_union_flavourssettings_look.feature +++ b/tests/behat/theme_boost_union_flavourssettings_look.feature @@ -23,7 +23,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, applyi And I upload "theme/boost_union/tests/fixtures/flavourlogo.png" file to "Compact logo" filemanager And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" - And I click on "Preview" "button" in the "#region-main table" "css_element" + And I click on ".action-preview" "css_element" in the "My shiny new flavour" "table_row" # We can't check the uploaded image file visually, but we can verify that the compact logo is shipped from the theme_boost_union flavour filearea. Then "//nav[contains(@class, 'navbar')]//img[contains(@class, 'logo')][contains(@src, 'pluginfile.php/1/theme_boost_union/flavours_look_logocompact')][contains(@src, 'flavourlogo.png')]" "xpath_element" should exist @@ -41,7 +41,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, applyi And I upload "theme/boost_union/tests/fixtures/flavourlogo.png" file to "Compact logo" filemanager And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" - And I click on "Preview" "button" in the "#region-main table" "css_element" + And I click on ".action-preview" "css_element" in the "My shiny new flavour" "table_row" # We can't check the uploaded image file visually, but we can verify that the compact logo is shipped from the theme_boost_union flavour filearea. Then "//nav[contains(@class, 'navbar')]//img[contains(@class, 'logo')][contains(@src, 'pluginfile.php/1/theme_boost_union/flavours_look_logocompact')][contains(@src, 'flavourlogo.png')]" "xpath_element" should exist @@ -58,7 +58,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, applyi And I set the field "Title" to "My shiny new flavour" And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" - And I click on "Preview" "button" in the "#region-main table" "css_element" + And I click on ".action-preview" "css_element" in the "My shiny new flavour" "table_row" # We can't check the uploaded image file visually, but we can verify that the compact logo is shipped from the theme_boost_union global logo filearea. Then "//nav[contains(@class, 'navbar')]//img[contains(@class, 'logo')][contains(@src, 'pluginfile.php/1/theme_boost_union/logocompact')][contains(@src, 'moodlelogo.png')]" "xpath_element" should exist @@ -72,7 +72,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, applyi And I upload "theme/boost_union/tests/fixtures/flavourfavicon.ico" file to "Favicon" filemanager And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" - And I click on "Preview" "button" in the "#region-main table" "css_element" + And I click on ".action-preview" "css_element" in the "My shiny new flavour" "table_row" # We can't check the uploaded image file visually, but we can verify that the favicon is shipped from the theme_boost_union flavour filearea. Then "//head//link[contains(@rel, 'shortcut')][contains(@href, 'pluginfile.php/1/theme_boost_union/flavours_look_favicon')][contains(@href, 'flavourfavicon.ico')]" "xpath_element" should exist @@ -90,7 +90,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, applyi And I upload "theme/boost_union/tests/fixtures/flavourfavicon.ico" file to "Favicon" filemanager And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" - And I click on "Preview" "button" in the "#region-main table" "css_element" + And I click on ".action-preview" "css_element" in the "My shiny new flavour" "table_row" # We can't check the uploaded image file visually, but we can verify that the favicon is shipped from the theme_boost_union flavour filearea. Then "//head//link[contains(@rel, 'shortcut')][contains(@href, 'pluginfile.php/1/theme_boost_union/flavours_look_favicon')][contains(@href, 'flavourfavicon.ico')]" "xpath_element" should exist @@ -107,7 +107,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, applyi And I set the field "Title" to "My shiny new flavour" And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" - And I click on "Preview" "button" in the "#region-main table" "css_element" + And I click on ".action-preview" "css_element" in the "My shiny new flavour" "table_row" # We can't check the uploaded image file visually, but we can verify that the favicon is shipped from the theme_boost_union global favicon filearea. Then "//head//link[contains(@rel, 'shortcut')][contains(@href, 'pluginfile.php/1/theme_boost_union/favicon')][contains(@href, 'favicon.ico')]" "xpath_element" should exist @@ -135,5 +135,5 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, applyi """ And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" - And I click on "Preview" "button" in the "#region-main table" "css_element" + And I click on ".action-preview" "css_element" in the "My shiny new flavour" "table_row" Then I should not see "Preview flavour" in the "#page-header .page-header-headings" "css_element" diff --git a/tests/behat/theme_boost_union_flavourssettings_management.feature b/tests/behat/theme_boost_union_flavourssettings_management.feature index c6fdf337702..7d3d5fd62fd 100644 --- a/tests/behat/theme_boost_union_flavourssettings_management.feature +++ b/tests/behat/theme_boost_union_flavourssettings_management.feature @@ -11,9 +11,9 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, managi And I should see "There aren't any flavours created yet. Please create your first flavour to get things going." And "table" "css_element" should not exist in the "#region-main" "css_element" And "Create flavour" "button" should exist in the "#region-main" "css_element" - And "Preview" "button" should not exist in the "#region-main" "css_element" - And "Edit" "button" should not exist in the "#region-main" "css_element" - And "Delete" "button" should not exist in the "#region-main" "css_element" + And ".action-preview" "css_element" should not exist in the "#region-main" "css_element" + And ".action-edit" "css_element" should not exist in the "#region-main" "css_element" + And ".action-delete" "css_element" should not exist in the "#region-main" "css_element" Scenario: Flavours: Management - Add a flavour (and set its metadata) When I log in as "admin" @@ -27,9 +27,9 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, managi And I should not see "There aren't any flavours created yet. Please create your first flavour to get things going." And "table" "css_element" should exist in the "#region-main" "css_element" And "Create flavour" "button" should exist in the "#region-main" "css_element" - And "Preview" "button" should exist in the "#region-main table" "css_element" - And "Edit" "button" should exist in the "#region-main table" "css_element" - And "Delete" "button" should exist in the "#region-main table" "css_element" + And ".action-preview" "css_element" should exist in the "My shiny new flavour" "table_row" + And ".action-edit" "css_element" should exist in the "My shiny new flavour" "table_row" + And ".action-delete" "css_element" should exist in the "My shiny new flavour" "table_row" And I should see "My shiny new flavour" in the "#region-main table" "css_element" And I should see "This is a great flavour" in the "#region-main table" "css_element" @@ -41,7 +41,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, managi And I set the field "Title" to "My shiny new flavour" And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" - And I click on "Preview" "button" in the "#region-main table" "css_element" + And I click on ".action-preview" "css_element" in the "My shiny new flavour" "table_row" Then I should see "Preview flavour" in the "#page-header h1" "css_element" And I should see "Lorem ipsum dolor sit amet" in the "#region-main" "css_element" And "Back to flavour overview" "button" should exist in the "#region-main" "css_element" @@ -57,7 +57,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, managi And I set the field "Description" to "

This is a great flavour

" And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" - And I click on "Edit" "button" in the "#region-main table" "css_element" + And I click on ".action-edit" "css_element" in the "My shiny new flavour" "table_row" And I should see "Edit flavour" in the "#page-header h1" "css_element" And I set the field "Title" to "My filthy old flavour" And I set the field "Description" to "

This is a not so great flavour

" @@ -79,12 +79,12 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, managi And I set the field "Title" to "My filthy old flavour" And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" - And I click on "Delete" "button" in the "My shiny new flavour" "table_row" + And I click on ".action-delete" "css_element" in the "My shiny new flavour" "table_row" Then I should see "Delete flavour" in the "#page-header h1" "css_element" And I should see "Do you really want to delete the flavour My shiny new flavour?" And I click on "Delete" "button" And I should see "Flavours" in the "#region-main h2" "css_element" - And I click on "Delete" "button" in the "My filthy old flavour" "table_row" + And I click on ".action-delete" "css_element" in the "My filthy old flavour" "table_row" And I should see "Delete flavour" in the "#page-header h1" "css_element" And I should see "Do you really want to delete the flavour My filthy old flavour?" And I click on "Delete" "button" @@ -92,9 +92,9 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, managi And I should see "There aren't any flavours created yet. Please create your first flavour to get things going." And "table" "css_element" should not exist in the "#region-main" "css_element" And "Create flavour" "button" should exist in the "#region-main" "css_element" - And "Preview" "button" should not exist in the "#region-main" "css_element" - And "Edit" "button" should not exist in the "#region-main" "css_element" - And "Delete" "button" should not exist in the "#region-main" "css_element" + And ".action-preview" "css_element" should not exist in the "#region-main" "css_element" + And ".action-edit" "css_element" should not exist in the "#region-main" "css_element" + And ".action-delete" "css_element" should not exist in the "#region-main" "css_element" Scenario: Flavours: Management - Cancel the creation of a new flavour When I log in as "admin" @@ -106,9 +106,9 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, managi And I should see "There aren't any flavours created yet. Please create your first flavour to get things going." And "table" "css_element" should not exist in the "#region-main" "css_element" And "Create flavour" "button" should exist in the "#region-main" "css_element" - And "Preview" "button" should not exist in the "#region-main" "css_element" - And "Edit" "button" should not exist in the "#region-main" "css_element" - And "Delete" "button" should not exist in the "#region-main" "css_element" + And ".action-preview" "css_element" should not exist in the "#region-main" "css_element" + And ".action-edit" "css_element" should not exist in the "#region-main" "css_element" + And ".action-delete" "css_element" should not exist in the "#region-main" "css_element" Scenario: Flavours: Management - Cancel the editing of an existing flavour When I log in as "admin" @@ -119,7 +119,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, managi And I set the field "Description" to "

This is a great flavour

" And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" - And I click on "Edit" "button" in the "#region-main table" "css_element" + And I click on ".action-edit" "css_element" in the "My shiny new flavour" "table_row" And I should see "Edit flavour" in the "#page-header h1" "css_element" And I set the field "Title" to "My filthy old flavour" And I set the field "Description" to "

This is a not so great flavour

" @@ -136,7 +136,7 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, managi And I set the field "Title" to "My shiny new flavour" And I click on "Save changes" "button" And I should see "Flavours" in the "#region-main h2" "css_element" - And I click on "Delete" "button" in the "My shiny new flavour" "table_row" + And I click on ".action-delete" "css_element" in the "My shiny new flavour" "table_row" And I should see "Delete flavour" in the "#page-header h1" "css_element" And I should see "Do you really want to delete the flavour My shiny new flavour?" And I click on "Cancel" "button" @@ -144,9 +144,9 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, managi And I should not see "There aren't any flavours created yet. Please create your first flavour to get things going." And "table" "css_element" should exist in the "#region-main" "css_element" And "Create flavour" "button" should exist in the "#region-main" "css_element" - And "Preview" "button" should exist in the "#region-main table" "css_element" - And "Edit" "button" should exist in the "#region-main table" "css_element" - And "Delete" "button" should exist in the "#region-main table" "css_element" + And ".action-preview" "css_element" should exist in the "My shiny new flavour" "table_row" + And ".action-edit" "css_element" should exist in the "My shiny new flavour" "table_row" + And ".action-delete" "css_element" should exist in the "My shiny new flavour" "table_row" And I should see "My shiny new flavour" in the "#region-main table" "css_element" Scenario: Flavours: Management - Move existing flavours up and down