Skip to content

Commit

Permalink
Merge pull request #89 from WisdmLabs/dev40
Browse files Browse the repository at this point in the history
Merge dev40 to stable40
  • Loading branch information
jishan-ansari2000 authored Jan 10, 2024
2 parents 14bb820 + e14110e commit 4576d3b
Show file tree
Hide file tree
Showing 23 changed files with 1,016 additions and 306 deletions.
2 changes: 1 addition & 1 deletion amd/build/common.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amd/build/common.min.js.map

Large diffs are not rendered by default.

17 changes: 4 additions & 13 deletions amd/src/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,28 +123,19 @@ define(['jquery'], function($) {
});


// ... + Show full summary label show conditionally.
var summaryheight = $('.read-more-target').height();
var browservendor = window.navigator.vendor;
var webkitboxorient = "vertical";
if (browservendor.indexOf('Apple') != -1) {
webkitboxorient = "horizontal";
}

if (summaryheight > 100) {
if (summaryheight > 300) {
$('.generalsectioninfo').find('#readmorebtn').removeClass('d-none');
$('.read-more-target .no-overflow').addClass('text-clamp text-clamp-3').css("-webkit-box-orient", webkitboxorient);
$('.read-more-target').addClass('text-clamp text-clamp-3').css("-webkit-box-orient", webkitboxorient);
$('.read-more-target').addClass('summary-collapsed').removeClass('summary-expanded');
}
$('#readmorebtn').on('click', function() {
$('.read-more-target .no-overflow').removeClass('text-clamp text-clamp-3');
$('.read-more-target').removeClass('text-clamp text-clamp-3');
$('.read-more-target').addClass('summary-expanded').removeClass('summary-collapsed');
$('.generalsectioninfo').find('#readmorebtn').addClass('d-none');
$('.generalsectioninfo').find('#readlessbtn').removeClass('d-none');
});
$('#readlessbtn').on('click', function () {
$('.read-more-target .no-overflow').addClass('text-clamp text-clamp-3').css("-webkit-box-orient", webkitboxorient);
$('.read-more-target').addClass('text-clamp text-clamp-3').css("-webkit-box-orient", webkitboxorient);
$('.read-more-target').addClass('summary-collapsed').removeClass('summary-expanded');
$('.generalsectioninfo').find('#readmorebtn').removeClass('d-none');
$('.generalsectioninfo').find('#readlessbtn').addClass('d-none');
});
Expand Down
8 changes: 8 additions & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
CHANGES LOG

Version 4.1.5
=============
Tweak - UI improvements:
- Optimized the height of section and activity cards.
- Removed activity type name for student users
Tweak - Added activity indentation for list layout
Fix - Fixed the issue where restriction information was not visible on the section.

Version 4.1.4
=============
Feature - Compatibility with Moodle 4.3.
Expand Down
17 changes: 17 additions & 0 deletions classes/course_format_data_common_trait.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ public function get_all_section_data($renderer, $editing, $rformat, $settings, $

$data->hiddenmessage = $this->course_section_availability($course, $section);

if(trim(strip_tags($data->hiddenmessage)) == ""){
$data->hiddenmessage = false;
}
if ($courseformat->is_section_current($section)) {
$data->iscurrent = true;
$data->highlightedlabel = get_string('highlight');
Expand Down Expand Up @@ -342,6 +345,9 @@ public function get_all_section_data($renderer, $editing, $rformat, $settings, $

$data->activityinfo = $extradetails['activityinfo'];
$data->progressinfo = $extradetails['progressinfo'];
if(!$course->enablecompletion){
$data->progressinfo = false;
}

// Set Marker.
if ($course->marker == $sectionindex) {
Expand All @@ -360,6 +366,13 @@ public function get_all_section_data($renderer, $editing, $rformat, $settings, $
}
$data->activityinfostring = implode($extradetails['activityinfo']);
$data->progressinfo = $extradetails['progressinfo'];
$data->checkrightsidecontent = true;
if(!$course->enablecompletion){
$data->progressinfo = false;
}
if(!$data->progressinfo && !$editing){
$data->checkrightsidecontent = false;
}
$data->sectionactivities = $this->course_section_cm_list(
$course, $section
);
Expand Down Expand Up @@ -952,6 +965,9 @@ private function get_activities_details($section, $course, $courserenderer, $set
$courserenderer,
$displayoptions
);
if (!$mod->visible) {
$activitydetails->modhiddenfromstudents = true;
}
$activitydetails->viewurl = $mod->url;
$activitydetails->title = $this->course_section_cm_name($mod, $displayoptions);
if (array_search($mod->modname, array('folder')) !== false) {
Expand Down Expand Up @@ -1022,6 +1038,7 @@ public function add_generalsection_data(&$export, $renderer, $editing, $course,
$export->generalsection['index'] = 0;
$generalsectionsummary = $renderer->format_summary_text($generalsection);
if (empty($generalsectionsummary)) {
$course->summary = file_rewrite_pluginfile_urls($course->summary, 'pluginfile.php', $coursecontext->id, 'course', 'summary', null) ;
$generalsectionsummary = $course->summary;
}
if ($generalsection) {
Expand Down
4 changes: 3 additions & 1 deletion classes/output/card_one_section_renderable.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ private function get_activities_details($section, $displayoptions = array()) {

$completiondata = $completioninfo->get_data($mod, true);
$activitydetails = new \stdClass();

if (!$mod->visible) {
$activitydetails->modhiddenfromstudents = true;
}
if ($mod->visible == 0) {
$activitydetails->notavailable = true;
if (has_capability('moodle/course:viewhiddensections', $context, $USER)) {
Expand Down
3 changes: 3 additions & 0 deletions lang/en/format_remuiformat.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,6 @@
$string["remuiheader"] = 'Header';
$string["headereditingbutton"] = "Select editing button positon";
$string['headereditingbutton_help'] = "Select editing button positon This setting will not work in remui, check course setting";

$string['headeroverlayopacity'] = "Change the header overlay opacity";
$string['headeroverlayopacity_help'] = "The default value is already set to '100'. To adjust opacity, please enter a value between 0 and 100";
21 changes: 18 additions & 3 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,10 @@ public function course_format_options($foreditform = false) {
'default' => "cover",
'type' => PARAM_RAW
),

'headeroverlayopacity' => array(
'default' => "100",
'type' => PARAM_RAW
),
);
}

Expand Down Expand Up @@ -406,7 +409,12 @@ public function course_format_options($foreditform = false) {
'help' => 'edw_format_hd_bgsize',
'help_component' => 'format_remuiformat'
),

'headeroverlayopacity' => array(
'label' => new lang_string('headeroverlayopacity', 'format_remuiformat'),
'element_type' => 'text',
'help' => 'headeroverlayopacity',
'help_component' => 'format_remuiformat'
),
);
$courseformatoptions = array_merge_recursive($courseformatoptions, $courseformatoptionsedit);
}
Expand Down Expand Up @@ -908,6 +916,13 @@ function get_extra_header_context(&$export, $course, $percentage, $imgurl) {
$export->generalsection['courseheaderdesign'] = get_config('theme_remui', 'courseheaderdesign') == 0 ? false : true;
$export->turneditingonswitch = "";
}

$headeroverlayopacity = $coursesettings['headeroverlayopacity'];
if(is_numeric($headeroverlayopacity) && ($headeroverlayopacity <= 100)){
$headeroverlayopacity = $headeroverlayopacity / 100;
$export->generalsection['overlayopacity'] = $headeroverlayopacity;
}else{
$export->generalsection['overlayopacity'] = 1;
}
$export->generalsection['coursecompletionstatus'] = $course->enablecompletion;
return $export->generalsection;
}
62 changes: 37 additions & 25 deletions scss/card-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,23 +163,24 @@
// margin-top: 20px;
.availabilityinfo {
&.isrestricted {
// font-size: 90%;
// padding: 10px;
// background: #e0e0e0;
// border-radius: 5px;
// margin: 5px 0 !important
margin: 0px;
margin-top: $margin-8;
// margin-top: $margin-16;
padding: $pad-8;
border-radius: $border-radius-8;
background-color: $small-ui-bg;
i{
color: $paragraph-color;
@include frmt-font-styling(14px,22px,600);
@include frmt-font-styling(12px,normal,400);
ul {
padding-left: 1rem;
li{
margin-top: 4px;
}
}

strong{
color: $heading-color;
@include frmt-font-styling(14px,22px,600);
@include frmt-font-styling(12px,15px,600);
a{
@include frmt-font-styling(12px,normal,400);
}
}
}
}
Expand Down Expand Up @@ -266,7 +267,7 @@
border: $border-height solid $light-border;
border-radius: inherit;
padding: $pad-24;
gap: $gap-32;
gap: $gap-16;

.content {
display: flex;
Expand Down Expand Up @@ -336,6 +337,7 @@
}
}
.section-header {
gap: $gap-16;
a {
text-decoration: none;
}
Expand Down Expand Up @@ -418,25 +420,25 @@
}
}
.general-single-card {
align-items: center;
align-items: flex-start;
justify-content: space-between;
gap:$gap-16;
@media (max-width:$screen-900) {
// flex-direction: column;
align-items: unset;
// align-items: unset;
// gap: $gap-24;
}
@media (max-width:$sm-screen-bp) {
@media (max-width:$tb-screenp-bp) {
flex-direction: column;
gap: $gap-32;
}
.header-progresbar-wrapper{
gap: $gap-40;
gap: $gap-6;
flex-direction: column;
@media (max-width:$screen-900) {
gap: $gap-24;
}
@media (max-width:$tb-screenp-bp) {
flex-direction: column;
gap:$gap-16
}
.section-title {
Expand All @@ -446,11 +448,15 @@
}
.progress-bar-warpper{
@media (max-width:$sm-screen-bp){
justify-content: center;
// justify-content: center;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
}

.progress {
width: $progress-bar-min-width;
}
}
}
}
Expand Down Expand Up @@ -485,19 +491,20 @@
display: flex;
transition: all 0.5s ease;
padding: 0px;
min-height: $section-card-min-height;
// min-height: $section-card-min-height;
&:hover{
box-shadow: $card-box-shadow;
}
.activitytitle {
width: 100%;
display: flex;
flex-direction: column;
gap: $gap-16;
gap: $gap-26 !important;
.media-body {
.text-font-small.small {
color: $paragraph-color;
@include frmt-font-styling(16px, 24px, 400);
display: none;
}
}
}
Expand All @@ -517,7 +524,12 @@
.single-card {
min-height: $single-card-min-height;
.single-card-child-wrapper{
gap: $gap-8;
gap: $gap-12;
}
}
&.modtype_label{
.single-card{
min-height: unset;
}
}
.editing_move {
Expand Down Expand Up @@ -545,7 +557,7 @@
width: 100%;
overflow: auto;
color: $paragraph-color;
@include frmt-font-styling(16px,24px,400);
@include frmt-font-styling(14px,24px,400);
.contentwithoutlink {
padding: 0;
}
Expand Down Expand Up @@ -616,9 +628,9 @@
display: none;
}
}
.nosummary .availabilityinfo {
text-align: center;
}
// .nosummary .availabilityinfo {
// text-align: center;
// }
// Placing conpletion marker.
.completion-container.manual-completion {
width: 100%;
Expand Down
Loading

0 comments on commit 4576d3b

Please sign in to comment.