Skip to content

Commit

Permalink
Added instance and templates instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
prasanna-lmsace committed Sep 20, 2023
1 parent 6a60483 commit d27ca04
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 17 deletions.
19 changes: 9 additions & 10 deletions classes/automation/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,14 @@ public static function get_templates_tablehelps() {

$actions = \mod_pulse\plugininfo\pulseaction::instance()->get_plugins_base();
array_walk($actions, function(&$value) {
$result['badge'] = \html_writer::tag('span', get_string('formtab', 'pulseaction_'.$value->get_component()), ['class' => 'badge badge-primary']);
$result['icon'] = \html_writer::span($value->get_action_icon(), 'action', ['class' => 'action-icon']);
$result['badge'] = \html_writer::tag('span', get_string('formtab', 'pulseaction_'.$value->get_component()), ['class' => 'badge badge-primary pulseaction_notification']);
$result['icon'] = \html_writer::span($value->get_action_icon(), 'action', ['class' => 'action-icon pulseaction_notification']);
$value = $result;
});

$templatehelp = [
'help1' => implode(',', array_column($actions, 'icon')),
'help2' => '<b> Welcom message </b>',
'help2' => '<b> Welcome message </b>',
'help3' => implode(',', array_column($actions, 'badge')),
'help4' => '<h5 class="template-reference">WELCOME_MESSAGE</h5>',
'help5' => $OUTPUT->pix_icon('t/edit', \get_string('edit')),
Expand Down Expand Up @@ -267,28 +267,27 @@ public static function get_instance_tablehelps() {
$actions = \mod_pulse\plugininfo\pulseaction::instance()->get_plugins_base();
array_walk($actions, function(&$value) {
$result['badge'] = \html_writer::tag('span', get_string('formtab', 'pulseaction_'.$value->get_component()), ['class' => 'badge badge-primary']);
$result['icon'] = \html_writer::span($value->get_action_icon(), 'action', ['class' => 'action-icon']);
$result['icon'] = \html_writer::span($value->get_action_icon(), 'action', ['class' => 'action-icon pulseaction_notification']);
$value = $result;
});

$templatehelp = [
'help1' => implode(',', array_column($actions, 'icon')),
'help2' => '<b> Welcom message </b>',
'help2' => '<b> Welcome message </b>',
'help3' => implode(',', array_column($actions, 'badge')),
'help4' => '<h5 class="template-reference">WELCOME_MESSAGE</h5>',
'help5' => $OUTPUT->pix_icon('t/edit', \get_string('edit')),
'help6' => $OUTPUT->pix_icon('t/hide', \get_string('hide')),
'help7' => \html_writer::tag('div', '<input type="checkbox" class="custom-control-input" checked>
<span class="custom-control-label"></span>', ['class' => "custom-control custom-switch"]),
'help8' => \html_writer::tag('label', "33 (1)", ['class' => 'overrides badge badge-secondary pl-10']),
'help6' => $OUTPUT->pix_icon('t/copy', \get_string('copy')),
'help7' => $OUTPUT->pix_icon('i/calendar', \get_string('copy')),
'help8' => $OUTPUT->pix_icon('t/hide', \get_string('hide')),
];

$table = new \html_table();
$table->id = 'plugins-control-panel';
$table->head = array('', '');

foreach ($templatehelp as $help => $result) {
$row = new \html_table_row(array($result, get_string('automationtemplate_'.$help, 'pulse')));
$row = new \html_table_row(array($result, get_string('automationinstance_'.$help, 'pulse')));
$table->data[] = $row;
}

Expand Down
12 changes: 11 additions & 1 deletion lang/en/pulse.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,20 @@
// ...Automation templates table instruction help texts.
$string['instruction'] = 'Instructions';
$string['automationtemplate_help1'] = 'The icon represents the enabled action(s) in the automation (template). the following actions are available: "Notification", "Assignment". "Membership", "Skills",';
$string['automationtemplate_help2'] = 'The title of the automation template. this should be a generic explanation about what the template is for. it can be changed inline by clicking on the pencil icon.';
$string['automationtemplate_help2'] = 'The title of the automation <b>template</b>. This should be a generic explanation about what the template is for. It can be changed inline by clicking on the pencil icon.';
$string['automationtemplate_help3'] = 'The pills provide additional improtant information about the automation template. In this case, it explains that it\'s a notification.';
$string['automationtemplate_help4'] = 'This is the reference of the template, and is providing a unique identifier for the template. it will be part of the unique identifier of the automation instance.';
$string['automationtemplate_help5'] = 'Click on this icon to edit the template.';
$string['automationtemplate_help6'] = 'Click on this icon to toggle the visibility of a template. A template which is not visible is hidden in courses. Existing automation instances will still be available, but new ones cannot be added anymore.';
$string['automationtemplate_help7'] = 'Use this toggle to turn on or off a template. A template which is turned off also disabled all automation instances, unless they are locally enabled using an override';
$string['automationtemplate_help8'] = 'How manu automation instances are using template. The number is brackets indicates the numder of disabled instances.';

// ...Automation instance table instruction help texts.
$string['automationinstance_help1'] = 'The icon represents the enabled action(s) in the automation (template). the following actions are available: "Notification", "Assignment". "Membership", "Skills",';
$string['automationinstance_help2'] = 'The title of the automation <b>instance</b>. This should be a generic explanation about what the template is for. It can be changed inline by clicking on the pencil icon.';
$string['automationinstance_help3'] = 'The pills provide additional improtant information about the automation instance. In this case, it explains that it\'s a notification.';
$string['automationinstance_help4'] = 'This is the reference of the instance, and acts as a unique identifier. It is (Usually) a combination of the template\'s reference combined with the course.';
$string['automationinstance_help5'] = 'Click on this icon to edit the automation.';
$string['automationinstance_help6'] = 'Duplicate the automation';
$string['automationinstance_help7'] = 'Open the automation queue (in the report builder), which provides information about all the automations that ran.';
$string['automationinstance_help8'] = 'Use this toggle to turn on or off the automation instance locally. This will override the status of the template, i.e. even if the template is turned off, it can be enabled.';
27 changes: 21 additions & 6 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,22 @@
border-bottom-left-radius: 5px;
}
.mod-pulse-automation-table table.generaltable tbody td:last-child {
text-align: right;
border-right: 1px solid #eee;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
.mod-pulse-automation-table table.generaltable tbody td .action-icon i {
width: 40px;
height: 40px;
font-size: 18px;
line-height: 30px;
line-height: 40px;
border-radius: 50%;
color: #fff;
}
.mod-pulse-automation-table table.generaltable tbody td .action-icon.pulseaction_notification i,
.mod-pulse-automation-table .badge.pulseaction_notification {
background-color: #7b61ff;
}
.mod-pulse-automation-table table.generaltable tbody td span.inplaceeditable {
font-size: 16px;
Expand Down Expand Up @@ -294,12 +303,18 @@ form.mform .tab-content .tab-pane .form-group .form-inline .custom-switch .check
vertical-align: middle;
}

/* Automation template table filter form */
div#pulse-automation-filterform {
position: absolute;
/* width: 100%; */
z-index: 1;
.path-admin-mod-pulse-automation-templates .box.generalbox {
position: relative;
}
.path-admin-mod-pulse-automation-templates .box.generalbox .filter-form-container {
float: right;
}
.path-admin-mod-pulse-automation-templates .box.generalbox .filter-form-container #pulse-automation-filterform {
background-color: #fff;
border: 1px solid #ccc;
box-shadow: 0px 0 0px 0.1px;
position: absolute;
top: 80%;
right: 0;
z-index: 2;
}

0 comments on commit d27ca04

Please sign in to comment.