add link to 'Edit treatment Profile' if any related plugins are enabled

This commit is contained in:
Jason Calabrese
2015-08-15 14:07:13 -07:00
parent 86a275b522
commit a54e1bd47a
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -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 ( ) {
+1
View File
@@ -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">