return function(sandbox) {
- var view = $(_.template(template)());
+ /* globals gettext*/
+
+ var config = sandbox.getConfig(),
+ userName = config.user && config.user.name,
+ view = $(_.template(template)({
+ userName: userName || gettext('anonymous')
+ }));
+
view.find('[data-cmd]').click(function(e) {
e.preventDefault();
sandbox.publish('cmd.' + $(e.target).attr('data-cmd'));
<ul>
<li>wersja: <span class="version"></span></li>
<li><a href="#" data-cmd="drop-draft"><%= gettext('drop a working draft') %></a></li>
+ <li><%= userName %></li>
<li><button class="btn btn-mini btn-info" data-cmd="save"><%= gettext('Save') %></button></li>
<li><a class="btn btn-mini btn-danger" href="/"><%= gettext('Exit') %></a></li>
</ul>