diff --git a/README.md b/README.md index 0568009..8d7027f 100644 --- a/README.md +++ b/README.md @@ -136,8 +136,7 @@ The file remuiformat/styles.css contains the CSS styles for the format. # Roadmap -1. Will give option to set image as background to the card in card layout. -2. Will give option to adjust image brightness of the card in card layout. +1. Global Course Announcement Feature. [(Back to top)](#table-of-contents) diff --git a/amd/build/format_card.js b/amd/build/format_card.js index 2d71378..b5f8c91 100644 --- a/amd/build/format_card.js +++ b/amd/build/format_card.js @@ -1 +1 @@ -define(["jquery","core/ajax","format_remuiformat/jquery.dragsort"],function(t,e){return{init:function(){function o(t){var e=t.changedTouches[0],o=document.createEvent("MouseEvent");o.initMouseEvent({touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"}[t.type],!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(o),t.preventDefault()}t(document).ready(function(){t("a.wdm-drag-drop").each(function(t,e){var i=e;i.addEventListener("touchstart",o,!0),i.addEventListener("touchmove",o,!0),i.addEventListener("touchend",o,!0),i.addEventListener("touchcancel",o,!0)})});var i=function(t){if(t.length>0){var e,o=[];t.css("min-height","initial"),t.each(function(t,i){e=(e=i.offsetHeight)>200?e:200,o.push(e)}),e=Math.max.apply(null,o)+55,t.css("min-height",e)}};function n(t){var e,o,i=decodeURIComponent(window.location.search.substring(1)).split("&");for(o=0;o"}),M.course=M.course||{},M.course.format=M.course.format||{},M.course.format.get_config=function(){return{container_node:"div",container_class:"cards",section_node:"div",section_class:"section"}},M.course.format.swap_sections=function(t,e,o){var i="course-content",n="section_add_menus",a=t.Node.all("."+i+" "+M.course.format.get_section_selector(t));a.item(e).one("."+n).swap(a.item(o).one("."+n))},M.course.format.process_sections=function(t,e,o,i,n){var a="sectionname",s=".left .section-handle .icon";if("move"==o.action){if(i>n){var c=n;n=i,i=c}for(var r,d,l,m,u=i;u<=n;u++){var f=t.Node.create(""+o.sectiontitles[u]+"");e.item(u).all("."+a).setHTML(f),l=(d=(r=e.item(u).one(s)).getAttribute("alt")).lastIndexOf(" "),m=d.substr(0,l+1)+u,r.setAttribute("alt",m),r.setAttribute("title",m)}}},t(".wdm-section-wrapper .single-card-container .wdm-activity-actions .wdm-show-in-row").on("click",function(){var o=n("id"),i=t(this).data("wdmsectionid"),a=t(this).data("wdmactivityid"),s=t(this);e.call([{methodname:"format_remuiformat_show_activity_in_row",args:{courseid:o,sectionid:i,activityid:a}}])[0].done(function(e){"row"==e.type?(t(s).closest(".single-card-container").removeClass("col-lg-4 col-md-6 col-sm-12").addClass("col-12"),t(s).closest(".single-card-container .single-card").removeClass("wdm-col").addClass("wdm-min-row"),t(s).find(".wdmactivitytype").toggle()):(t(s).closest(".single-card-container").removeClass("col-12").addClass("col-lg-4 col-md-6 col-sm-12"),t(s).closest(".single-card-container .single-card").removeClass("wdm-min-row wdm-row").addClass("wdm-col"),t(s).find(".wdmactivitytype").toggle())})}),t(".wdm-section-wrapper .single-card-container .wdm-activity-actions .ecfsectionname").on("click",function(){var o=n("id"),i=t(this).data("oldsectionid"),a=t(this).data("sectionidtomove"),s=t(this).closest(".single-card-container").attr("data-id"),c=t(this);e.call([{methodname:"format_remuiformat_move_activity_to_section",args:{courseid:o,newsectionid:a,oldsectionid:i,activityidtomove:s}}])[0].done(function(e){1==e.success?t(c).closest(".single-card-container").fadeOut("slow"):t('
'+e.message+"
").insertAfter(t(c).closest(".single-card-container .wdm-activity-actions"))})})}}}); \ No newline at end of file +define(["jquery","core/ajax","format_remuiformat/jquery.dragsort"],function(t,e){return{init:function(){function o(t){var e=t.changedTouches[0],o=document.createEvent("MouseEvent");o.initMouseEvent({touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"}[t.type],!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(o),t.preventDefault()}t(document).ready(function(){t("a.wdm-drag-drop").each(function(t,e){var i=e;i.addEventListener("touchstart",o,!0),i.addEventListener("touchmove",o,!0),i.addEventListener("touchend",o,!0),i.addEventListener("touchcancel",o,!0)})});var i=function(t){if(t.length>0){var e,o=[];t.css("min-height","initial"),t.each(function(t,i){e=(e=i.offsetHeight)>200?e:200,o.push(e)}),e=Math.max.apply(null,o)+55,t.css("min-height",e)}};function n(t){var e,o,i=decodeURIComponent(window.location.search.substring(1)).split("&");for(o=0;o"}),M.course=M.course||{},M.course.format=M.course.format||{},M.course.format.get_config=function(){return{container_node:"div",container_class:"cards",section_node:"div",section_class:"section"}},M.course.format.swap_sections=function(t,e,o){var i="course-content",n="section_add_menus",a=t.Node.all("."+i+" "+M.course.format.get_section_selector(t));a.item(e).one("."+n).swap(a.item(o).one("."+n))},M.course.format.process_sections=function(t,e,o,i,n){var a="sectionname",s=".left .section-handle .icon";if("move"==o.action){if(i>n){var c=n;n=i,i=c}for(var r,d,l,m,u=i;u<=n;u++){var f=t.Node.create(""+o.sectiontitles[u]+"");e.item(u).all("."+a).setHTML(f),l=(d=(r=e.item(u).one(s)).getAttribute("alt")).lastIndexOf(" "),m=d.substr(0,l+1)+u,r.setAttribute("alt",m),r.setAttribute("title",m)}}},t(".wdm-section-wrapper .single-card-container .wdm-activity-actions .wdm-show-in-row").on("click",function(){var o=n("id"),i=t(this).data("wdmsectionid"),a=t(this).data("wdmactivityid"),s=t(this);e.call([{methodname:"format_remuiformat_show_activity_in_row",args:{courseid:o,sectionid:i,activityid:a}}])[0].done(function(e){"row"==e.type?(t(s).closest(".single-card-container").removeClass("col-lg-4 col-md-6 col-sm-12").addClass("col-12"),t(s).closest(".single-card-container .single-card").removeClass("wdm-col").addClass("wdm-min-row"),t(s).find(".wdmactivitytype").toggle()):(t(s).closest(".single-card-container").removeClass("col-12").addClass("col-lg-4 col-md-6 col-sm-12"),t(s).closest(".single-card-container .single-card").removeClass("wdm-min-row wdm-row").addClass("wdm-col"),t(s).find(".wdmactivitytype").toggle())})}),t(".wdm-section-wrapper .single-card-container .wdm-activity-actions .ecfsectionname").on("click",function(){var o=n("id"),i=t(this).data("oldsectionid"),a=t(this).data("sectionidtomove"),s=t(this).closest(".single-card-container").attr("data-id"),c=t(this);e.call([{methodname:"format_remuiformat_move_activity_to_section",args:{courseid:o,newsectionid:a,oldsectionid:i,activityidtomove:s}}])[0].done(function(e){1==e.success?t(c).closest(".single-card-container").fadeOut("slow"):t('
'+e.message+"
").insertAfter(t(c).closest(".single-card-container .wdm-activity-actions"))})}),t(".read-more-target .no-overflow").height()>52&&t(".read-more-trigger").show()}}}); diff --git a/amd/src/format_card.js b/amd/src/format_card.js index 6734296..2eab883 100644 --- a/amd/src/format_card.js +++ b/amd/src/format_card.js @@ -270,6 +270,12 @@ define(['jquery', 'core/ajax', 'format_remuiformat/jquery.dragsort'], function($ } }); }); + + // + Show full summary label show conditionally. + var summaryheight = $('.read-more-target .no-overflow').height(); + if (summaryheight > 52) { + $('.read-more-trigger').show(); + } } // Must return the init function. diff --git a/changes.txt b/changes.txt index 4669b55..73a1a36 100644 --- a/changes.txt +++ b/changes.txt @@ -1,13 +1,24 @@ +Version 1.0.4 +Fixes +* Fixed issue when course layout resets on course restore. +* Fixed multi-language support for section/topic summary in card format. +* Fixed language support issue in activity count showed in the general section in card format. +* General section image changes when changed in the other duplicated course in List format. + +Tweaks +* Added fixed SVG pattern to topic card if image is not added in topic summary. +* Hide label 'Activities' if no activity exists in general section of card format. + Version 1.0.3 Fixes * Fixed Drag&Drop Upload Problem in List format. Features -* Add background image to section in Card format. -* Move activity to specific section in Card format. -* Course progress and total number of different activity count details in the course added in Card format general section. -* Showed limited activity depending on screen size in general section in Card foramt. -* Resume to last viewed activity functionality in Card format general section. +* Add a background image to the section in Card format. +* Move activity to the specific section in Card format. +* Course progress and the total number of different activity count details in the course added in Card format general section. +* Showed limited activity depending on screen size in the general section in Card format. +* Resume to the last viewed activity functionality in the Card format general section. * Add new section after specific section in list format. Version 1.0.2 diff --git a/classes/course_format_data_common_trait.php b/classes/course_format_data_common_trait.php index 6b0c1ea..1ca7e56 100644 --- a/classes/course_format_data_common_trait.php +++ b/classes/course_format_data_common_trait.php @@ -224,37 +224,46 @@ public function get_all_section_data($renderer, $editing, $rformat, $settings, $ $extradetails = $this->get_section_module_info($currentsection, $course, null, $singlepageurl); if ($rformat == REMUI_CARD_FORMAT) { - if (!empty($currentsection->summary)) { - // Get the section summary. - $sectiondetails->summary = $renderer->abstract_html_contents( - $currentsection->summary, $sectiontitlesummarymaxlength - ); - // Check if background image to section card setting is enable and image exists in summary, - // if yes then add background image to context. - if ($remuienablecardbackgroundimg == 1 && $this->get_section_first_image( - $currentsection, $currentsection->summary - )) { + // Get the section summary. + $sectiondetails->summary = $renderer->abstract_html_contents( + $renderer->format_summary_text($currentsection), $sectiontitlesummarymaxlength + ); + + // Check if background image to section card setting is enable and image exists in summary, + // if yes then add background image to context. + if ($remuienablecardbackgroundimg == 1 + && $this->get_section_first_image( $currentsection, $currentsection->summary )) + { + if ( $remuidefaultsectiontheme == 1 ) { + // Dark theme. + $remuidefaultsectionoverlay = 'rgba(0,0,0,0.45)'; + $remuinewfontcolor = '#eaeaea'; + $remuinewthemecolor = 'dark'; + } else { + // Light theme. $remuidefaultsectionoverlay = 'rgba(255,255,255,0.8)'; - if ( $remuidefaultsectiontheme == 1 ) { - // Dark theme. - $remuidefaultsectionoverlay = 'rgba(0,0,0,0.45)'; - $remuinewfontcolor = '#eaeaea'; - $remuinewthemecolor = 'dark'; - } else { - // Light theme. - $remuidefaultsectionoverlay = 'rgba(255,255,255,0.8)'; - $remuinewfontcolor = '#101010'; - $remuinewthemecolor = 'light'; - } - // Get first image from section to set card card background image. - $sectiondetails->sectionfirstimage = $this->get_section_first_image( - $currentsection, $currentsection->summary - ); - $sectiondetails->remuidefaultsectionoverlay = $remuidefaultsectionoverlay; - $sectiondetails->remuinewfontcolor = $remuinewfontcolor; - $sectiondetails->remuinewthemecolor = $remuinewthemecolor; + $remuinewfontcolor = '#101010'; + $remuinewthemecolor = 'light'; } + + // Get first image from section to set card card background image. + $imgarray = $this->get_section_first_image( $currentsection, $currentsection->summary ); + $sectiondetails->sectionfirstimage = $imgarray['img']; + + // Change the overlay opacity if pattern image. + if ( $remuidefaultsectiontheme == 0 && $imgarray['pattern'] == 1) { + // Light theme. + $remuidefaultsectionoverlay = 'rgba(255,255,255,0.0)'; + } elseif ( $remuidefaultsectiontheme == 1 && $imgarray['pattern'] == 1 ) { + // Dark theme. + $remuidefaultsectionoverlay = 'rgba(0, 0, 0, 0.55)'; + } + + $sectiondetails->remuidefaultsectionoverlay = $remuidefaultsectionoverlay; + $sectiondetails->remuinewfontcolor = $remuinewfontcolor; + $sectiondetails->remuinewthemecolor = $remuinewthemecolor; } + $sectiondetails->activityinfo = $extradetails['activityinfo']; $sectiondetails->progressinfo = $extradetails['progressinfo']; @@ -448,16 +457,24 @@ public function get_activity_to_resume($course) { * Get the image from section. */ public function get_section_first_image($currentsection, $summaryhtml) { - $newcontent = ''; + $imgarray = array(); $context = context_course::instance($currentsection->course); $summarytext = file_rewrite_pluginfile_urls($summaryhtml, 'pluginfile.php', $context->id, 'course', 'section', $currentsection->id); - $image = $this->extract_first_image($summarytext); + $image = ''; + if( !empty($summarytext) ) { + $image = $this->extract_first_image($summarytext); + } if ($image) { - $imagesrc = $image['src']; - $newcontent .= $imagesrc; - return $newcontent; + $imagesrc = 'url(' . $image['src'] . ')'; + $imgarray['img'] = $imagesrc; + $imgarray['pattern'] = 0; + } else { + $imgarray['img'] = "linear-gradient(324deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 85%), + url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='200' viewBox='0 0 160 80'%3E%3Cg fill='%23ededed' %3E%3Cpolygon points='0 10 0 0 10 0'/%3E%3Cpolygon points='0 40 0 30 10 30'/%3E%3Cpolygon points='0 30 0 20 10 20'/%3E%3Cpolygon points='0 70 0 60 10 60'/%3E%3Cpolygon points='0 80 0 70 10 70'/%3E%3Cpolygon points='50 80 50 70 60 70'/%3E%3Cpolygon points='10 20 10 10 20 10'/%3E%3Cpolygon points='10 40 10 30 20 30'/%3E%3Cpolygon points='20 10 20 0 30 0'/%3E%3Cpolygon points='10 10 10 0 20 0'/%3E%3Cpolygon points='30 20 30 10 40 10'/%3E%3Cpolygon points='20 20 20 40 40 20'/%3E%3Cpolygon points='40 10 40 0 50 0'/%3E%3Cpolygon points='40 20 40 10 50 10'/%3E%3Cpolygon points='40 40 40 30 50 30'/%3E%3Cpolygon points='30 40 30 30 40 30'/%3E%3Cpolygon points='40 60 40 50 50 50'/%3E%3Cpolygon points='50 30 50 20 60 20'/%3E%3Cpolygon points='40 60 40 80 60 60'/%3E%3Cpolygon points='50 40 50 60 70 40'/%3E%3Cpolygon points='60 0 60 20 80 0'/%3E%3Cpolygon points='70 30 70 20 80 20'/%3E%3Cpolygon points='70 40 70 30 80 30'/%3E%3Cpolygon points='60 60 60 80 80 60'/%3E%3Cpolygon points='80 10 80 0 90 0'/%3E%3Cpolygon points='70 40 70 60 90 40'/%3E%3Cpolygon points='80 60 80 50 90 50'/%3E%3Cpolygon points='60 30 60 20 70 20'/%3E%3Cpolygon points='80 70 80 80 90 80 100 70'/%3E%3Cpolygon points='80 10 80 40 110 10'/%3E%3Cpolygon points='110 40 110 30 120 30'/%3E%3Cpolygon points='90 40 90 70 120 40'/%3E%3Cpolygon points='10 50 10 80 40 50'/%3E%3Cpolygon points='110 60 110 50 120 50'/%3E%3Cpolygon points='100 60 100 80 120 60'/%3E%3Cpolygon points='110 0 110 20 130 0'/%3E%3Cpolygon points='120 30 120 20 130 20'/%3E%3Cpolygon points='130 10 130 0 140 0'/%3E%3Cpolygon points='130 30 130 20 140 20'/%3E%3Cpolygon points='120 40 120 30 130 30'/%3E%3Cpolygon points='130 50 130 40 140 40'/%3E%3Cpolygon points='120 50 120 70 140 50'/%3E%3Cpolygon points='110 70 110 80 130 80 140 70'/%3E%3Cpolygon points='140 10 140 0 150 0'/%3E%3Cpolygon points='140 20 140 10 150 10'/%3E%3Cpolygon points='140 40 140 30 150 30'/%3E%3Cpolygon points='140 50 140 40 150 40'/%3E%3Cpolygon points='140 70 140 60 150 60'/%3E%3Cpolygon points='150 20 150 40 160 30 160 20'/%3E%3Cpolygon points='150 60 150 50 160 50'/%3E%3Cpolygon points='140 70 140 80 150 80 160 70'/%3E%3C/g%3E%3C/svg%3E\")"; + $imgarray['pattern'] = 1; } + return $imgarray; } /** @@ -551,4 +568,4 @@ public function abstract_html_contents($html, $maxlength = 100) { return $newcontent; } -} \ No newline at end of file +} diff --git a/classes/output/card_all_sections_summary_renderable.php b/classes/output/card_all_sections_summary_renderable.php index 9d967e0..3736af4 100644 --- a/classes/output/card_all_sections_summary_renderable.php +++ b/classes/output/card_all_sections_summary_renderable.php @@ -124,7 +124,14 @@ private function get_card_format_context(&$export, $renderer, $editing, $rformat $export->generalsection['title'] = $this->courseformat->get_section_name($generalsection); } - $export->generalsection['activities'] = $this->get_activities_details($generalsection); + $generalsecactivities = $this->get_activities_details($generalsection); + $export->generalsection['activities'] = $generalsecactivities; + // Check if activities exists in general section. + if ( !empty($generalsecactivities) ) { + $export->generalsection['activityexists'] = 1; + } else { + $export->generalsection['activityexists'] = 0; + } $export->generalsection['availability'] = $renderer->section_availability($generalsection); $sectiontitlesummarymaxlength = $this->settings['sectiontitlesummarymaxlength']; @@ -145,25 +152,29 @@ private function get_card_format_context(&$export, $renderer, $editing, $rformat $percentage = floor($percentage); $export->generalsection['percentage'] = $percentage; } - $courseallactivities = get_array_of_activities($this->course->id); - $export->nooftotalactivities = count($courseallactivities); - $allactivitiesarray = array(); - foreach ($courseallactivities as $key => $value) { - if (array_key_exists($value->mod, $allactivitiesarray)) { - $allactivitiesarray[$value->mod]++; - } else { - $allactivitiesarray[$value->mod] = 1; + + // Get the all activities count from the all sections. + $sectionmods = array(); + for($i = 0; $i < count($sections); $i++) { + if (isset($modinfo->sections[$i])) { + foreach ($modinfo->sections[$i] as $cmid) { + $thismod = $modinfo->cms[$cmid]; + if (isset($sectionmods[$thismod->modname])) { + $sectionmods[$thismod->modname]['name'] = $thismod->modplural; + $sectionmods[$thismod->modname]['count']++; + } else { + $sectionmods[$thismod->modname]['name'] = $thismod->modfullname; + $sectionmods[$thismod->modname]['count'] = 1; + } + } } } - $output = array(); - foreach ($allactivitiesarray as $key => $value) { - // Make activity type plural if count is more than 1. - if ($value > 1) { - $key = $key.'s'; - } - $output['activitylist'][] = $value.' '.$key; + foreach ($sectionmods as $mod) { + $output['activitylist'][] = $mod['count'].' '.$mod['name']; } $export->activitylist = $output['activitylist']; + + // Get reseume activity link. $export->resumeactivityurl = $this->courseformatdatacommontrait->get_activity_to_resume($this->course); if ( isset($export->resumeactivityurl) ) { $baseurl = course_get_url($this->course); @@ -237,4 +248,4 @@ private function get_activities_details($section, $displayoptions = array()) { } return $output; } -} \ No newline at end of file +} diff --git a/db/install.xml b/db/install.xml index 28410bb..e13d183 100644 --- a/db/install.xml +++ b/db/install.xml @@ -1,5 +1,5 @@ - diff --git a/db/upgrade.php b/db/upgrade.php index b94d7cb..a56b2b7 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -43,7 +43,7 @@ function xmldb_format_remuiformat_upgrade($oldversion) { global $DB; $dbman = $DB->get_manager(); - if ($oldversion < 2019110601) { + if ($oldversion < 2019120500) { // Define table format_remuiformat to be created. $table = new xmldb_table('format_remuiformat'); @@ -67,6 +67,6 @@ function xmldb_format_remuiformat_upgrade($oldversion) { } // Remuiformat savepoint reached. - upgrade_plugin_savepoint(true, 2019110601, 'format', 'remuiformat'); + upgrade_plugin_savepoint(true, 2019120500, 'format', 'remuiformat'); } } diff --git a/lang/en/format_remuiformat.php b/lang/en/format_remuiformat.php index 15be24c..221d22d 100644 --- a/lang/en/format_remuiformat.php +++ b/lang/en/format_remuiformat.php @@ -56,6 +56,7 @@ // Section. $string['sectionname'] = 'Section'; +$string['sectionnamecaps'] = 'SECTION'; $string['section0name'] = 'General'; $string['hidefromothers'] = 'Hide topic'; $string['showfromothers'] = 'Show topic'; @@ -137,7 +138,9 @@ $string['activityremaining'] = 'activity remaining'; $string['allactivitiescompleted'] = "All activitie's completed"; - - // Used in format.js on change course layout. $string['showallsectionperpage'] = 'Show all sections per page'; + +// Card format general section +$string['showfullsummary'] = '+ Show full summary'; +$string['showless'] = 'Show less'; diff --git a/lib.php b/lib.php index b03b7ce..3e2d8d6 100644 --- a/lib.php +++ b/lib.php @@ -522,7 +522,12 @@ public function get_config_for_external() { public function update_course_format_options($data, $sectionid = null) { if (!empty($data)) { // Used optional_param() instead of using $_POST and $_GET. - $data->remuicourseformat = optional_param('remuicourseformat', null, PARAM_INT); + + // Added check to handle restore course issue. + // if ( !isset( $data->remuicourseformat )) { + // $data->remuicourseformat = optional_param('remuicourseformat', null, PARAM_INT); + // } + $contextid = context_course::instance($this->courseid); if (!empty($data->remuicourseimage_filemanager)) { file_postupdate_standard_filemanager( @@ -535,6 +540,11 @@ public function update_course_format_options($data, $sectionid = null) { $data->remuicourseimage_filemanager ); } + + // Remove course image in case of Restore. + if ( !isset($_REQUEST['remuicourseimage_filemanager']) && isset($data->remuicourseimage_filemanager ) ) { + $data->remuicourseimage_filemanager = ''; + } } return $this->update_format_options($data); } diff --git a/styles.css b/styles.css index 8787908..0f28751 100644 --- a/styles.css +++ b/styles.css @@ -29,6 +29,11 @@ overflow: visible; } +.col-12 { + padding-right: 1.0715rem !important; + padding-left: 1.0715rem !important; +} + /* RemUI 3.4, 3.5, 3.6 */ #page-course-view-remuiformat.pagelayout-course .container #region-main .card.card-block:first-of-type { background: transparent; @@ -285,7 +290,7 @@ ul.remui-format-list h4.sectionname { font-size: 18px; font-weight: 500; padding: 7px 0; - clear: both; /* Fordson */ + /* clear: both; Fordson */ } #page-course-view-remuiformat div#card-editing-container .section-title, @@ -295,7 +300,7 @@ ul.remui-format-list h4.sectionname { font-size: 22px; font-weight: 700; padding: 7px 0; - clear: both; /* Fordson */ + /* clear: both; Fordson */ } #page-course-view-remuiformat div#card-container .section-title:hover, @@ -402,6 +407,7 @@ input.ignoredirty.form-control { border-radius: 15px; background-color: #ddd; height: 12px; + border-bottom: unset; /* Fordson */ } .general-activities-list-group { @@ -621,6 +627,8 @@ input.ignoredirty.form-control { #page-course-view-remuiformat .wdm-section-wrapper { list-style-type: none; padding: 0; + margin-right: -1.0715rem; + margin-left: -1.0715rem; } #page-course-view-remuiformat .wdm-card-single-section .section-modchooser { @@ -874,6 +882,7 @@ ul.remui-format-list .mod-indent-outer .actions { } .teacher-img-container img.userpicture { margin: 0 1rem; + border-radius: 50%; } .mb-25 { @@ -901,7 +910,9 @@ ul.remui-format-list .mod-indent-outer .actions { opacity: 1 !important; min-width: 25px !important; } - +.first-section-li .carousel-inner { + width: 155px; +} .teacher-label { display: flex; justify-content: flex-end; @@ -1058,6 +1069,11 @@ ul.remui-format-list span.inplaceeditable input { text-align: center !important; } +.showactivitywrapper .showactivity { + font-size: 24px; + line-height: 24px; +} + #page-course-view-remuiformat ul.section.first-section.row { flex-wrap: wrap; justify-content: center; @@ -1178,9 +1194,9 @@ ul.remui-format-list span.inplaceeditable input { .fadeout-summary { position: absolute; - margin-top: -50px; + margin-top: -60px; width: 95%; - height: 50px; + height: 60px; background-image: linear-gradient(rgba(255, 255, 255, 0.3) 0, rgba(255, 255, 255, 1) 100%); } @@ -1195,13 +1211,14 @@ ul.remui-format-list span.inplaceeditable input { .read-more-trigger { cursor: pointer !important; + display: none; } -.read-more-state ~ .read-more-trigger:before { +/* .read-more-state ~ .read-more-trigger:before { content: ' + Show full summary'; } .read-more-state:checked ~ .read-more-trigger:before { content: 'Show less'; -} +} */ /* General section summary show/hide end. */ diff --git a/templates/card_all_sections_summary.mustache b/templates/card_all_sections_summary.mustache index 1411c5a..a3de740 100644 --- a/templates/card_all_sections_summary.mustache +++ b/templates/card_all_sections_summary.mustache @@ -66,7 +66,14 @@ ], } }} - + {{#editing}}
{{! Display General Section }} diff --git a/templates/card_general_section.mustache b/templates/card_general_section.mustache index 933dfa9..0ddb672 100644 --- a/templates/card_general_section.mustache +++ b/templates/card_general_section.mustache @@ -108,8 +108,10 @@
-

