4 'libs/text!./template.html'], function($, _, template) {
8 return function(sandbox) {
12 var config = sandbox.getConfig(),
13 userName = config.user && config.user.name,
14 view = $(_.template(template)({
15 userName: userName || gettext('anonymous')
18 view.find('[data-cmd]').click(function(e) {
20 sandbox.publish('cmd.' + $(e.target).attr('data-cmd'));
24 start: function() { sandbox.publish('ready'); },
25 getView: function() {return view;},
26 setCommandEnabled: function(cmd, enabled) {
27 view.find('[data-cmd='+cmd+']').toggleClass('disabled', !enabled);
29 setVersion: function(version) {
30 view.find('.version').text(version);