<span class="text-danger">{{status}}</span>
{{/notEq}}
- <a class="js-lang link-no-underline" data-lang="{{lang}}">{{langName}}</a>
+ <span class="note">{{langName}}</span>
{{#notEmpty tags}}
<i class="icon-tags"></i>
- {{#each tags}}
- <a class="js-tag link-no-underline" data-tag="{{this}}">{{this}}</a>
- {{/each}}
+ <span class="note">{{join tags ', '}}</span>
{{/notEmpty}}
</div>
</td>
'templates/coding-rules'
], function (WorkspaceListView, WorkspaceListItemView, WorkspaceListEmptyView) {
- var $ = jQuery;
-
return WorkspaceListView.extend({
template: Templates['coding-rules-workspace-list'],
itemView: WorkspaceListItemView,
itemViewContainer: '.js-list',
emptyView: WorkspaceListEmptyView,
- events: function () {
- return {
- 'click .js-tag': 'onTagClick',
- 'click .js-lang': 'onLangClick'
- };
- },
-
bindShortcuts: function () {
WorkspaceListView.prototype.bindShortcuts.apply(this, arguments);
var that = this;
that.options.app.controller.showDetailsForSelected();
return false;
});
- },
-
- onTagClick: function (e) {
- var tag = $(e.currentTarget).data('tag');
- this.selectTag(tag);
- },
-
- onLangClick: function (e) {
- var lang = $(e.currentTarget).data('lang');
- this.selectLang(lang);
- },
-
- selectTag: function (tag) {
- this.options.app.state.setQuery({ tags: tag });
- },
-
- selectLang: function (lang) {
- this.options.app.state.setQuery({ languages: lang });
}
});