{{#str}} generalactivities, format_remuiformat{{/str}}

-
    + {{#activityexists}} +

    {{#str}} generalactivities, format_remuiformat{{/str}}

    + {{/activityexists}} +
      {{#activities}}
    • @@ -130,7 +132,9 @@ {{/activities}}
    @@ -141,10 +145,10 @@ require(['jquery'], function(jQuery) { jQuery('.showactivity').on('click', function() { if(jQuery(this).hasClass('show')) { - jQuery(this).html(''); + jQuery(this).html(''); jQuery(this).toggleClass('show'); //Remove show class. } else { - jQuery(this).html(''); + jQuery(this).html(''); jQuery(this).toggleClass('show'); //Add show class. jQuery("html, body").animate({ scrollTop: 0 }, "slow"); } diff --git a/templates/card_general_section_edit.mustache b/templates/card_general_section_edit.mustache index 97f0aa1..c220175 100644 --- a/templates/card_general_section_edit.mustache +++ b/templates/card_general_section_edit.mustache @@ -123,9 +123,11 @@ -

    {{#str}} generalactivities, format_remuiformat{{/str}}

    + {{#activityexists}} +

    {{#str}} generalactivities, format_remuiformat{{/str}}

    + {{/activityexists}}
    -
      +
        {{#activities}}
      • @@ -147,7 +149,9 @@
        {{{addnewactivity}}}
    @@ -175,10 +179,10 @@ require(['jquery'], function(jQuery) { jQuery('.showactivity').on('click', function() { if(jQuery(this).hasClass('show')) { - jQuery(this).html(''); + jQuery(this).html(''); jQuery(this).toggleClass('show'); //Remove show class } else { - jQuery(this).html(''); + jQuery(this).html(''); jQuery(this).toggleClass('show'); //Add show class jQuery("html, body").animate({ scrollTop: 0 }, "slow"); } diff --git a/templates/card_one_section.mustache b/templates/card_one_section.mustache index 9258907..83db84b 100644 --- a/templates/card_one_section.mustache +++ b/templates/card_one_section.mustache @@ -67,7 +67,7 @@ {{/editing}}
    -
      +
        {{#activities}}
      • diff --git a/templates/card_section_summary.mustache b/templates/card_section_summary.mustache index d293051..cc04e2f 100644 --- a/templates/card_section_summary.mustache +++ b/templates/card_section_summary.mustache @@ -71,7 +71,7 @@ {{^addsection}}
        @@ -80,7 +80,7 @@ {{{ addnewsection }}} {{{ optionmenu }}}
        - SECTION {{ index }} + {{#str}} sectionnamecaps, format_remuiformat{{/str}} {{ index }}
        {{#addnewsection}}

        {{{ title }}}

        diff --git a/templates/list_general_section.mustache b/templates/list_general_section.mustache index 43f1ad3..3d8277d 100644 --- a/templates/list_general_section.mustache +++ b/templates/list_general_section.mustache @@ -80,7 +80,7 @@
        -
          +
            {{#activities}}
          • @@ -101,7 +101,9 @@ {{/activities}}
      • @@ -112,10 +114,10 @@ require(['jquery'], function(jQuery) { jQuery('.showactivity').on('click', function() { jQuery('.section.first-section').toggleClass('showhideactivity'); if(jQuery(this).hasClass('show')) { - jQuery(this).html(''); + jQuery(this).html(''); jQuery(this).toggleClass('show'); } else { - jQuery(this).html(''); + jQuery(this).html(''); jQuery(this).toggleClass('show'); } }); diff --git a/templates/list_general_section_edit.mustache b/templates/list_general_section_edit.mustache index cee6ff9..ad06f2d 100644 --- a/templates/list_general_section_edit.mustache +++ b/templates/list_general_section_edit.mustache @@ -79,7 +79,7 @@
        -
          +
            {{#activities}}
          • @@ -99,7 +99,9 @@ {{/activities}}
          - +
          {{{addnewactivity}}}
        @@ -128,10 +130,10 @@ require(['jquery'], function(jQuery) { jQuery('.showactivity').on('click', function() { jQuery('.section.first-section').toggleClass('showhideactivity'); if(jQuery(this).hasClass('show')) { - jQuery(this).html(''); + jQuery(this).html(''); jQuery(this).toggleClass('show'); } else { - jQuery(this).html(''); + jQuery(this).html(''); jQuery(this).toggleClass('show'); } }); diff --git a/version.php b/version.php index e6188ed..7d8d071 100644 --- a/version.php +++ b/version.php @@ -24,8 +24,8 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2019110601; // The current plugin version (Date: YYYYMMDDXX). -$plugin->release = '1.0.3'; +$plugin->version = 2019120500; // The current plugin version (Date: YYYYMMDDXX). +$plugin->release = '1.0.4'; $plugin->requires = 2017111300; // Requires this Moodle version (Moodle V3.4.0). $plugin->maturity = MATURITY_STABLE; $plugin->component = 'format_remuiformat'; // Full name of the plugin (used for diagnostics).