diff --git a/classes/output/core/course_renderer.php b/classes/output/core/course_renderer.php
index 158fa4fb406..08f339c1b5d 100644
--- a/classes/output/core/course_renderer.php
+++ b/classes/output/core/course_renderer.php
@@ -130,13 +130,13 @@ protected function coursecat_courses(coursecat_helper $chelper, $courses, $total
}
$coursecount = 1;
- $content .= html_writer::start_tag('div', array('class' => 'row'));
+ $content .= html_writer::start_tag('div', array('class' => 'card-deck'));
foreach ($courses as $course) {
- $content .= $this->coursecat_coursebox($chelper, $course, 'col-md-3');
+ $content .= $this->coursecat_coursebox($chelper, $course);
if ($coursecount % 4 == 0) {
$content .= html_writer::end_tag('div');
- $content .= html_writer::start_tag('div', array('class' => 'row'));
+ $content .= html_writer::start_tag('div', array('class' => 'card-deck'));
}
$coursecount ++;
@@ -187,9 +187,8 @@ protected function coursecat_coursebox(coursecat_helper $chelper, $course, $addi
require_once($CFG->libdir. '/coursecatlib.php');
$course = new course_in_list($course);
}
- $content = html_writer::start_tag('div', array('class' => $additionalclasses));
- $classes = trim('card clearfix');
+ $classes = trim('card');
if ($chelper->get_show_courses() >= self::COURSECAT_SHOW_COURSES_EXPANDED) {
$nametag = 'h3';
} else {
@@ -198,7 +197,7 @@ protected function coursecat_coursebox(coursecat_helper $chelper, $course, $addi
}
// End coursebox.
- $content .= html_writer::start_tag('div', array(
+ $content = html_writer::start_tag('div', array(
'class' => $classes,
'data-courseid' => $course->id,
'data-type' => self::COURSECAT_TYPE_COURSE,
@@ -208,8 +207,6 @@ protected function coursecat_coursebox(coursecat_helper $chelper, $course, $addi
$content .= html_writer::end_tag('div'); // End coursebox.
- $content .= html_writer::end_tag('div'); // End col-md-4.
-
return $content;
}
@@ -223,13 +220,7 @@ protected function coursecat_coursebox(coursecat_helper $chelper, $course, $addi
* @return string
*/
protected function coursecat_coursebox_content(coursecat_helper $chelper, $course) {
- global $CFG;
-
- $theme = \theme_config::load('moove');
-
- if (!empty($theme->settings->courselistview)) {
- return parent::coursecat_coursebox_content($chelper, $course);
- }
+ global $CFG, $DB;
if ($course instanceof stdClass) {
require_once($CFG->libdir. '/coursecatlib.php');
@@ -238,25 +229,43 @@ protected function coursecat_coursebox_content(coursecat_helper $chelper, $cours
// Course name.
$coursename = $chelper->get_course_formatted_name($course);
- $coursenamelink = html_writer::link(new moodle_url('/course/view.php', array('id' => $course->id)),
- $coursename, array('class' => $course->visible ? '' : 'dimmed'));
+ $courselink = new moodle_url('/course/view.php', array('id' => $course->id));
+ $coursenamelink = html_writer::link($courselink, $coursename, array('class' => $course->visible ? '' : 'dimmed'));
- $content = $this->get_course_summary_image($course);
+ $content = $this->get_course_summary_image($course, $courselink);
+
+ // Course instructors.
+ if ($course->has_course_contacts()) {
+ $content .= html_writer::start_tag('div', array('class' => 'course-contacts'));
+
+ $instructors = $course->get_course_contacts();
+ foreach ($instructors as $key => $instructor) {
+ $name = $instructor['username'];
+ $url = $CFG->wwwroot.'/user/profile.php?id='.$key;
+ $picture = $this->get_user_picture($DB->get_record('user', array('id' => $key)));
+
+ $content .= "";
+ $content .= "";
+ $content .= "";
+ }
+
+ $content .= html_writer::end_tag('div'); // Ends course-contacts.
+ }
- $content .= html_writer::start_tag('div', array('class' => 'card-block'));
+ $content .= html_writer::start_tag('div', array('class' => 'card-body'));
$content .= "
". $coursenamelink ."
";
// Display course summary.
if ($course->has_summary()) {
$content .= html_writer::start_tag('p', array('class' => 'card-text'));
$content .= $chelper->get_course_formatted_summary($course,
- array('overflowdiv' => true, 'noclean' => true, 'para' => false));
+ array('overflowdiv' => true, 'noclean' => true, 'para' => false));
$content .= html_writer::end_tag('p'); // End summary.
}
$content .= html_writer::end_tag('div');
- $content .= html_writer::start_tag('div', array('class' => 'card-block'));
+ $content .= html_writer::start_tag('div', array('class' => 'card-footer'));
// Print enrolmenticons.
if ($icons = enrol_get_course_info_icons($course)) {
@@ -267,34 +276,19 @@ protected function coursecat_coursebox_content(coursecat_helper $chelper, $cours
$content .= html_writer::start_tag('div', array('class' => 'pull-right'));
$content .= html_writer::link(new moodle_url('/course/view.php', array('id' => $course->id)),
- get_string('access', 'theme_moove'), array('class' => 'card-link btn btn-primary'));
+ get_string('access', 'theme_moove'), array('class' => 'card-link btn btn-primary'));
$content .= html_writer::end_tag('div'); // End pull-right.
$content .= html_writer::end_tag('div'); // End card-block.
- // Display course contacts. See course_in_list::get_course_contacts().
- if ($course->has_course_contacts()) {
- $content .= html_writer::start_tag('div', array('class' => 'card-footer teachers'));
- $content .= html_writer::start_tag('ul');
- foreach ($course->get_course_contacts() as $userid => $coursecontact) {
- $name = $coursecontact['rolename'].': '.
- html_writer::link(new moodle_url('/user/view.php',
- array('id' => $userid, 'course' => SITEID)),
- $coursecontact['username']);
- $content .= html_writer::tag('li', $name);
- }
- $content .= html_writer::end_tag('ul'); // End teachers.
- $content .= html_writer::end_tag('div'); // End teachers.
- }
-
// Display course category if necessary (for example in search results).
if ($chelper->get_show_courses() == self::COURSECAT_SHOW_COURSES_EXPANDED_WITH_CAT) {
require_once($CFG->libdir. '/coursecatlib.php');
if ($cat = coursecat::get($course->category, IGNORE_MISSING)) {
$content .= html_writer::start_tag('div', array('class' => 'coursecat'));
$content .= get_string('category').': '.
- html_writer::link(new moodle_url('/course/index.php', array('categoryid' => $cat->id)),
- $cat->get_formatted_name(), array('class' => $cat->visible ? '' : 'dimmed'));
+ html_writer::link(new moodle_url('/course/index.php', array('categoryid' => $cat->id)),
+ $cat->get_formatted_name(), array('class' => $cat->visible ? '' : 'dimmed'));
$content .= html_writer::end_tag('div'); // End coursecat.
}
}
@@ -308,29 +302,55 @@ protected function coursecat_coursebox_content(coursecat_helper $chelper, $cours
* @param stdClass $course the course object
* @return string
*/
- protected function get_course_summary_image($course) {
+ protected function get_course_summary_image($course, $courselink) {
global $CFG;
$contentimage = '';
foreach ($course->get_course_overviewfiles() as $file) {
$isimage = $file->is_valid_image();
$url = file_encode_url("$CFG->wwwroot/pluginfile.php",
- '/'. $file->get_contextid(). '/'. $file->get_component(). '/'.
- $file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage);
+ '/'. $file->get_contextid(). '/'. $file->get_component(). '/'.
+ $file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage);
if ($isimage) {
- $contentimage = html_writer::empty_tag('img', array('src' => $url, 'alt' => 'Course Image '. $course->fullname,
- 'class' => 'card-img-top w-100'));
- break;
+ $contentimage = html_writer::link($courselink, html_writer::empty_tag('img', array(
+ 'src' => $url,
+ 'alt' => $course->fullname,
+ 'class' => 'card-img-top w-100')));
+ break;
}
}
if (empty($contentimage)) {
$url = $CFG->wwwroot . "/theme/moove/pix/default_course.jpg";
- $contentimage = html_writer::empty_tag('img', array('src' => $url, 'alt' => 'Course Image '. $course->fullname,
- 'class' => 'card-img-top w-100'));
+ $contentimage = html_writer::link($courselink, html_writer::empty_tag('img', array(
+ 'src' => $url,
+ 'alt' => $course->fullname,
+ 'class' => 'card-img-top w-100')));
}
return $contentimage;
}
+
+ /**
+ * Get the user profile pic
+ *
+ * @param null $userobject
+ * @param int $imgsize
+ * @return moodle_url
+ * @throws \coding_exception
+ */
+ protected function get_user_picture($userobject = null, $imgsize = 100) {
+ global $USER, $PAGE;
+
+ if (!$userobject) {
+ $userobject = $USER;
+ }
+
+ $userimg = new \user_picture($userobject);
+
+ $userimg->size = $imgsize;
+
+ return $userimg->get_url($PAGE);
+ }
}
diff --git a/lib.php b/lib.php
index 3b93b3c2b72..e20fb6ce0a2 100644
--- a/lib.php
+++ b/lib.php
@@ -312,7 +312,8 @@ function theme_moove_rebuildcoursesections(\flat_navigation $flatnav) {
'icon' => $item->icon,
'type' => $item->type,
'key' => $item->key,
- 'parent' => $coursesections
+ 'parent' => $coursesections,
+ 'action' => $item->action
]));
}
}
diff --git a/scss/moove/_frontpage.scss b/scss/moove/_frontpage.scss
index 7fb223c6bfe..587e4f07630 100644
--- a/scss/moove/_frontpage.scss
+++ b/scss/moove/_frontpage.scss
@@ -1,17 +1,35 @@
-#frontpage-course-list {
+#frontpage-course-list,
+#frontpage-category-combo {
h2 {
text-align: center;
- color: $brand-primary;
- margin-bottom: 2rem;
}
- .courses .card .teachers ul {
- list-style: none;
- margin-bottom: 0;
- padding-left: 0;
+ .card-deck .card .card-footer .icon {
+ height: 36px;
+ }
+
+ .course-contacts {
+ margin: -30px 6px -20px 6px;
+ text-align: right;
+
+ .contact {
+ margin: 0 3px;
+
+ img {
+ width: 48px;
+ border: 2px solid white;
+ cursor: pointer;
+ border-radius: 50%;
+ }
+ }
}
}
+#frontpage-category-combo .courses .card-deck .card,
+#frontpage-course-list .frontpage-course-list-all .card-deck .card {
+ margin-bottom: 2rem;
+}
+
#page-site-index #mooveslideshow {
margin: 1rem 0;
diff --git a/scss/moove/_navbar.scss b/scss/moove/_navbar.scss
index 8b3a65b9932..f57827d19f7 100644
--- a/scss/moove/_navbar.scss
+++ b/scss/moove/_navbar.scss
@@ -323,4 +323,18 @@ nav.navbar {
}
}
}
+}
+
+.userloggedinas {
+ nav.navbar ul.navbar-nav .usermenu {
+ line-height: 35px;
+
+ .usertext .meta.viewingas {
+ line-height: initial;
+ }
+
+ .userbutton .avatars .realuser {
+ padding-top: 10px;
+ }
+ }
}
\ No newline at end of file
diff --git a/scss/moove/_responsive.scss b/scss/moove/_responsive.scss
index 1214393022d..0f73d37ed6b 100644
--- a/scss/moove/_responsive.scss
+++ b/scss/moove/_responsive.scss
@@ -177,7 +177,6 @@
}
}
}
-
@media (min-width: 768px) {
body {
margin-left: 55px;
@@ -203,6 +202,14 @@
border-bottom-left-radius: $m-login-padding;
}
}
+
+ .card-deck .card {
+ flex-basis: calc(25% - 30px);
+ }
+
+ .pagelayout-mydashboard .card-deck .card {
+ flex-basis: calc(50% - 30px);
+ }
}
@media (max-width: 991px) {
diff --git a/version.php b/version.php
index bab68b7bc31..ee4967b93ca 100644
--- a/version.php
+++ b/version.php
@@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();
// This is the version of the plugin.
-$plugin->version = 2018070200;
+$plugin->version = 2018090200;
// This is the version of Moodle this plugin requires.
$plugin->requires = 2018050800;
@@ -36,7 +36,7 @@
$plugin->component = 'theme_moove';
// This is the named version.
-$plugin->release = '2.3.6';
+$plugin->release = '2.3.8';
// This is a stable release.
$plugin->maturity = MATURITY_STABLE;