Index: lams_monitoring/web/css/components-monitoring.css =================================================================== diff -u -r11451ea046ecf5451b71400c2b2063c48aa893cd -r5b0b163e3a7c6105a347ed651367666ba20468da --- lams_monitoring/web/css/components-monitoring.css (.../components-monitoring.css) (revision 11451ea046ecf5451b71400c2b2063c48aa893cd) +++ lams_monitoring/web/css/components-monitoring.css (.../components-monitoring.css) (revision 5b0b163e3a7c6105a347ed651367666ba20468da) @@ -331,58 +331,47 @@ margin-bottom: 2rem; } -.monitoring-page-wrapper .tasks-col .row { - margin-bottom: 1rem; +.monitoring-page-wrapper #required-tasks-content .row { + margin-bottom: 1.5rem; } -.monitoring-page-wrapper .tasks-col .row > div:first-child { +.monitoring-page-wrapper #required-tasks-content .label { color: #2E384D; font-family: mont-regular, sans-serif; font-size: .8rem; margin: 0; - margin-top: .6rem; } -.monitoring-page-wrapper .tasks-col select { - width: 100%; - border: 0; - background-color: #F6F5FA; - height: 2.8rem; - padding: .5rem 1rem; - border-radius: .9rem; - -moz-appearance: none; /* Firefox */ - -webkit-appearance: none; /* Safari and Chrome */ - appearance: none; - font-size: .8rem; - color: #ACB5CC; - font-family: mont-regular, sans-serif; - background-repeat: no-repeat; - background-position: calc(100% - 1.3rem) 1.3rem; - background-size: .6rem; - background-image: url(/lams/images/components/arrow.svg); +.monitoring-page-wrapper #required-tasks-content .label.contribute-activity-title { + font-family: mont-bold, sans-serif; } -.monitoring-page-wrapper .tasks-col select:focus { - outline: none; +.monitoring-page-wrapper #required-tasks-content .badge { + padding: .5rem 1rem; + vertical-align: middle; } -.monitoring-page-wrapper .tasks-col button { +.monitoring-page-wrapper #required-tasks-content button { background-color: #3C42E0; border: 0; color: #fff; font-family: mont-regular, sans-serif; font-size: .8rem; - width: 10rem; - height: 2.7rem; - border-radius: .8rem; box-shadow: 0px 3px 6px #3C42E040; - transition: all .3s ease; } -.monitoring-page-wrapper .tasks-col button:hover { +.monitoring-page-wrapper #required-tasks-content button.contribute-go-button { + min-width: 5rem; +} + +.monitoring-page-wrapper #required-tasks-content button:hover { background-color: #878bea; } +.monitoring-page-wrapper #required-tasks-content .dropdown-item { + font-size: .8rem; +} + .monitoring-page-wrapper .insight-col-content p { margin: 0; width: 100%; Index: lams_monitoring/web/includes/javascript/monitorLesson5.js =================================================================== diff -u --- lams_monitoring/web/includes/javascript/monitorLesson5.js (revision 0) +++ lams_monitoring/web/includes/javascript/monitorLesson5.js (revision 5b0b163e3a7c6105a347ed651367666ba20468da) @@ -0,0 +1,149 @@ + //auto refresh all tabs every 30 seconds +let autoRefreshInterval = 30 * 1000, + autoRefreshIntervalObject = null; + +function refreshMonitor(tabName, isAuto){ + if (autoRefreshIntervalObject && !isAuto) { + clearInterval(autoRefreshIntervalObject); + autoRefreshIntervalObject = null; + } + + if (!autoRefreshIntervalObject) { + autoRefreshIntervalObject = setInterval(function(){ + // refreshMonitor(null, true); + }, autoRefreshInterval); + } + + updateLessonTab(); +} + +/** + * Updates widgets in lesson tab according to response sent to refreshMonitor() + */ +function updateLessonTab(){ + $.ajax({ + dataType : 'json', + url : LAMS_URL + 'monitoring/monitoring/getLessonDetails.do', + cache : false, + data : { + 'lessonID' : lessonId + }, + + success : function(response) { + updateContributeActivities(response.contributeActivities); + } + }); +} + + +function updateContributeActivities(contributeActivities) { + let requiredTasksPanel = $('#required-tasks'), + requiredTasksContent = $('#required-tasks-content', requiredTasksPanel), + row = null; + $('.contribute-row', requiredTasksContent).remove(); + + /* + // special case - add a Live Edit option. This does not directly map to an activity + if ( lockedForEdit && lockedForEditUserId == userId) { + // show Live Edit task only if currently editing myself, not if someone else is editing. + // put it at the top of the contribution list + var cell = $('
').addClass('contributeActivityCell').text(LABELS.LIVE_EDIT_BUTTON); + var row = $('').addClass('contributeRow').insertAfter(row).append(cell); + var entryContent = LABELS.LIVE_EDIT_TOOLTIP + + '' + LABELS.CONTRIBUTE_BUTTON + ''; + cell = $('').addClass('contributeEntryCell').html(entryContent); + row = row.append(cell); + } + */ + + if (contributeActivities) { + $.each(contributeActivities, function(){ + let contributeActivity = this; + if (contributeActivity.title) { + $('').addClass('label contribute-activity-title contribute-row') + .text(contributeActivity.title) + .attr('id', 'contribute' + contributeActivity.activityID) + .appendTo(requiredTasksContent); + } + + let row = $('').addClass('row contribute-row' + (contributeActivity.title ? ' ml-1' : '')) + .appendTo(requiredTasksContent); + + $.each(this.contributeEntries, function(){ + var entryContent = '