Skip to content

Commit

Permalink
add link to 'Edit treatment Profile' if any related plugins are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncalabrese committed Aug 15, 2015
1 parent 86a275b commit a54e1bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/client/browser-settings.js
Expand Up @@ -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
Expand All @@ -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 ( ) {
Expand Down
1 change: 1 addition & 0 deletions static/index.html
Expand Up @@ -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">
Expand Down

0 comments on commit a54e1bd

Please sign in to comment.