Commit 00ec6028 authored by Astor Bizard's avatar Astor Bizard
Browse files

War effort to reduce moodle css by using bootstrap.

parent 16ff5715
define(["jquery","jqueryui","core/url","mod_randomactivity/orderabletable"],function(a,b,c,d){function e(b,c){var d=b.find("tbody tr");if(d.length>1)b.find(".empty-row").remove();else if(0==d.length){var e=b.find("thead th").length;b.find("tbody").append('<tr class="empty-row lastrow"><td colspan="'+e+'"></td></tr>')}var f="";b.find("tbody tr:not(.empty-row)").each(function(b){a(this).find("td:first-child").html(b+1),f+=a(this).data("cmid")+" "}).removeClass("lastrow").last().addClass("lastrow"),c.val(f.trim())}return{setup:function(){var b=a("#randomactivity-activities-table"),f=a("#form-randomactivity-activities"),g=f.find("[name=activities]"),h=f.find("[name=seed]");e(b,g),d.makeOrderable(a(".activitytable"),function(){e(b,g),f.change()}),a(".activitytable .removebutton").click(function(){a(this).closest("tr").remove(),e(b,g),f.change()});var i=function(a){a.preventDefault(),a.returnValue=""},j=!1;f.change(function(){a("#apply-assign-button").removeAttr("disabled"),j||(j=!0,window.addEventListener("beforeunload",i))}),a("#cancel-button").click(function(){window.removeEventListener("beforeunload",i)});var k=a("#confirm-reassign").dialog({autoOpen:!1,dialogClass:"popup-dialog",title:M.util.get_string("confirm","moodle"),modal:!0,buttons:[{text:M.util.get_string("confirm","moodle"),class:"btn btn-primary",click:function(){window.removeEventListener("beforeunload",i),f.submit()}},{text:M.util.get_string("cancel","moodle"),class:"btn btn-secondary",click:function(){a(this).dialog("close")}}],open:function(){a(":focus").blur()}});a("#apply-assign-button").attr("disabled","disabled").click(function(){k.dialog("open")}),a("#seed-timestamp").click(function(a){a.preventDefault(),h.val((new Date).getTime()),f.change()});var l=c.relativeUrl("/mod/randomactivity/ajax");a("#seed-balance").click(function(b){b.preventDefault();var c=a(".load-icon");c.show(),h.attr("disabled","disabled");var d=f.find("[name=id]").val(),e=f.find("[name=group]").val(),i=g.val(),j=0;""!=i&&(j=i.split(" ").length),a.ajax(l+"/balanceseed.json.php?id="+d+"&nactivities="+j+"&group="+e).done(function(a){a.success&&(h.val(a.response.seed),f.change())}).always(function(){h.removeAttr("disabled"),c.hide()})}),a(".refresh-assignees").click(function(){var c=f.find("[name=id]").val(),d=f.find("[name=group]").val(),e=g.val(),i=h.val();a.ajax(l+"/refresh.json.php?id="+c+"&activities="+e+"&seed="+i+"&group="+d).done(function(c){c.success&&b.find("tbody tr td:nth-child(3)").each(function(b){a(this).html(c.response.assignees[b])})})});var m={$selector:a(".activity-type-selector"),$dropdown:a(".activity-type-dropdown"),$selectmenu:a(".activity-type-selector, .activity-type-dropdown"),$selectedvalue:a(".activity-type-selected span"),$search:a("#activity-search")},n=function(){var b=m.$selectedvalue.data("cmtype"),c=m.$search.val(),d=g.val().split(" "),e=!0;a(".activities-to-add-list .section").each(function(){var f=!0,g=a(this).is(".expanded");a(this).find(".activity-to-add").each(function(){var e=a(this).data("cmid"),h=a(this).data("cmtype"),i=a(this).find("label").text(),j=(!b||h==b)&&!d.includes(e+"")&&(""===c||i.toLowerCase().includes(c.toLowerCase()));a(this).toggle(j&&g),j&&(f=!1)}),f?a(this).hide():(e=!1,a(this).show())}),a("#no-activity-to-add-message").toggle(e)},o=a("#activities-choice").dialog({autoOpen:!1,dialogClass:"popup-dialog",title:M.util.get_string("addactivities","mod_randomactivity"),modal:!0,buttons:[{text:M.util.get_string("addselectedactivities","mod_randomactivity"),class:"btn btn-primary",click:function(){a(".activity-to-add").each(function(){a(this).find('input[type="checkbox"]').prop("checked")&&a(this).find("tr").clone(!0,!0).appendTo(b).css("display","")}),a(this).dialog("close"),e(b,g),f.change()}},{text:M.util.get_string("cancel","moodle"),class:"btn btn-secondary",click:function(){a(this).dialog("close")}}],open:function(){a(":focus").blur(),a('.activity-to-add input[type="checkbox"]').prop("checked",!1),a(".activities-to-add-list .section").addClass("expanded"),a(".activities-to-add-list").scrollTop(0),m.$selectedvalue.html(a(".activity-type").first().html()).data("cmtype",""),m.$selector.removeClass("expanded").addClass("collapsed"),m.$selectmenu.width(""),m.$search.val("").keyup(),n()}});a("#add-activities").click(function(){o.dialog("open")}),m.$selectmenu.click(function(){if(m.$selector.toggleClass("collapsed expanded"),m.$selector.is(".expanded")){var a=2*m.$dropdown.width()-m.$dropdown.prop("clientWidth");m.$selectmenu.width(Math.max(a,m.$selector.width()))}else m.$selectmenu.width("")}),a(".activity-type").click(function(){m.$selectedvalue.html(a(this).html()).data("cmtype",a(this).data("cmtype")),n()}),m.$search.keyup(function(){a(this).toggleClass("empty",""===a(this).val()),n()}),a(".search-remove").click(function(){m.$search.val("").keyup()}),a(".search-icon").click(function(){m.$search.focus()}),a(".activities-to-add-list .section .toggle-all").click(function(b){b.stopImmediatePropagation(),a(this).parents(".section").find('.activity-to-add:visible input[type="checkbox"]').prop("checked","select"==a(this).data("action"))}),a(".activities-to-add-list .section-header").click(function(){a(this).parents(".section").toggleClass("expanded"),n()})}}});
\ No newline at end of file
define(["jquery","jqueryui","core/url","mod_randomactivity/orderabletable"],function(a,b,c,d){function e(b,c){var d=b.find("tbody tr");if(d.length>1)b.find(".empty-row").remove();else if(0==d.length){var e=b.find("thead th").length;b.find("tbody").append('<tr class="empty-row lastrow"><td colspan="'+e+'"></td></tr>')}var f="";b.find("tbody tr:not(.empty-row)").each(function(b){a(this).find("td:first-child").html(b+1),f+=a(this).data("cmid")+" "}).removeClass("lastrow").last().addClass("lastrow"),c.val(f.trim())}return{setup:function(){var b=a("#randomactivity-activities-table"),f=a("#form-randomactivity-activities"),g=f.find("[name=activities]"),h=f.find("[name=seed]");e(b,g),d.makeOrderable(a(".activitytable"),function(){e(b,g),f.change()}),a(".activitytable .removebutton").click(function(){a(this).closest("tr").remove(),e(b,g),f.change()});var i=function(a){a.preventDefault(),a.returnValue=""},j=!1;f.change(function(){a("#apply-assign-button").removeAttr("disabled"),j||(j=!0,window.addEventListener("beforeunload",i))}),a("#cancel-button").click(function(){window.removeEventListener("beforeunload",i)});var k=a("#confirm-reassign").dialog({autoOpen:!1,dialogClass:"popup-dialog bg-white p-3",title:M.util.get_string("confirm","moodle"),modal:!0,buttons:[{text:M.util.get_string("confirm","moodle"),class:"btn btn-primary mx-1",click:function(){window.removeEventListener("beforeunload",i),f.submit()}},{text:M.util.get_string("cancel","moodle"),class:"btn btn-secondary mx-1",click:function(){a(this).dialog("close")}}],open:function(){a(":focus").blur()}});a("#apply-assign-button").attr("disabled","disabled").click(function(){k.dialog("open")}),a("#seed-timestamp").click(function(a){a.preventDefault(),h.val((new Date).getTime()),f.change()});var l=c.relativeUrl("/mod/randomactivity/ajax");a("#seed-balance").click(function(b){b.preventDefault();var c=a(".load-icon");c.show(),h.attr("disabled","disabled");var d=f.find("[name=id]").val(),e=f.find("[name=group]").val(),i=g.val(),j=0;""!=i&&(j=i.split(" ").length),a.ajax(l+"/balanceseed.json.php?id="+d+"&nactivities="+j+"&group="+e).done(function(a){a.success&&(h.val(a.response.seed),f.change())}).always(function(){h.removeAttr("disabled"),c.hide()})}),a(".refresh-assignees").click(function(){var c=f.find("[name=id]").val(),d=f.find("[name=group]").val(),e=g.val(),i=h.val();a.ajax(l+"/refresh.json.php?id="+c+"&activities="+e+"&seed="+i+"&group="+d).done(function(c){c.success&&b.find("tbody tr td:nth-child(3)").each(function(b){a(this).html(c.response.assignees[b])})})});var m={$selector:a(".activity-type-selector"),$dropdown:a(".activity-type-dropdown"),$selectmenu:a(".activity-type-selector, .activity-type-dropdown"),$selectedvalue:a(".activity-type-selected span"),$search:a("#activity-search")},n=function(){var b=m.$selectedvalue.data("cmtype"),c=m.$search.val(),d=g.val().split(" "),e=!0;a(".activities-to-add-list .section").each(function(){var f=!0,g=a(this).is(".expanded");a(this).find(".activity-to-add").each(function(){var e=a(this).data("cmid"),h=a(this).data("cmtype"),i=a(this).find("label").text(),j=(!b||h==b)&&!d.includes(e+"")&&(""===c||i.toLowerCase().includes(c.toLowerCase()));a(this).toggle(j&&g),j&&(f=!1)}),f?a(this).hide():(e=!1,a(this).show())}),a("#no-activity-to-add-message").toggle(e)},o=a("#activities-choice").dialog({autoOpen:!1,dialogClass:"popup-dialog bg-white p-3",title:M.util.get_string("addactivities","mod_randomactivity"),modal:!0,buttons:[{text:M.util.get_string("addselectedactivities","mod_randomactivity"),class:"btn btn-primary mx-1",click:function(){a(".activity-to-add").each(function(){a(this).find('input[type="checkbox"]').prop("checked")&&a(this).find("tr").clone(!0,!0).appendTo(b).css("display","")}),a(this).dialog("close"),e(b,g),f.change()}},{text:M.util.get_string("cancel","moodle"),class:"btn btn-secondary mx-1",click:function(){a(this).dialog("close")}}],open:function(){a(":focus").blur(),a('.activity-to-add input[type="checkbox"]').prop("checked",!1),a(".activities-to-add-list .section").addClass("expanded"),a(".activities-to-add-list").scrollTop(0),m.$selectedvalue.html(a(".activity-type").first().html()).data("cmtype",""),m.$selector.removeClass("expanded").addClass("collapsed"),m.$selectmenu.width(""),m.$search.val("").keyup(),n()}});a("#add-activities").click(function(){o.dialog("open")}),m.$selectmenu.click(function(){if(m.$selector.toggleClass("collapsed expanded"),m.$selector.is(".expanded")){var a=2*m.$dropdown.width()-m.$dropdown.prop("clientWidth");m.$selectmenu.width(Math.max(a,m.$selector.width()))}else m.$selectmenu.width("")}),a(".activity-type").click(function(){m.$selectedvalue.html(a(this).html()).data("cmtype",a(this).data("cmtype")),n()}),m.$search.keyup(function(){a(this).toggleClass("empty",""===a(this).val()),n()}),a(".search-remove").click(function(){m.$search.val("").keyup()}),a(".search-icon").click(function(){m.$search.focus()}),a(".activities-to-add-list .section .toggle-all").click(function(b){b.stopImmediatePropagation(),a(this).parents(".section").find('.activity-to-add:visible input[type="checkbox"]').prop("checked","select"==a(this).data("action"))}),a(".activities-to-add-list .section-header").click(function(){a(this).parents(".section").toggleClass("expanded"),n()})}}});
\ No newline at end of file
......@@ -98,13 +98,13 @@ define(['jquery', 'jqueryui', 'core/url', 'mod_randomactivity/orderabletable'],
// Confirmation dialog upon submit and acitvity re-assigning.
var $confirmReassignDialog = $('#confirm-reassign').dialog({
autoOpen: false,
dialogClass: 'popup-dialog',
dialogClass: 'popup-dialog bg-white p-3',
title: M.util.get_string('confirm', 'moodle'),
modal: true,
buttons:
[{
text: M.util.get_string('confirm', 'moodle'),
'class': 'btn btn-primary',
'class': 'btn btn-primary mx-1',
click: function() {
// The unloading of the page will not lose modifications, don't prompt the user anymore.
window.removeEventListener('beforeunload', preventUnsavedChangesUnload);
......@@ -113,7 +113,7 @@ define(['jquery', 'jqueryui', 'core/url', 'mod_randomactivity/orderabletable'],
},
{
text: M.util.get_string('cancel', 'moodle'),
'class': 'btn btn-secondary',
'class': 'btn btn-secondary mx-1',
click: function() {
$(this).dialog('close');
}
......@@ -237,13 +237,13 @@ define(['jquery', 'jqueryui', 'core/url', 'mod_randomactivity/orderabletable'],
// Activities addition dialog.
var $addActivitiesDialog = $('#activities-choice').dialog({
autoOpen: false,
dialogClass: 'popup-dialog',
dialogClass: 'popup-dialog bg-white p-3',
title: M.util.get_string('addactivities', 'mod_randomactivity'),
modal: true,
buttons:
[{
text: M.util.get_string('addselectedactivities', 'mod_randomactivity'),
'class': 'btn btn-primary',
'class': 'btn btn-primary mx-1',
click: function() {
$('.activity-to-add').each(function() {
if ($(this).find('input[type="checkbox"]').prop('checked')) {
......@@ -257,7 +257,7 @@ define(['jquery', 'jqueryui', 'core/url', 'mod_randomactivity/orderabletable'],
},
{
text: M.util.get_string('cancel', 'moodle'),
'class': 'btn btn-secondary',
'class': 'btn btn-secondary mx-1',
click: function() {
$(this).dialog('close');
}
......
......@@ -74,6 +74,7 @@ echo get_string( 'viewingradebook', RANDOMACTIVITY );
echo '</a>';
$table = new html_table();
$table->attributes['class'] = 'generaltable mt-3';
$table->head = array(
'#',
......
......@@ -48,7 +48,7 @@ echo $OUTPUT->header();
echo $OUTPUT->heading( $course->fullname . ' - ' . get_string( 'modulenameplural', RANDOMACTIVITY ) );
echo $OUTPUT->box_start();
echo '<div id="index-orderby-select">';
echo '<div class="d-flex align-items-center">';
$url = $PAGE->url;
$urls = array(
$url->out(true, array('groupbyseeding' => 0)),
......
......@@ -274,10 +274,10 @@ function randomactivity_create_activity_table_row($i, $cminfo, $cmassignees, $ed
if ($cminfo !== null) {
$cmid = $cminfo->id;
$actions = '<a href="' . $CFG->wwwroot . '/course/modedit.php?update=' . $cminfo->id . '">' .
randomactivity_print_icon( 'settings', get_string( 'editsettings' ), array( 'class' => 'action-button' ) ) .
randomactivity_print_icon( 'settings', get_string( 'editsettings' ), array( 'class' => 'text-dark mr-2' ) ) .
'</a>';
if ($editmode) {
$actions .= randomactivity_print_icon( 'move', get_string( 'move' ), array( 'class' => 'draghandle action-button' ) );
$actions .= randomactivity_print_icon( 'move', get_string( 'move' ), array( 'class' => 'draghandle text-dark clickable mr-2' ) );
}
$gradeitems = grade_get_grades($cminfo->course, 'mod', $cminfo->modname, $cminfo->instance)->items;
......@@ -297,7 +297,7 @@ function randomactivity_create_activity_table_row($i, $cminfo, $cmassignees, $ed
}
if ($editmode) {
$actions .= randomactivity_print_icon( 'remove', get_string( 'remove' ), array( 'class' => 'removebutton action-button' ) );
$actions .= randomactivity_print_icon( 'remove', get_string( 'remove' ), array( 'class' => 'removebutton text-dark clickable' ) );
}
$row = new html_table_row(array($i, randomactivity_activity_icon_and_name($cminfo), $cmassignees, $grade, $status, $actions));
......@@ -316,9 +316,14 @@ function randomactivity_get_calendar_event($modinstance) {
$event->description = get_string('duedatefor_desc', RANDOMACTIVITY);
$event->format = FORMAT_HTML;
$event->courseid = $modinstance->course;
$event->userid = 0;
$event->groupid = 0;
$event->modulename = 'randomactivity';
$event->instance = $modinstance->id;
$event->eventtype = 'duedate';
$event->type = CALENDAR_EVENT_TYPE_ACTION;
// TODO : mod_randomactivity_core_calendar_provide_event_action()
// see https://docs.moodle.org/dev/Calendar_API
$event->timestart = $modinstance->duedate;
return $event;
}
\ No newline at end of file
......@@ -7,86 +7,40 @@
z-index: 500;
}
.path-mod-randomactivity .action-button {
color: black;
cursor: pointer;
width: 1.2em;
text-align: center;
margin-right: .1em;
}
.path-mod-randomactivity .button-icon .icon {
margin-right: .25em;
}
.path-mod-randomactivity .btn + .btn {
margin-left: 6px;
}
.path-mod-randomactivity .btn + table {
margin-top: 1em;
}
.path-mod-randomactivity .activitytable .group-assignee {
cursor: default;
}
.path-mod-randomactivity .group-panel label {
display: none;
}
.path-mod-randomactivity #apply-assign-button {
background-color: red;
color: white;
}
.path-mod-randomactivity #apply-assign-button:disabled {
opacity: .50;
}
.path-mod-randomactivity #add-activities {
margin-bottom: 2em;
}
.path-mod-randomactivity #form-randomactivity-activities {
position: relative;
}
.path-mod-randomactivity #form-seed {
position: absolute;
right: 0;
top: 0;
}
.path-mod-randomactivity #seed-controls {
text-align: right;
}
.path-mod-randomactivity #form-seed .load-icon {
position: absolute;
top: .7em;
top: .5em;
right: 4em;
z-index: 100;
display: none;
}
.path-mod-randomactivity .popup-dialog {
background-color: white;
z-index: 1000;
box-shadow: 4px 3px 4px lightblue;
border: 1px solid gray;
padding: 1em;
min-width: max-content;
}
.path-mod-randomactivity .popup-dialog .btn {
margin: 0 .3em;
}
.path-mod-randomactivity .popup-dialog .ui-dialog-buttonpane {
text-align: right;
}
.path-mod-randomactivity .popup-dialog .ui-dialog-content {
padding: 1em 0;
}
.path-mod-randomactivity .popup-dialog .ui-dialog-titlebar-close {
display: none;
}
......@@ -106,51 +60,24 @@
display: none;
}
.path-mod-randomactivity #activities-choice input[type=checkbox] {
margin-right: .4em;
}
.path-mod-randomactivity #activities-choice {
max-width: 40vw;
}
.path-mod-randomactivity .activity-to-add {
display: flex;
align-items: baseline;
}
.path-mod-randomactivity .activity-to-add label {
overflow: hidden;
text-overflow: ellipsis;
}
.path-mod-randomactivity .activities-to-add-list {
border-top: 1px solid lightgray;
padding-top: 3px;
}
.path-mod-randomactivity .activities-to-add-list .section {
cursor: default;
}
.path-mod-randomactivity .activities-to-add-list .section .dropdown-icon i.icon {
.path-mod-randomactivity .activities-to-add-list .section .dropdown-icon .icon {
margin-right: 0;
}
.path-mod-randomactivity .activities-to-add-list .section.expanded .dropdown-icon.collapsed,
.path-mod-randomactivity .activities-to-add-list .section:not(.expanded) .dropdown-icon.expanded {
display: none;
}
.path-mod-randomactivity .activities-to-add-list .section:not(.expanded) .dropdown-icon.expanded,
.path-mod-randomactivity .activities-to-add-list .section:not(.expanded) .toggle-all {
display: none;
}
.path-mod-randomactivity .activity-selector-wrapper {
margin-bottom: .8em;
}
.path-mod-randomactivity .activity-type-selector,
.path-mod-randomactivity .activity-type-dropdown {
border: 1px solid lightgrey;
......@@ -161,11 +88,6 @@
margin-right: 6px;
}
.path-mod-randomactivity .activity-type-selector {
position: relative;
display: inline-block;
}
.path-mod-randomactivity .activity-type-selector.expanded,
.path-mod-randomactivity .activity-type-dropdown {
box-shadow: 1px 2px 2px gray;
......@@ -188,15 +110,9 @@
}
.path-mod-randomactivity .activity-type-selected {
vertical-align: middle;
display: inline-block;
height: 2.3em;
}
.path-mod-randomactivity .activity-type-selected span {
vertical-align: middle;
}
.path-mod-randomactivity .activity-type-selector i {
margin-right: 3px;
float: right;
......@@ -214,26 +130,17 @@
color: white;
}
.path-mod-randomactivity #form-activity-search {
position: relative;
display: inline-block;
}
.path-mod-randomactivity .search-icon,
.path-mod-randomactivity .search-remove {
color: lightgrey;
margin-left: -1.7em;
vertical-align: middle;
}
.path-mod-randomactivity .search-icon {
cursor: text;
}
.path-mod-randomactivity #activity-search.empty ~ .search-remove {
display: none;
}
.path-mod-randomactivity #activity-search.empty ~ .search-remove,
.path-mod-randomactivity #activity-search:not(.empty) ~ .search-icon {
display: none;
}
......@@ -242,20 +149,4 @@
.path-mod-randomactivity .activity-type-dropdown {
max-height: 40vh;
overflow-y: auto;
}
.path-mod-randomactivity .hidden-table {
display: none;
}
.path-mod-randomactivity .group-panel {
margin-bottom: 1em;
}
.path-mod-randomactivity .group-panel label {
display: none;
}
.path-mod-randomactivity #index-orderby-select .urlselect {
display: inline-block;
}
\ No newline at end of file
......@@ -43,20 +43,20 @@
"editmode": true
}
}}
<form id="form-randomactivity-activities" class="form-inline" method="post">
<form id="form-randomactivity-activities" class="form-inline float-right" method="post">
<input name="id" type="hidden" value="{{id}}">
<input name="sesskey" type="hidden" value="{{sesskey}}">
<input name="group" type="hidden" value="{{group}}">
<input name="activities" type="hidden" value="{{activities}}">
<div id="form-seed">
<div id="form-seed" class="position-relative">
{{# str}} seed, mod_randomactivity {{/ str}}{{{seedhelpbutton}}}
<input name="seed" class="form-control" type="text" size="15" value="{{seed}}" autocomplete="off" {{^ editmode}}disabled="disabled"{{/ editmode}}>
{{# editmode}}
<div id="seed-controls">
<span class="load-icon" style="display:none;">{{# pix}} loading, mod_randomactivity {{/ pix}}</span>
<div class="text-right">
<a id="seed-timestamp" href="#">{{# str}} seedtotimestamp, mod_randomactivity {{/ str}}</a>
<br>
<a id="seed-balance" href="#">{{# str}} seedtobalance, mod_randomactivity {{/ str}}</a>
<span class="load-icon" style="display:none;">{{# pix}} loading, mod_randomactivity {{/ pix}}</span>
</div>
{{/ editmode}}
</div>
......
......@@ -76,11 +76,11 @@
]
}
}}
<div id="activities-choice">
<div id="activities-choice" class="py-3">
<div>{{# str}} filters, mod_randomactivity {{/ str}}</div>
<div class="activity-selector-wrapper">
<div class="activity-type-selector collapsed">
<div class="activity-type-selected"><span></span></div>
<div class="mb-2 pb-1">
<div class="activity-type-selector d-inline-block collapsed">
<div class="activity-type-selected align-middle d-inline-block"><span class="align-middle"></span></div>
{{# pix}} dropdown, mod_randomactivity {{/ pix}}
</div>
<div class="activity-type-dropdown">
......@@ -91,13 +91,13 @@
</div>
{{/ moduletypes}}
</div>
<form id="form-activity-search" class="form-inline" action="javascript:void(0);">
<form class="form-inline d-inline-block" action="javascript:void(0);">
<input id="activity-search" class="form-control" type="text" autocomplete="off"/>
<span class="search-icon">{{# pix}} search, mod_randomactivity {{/ pix}}</span>
<span class="search-remove action-button">{{# pix}} remove, mod_randomactivity {{/ pix}}</span>
<span class="search-icon align-middle m-r-1">{{# pix}} search, mod_randomactivity {{/ pix}}</span>
<span class="search-remove clickable align-middle m-r-1">{{# pix}} remove, mod_randomactivity {{/ pix}}</span>
</form>
</div>
<div class="activities-to-add-list">
<div class="activities-to-add-list border-top pt-1">
{{# allsections}}
<div class="section expanded">
<div class="section-header">
......@@ -108,9 +108,9 @@
<span class="toggle-all" data-action="deselect">(<span class="btn-link">{{# str}} deselectall {{/ str}}</span>)</span>
</div>
{{# activities}}
<div class="activity-to-add" data-cmid="{{cmid}}" data-cmtype="{{modname}}">
<input type="checkbox" id="cm{{cmid}}"/>
<label for="cm{{cmid}}">{{{activity}}}</label>
<div class="activity-to-add d-flex align-items-baseline" data-cmid="{{cmid}}" data-cmtype="{{modname}}">
<input type="checkbox" id="cm{{cmid}}" class="mr-2"/>
<label for="cm{{cmid}}" class="text-truncate">{{{activity}}}</label>
{{{hiddentable}}}
</div>
{{/ activities}}
......
......@@ -38,22 +38,20 @@
}
}}
{{# editmode}}
<button id="add-activities" class="btn btn-secondary">
<span class="button-icon">{{# pix}} add, mod_randomactivity {{/ pix}}</span>
{{# str}} addactivities, mod_randomactivity {{/ str}}
<button id="add-activities" class="btn btn-secondary m-b-2">
{{# pix}} add, mod_randomactivity {{/ pix}}{{# str}} addactivities, mod_randomactivity {{/ str}}
</button>
<br>
<button id="apply-assign-button" class="btn">
<span class="button-icon">{{# pix}} reassign, mod_randomactivity {{/ pix}}</span>
{{# str}} applychangesreassign, mod_randomactivity {{/ str}}
</button>
<a id="cancel-button" class="btn btn-secondary" href="?id={{id}}{{# group}}&group={{group}}{{/ group}}">
<div>
<button id="apply-assign-button" class="btn text-white">
{{# pix}} reassign, mod_randomactivity {{/ pix}}{{# str}} applychangesreassign, mod_randomactivity {{/ str}}
</button>{{!
}}<a id="cancel-button" class="btn btn-secondary ml-2" href="?id={{id}}{{# group}}&group={{group}}{{/ group}}">
{{# str}} cancel {{/ str}}
</a>
</div>
{{/ editmode}}
{{# allowedit}}
<a class="btn btn-secondary" href="?id={{id}}&edit=1{{# group}}&group={{group}}{{/ group}}">
{{# pix}} edit, mod_randomactivity {{/ pix}}
{{# str}} edit {{/ str}}
{{# pix}} edit, mod_randomactivity {{/ pix}}{{# str}} edit {{/ str}}
</a>
{{/ allowedit}}
\ No newline at end of file
......@@ -23,7 +23,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021072200;
$plugin->version = 2022021800;
$plugin->requires = 2018112800;
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '1.4.2';
......
......@@ -124,7 +124,7 @@ if ($cminfo->effectivegroupmode != NOGROUPS) {
}
}
echo html_writer::nonempty_tag('div', $grouppanel, array('class' => 'group-panel'));
echo html_writer::nonempty_tag('div', $grouppanel, array('class' => 'group-panel m-b-1'));
// Main activity pool table.
$table = new html_table();
......@@ -134,7 +134,7 @@ $table->attributes['class'] = 'generaltable activitytable';
$titleassignees = get_string('assignees', RANDOMACTIVITY);
if ($editmode) {
$titleassignees .= randomactivity_print_icon( 'refresh', get_string('refresh_help', RANDOMACTIVITY),
array( 'class' => 'refresh-assignees action-button' ) );
array( 'class' => 'refresh-assignees clickable ml-1' ) );
}
$table->head = array(
......@@ -227,7 +227,7 @@ if ($editmode) {
$activity->activity = randomactivity_activity_icon_and_name($cminfo, false);
// Add a hidden table containing only one row. This row will be copied to the main table if the activity is added.
$hiddentable = new html_table();
$hiddentable->attributes['class'] = 'hidden-table activitytable';
$hiddentable->attributes['class'] = 'activitytable d-none';
$hiddentable->data = array( randomactivity_create_activity_table_row(0, $cminfo, get_string('none'), $editmode) );
$activity->hiddentable = html_writer::table( $hiddentable );
$section->activities[] = $activity;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment