Skip to content

Commit

Permalink
Merge pull request #16 from uofr/duplication
Browse files Browse the repository at this point in the history
Duplication status button.
  • Loading branch information
JohnOLane authored Aug 25, 2023
2 parents 2b3e183 + 01d4e8d commit 2337a71
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions layout/drawers.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
$PAGE->requires->css('/theme/urcourses_default/style/darkmode.css?v=2023061301');
}


$header = $PAGE->activityheader;
$headercontent = $header->export_for_template($renderer);

Expand All @@ -169,6 +168,16 @@
$course_visibility_toggle = $course_visibility_toggle_renderable->export_for_template($renderer);
}

$pendingbanner = '';
$haspendingduplications = \local_duplicate_course\duplicator::has_pending_duplications($COURSE->id);
$pageurl = $PAGE->url;
$course_viewurl = new moodle_url('/course/view.php', array('id' => $courseid));
$is_on_course_view = $pageurl->compare($course_viewurl, URL_MATCH_BASE);
if ($haspendingduplications && $is_on_course_view) {
$progressurl = new \moodle_url('/local/duplicate_course/duplicate_status.php', array('id' => $COURSE->id));
$pendingbanner = $OUTPUT->render_from_template('local_duplicate_course/pending_banner', array('link' => $progressurl));
}

$templatecontext = [
'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]),
'output' => $OUTPUT,
Expand All @@ -189,7 +198,8 @@
'overflow' => $overflow,
'headercontent' => $headercontent,
'addblockbutton' => $addblockbutton,
'visibilitytoggle' => $course_visibility_toggle
'visibilitytoggle' => $course_visibility_toggle,
'pendingbanner' => $pendingbanner
];

// Get and use the course related hints HTML code, if any hints are configured.
Expand Down
1 change: 1 addition & 0 deletions templates/drawers.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
{{#visibilitytoggle}}
{{> theme_urcourses_default/course_visibility_toggle}}
{{/visibilitytoggle}}
{{{pendingbanner}}}
<div id="page-content" class="pb-3 d-print-block">
<div id="region-main-box">
{{#hasregionmainsettingsmenu}}
Expand Down

0 comments on commit 2337a71

Please sign in to comment.