mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
add link to 'Edit treatment Profile' if any related plugins are enabled
This commit is contained in:
@@ -56,6 +56,7 @@ function init (client, plugins, serverSettings, $) {
|
||||
}
|
||||
|
||||
var showPluginsSettings = $('#show-plugins');
|
||||
var hasPluginsToShow = false;
|
||||
plugins.eachEnabledPlugin(function each(plugin) {
|
||||
if (plugins.specialPlugins.indexOf(plugin.name) > -1) {
|
||||
//ignore these, they are always on for now
|
||||
@@ -64,9 +65,14 @@ function init (client, plugins, serverSettings, $) {
|
||||
var dd = $('<dd><input type="checkbox" id="' + id + '" value="' + plugin.name + '"/><label for="' + id + '">' + translate(plugin.label || plugin.name) + '</label></dd>');
|
||||
showPluginsSettings.append(dd);
|
||||
dd.find('input').prop('checked', settings.showPlugins.indexOf(plugin.name) > -1);
|
||||
hasPluginsToShow = true;
|
||||
}
|
||||
});
|
||||
|
||||
showPluginsSettings.toggle(hasPluginsToShow);
|
||||
|
||||
$('#editprofilelink').toggle(settings.isEnabled(['iob', 'cob', 'bwp', 'basal']));
|
||||
|
||||
}
|
||||
|
||||
function wireForm ( ) {
|
||||
|
||||
@@ -135,6 +135,7 @@
|
||||
<dl id="show-plugins" class="toggle">
|
||||
<dt class="translate">Show Plugins</dt>
|
||||
</dl>
|
||||
<a id="editprofilelink" href="/profile/index.html" target="profileeditor" class="translate">Edit treatment Profile</a>
|
||||
</fieldset>
|
||||
|
||||
<div class="actions">
|
||||
|
||||
Reference in New Issue
Block a user