Merge branch 'MDL-82503-main' of https://github.com/sarjona/moodle
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
issueNumber: MDL-82503
|
||||
notes:
|
||||
core_badges:
|
||||
- message: >-
|
||||
The course_badges systemreport has been deprecated and merged with the
|
||||
badges systemreport. Please, use the badges systemreport instead.
|
||||
type: deprecated
|
||||
@@ -0,0 +1,7 @@
|
||||
issueNumber: MDL-82503
|
||||
notes:
|
||||
core_badges:
|
||||
- message: >-
|
||||
The $showmanage parameter in the core_badges\output\standard_action_bar
|
||||
constructor has been deprecated and should not be used anymore.
|
||||
type: deprecated
|
||||
@@ -0,0 +1,7 @@
|
||||
issueNumber: MDL-82503
|
||||
notes:
|
||||
core_badges:
|
||||
- message: >-
|
||||
The badges/view.php page has been deprecated and merged with
|
||||
badges/index.php. Please, use badges/index.php instead.
|
||||
type: deprecated
|
||||
@@ -165,7 +165,7 @@ class backup_course_task extends backup_task {
|
||||
// A few other key course links.
|
||||
$content = self::encode_links_helper($content, 'GRADEINDEXBYID', '/grade/index.php?id=');
|
||||
$content = self::encode_links_helper($content, 'GRADEREPORTINDEXBYID', '/grade/report/index.php?id=');
|
||||
$content = self::encode_links_helper($content, 'BADGESVIEWBYID', '/badges/view.php?type=2&id=');
|
||||
$content = self::encode_links_helper($content, 'BADGESVIEWBYID', '/badges/index.php?type=2&id=');
|
||||
$content = self::encode_links_helper($content, 'USERINDEXVIEWBYID', '/user/index.php?id=');
|
||||
$content = self::encode_links_helper($content, 'PLUGINFILEBYCONTEXT', '/pluginfile.php/');
|
||||
$content = self::encode_links_helper($content, 'PLUGINFILEBYCONTEXTURLENCODED', '/pluginfile.php/', true);
|
||||
|
||||
@@ -164,7 +164,7 @@ class restore_course_task extends restore_task {
|
||||
// A few other key course links.
|
||||
$rules[] = new restore_decode_rule('GRADEINDEXBYID', '/grade/index.php?id=$1', 'course');
|
||||
$rules[] = new restore_decode_rule('GRADEREPORTINDEXBYID', '/grade/report/index.php?id=$1', 'course');
|
||||
$rules[] = new restore_decode_rule('BADGESVIEWBYID', '/badges/view.php?type=2&id=$1', 'course');
|
||||
$rules[] = new restore_decode_rule('BADGESVIEWBYID', '/badges/index.php?type=2&id=$1', 'course');
|
||||
$rules[] = new restore_decode_rule('USERINDEXVIEWBYID', '/user/index.php?id=$1', 'course');
|
||||
$rules[] = new restore_decode_rule('PLUGINFILEBYCONTEXT', '/pluginfile.php/$1', 'context');
|
||||
$rules[] = new restore_decode_rule('PLUGINFILEBYCONTEXTURLENCODED', '/pluginfile.php/$1', 'context', true);
|
||||
|
||||
@@ -54,7 +54,7 @@ class backup_encode_content_test extends \basic_testcase {
|
||||
$httpsroot . '/course/view.php?id=123, ' .
|
||||
$httpsroot . '/grade/index.php?id=123, ' .
|
||||
$httpsroot . '/grade/report/index.php?id=123, ' .
|
||||
$httpsroot . '/badges/view.php?type=2&id=123, ' .
|
||||
$httpsroot . '/badges/index.php?type=2&id=123, ' .
|
||||
$httpsroot . '/user/index.php?id=123, ' .
|
||||
$httpsroot . '/pluginfile.php/123 and ' .
|
||||
urlencode($httpsroot . '/pluginfile.php/123') . '.'
|
||||
@@ -70,7 +70,7 @@ class backup_encode_content_test extends \basic_testcase {
|
||||
$httpsroot . '/course/view.php?id=123, ' .
|
||||
$httproot . '/grade/index.php?id=123, ' .
|
||||
$httproot . '/grade/report/index.php?id=123, ' .
|
||||
$httproot . '/badges/view.php?type=2&id=123, ' .
|
||||
$httproot . '/badges/index.php?type=2&id=123, ' .
|
||||
$httproot . '/user/index.php?id=123, ' .
|
||||
$httproot . '/pluginfile.php/123 and ' .
|
||||
urlencode($httproot . '/pluginfile.php/123') . '.'
|
||||
|
||||
@@ -69,7 +69,7 @@ Feature: Import course's contents into another course
|
||||
| Unpublished course badge | editingteacher |
|
||||
When I import "Course 1" course into "Course 2" course using this options:
|
||||
| Settings | Include badges | 1 |
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
Then I should see "Published course badge"
|
||||
And I should see "Unpublished course badge"
|
||||
And I should see "Unpublished without criteria course badge"
|
||||
|
||||
@@ -285,7 +285,7 @@ Feature: Restore Moodle 2 course backups
|
||||
| Confirmation | Filename | test_backup.mbz |
|
||||
When I restore "test_backup.mbz" backup into a new course using this options:
|
||||
| Settings | Include badges | 1 |
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
Then I should see "Published course badge"
|
||||
And I should see "Unpublished course badge"
|
||||
And I should see "Unpublished without criteria course badge"
|
||||
|
||||
+6
-1
@@ -84,7 +84,12 @@ if (!$badge->is_active()) {
|
||||
|
||||
$returnurl = new moodle_url('recipients.php', array('id' => $badge->id));
|
||||
$returnlink = html_writer::link($returnurl, $strrecipients);
|
||||
$actionbar = new \core_badges\output\standard_action_bar($PAGE, $badge->type, false, false, $returnurl);
|
||||
$actionbar = new \core_badges\output\standard_action_bar(
|
||||
page: $PAGE,
|
||||
type: $badge->type,
|
||||
showaddbadge: false,
|
||||
backurl: $returnurl
|
||||
);
|
||||
$output = $PAGE->get_renderer('core', 'badges');
|
||||
$tertiarynav = $output->render_tertiary_navigation($actionbar);
|
||||
|
||||
|
||||
@@ -67,7 +67,10 @@ class manage_badge_action_bar extends base_action_bar {
|
||||
$params['id'] = $this->page->context->instanceid;
|
||||
}
|
||||
$elements['button'] = new single_button(new moodle_url('/badges/index.php', $params), get_string('back'), 'get');
|
||||
$elements['urlselect'] = new url_select($this->generate_badge_navigation(), $this->page->url->out(false), null);
|
||||
$badgenav = $this->generate_badge_navigation();
|
||||
if ($badgenav) {
|
||||
$elements['urlselect'] = new url_select($badgenav, $this->page->url->out(false), null);
|
||||
}
|
||||
foreach ($elements as $key => $element) {
|
||||
$elements[$key] = $element->export_for_template($output);
|
||||
}
|
||||
@@ -132,6 +135,7 @@ class manage_badge_action_bar extends base_action_bar {
|
||||
*/
|
||||
protected function generate_badge_navigation(): array {
|
||||
global $DB;
|
||||
|
||||
$params = ['id' => $this->badge->id];
|
||||
$options = [];
|
||||
$construct = $this->get_badge_administration_mapping_construct();
|
||||
@@ -168,6 +172,10 @@ class manage_badge_action_bar extends base_action_bar {
|
||||
$url = new moodle_url($checks['url'], $params + ($checks['additionalparams'] ?? []));
|
||||
$options[get_string($stringidentifier, 'core_badges', $content)] = $url->out(false);
|
||||
}
|
||||
if (count($options) <= 1) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return array_flip($options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,29 +29,29 @@ use single_button;
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class standard_action_bar extends base_action_bar {
|
||||
/** @var bool $showmanage Whether or not to show the manage badges button. */
|
||||
protected $showmanage;
|
||||
|
||||
/** @var bool $showaddbadge Whether or not to show the add badges button. */
|
||||
protected $showaddbadge;
|
||||
|
||||
/** @var moodle_url $backurl BackURL to be used when the back button is required. */
|
||||
protected $backurl;
|
||||
|
||||
/**
|
||||
* standard_action_bar constructor
|
||||
* The constructor.
|
||||
*
|
||||
* @param moodle_page $page The page object
|
||||
* @param int $type The type of badge we are operating with
|
||||
* @param bool $showmanage Whether or not to show the manage badges button
|
||||
* @param bool $showaddbadge Whether or not to show the add badges button
|
||||
* @param moodle_url|null $backurl The backurl to be used
|
||||
*/
|
||||
public function __construct(moodle_page $page, int $type, bool $showmanage = true,
|
||||
$showaddbadge = true, ?moodle_url $backurl = null) {
|
||||
public function __construct(
|
||||
moodle_page $page,
|
||||
int $type,
|
||||
/** @var null|bool $showmanage This parameter has been deprecated since 4.5 and should not be used anymore. */
|
||||
?bool $showmanage = null,
|
||||
/** @var bool $showaddbadge Whether or not to show the add badges button. */
|
||||
protected bool $showaddbadge = true,
|
||||
/** @var moodle_url $backurl BackURL to be used when the back button is required. */
|
||||
protected ?moodle_url $backurl = null,
|
||||
) {
|
||||
parent::__construct($page, $type);
|
||||
|
||||
$this->showmanage = $showmanage;
|
||||
if ($showmanage !== null) {
|
||||
debugging(
|
||||
'The showmanage argument has been deprecated. Please remove it from your method calls.',
|
||||
DEBUG_DEVELOPER,
|
||||
);
|
||||
}
|
||||
|
||||
$this->showaddbadge = $showaddbadge;
|
||||
$this->backurl = $backurl;
|
||||
}
|
||||
@@ -82,11 +82,6 @@ class standard_action_bar extends base_action_bar {
|
||||
$params['id'] = $this->page->context->instanceid;
|
||||
}
|
||||
|
||||
if ($this->showmanage) {
|
||||
$buttons[] = new single_button(new moodle_url('/badges/index.php', $params),
|
||||
get_string('managebadges', 'core_badges'), 'get');
|
||||
}
|
||||
|
||||
if ($this->showaddbadge && has_capability('moodle/badges:createbadge', $this->page->context)) {
|
||||
$editparams = ['action' => 'new'];
|
||||
if (array_key_exists('id', $params)) {
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace core_badges\reportbuilder\local\systemreports;
|
||||
|
||||
use core\context\{course, system};
|
||||
use core_badges\reportbuilder\local\entities\badge;
|
||||
use core_badges\reportbuilder\local\entities\badge_issued;
|
||||
use core_reportbuilder\local\helpers\database;
|
||||
use core_reportbuilder\local\report\{action, column};
|
||||
use core_reportbuilder\system_report;
|
||||
@@ -50,6 +51,8 @@ class badges extends system_report {
|
||||
* Initialise report, we need to set the main table, load our entities and set columns/filters
|
||||
*/
|
||||
protected function initialise(): void {
|
||||
global $USER;
|
||||
|
||||
// Our main entity, it contains all of the column definitions that we need.
|
||||
$badgeentity = new badge();
|
||||
$entityalias = $badgeentity->get_table_alias('badge');
|
||||
@@ -69,14 +72,29 @@ class badges extends system_report {
|
||||
[$paramtype => $type, $paramcourseid => $context->instanceid]);
|
||||
}
|
||||
|
||||
if (!$this->can_view_draft_badges()) {
|
||||
$this->add_base_condition_sql("({$entityalias}.status = " . BADGE_STATUS_ACTIVE .
|
||||
" OR {$entityalias}.status = " . BADGE_STATUS_ACTIVE_LOCKED . ")");
|
||||
}
|
||||
|
||||
// Any columns required by actions should be defined here to ensure they're always available.
|
||||
$this->add_base_fields("{$entityalias}.id, {$entityalias}.type, {$entityalias}.courseid, {$entityalias}.status");
|
||||
|
||||
$badgeissuedentity = new badge_issued();
|
||||
$badgeissuedalias = $badgeissuedentity->get_table_alias('badge_issued');
|
||||
$this->add_entity($badgeissuedentity
|
||||
->add_join("LEFT JOIN {badge_issued} {$badgeissuedalias}
|
||||
ON {$entityalias}.id = {$badgeissuedalias}.badgeid AND {$badgeissuedalias}.userid = ".$USER->id)
|
||||
);
|
||||
|
||||
$this->add_base_fields("{$badgeissuedalias}.uniquehash");
|
||||
|
||||
// Now we can call our helper methods to add the content we want to include in the report.
|
||||
$this->add_columns();
|
||||
$this->add_columns($badgeissuedalias);
|
||||
$this->add_filters();
|
||||
$this->add_actions();
|
||||
|
||||
// Set initial sorting by name.
|
||||
$this->set_initial_sort_column('badge:namewithlink', SORT_ASC);
|
||||
$this->set_default_no_results_notice(new lang_string('nomatchingbadges', 'core_badges'));
|
||||
|
||||
@@ -91,6 +109,7 @@ class badges extends system_report {
|
||||
*/
|
||||
protected function can_view(): bool {
|
||||
return has_any_capability([
|
||||
'moodle/badges:viewbadges',
|
||||
'moodle/badges:viewawarded',
|
||||
'moodle/badges:createbadge',
|
||||
'moodle/badges:awardbadge',
|
||||
@@ -105,47 +124,76 @@ class badges extends system_report {
|
||||
*
|
||||
* They are provided by the entities we previously added in the {@see initialise} method, referencing each by their
|
||||
* unique identifier. If custom columns are needed just for this report, they can be defined here.
|
||||
*
|
||||
* @param string $badgeissuedalias
|
||||
*/
|
||||
protected function add_columns(): void {
|
||||
$badgeentity = $this->get_entity('badge');
|
||||
|
||||
$this->add_columns_from_entities([
|
||||
public function add_columns(string $badgeissuedalias): void {
|
||||
$columns = [
|
||||
'badge:image',
|
||||
'badge:namewithlink',
|
||||
'badge:version',
|
||||
'badge:status',
|
||||
'badge:criteria',
|
||||
]);
|
||||
];
|
||||
|
||||
// Issued badges column.
|
||||
$tempbadgealias = database::generate_alias();
|
||||
$badgeentityalias = $badgeentity->get_table_alias('badge');
|
||||
$this->add_column((new column(
|
||||
'issued',
|
||||
new lang_string('awards', 'core_badges'),
|
||||
$badgeentity->get_entity_name()
|
||||
))
|
||||
->add_joins($this->get_joins())
|
||||
->set_type(column::TYPE_INTEGER)
|
||||
->add_field("(SELECT COUNT({$tempbadgealias}.userid)
|
||||
FROM {badge_issued} {$tempbadgealias}
|
||||
INNER JOIN {user} u
|
||||
ON {$tempbadgealias}.userid = u.id
|
||||
WHERE {$tempbadgealias}.badgeid = {$badgeentityalias}.id AND u.deleted = 0)", 'issued')
|
||||
->set_is_sortable(true)
|
||||
->set_callback(function(int $count): string {
|
||||
if (!has_capability('moodle/badges:viewawarded', $this->get_context())) {
|
||||
return (string) $count;
|
||||
}
|
||||
|
||||
return html_writer::link(new moodle_url('/badges/recipients.php', ['id' => $this->badgeid]), $count);
|
||||
}));
|
||||
$canviewdraftbadges = $this->can_view_draft_badges();
|
||||
if (!$canviewdraftbadges) {
|
||||
// Remove status and recipients column.
|
||||
unset($columns[2]);
|
||||
}
|
||||
$this->add_columns_from_entities($columns);
|
||||
|
||||
// Remove title from image column.
|
||||
$this->get_column('badge:image')->set_title(null);
|
||||
|
||||
// Change title from namewithlink column.
|
||||
$this->get_column('badge:namewithlink')->set_title(new lang_string('name'));
|
||||
|
||||
// Recipients column.
|
||||
if ($canviewdraftbadges) {
|
||||
$badgeentity = $this->get_entity('badge');
|
||||
$tempbadgealias = database::generate_alias();
|
||||
$badgeentityalias = $badgeentity->get_table_alias('badge');
|
||||
$this->add_column((new column(
|
||||
'issued',
|
||||
new lang_string('awards', 'core_badges'),
|
||||
$badgeentity->get_entity_name()
|
||||
))
|
||||
->add_joins($this->get_joins())
|
||||
->set_type(column::TYPE_INTEGER)
|
||||
->add_field("(SELECT COUNT({$tempbadgealias}.userid)
|
||||
FROM {badge_issued} {$tempbadgealias}
|
||||
INNER JOIN {user} u
|
||||
ON {$tempbadgealias}.userid = u.id
|
||||
WHERE {$tempbadgealias}.badgeid = {$badgeentityalias}.id AND u.deleted = 0)", 'issued')
|
||||
->set_is_sortable(true)
|
||||
->set_callback(function(int $count): string {
|
||||
if (!has_capability('moodle/badges:viewawarded', $this->get_context())) {
|
||||
return (string) $count;
|
||||
}
|
||||
|
||||
return html_writer::link(new moodle_url('/badges/recipients.php', ['id' => $this->badgeid]), $count);
|
||||
}));
|
||||
}
|
||||
|
||||
// Add the date the badge was issued at the end of the report.
|
||||
$this->add_column_from_entity('badge_issued:issued');
|
||||
$this->get_column('badge_issued:issued')
|
||||
->set_title(new lang_string('awardedtoyou', 'core_badges'))
|
||||
->add_fields("{$badgeissuedalias}.uniquehash")
|
||||
->set_callback(static function(?int $value, stdClass $row) {
|
||||
global $OUTPUT;
|
||||
|
||||
if (!$value) {
|
||||
return '';
|
||||
}
|
||||
$format = get_string('strftimedatefullshort', 'core_langconfig');
|
||||
$date = $value ? userdate($value, $format) : '';
|
||||
$badgeurl = new moodle_url('/badges/badge.php', ['hash' => $row->uniquehash]);
|
||||
$icon = new pix_icon('i/valid', get_string('dateearned', 'badges', $date));
|
||||
return $OUTPUT->action_icon($badgeurl, $icon, null, null, true);
|
||||
});
|
||||
|
||||
$this->set_initial_sort_column('badge:namewithlink', SORT_ASC);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,12 +203,19 @@ class badges extends system_report {
|
||||
* unique identifier
|
||||
*/
|
||||
protected function add_filters(): void {
|
||||
$this->add_filters_from_entities([
|
||||
$filters = [
|
||||
'badge:name',
|
||||
'badge:version',
|
||||
'badge:status',
|
||||
'badge:expiry',
|
||||
]);
|
||||
'badge_issued:issued',
|
||||
];
|
||||
if (!$this->can_view_draft_badges()) {
|
||||
// Remove version and status filters.
|
||||
unset($filters[1]);
|
||||
unset($filters[2]);
|
||||
}
|
||||
$this->add_filters_from_entities($filters);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -295,6 +350,22 @@ class badges extends system_report {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the user can view unpublished badges.
|
||||
*
|
||||
* @return bool True if the user can edit badges, false otherwise.
|
||||
*/
|
||||
private function can_view_draft_badges(): bool {
|
||||
return has_any_capability([
|
||||
'moodle/badges:viewawarded',
|
||||
'moodle/badges:createbadge',
|
||||
'moodle/badges:awardbadge',
|
||||
'moodle/badges:configurecriteria',
|
||||
'moodle/badges:configuremessages',
|
||||
'moodle/badges:configuredetails',
|
||||
'moodle/badges:deletebadge'], $this->get_context());
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the ID of the badge within each row
|
||||
*
|
||||
|
||||
@@ -37,13 +37,19 @@ require_once("{$CFG->libdir}/badgeslib.php");
|
||||
* @package core_badges
|
||||
* @copyright 2023 David Carrillo <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @deprecated since 4.5. Use badges system_report instead.
|
||||
* @todo MDL-82383 This class will be deleted in Moodle 6.0.
|
||||
*/
|
||||
class course_badges extends system_report {
|
||||
|
||||
/**
|
||||
* Initialise report, we need to set the main table, load our entities and set columns/filters
|
||||
*
|
||||
* @deprecated since 4.5. Use badges system_report instead.
|
||||
*/
|
||||
#[\core\attribute\deprecated('course_badges::initialise', since: '4.5', mdl: 'MDL-82503')]
|
||||
protected function initialise(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
global $USER;
|
||||
// Our main entity, it contains all of the column definitions that we need.
|
||||
$badgeentity = new badge();
|
||||
@@ -84,8 +90,11 @@ class course_badges extends system_report {
|
||||
* Validates access to view this report
|
||||
*
|
||||
* @return bool
|
||||
* @deprecated since 4.5. Use badges system_report instead.
|
||||
*/
|
||||
#[\core\attribute\deprecated('course_badges::can_view', since: '4.5', mdl: 'MDL-82503')]
|
||||
protected function can_view(): bool {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
return has_capability('moodle/badges:viewbadges', $this->get_context());
|
||||
}
|
||||
|
||||
@@ -94,8 +103,13 @@ class course_badges extends system_report {
|
||||
*
|
||||
* They are provided by the entities we previously added in the {@see initialise} method, referencing each by their
|
||||
* unique identifier. If custom columns are needed just for this report, they can be defined here.
|
||||
*
|
||||
* @param string $badgeissuedalias
|
||||
* @deprecated since 4.5. Use badges system_report instead.
|
||||
*/
|
||||
#[\core\attribute\deprecated('course_badges::add_columns', since: '4.5', mdl: 'MDL-82503')]
|
||||
protected function add_columns(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
$badgeissuedalias = $this->get_entity('badge_issued')->get_table_alias('badge_issued');
|
||||
|
||||
$this->add_columns_from_entities([
|
||||
@@ -128,8 +142,12 @@ class course_badges extends system_report {
|
||||
*
|
||||
* They are all provided by the entities we previously added in the {@see initialise} method, referencing each by their
|
||||
* unique identifier
|
||||
*
|
||||
* @deprecated since 4.5. Use badges system_report instead.
|
||||
*/
|
||||
#[\core\attribute\deprecated('course_badges::add_filters', since: '4.5', mdl: 'MDL-82503')]
|
||||
protected function add_filters(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
$this->add_filters_from_entities([
|
||||
'badge:name',
|
||||
'badge_issued:issued',
|
||||
|
||||
+35
-16
@@ -48,13 +48,16 @@ if (empty($CFG->badges_allowcoursebadges) && ($type == BADGE_TYPE_COURSE)) {
|
||||
throw new \moodle_exception('coursebadgesdisabled', 'badges');
|
||||
}
|
||||
|
||||
if ($type == BADGE_TYPE_COURSE && !$courseid) {
|
||||
throw new \moodle_exception('courseidnotfound');
|
||||
}
|
||||
|
||||
$urlparams = ['type' => $type];
|
||||
|
||||
if ($course = $DB->get_record('course', ['id' => $courseid])) {
|
||||
$urlparams['id'] = $course->id;
|
||||
}
|
||||
|
||||
$hdr = get_string('managebadges', 'badges');
|
||||
$returnurl = new moodle_url('/badges/index.php', $urlparams);
|
||||
$PAGE->set_url($returnurl);
|
||||
$PAGE->add_body_class('limitedwidth');
|
||||
@@ -64,31 +67,34 @@ if ($type == BADGE_TYPE_SITE) {
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_pagelayout('admin');
|
||||
$PAGE->set_heading(get_string('administrationsite'));
|
||||
navigation_node::override_active_url(new moodle_url('/badges/index.php', array('type' => BADGE_TYPE_SITE)), true);
|
||||
navigation_node::override_active_url(new moodle_url('/badges/index.php', ['type' => BADGE_TYPE_SITE]), true);
|
||||
$eventotherparams = ['badgetype' => BADGE_TYPE_SITE];
|
||||
} else {
|
||||
require_login($course);
|
||||
$coursecontext = context_course::instance($course->id);
|
||||
$title = get_string('coursebadges', 'badges');
|
||||
$PAGE->set_context($coursecontext);
|
||||
$PAGE->set_pagelayout('incourse');
|
||||
$PAGE->set_heading(format_string($course->fullname, true, array('context' => $coursecontext)));
|
||||
$PAGE->set_heading(format_string($course->fullname, true, ['context' => $coursecontext]));
|
||||
navigation_node::override_active_url(
|
||||
new moodle_url('/badges/index.php', array('type' => BADGE_TYPE_COURSE, 'id' => $course->id))
|
||||
new moodle_url('/badges/index.php', ['type' => BADGE_TYPE_COURSE, 'id' => $course->id])
|
||||
);
|
||||
$eventotherparams = ['badgetype' => BADGE_TYPE_COURSE, 'courseid' => $course->id];
|
||||
}
|
||||
|
||||
if (!has_any_capability(array(
|
||||
if (!has_any_capability([
|
||||
'moodle/badges:viewbadges',
|
||||
'moodle/badges:viewawarded',
|
||||
'moodle/badges:createbadge',
|
||||
'moodle/badges:awardbadge',
|
||||
'moodle/badges:configurecriteria',
|
||||
'moodle/badges:configuremessages',
|
||||
'moodle/badges:configuredetails',
|
||||
'moodle/badges:deletebadge'), $PAGE->context)) {
|
||||
'moodle/badges:deletebadge'], $PAGE->context)) {
|
||||
redirect($CFG->wwwroot);
|
||||
}
|
||||
|
||||
$PAGE->set_title($hdr);
|
||||
$PAGE->set_title($title);
|
||||
|
||||
/** @var core_badges_renderer $output */
|
||||
$output = $PAGE->get_renderer('core', 'badges');
|
||||
@@ -102,14 +108,14 @@ if ($delete || $archive) {
|
||||
// Archive this badge?
|
||||
echo $output->heading(get_string('archivebadge', 'badges', $badge->name));
|
||||
$archivebutton = $output->single_button(
|
||||
new moodle_url($PAGE->url, array('archive' => $badge->id, 'confirm' => 1)),
|
||||
new moodle_url($PAGE->url, ['archive' => $badge->id, 'confirm' => 1]),
|
||||
get_string('archiveconfirm', 'badges'));
|
||||
echo $output->box(get_string('archivehelp', 'badges') . $archivebutton, 'generalbox');
|
||||
|
||||
// Delete this badge?
|
||||
echo $output->heading(get_string('delbadge', 'badges', $badge->name));
|
||||
$deletebutton = $output->single_button(
|
||||
new moodle_url($PAGE->url, array('delete' => $badge->id, 'confirm' => 1)),
|
||||
new moodle_url($PAGE->url, ['delete' => $badge->id, 'confirm' => 1]),
|
||||
get_string('delconfirm', 'badges'));
|
||||
echo $output->box(get_string('deletehelp', 'badges') . $deletebutton, 'generalbox');
|
||||
|
||||
@@ -140,20 +146,28 @@ if ($deactivate && has_capability('moodle/badges:configuredetails', $PAGE->conte
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
$backurl = $type == BADGE_TYPE_SITE ? null : new moodle_url('/badges/view.php', ['type' => $type, 'id' => $courseid]);
|
||||
$actionbar = new \core_badges\output\standard_action_bar($PAGE, $type, false, true, $backurl);
|
||||
echo $output->render_tertiary_navigation($actionbar);
|
||||
|
||||
echo $OUTPUT->container_start('badges-heading');
|
||||
if ($type == BADGE_TYPE_SITE) {
|
||||
echo $OUTPUT->heading_with_help($hdr, 'sitebadges', 'badges');
|
||||
echo $OUTPUT->heading_with_help($title, 'sitebadges', 'badges');
|
||||
} else {
|
||||
echo $OUTPUT->heading($hdr);
|
||||
echo $OUTPUT->heading($title);
|
||||
}
|
||||
$actionbar = new \core_badges\output\standard_action_bar(
|
||||
page: $PAGE,
|
||||
type: $type,
|
||||
showaddbadge: true,
|
||||
);
|
||||
echo $output->render_tertiary_navigation($actionbar);
|
||||
echo $OUTPUT->container_end();
|
||||
|
||||
echo $OUTPUT->box('', 'notifyproblem hide', 'check_connection');
|
||||
|
||||
if ($course && $course->startdate > time()) {
|
||||
echo $OUTPUT->box(get_string('error:notifycoursedate', 'badges'), 'generalbox notifyproblem');
|
||||
echo $OUTPUT->notification(
|
||||
get_string('error:notifycoursedate', 'badges', userdate($course->startdate)),
|
||||
'warning'
|
||||
);
|
||||
}
|
||||
|
||||
if ($msg !== '') {
|
||||
@@ -161,8 +175,13 @@ if ($msg !== '') {
|
||||
}
|
||||
|
||||
$report = system_report_factory::create(badges::class, $PAGE->context);
|
||||
echo $report->output();
|
||||
|
||||
echo $report->output();
|
||||
$PAGE->requires->js_call_amd('core_badges/actions', 'init');
|
||||
|
||||
// Trigger event, badge listing viewed.
|
||||
$eventparams = ['context' => $PAGE->context, 'other' => $eventotherparams];
|
||||
$event = \core\event\badge_listing_viewed::create($eventparams);
|
||||
$event->trigger();
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -67,8 +67,8 @@ Feature: Add badges to the system
|
||||
| Image caption | Test caption image |
|
||||
And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
|
||||
And I press "Create badge"
|
||||
And I navigate to "Badges > Manage badges" in site administration
|
||||
And I press "Add a new badge"
|
||||
And I wait until the page is ready
|
||||
And I navigate to "Badges > Add a new badge" in site administration
|
||||
And I set the following fields to these values:
|
||||
| Name | Test Badge 2 |
|
||||
| Version | v2 |
|
||||
@@ -82,6 +82,7 @@ Feature: Add badges to the system
|
||||
And I should see "This badge does not have any related badges."
|
||||
And I press "Add related badge"
|
||||
And I follow "Related badges"
|
||||
And I wait until the page is ready
|
||||
And I follow "Related badges"
|
||||
And I set the field "relatedbadgeids[]" to "Test Badge 1 (version: v1, language: French, Site badges)"
|
||||
When I press "Save changes"
|
||||
@@ -168,13 +169,12 @@ Feature: Add badges to the system
|
||||
And I am on homepage
|
||||
When I click on "Site pages" "list_item" in the "Navigation" "block"
|
||||
And I click on "Site badges" "link" in the "Navigation" "block"
|
||||
Then I should see "Manage badges"
|
||||
And I should see "Add a new badge"
|
||||
Then I should see "Add a new badge"
|
||||
|
||||
@javascript @_file_upload
|
||||
Scenario: Edit a site badge
|
||||
Given the following "core_badges > Badge" exists:
|
||||
| name | Site badge |
|
||||
| name | Testing site badge |
|
||||
| status | inactive |
|
||||
| version | 1 |
|
||||
| language | ca |
|
||||
@@ -184,11 +184,11 @@ Feature: Add badges to the system
|
||||
| imagecaption | My caption image |
|
||||
| issuercontact | testuser@example.com |
|
||||
And the following "core_badges > Criterias" exist:
|
||||
| badge | role |
|
||||
| Site badge | editingteacher |
|
||||
| badge | role |
|
||||
| Testing site badge | editingteacher |
|
||||
And I navigate to "Badges > Manage badges" in site administration
|
||||
When I press "Edit" action in the "Site badge" report row
|
||||
And I should see "Site badge"
|
||||
When I press "Edit" action in the "Testing site badge" report row
|
||||
And I should see "Testing site badge"
|
||||
And the field "Issuer contact" matches value "testuser@example.com"
|
||||
And I set the following fields to these values:
|
||||
| Name | Test badge with 'apostrophe' and other friends (<>&@#) |
|
||||
@@ -203,7 +203,7 @@ Feature: Add badges to the system
|
||||
And I select "Overview" from the "jump" singleselect
|
||||
And I expand all fieldsets
|
||||
Then I should see "Test badge with 'apostrophe' and other friends (&@#)"
|
||||
And I should not see "Site badge"
|
||||
And I should not see "Testing site badge"
|
||||
And I should see "secondversion"
|
||||
And I should not see "firstversion"
|
||||
And I should see "Math"
|
||||
@@ -218,42 +218,3 @@ Feature: Add badges to the system
|
||||
| badges_defaultissuername | Test Badge Site |
|
||||
And I navigate to "Badges > Add a new badge" in site administration
|
||||
And the field "Issuer name" matches value "Test Badge Site"
|
||||
|
||||
Scenario: Cancel button behaviour when creating badges
|
||||
Given the following "course" exists:
|
||||
| fullname | Course 1 |
|
||||
| shortname | C1 |
|
||||
And the following "core_badges > Badge" exists:
|
||||
| name | Site Badge 1 |
|
||||
| description | Site badge 1 description |
|
||||
| image | badges/tests/behat/badge.png |
|
||||
| status | 0 |
|
||||
| type | 1 |
|
||||
And the following "core_badges > Badge" exists:
|
||||
| name | Course Badge 1 |
|
||||
| course | C1 |
|
||||
| description | Course badge 1 description |
|
||||
| image | badges/tests/behat/badge.png |
|
||||
| status | 0 |
|
||||
| type | 2 |
|
||||
# Site badge: cancel when creating.
|
||||
When I navigate to "Badges > Add a new badge" in site administration
|
||||
And I click on "Cancel" "button"
|
||||
Then I should see "Manage badges"
|
||||
And I should see "Add a new badge"
|
||||
# Site badge: cancel when editing.
|
||||
And I press "Edit" action in the "Site Badge 1" report row
|
||||
And I click on "Cancel" "button"
|
||||
And I should see "Site badge 1"
|
||||
And I should not see "Save changes"
|
||||
# Course badge: cancel when creating.
|
||||
And I am on the "Course 1" "course" page
|
||||
And I navigate to "Badges > Manage badges > Add a new badge" in current page administration
|
||||
And I click on "Cancel" "button"
|
||||
Then I should see "Manage badges"
|
||||
And I should see "Add a new badge"
|
||||
# Course badge: cancel when editing.
|
||||
And I press "Edit" action in the "Course Badge 1" report row
|
||||
And I click on "Cancel" "button"
|
||||
And I should see "Course badge 1"
|
||||
And I should not see "Save changes"
|
||||
|
||||
@@ -37,7 +37,7 @@ Feature: Award badges
|
||||
| badge | Course Badge 1 |
|
||||
| role | editingteacher |
|
||||
And I am on the "Course 1" "course" page logged in as "teacher1"
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge 2"
|
||||
And I select "Criteria" from the "jump" singleselect
|
||||
# Set "course badge 1" as criteria for Badge 2.
|
||||
@@ -47,7 +47,7 @@ Feature: Award badges
|
||||
And I press "Enable access"
|
||||
And I click on "Enable" "button" in the "Confirm" "dialogue"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge 1"
|
||||
And I select "Recipients (0)" from the "jump" singleselect
|
||||
And I press "Award badge"
|
||||
@@ -55,7 +55,7 @@ Feature: Award badges
|
||||
And I set the field "potentialrecipients[]" to "Student 1 (student1@example.com)"
|
||||
When I press "Award badge"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge 1"
|
||||
And I select "Recipients (1)" from the "jump" singleselect
|
||||
Then I should see "Recipients (1)"
|
||||
@@ -70,16 +70,26 @@ Feature: Award badges
|
||||
When I follow "Badges"
|
||||
Then I should see "Course Badge 1"
|
||||
And I should see "Course Badge 2"
|
||||
And I should not see "Manage badges"
|
||||
And I should not see "Add a new badge"
|
||||
# Student 1 should have both badges in the course too.
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I should see "Course Badge 1"
|
||||
And I should see "Course Badge 2"
|
||||
And I should not see "Course badge 1 description"
|
||||
And I should not see "Course badge 2 description"
|
||||
And I should not see "Recipients"
|
||||
And I should not see "Badge status"
|
||||
And I follow "Course Badge 1"
|
||||
And I should see "Course badge 1 description"
|
||||
And I should not see "Course badge 2 description"
|
||||
And I log out
|
||||
# Teacher 1 should have access to manage/create badges in the Badges navigation section.
|
||||
When I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
Then I should see "Course Badge 1"
|
||||
And I should see "Course Badge 2"
|
||||
And I should see "Manage badges"
|
||||
And I should see "Add a new badge"
|
||||
# Teacher 1 should NOT have access to manage/create site badges in the Site badges section.
|
||||
When I am on homepage
|
||||
@@ -91,7 +101,6 @@ Feature: Award badges
|
||||
And I click on "Site pages" "list_item" in the "Navigation" "block"
|
||||
And I click on "Site badges" "link" in the "Navigation" "block"
|
||||
Then I should see "There are no matching badges available for users to earn"
|
||||
And I should not see "Manage badges"
|
||||
And I should not see "Add a new badge"
|
||||
|
||||
@javascript
|
||||
@@ -127,6 +136,7 @@ Feature: Award badges
|
||||
And I press "Update profile"
|
||||
And I follow "Profile" in the user menu
|
||||
Then I should see "Profile Badge"
|
||||
And I should not see "There are no matching badges available for users to earn"
|
||||
|
||||
@javascript
|
||||
Scenario: Award site badge
|
||||
@@ -169,7 +179,7 @@ Feature: Award badges
|
||||
| badge | Course Badge |
|
||||
| role | editingteacher |
|
||||
And I am on the "Course 1" "course" page logged in as "teacher1"
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
And I select "Recipients (0)" from the "jump" singleselect
|
||||
And I press "Award badge"
|
||||
@@ -178,7 +188,7 @@ Feature: Award badges
|
||||
And I set the field "potentialrecipients[]" to "Student 1 (student1@example.com)"
|
||||
When I press "Award badge"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
Then I should see "Recipients (2)"
|
||||
And I log out
|
||||
@@ -198,7 +208,7 @@ Feature: Award badges
|
||||
| status | 0 |
|
||||
| type | 2 |
|
||||
And I am on the "Course 1" "course" page logged in as "teacher1"
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
And I select "Criteria" from the "jump" singleselect
|
||||
And I set the field "type" to "Activity completion"
|
||||
@@ -240,7 +250,7 @@ Feature: Award badges
|
||||
And I set the field "Assignment - Music history" to "1"
|
||||
And I press "Save changes"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
And I select "Criteria" from the "jump" singleselect
|
||||
And I set the field "type" to "Course completion"
|
||||
@@ -280,7 +290,7 @@ Feature: Award badges
|
||||
| badge | Course Badge 1 |
|
||||
| role | editingteacher |
|
||||
And I am on the "Course 1" "course" page logged in as "teacher1"
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge 1"
|
||||
And I select "Recipients (0)" from the "jump" singleselect
|
||||
And I press "Award badge"
|
||||
@@ -288,7 +298,7 @@ Feature: Award badges
|
||||
And I set the field "potentialrecipients[]" to "Student 1 (student1@example.com)"
|
||||
When I press "Award badge"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge 1"
|
||||
And I select "Recipients (1)" from the "jump" singleselect
|
||||
Then I should see "Recipients (1)"
|
||||
@@ -300,7 +310,7 @@ Feature: Award badges
|
||||
| image | badges/tests/behat/badge.png |
|
||||
| status | 0 |
|
||||
| type | 2 |
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge 2"
|
||||
And I select "Criteria" from the "jump" singleselect
|
||||
And I set the field "type" to "Manual issue by role"
|
||||
@@ -317,7 +327,7 @@ Feature: Award badges
|
||||
And I set the field "potentialrecipients[]" to "Student 2 (student2@example.com)"
|
||||
When I press "Award badge"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge 2"
|
||||
And I select "Recipients (1)" from the "jump" singleselect
|
||||
Then I should see "Recipients (1)"
|
||||
@@ -350,7 +360,7 @@ Feature: Award badges
|
||||
| badge | Course Badge |
|
||||
| role | editingteacher |
|
||||
And I am on the "Course 1" "course" page logged in as "teacher1"
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
And I select "Recipients (0)" from the "jump" singleselect
|
||||
And I press "Award badge"
|
||||
@@ -359,7 +369,7 @@ Feature: Award badges
|
||||
And I set the field "potentialrecipients[]" to "Student 1 (student1@example.com)"
|
||||
When I press "Award badge"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
Then I should see "Recipients (2)"
|
||||
And I select "Recipients (2)" from the "jump" singleselect
|
||||
@@ -369,6 +379,6 @@ Feature: Award badges
|
||||
And I set the field "existingrecipients[]" to "Student 1 (student1@example.com)"
|
||||
When I press "Revoke badge"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
Then I should see "Recipients (0)"
|
||||
|
||||
@@ -38,7 +38,7 @@ Feature: Award badges with separate groups
|
||||
| status | 0 |
|
||||
| type | 2 |
|
||||
And I am on the "Course 1" "course" page logged in as "teacher1"
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
And I select "Criteria" from the "jump" singleselect
|
||||
And I set the field "type" to "Manual issue by role"
|
||||
@@ -55,7 +55,7 @@ Feature: Award badges with separate groups
|
||||
Scenario: Award course badge as non-editing teacher with only one group
|
||||
When I log in as "teacher2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
And I press "Award badge"
|
||||
And I set the field "role" to "Non-editing teacher"
|
||||
@@ -68,7 +68,7 @@ Feature: Award badges with separate groups
|
||||
And I set the field "potentialrecipients[]" to "Student 2 (student2@example.com)"
|
||||
And I press "Award badge"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
And I should see "Recipients (1)"
|
||||
And I log out
|
||||
@@ -89,7 +89,7 @@ Feature: Award badges with separate groups
|
||||
And I log out
|
||||
When I log in as "teacher2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
And I press "Award badge"
|
||||
And I set the field "role" to "Non-editing teacher"
|
||||
@@ -114,7 +114,7 @@ Feature: Award badges with separate groups
|
||||
And I log out
|
||||
When I log in as "teacher2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
And I press "Award badge"
|
||||
# Teacher 2 shouldn't be able to go further
|
||||
@@ -123,7 +123,7 @@ Feature: Award badges with separate groups
|
||||
@javascript
|
||||
Scenario: Editing teacher can award badge to members of separate groups
|
||||
Given I am on the "Course 1" course page logged in as teacher1
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
And I press "Award badge"
|
||||
When I set the field "role" to "Teacher"
|
||||
@@ -155,7 +155,7 @@ Feature: Award badges with separate groups
|
||||
And I set the field "Group mode" to "Visible groups"
|
||||
And I press "Save and display"
|
||||
When I am on the "Course 1" course page logged in as <loggedinuser>
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
And I press "Award badge"
|
||||
And I set the field "role" to "<awarder>"
|
||||
@@ -196,7 +196,7 @@ Feature: Award badges with separate groups
|
||||
And I set the field "Group mode" to "No groups"
|
||||
And I press "Save and display"
|
||||
When I am on the "Course 1" course page logged in as <loggedinuser>
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge"
|
||||
And I press "Award badge"
|
||||
And I set the field "role" to "<awarder>"
|
||||
|
||||
@@ -46,28 +46,14 @@ Feature: Test tertiary navigation as various users
|
||||
Given I log in as "<user>"
|
||||
And I am on "Course 1" course homepage
|
||||
When I navigate to "Badges" in current page administration
|
||||
Then "Manage badges" "button" should exist
|
||||
And "Add a new badge" "button" <createbutton>
|
||||
Then "Add a new badge" "button" <createbutton>
|
||||
And I should see "<activetab>" is active in secondary navigation
|
||||
And I click on "Manage badges" "button"
|
||||
And "Manage badges" "button" should not exist
|
||||
And "Back" "button" should exist
|
||||
And "Add a new badge" "button" <createbutton>
|
||||
And I should see "<activetab>" is active in secondary navigation
|
||||
And I click on "Back" "button"
|
||||
And "Back" "button" should not exist
|
||||
And "Manage badges" "button" should exist
|
||||
And "Add a new badge" "button" <createbutton>
|
||||
And I should see "<activetab>" is active in secondary navigation
|
||||
And I click on "Manage badges" "button"
|
||||
And I click on "Testing course badge" "link"
|
||||
And "Manage badges" "button" should not exist
|
||||
And "Add a new badge" "button" should not exist
|
||||
And "Back" "button" should exist
|
||||
And I should see "<activetab>" is active in secondary navigation
|
||||
And I click on "Back" "button"
|
||||
And "Back" "button" should exist
|
||||
And "Manage badges" "button" should not exist
|
||||
And "Add a new badge" "button" <createbutton>
|
||||
And I should see "<activetab>" is active in secondary navigation
|
||||
|
||||
@@ -84,7 +70,6 @@ Feature: Test tertiary navigation as various users
|
||||
# Enable one badge.
|
||||
When I am on the "C1" "Course" page logged in as "admin"
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I click on "Manage badges" "button"
|
||||
And I press "Enable access" action in the "Testing course badge" report row
|
||||
And I click on "Enable" "button" in the "Confirm" "dialogue"
|
||||
And I log out
|
||||
@@ -93,24 +78,20 @@ Feature: Test tertiary navigation as various users
|
||||
Then "Badges" "link" should exist in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And "Back" "button" should not exist
|
||||
And "Manage badges" "button" should not exist
|
||||
And "Add a new badge" "button" should not exist
|
||||
And I should see "Badges" is active in secondary navigation
|
||||
|
||||
Scenario: Check navigation as an admin in a site context
|
||||
Given I log in as "admin"
|
||||
When I navigate to "Badges > Manage badges" in site administration
|
||||
Then "Manage badges" "button" should not exist
|
||||
And "Add a new badge" "button" should exist
|
||||
Then "Add a new badge" "button" should exist
|
||||
And I should see "General" is active in secondary navigation
|
||||
And I click on "Testing site badge" "link"
|
||||
And "Manage badges" "button" should not exist
|
||||
And "Add a new badge" "button" should not exist
|
||||
And "Back" "button" should exist
|
||||
And I should see "General" is active in secondary navigation
|
||||
And I click on "Back" "button"
|
||||
And "Back" "button" should not exist
|
||||
And "Manage badges" "button" should not exist
|
||||
And "Add a new badge" "button" should exist
|
||||
|
||||
Scenario Outline: Check secondary navigation highlights after tertiary nav jumps in site admin
|
||||
@@ -135,7 +116,6 @@ Feature: Test tertiary navigation as various users
|
||||
Given I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I click on "Manage badges" "button"
|
||||
And I click on "Testing course badge" "link"
|
||||
When I select "<option>" from the "jump" singleselect
|
||||
Then I should see "More" is active in secondary navigation
|
||||
|
||||
@@ -52,7 +52,6 @@ Feature: Award badges based on activity completion
|
||||
|
||||
Scenario: Student does not earn a badge using activity completion when does not get passing grade
|
||||
Given I navigate to "Badges" in current page administration
|
||||
And I press "Manage badges"
|
||||
And I follow "Course Badge 1"
|
||||
And I select "Criteria" from the "jump" singleselect
|
||||
And I set the field "type" to "Activity completion"
|
||||
@@ -69,7 +68,7 @@ Feature: Award badges based on activity completion
|
||||
And user "student2" has attempted "Test quiz name 1" with responses:
|
||||
| slot | response |
|
||||
| 1 | False |
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge 1"
|
||||
Then I should see "Recipients (1)"
|
||||
And I select "Recipients (1)" from the "jump" singleselect
|
||||
@@ -78,7 +77,6 @@ Feature: Award badges based on activity completion
|
||||
|
||||
Scenario: Students with any grades in an activity will receive a badge if the completion condition is set to receive any grade
|
||||
Given I navigate to "Badges" in current page administration
|
||||
And I press "Manage badges"
|
||||
And I follow "Course Badge 2"
|
||||
And I select "Criteria" from the "jump" singleselect
|
||||
And I set the field "type" to "Activity completion"
|
||||
@@ -94,7 +92,7 @@ Feature: Award badges based on activity completion
|
||||
And user "student2" has attempted "Test quiz name 2" with responses:
|
||||
| slot | response |
|
||||
| 1 | False |
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Course Badge 2"
|
||||
Then I should see "Recipients (2)"
|
||||
And I select "Recipients (2)" from the "jump" singleselect
|
||||
@@ -111,7 +109,6 @@ Feature: Award badges based on activity completion
|
||||
| slot | response |
|
||||
| 1 | False |
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I press "Manage badges"
|
||||
And I follow "Course Badge 1"
|
||||
And I select "Criteria" from the "jump" singleselect
|
||||
And I set the field "type" to "Activity completion"
|
||||
|
||||
@@ -47,7 +47,6 @@ Feature: Award badges based on competency completion
|
||||
And I am on "Course 1" course homepage
|
||||
And I change window size to "large"
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I press "Manage badges"
|
||||
And I follow "Course Badge"
|
||||
And I select "Criteria" from the "jump" singleselect
|
||||
# Set the competency as a criteria for the badge
|
||||
|
||||
@@ -19,33 +19,33 @@ Feature: Delete course badge already awarded
|
||||
@javascript
|
||||
Scenario Outline: Delete course badge already awarded to student
|
||||
Given the following "core_badges > Badges" exist:
|
||||
| name | course | description | image | status | type |
|
||||
| <badgename> | C1 | <badgename> description | badges/tests/behat/badge.png | active | 2 |
|
||||
| name | course | description | image | status | type |
|
||||
| Testing badge 1 | C1 | Testing badge 1 description | badges/tests/behat/badge.png | active | 2 |
|
||||
And the following "core_badges > Criterias" exist:
|
||||
| badge | role |
|
||||
| <badgename> | editingteacher |
|
||||
| badge | role |
|
||||
| Testing badge 1 | editingteacher |
|
||||
And the following "core_badges > Issued badges" exist:
|
||||
| badge | user |
|
||||
| <badgename> | student1 |
|
||||
| badge | user |
|
||||
| Testing badge 1 | student1 |
|
||||
When I am on the "Course 1" "enrolled users" page logged in as "teacher1"
|
||||
And I click on "Student 1" "link"
|
||||
Then I should see "<badgename>"
|
||||
Then I should see "Testing badge 1"
|
||||
And I am on the "Course 1" course page
|
||||
# Navigate to Manage Badges page in order to delete the badge
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
# Navigate to Badges page in order to delete the badge
|
||||
And I navigate to "Badges" in current page administration
|
||||
# Delete the badge
|
||||
And I press "Delete" action in the "<badgename>" report row
|
||||
And I press "Delete" action in the "Testing badge 1" report row
|
||||
And I press "<deleteoption>"
|
||||
And the following <shouldtable> exist in the "reportbuilder-table" table:
|
||||
| Name | Badge status |
|
||||
| Testing badge 1 | Archived |
|
||||
And I <shouldmsg> see "There are no matching badges available for users to earn"
|
||||
# Confirm that badge is retained in the first case as awarded badge but not in the second.
|
||||
And I am on the "Course 1" "enrolled users" page
|
||||
And I click on "Student 1" "link"
|
||||
# Confirm that Badge 1 is retained as awarded badge but Badge 2 is not
|
||||
And I <visibility> see "<badgename>"
|
||||
And I am on the "Course 1" course page
|
||||
# Navigate to Badges page to confirm that no badges exist, hence, Manage badges would not exist
|
||||
And I navigate to "Badges" in current page administration
|
||||
# Confirm that badges are sucessfully deleted
|
||||
And I should see "There are no matching badges available for users to earn"
|
||||
And I <shouldtable> see "Testing badge 1"
|
||||
|
||||
Examples:
|
||||
| badgename | deleteoption | visibility |
|
||||
| Badge 1 | Delete and keep existing issued badges | should |
|
||||
| Badge 2 | Delete and remove existing issued badges | should not |
|
||||
| deleteoption | shouldtable | shouldmsg |
|
||||
| Delete and keep existing issued badges | should | should not |
|
||||
| Delete and remove existing issued badges | should not | should |
|
||||
|
||||
@@ -23,9 +23,9 @@ Feature: Manage badges
|
||||
And I press "Save changes"
|
||||
And I click on "Back" "button"
|
||||
Then the following should exist in the "reportbuilder-table" table:
|
||||
| Name | Version | Badge status |
|
||||
| Badge #1 | 1.0 | Not available |
|
||||
| Copy of Badge #1 | 1.0 | Not available |
|
||||
| Name | Badge status |
|
||||
| Badge #1 | Not available |
|
||||
| Copy of Badge #1 | Not available |
|
||||
|
||||
Scenario: Edit a badge
|
||||
Given I log in as "admin"
|
||||
@@ -37,8 +37,10 @@ Feature: Manage badges
|
||||
And I press "Save changes"
|
||||
And I click on "Back" "button"
|
||||
Then the following should exist in the "reportbuilder-table" table:
|
||||
| Name | Version | Badge status |
|
||||
| New Badge #1 | 1.1 | Not available |
|
||||
| Name | Badge status |
|
||||
| New Badge #1 | Not available |
|
||||
And I follow "New Badge #1"
|
||||
And I should see "1.1"
|
||||
|
||||
Scenario: Delete a badge
|
||||
Given I log in as "admin"
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
@core @core_badges @_file_upload @javascript
|
||||
Feature: Manage badges is not shown when there are no existing badges.
|
||||
Feature: Badges not shown when there are no existing badges.
|
||||
|
||||
Scenario: Check navigation at site level with no badges
|
||||
Given I log in as "admin"
|
||||
When I navigate to "Badges > Manage badges" in site administration
|
||||
And I should see "There are no matching badges available for users to earn"
|
||||
Then "Manage badges" "button" should not exist
|
||||
Then I should see "There are no matching badges available for users to earn"
|
||||
|
||||
Scenario: Check navigation at course level with no badges
|
||||
Given the following "users" exist:
|
||||
@@ -20,8 +19,7 @@ Feature: Manage badges is not shown when there are no existing badges.
|
||||
And I log in as "teacher"
|
||||
And I am on "Course 1" course homepage
|
||||
When I navigate to "Badges" in current page administration
|
||||
Then "Manage badges" "button" should not exist
|
||||
And I click on "Add a new badge" "button"
|
||||
Then I click on "Add a new badge" "button"
|
||||
And I set the following fields to these values:
|
||||
| Name | Testing course badge |
|
||||
| Version | 1.1 |
|
||||
@@ -33,11 +31,6 @@ Feature: Manage badges is not shown when there are no existing badges.
|
||||
And I click on "Create badge" "button"
|
||||
And I click on "Back" "button"
|
||||
And I should see "Testing course badge"
|
||||
And I click on "Back" "button"
|
||||
And "Manage badges" "button" should exist
|
||||
# Badge is not enabled so is not listed.
|
||||
And I should not see "Testing course badge"
|
||||
And I click on "Manage badges" "button"
|
||||
And I press "Edit" action in the "Testing course badge" report row
|
||||
And I click on "Add criteria" "button"
|
||||
And I set the field "type" to "Manual issue by role"
|
||||
@@ -46,18 +39,9 @@ Feature: Manage badges is not shown when there are no existing badges.
|
||||
And I click on "Save" "button"
|
||||
And I click on "Back" "button"
|
||||
And I should see "Testing course badge"
|
||||
And I click on "Back" "button"
|
||||
And "Manage badges" "button" should exist
|
||||
# Badge is not enabled yet so is not listed.
|
||||
And I should not see "Testing course badge"
|
||||
And I click on "Manage badges" "button"
|
||||
And I press "Enable access" action in the "Testing course badge" report row
|
||||
And I click on "Enable" "button" in the "Confirm" "dialogue"
|
||||
And I should see "Testing course badge"
|
||||
And I click on "Back" "button"
|
||||
And "Manage badges" "button" should exist
|
||||
# Badge is already enabled so is listed.
|
||||
And I should see "Testing course badge"
|
||||
|
||||
Scenario: Check navigation at course level with no badges as a student
|
||||
# Create a badge, but leave it not enabled for now.
|
||||
@@ -90,16 +74,14 @@ Feature: Manage badges is not shown when there are no existing badges.
|
||||
# Enable the badge.
|
||||
And I am on the "C1" "Course" page logged in as "admin"
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I click on "Manage badges" "button"
|
||||
And I press "Enable access" action in the "Testing course badge" report row
|
||||
And I click on "Enable" "button" in the "Confirm" "dialogue"
|
||||
And I log out
|
||||
# Now student should see the Badges link.
|
||||
And I am on the "C1" "Course" page logged in as "student1"
|
||||
And I follow "Badges"
|
||||
And "Manage badges" "button" should not exist
|
||||
And "Add a new badge" "button" should not exist
|
||||
And I should not see "There are no matching badges available for users to earn"
|
||||
And the following should exist in the "Course badges" table:
|
||||
| Name | Description | Criteria |
|
||||
| Testing course badge | Testing course badge description | Awarded by: Teacher |
|
||||
And I should not see "There are no matching badges available for users to earn."
|
||||
And the following should exist in the "reportbuilder-table" table:
|
||||
| Name | Criteria |
|
||||
| Testing course badge | Awarded by: Teacher |
|
||||
|
||||
@@ -69,9 +69,7 @@ class manage_badge_action_bar_test extends \advanced_testcase {
|
||||
]
|
||||
],
|
||||
"Test tertiary nav as a student" => [
|
||||
"student", [
|
||||
'Overview'
|
||||
]
|
||||
"student", [],
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
+3
-83
@@ -22,94 +22,14 @@
|
||||
* @copyright 2012 onwards Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @author Yuliya Bozhko <[email protected]>
|
||||
* @deprecated since 4.5. Use badges/index.php instead.
|
||||
* @todo MDL-82383 This file will be deleted in Moodle 6.0.
|
||||
*/
|
||||
|
||||
use core_badges\reportbuilder\local\systemreports\course_badges;
|
||||
use core_reportbuilder\system_report_factory;
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once($CFG->libdir . '/badgeslib.php');
|
||||
|
||||
$type = required_param('type', PARAM_INT);
|
||||
$courseid = optional_param('id', 0, PARAM_INT);
|
||||
|
||||
require_login();
|
||||
|
||||
if (empty($CFG->enablebadges)) {
|
||||
throw new \moodle_exception('badgesdisabled', 'badges');
|
||||
}
|
||||
|
||||
if (empty($CFG->badges_allowcoursebadges) && $courseid != 0) {
|
||||
throw new \moodle_exception('coursebadgesdisabled', 'badges');
|
||||
}
|
||||
|
||||
if ($course = $DB->get_record('course', array('id' => $courseid))) {
|
||||
$PAGE->set_url('/badges/view.php', ['type' => $type, 'id' => $course->id]);
|
||||
} else {
|
||||
$PAGE->set_url('/badges/view.php', ['type' => $type]);
|
||||
}
|
||||
|
||||
$PAGE->add_body_class('limitedwidth');
|
||||
|
||||
if ($type == BADGE_TYPE_SITE) {
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_pagelayout('admin');
|
||||
$PAGE->set_heading(get_string('administrationsite'));
|
||||
$title = get_string('sitebadges', 'badges');
|
||||
$eventotherparams = array('badgetype' => BADGE_TYPE_SITE);
|
||||
} else {
|
||||
require_login($course);
|
||||
$coursename = format_string($course->fullname, true, array('context' => context_course::instance($course->id)));
|
||||
$title = get_string('coursebadges', 'badges');
|
||||
$PAGE->set_context(context_course::instance($course->id));
|
||||
$PAGE->set_pagelayout('incourse');
|
||||
$PAGE->set_heading($coursename);
|
||||
$eventotherparams = array('badgetype' => BADGE_TYPE_COURSE, 'courseid' => $course->id);
|
||||
}
|
||||
|
||||
require_capability('moodle/badges:viewbadges', $PAGE->context);
|
||||
|
||||
$PAGE->set_title($title);
|
||||
|
||||
/** @var core_badges_renderer $output */
|
||||
$output = $PAGE->get_renderer('core', 'badges');
|
||||
|
||||
// Display "Manage badges" button to users with proper capabilities.
|
||||
$isfrontpage = (empty($courseid) || $courseid == $SITE->id);
|
||||
if ($isfrontpage) {
|
||||
$context = context_system::instance();
|
||||
} else {
|
||||
$context = context_course::instance($courseid);
|
||||
}
|
||||
$canmanage = has_any_capability(array('moodle/badges:viewawarded',
|
||||
'moodle/badges:createbadge',
|
||||
'moodle/badges:awardbadge',
|
||||
'moodle/badges:configurecriteria',
|
||||
'moodle/badges:configuremessages',
|
||||
'moodle/badges:configuredetails',
|
||||
'moodle/badges:deletebadge'), $context);
|
||||
|
||||
if ($canmanage) {
|
||||
// Check there are non archived badges on the course.
|
||||
$allbadgescount = count(badges_get_badges($type, $courseid));
|
||||
$canmanage = ($allbadgescount > 0);
|
||||
}
|
||||
$actionbar = new \core_badges\output\standard_action_bar($PAGE, $type, $canmanage);
|
||||
echo $output->header();
|
||||
echo $output->render_tertiary_navigation($actionbar);
|
||||
echo $OUTPUT->heading($title);
|
||||
|
||||
if ($course && $course->startdate > time()) {
|
||||
echo $OUTPUT->box(get_string('error:notifycoursedate', 'badges'), 'generalbox notifyproblem');
|
||||
}
|
||||
|
||||
$report = system_report_factory::create(course_badges::class, $PAGE->context, '', '', 0,
|
||||
['type' => $type, 'courseid' => $courseid]);
|
||||
echo $report->output();
|
||||
|
||||
// Trigger event, badge listing viewed.
|
||||
$eventparams = array('context' => $PAGE->context, 'other' => $eventotherparams);
|
||||
$event = \core\event\badge_listing_viewed::create($eventparams);
|
||||
$event->trigger();
|
||||
|
||||
echo $output->footer();
|
||||
redirect(new moodle_url('/badges/index.php', ['type' => $type, 'id' => $courseid]));
|
||||
|
||||
@@ -23,7 +23,7 @@ Feature: Enable Block Badges in a course
|
||||
| Badge 1 | editingteacher |
|
||||
| Badge 2 | editingteacher |
|
||||
And I am on the "Course 1" "course" page logged in as "teacher1"
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Badge 1"
|
||||
And I select "Recipients (0)" from the "jump" singleselect
|
||||
And I press "Award badge"
|
||||
@@ -31,7 +31,7 @@ Feature: Enable Block Badges in a course
|
||||
And I press "Award badge"
|
||||
# Issue Badge 2 of 2
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Badge 2"
|
||||
And I select "Recipients (0)" from the "jump" singleselect
|
||||
And I press "Award badge"
|
||||
|
||||
@@ -28,7 +28,7 @@ Feature: Enable Block Badges on the dashboard and view awarded badges
|
||||
| badge | Badge 1 |
|
||||
| role | editingteacher |
|
||||
And I am on the "Course 1" "course" page logged in as "teacher1"
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Badge 1"
|
||||
And I select "Recipients (0)" from the "jump" singleselect
|
||||
And I press "Award badge"
|
||||
|
||||
@@ -28,7 +28,7 @@ Feature: Enable Block Badges on the frontpage and view awarded badges
|
||||
| badge | Badge 1 |
|
||||
| role | editingteacher |
|
||||
And I am on the "Course 1" "course" page logged in as "teacher1"
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
And I navigate to "Badges" in current page administration
|
||||
And I follow "Badge 1"
|
||||
And I select "Recipients (0)" from the "jump" singleselect
|
||||
And I press "Award badge"
|
||||
|
||||
+1
-1
@@ -323,7 +323,7 @@ $string['error:nosuchfield'] = 'Warning: This user profile field is no longer av
|
||||
$string['error:nosuchmod'] = 'Warning: This activity is no longer available.';
|
||||
$string['error:nosuchrole'] = 'Warning: This role is no longer available.';
|
||||
$string['error:nosuchuser'] = 'User with this email address does not have an account with the current backpack provider.';
|
||||
$string['error:notifycoursedate'] = 'Warning: Badges associated with course and activity completions will not be issued until the course start date.';
|
||||
$string['error:notifycoursedate'] = 'Badges associated with course and activity completions will not be issued until the course start date ({$a}).';
|
||||
$string['error:parameter'] = 'Warning: At least one parameter should be selected to ensure correct badge issuing workflow.';
|
||||
$string['error:requesttimeout'] = 'The connection request timed out before it could complete.';
|
||||
$string['error:requesterror'] = 'The connection request failed (error code {$a}).';
|
||||
|
||||
@@ -84,7 +84,7 @@ class badge_listing_viewed extends base {
|
||||
} else {
|
||||
$params = array('id' => $this->other['courseid'], 'type' => $this->other['badgetype']);
|
||||
}
|
||||
return new \moodle_url('/badges/view.php', $params );
|
||||
return new \moodle_url('/badges/index.php', $params );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2975,7 +2975,7 @@ class global_navigation extends navigation_node {
|
||||
|
||||
// Badges.
|
||||
if ($navoptions->badges) {
|
||||
$url = new moodle_url('/badges/view.php', array('type' => 2, 'id' => $course->id));
|
||||
$url = new moodle_url('/badges/index.php', ['type' => 2, 'id' => $course->id]);
|
||||
|
||||
$coursenode->add(get_string('coursebadges', 'badges'), $url,
|
||||
navigation_node::TYPE_SETTING, null, 'badgesview',
|
||||
@@ -3059,7 +3059,7 @@ class global_navigation extends navigation_node {
|
||||
|
||||
// Badges.
|
||||
if ($navoptions->badges) {
|
||||
$url = new moodle_url($CFG->wwwroot . '/badges/view.php', array('type' => 1));
|
||||
$url = new moodle_url($CFG->wwwroot . '/badges/index.php', ['type' => 1]);
|
||||
$coursenode->add(get_string('sitebadges', 'badges'), $url, navigation_node::TYPE_CUSTOM);
|
||||
}
|
||||
|
||||
|
||||
@@ -1854,6 +1854,28 @@ ul.badges {
|
||||
color: map-get($theme-colors, 'warning');
|
||||
}
|
||||
|
||||
#page-badges-index #page {
|
||||
.badges-heading {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 0; /* Removes default margins */
|
||||
}
|
||||
|
||||
#action_bar {
|
||||
margin: 0; /* Removes any default margin that might affect alignment */
|
||||
}
|
||||
|
||||
.tertiary-navigation.container-fluid {
|
||||
width: auto;
|
||||
height: 50px;
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
#page-badges-award .recipienttable tr td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
@@ -24902,6 +24902,23 @@ ul.badges {
|
||||
color: #f0ad4e;
|
||||
}
|
||||
|
||||
#page-badges-index #page .badges-heading {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
#page-badges-index #page h2 {
|
||||
margin: 0; /* Removes default margins */
|
||||
}
|
||||
#page-badges-index #page #action_bar {
|
||||
margin: 0; /* Removes any default margin that might affect alignment */
|
||||
}
|
||||
#page-badges-index #page .tertiary-navigation.container-fluid, #page-badges-index #page .tertiary-navigation.container-sm, #page-badges-index #page .tertiary-navigation.container-md, #page-badges-index #page .tertiary-navigation.container-lg, #page-badges-index #page .tertiary-navigation.container-xl {
|
||||
width: auto;
|
||||
height: 50px;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
#page-badges-award .recipienttable tr td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
@@ -24902,6 +24902,23 @@ ul.badges {
|
||||
color: #f0ad4e;
|
||||
}
|
||||
|
||||
#page-badges-index #page .badges-heading {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
#page-badges-index #page h2 {
|
||||
margin: 0; /* Removes default margins */
|
||||
}
|
||||
#page-badges-index #page #action_bar {
|
||||
margin: 0; /* Removes any default margin that might affect alignment */
|
||||
}
|
||||
#page-badges-index #page .tertiary-navigation.container-fluid, #page-badges-index #page .tertiary-navigation.container-sm, #page-badges-index #page .tertiary-navigation.container-md, #page-badges-index #page .tertiary-navigation.container-lg, #page-badges-index #page .tertiary-navigation.container-xl {
|
||||
width: auto;
|
||||
height: 50px;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
#page-badges-award .recipienttable tr td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user