-
-
Save rashfael/4546281 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = class ReportController extends Controller | |
historyURL: 'reports' | |
index: -> | |
collection = new Reports() | |
collection.fetch() | |
@view = new ReportListView | |
collection: collection | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a(href='/reports/add') Neuer Report | |
table.table | |
thead | |
tr | |
th # | |
th Name | |
th Erstellt | |
th PDF | |
th Actions | |
tbody#list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
td= number | |
td: a(href='/reports/'+_id)= name | |
td= createdAt | |
td: a(href='/reports/'+_id+'/report.pdf') PDF | |
td: i.remove.icon-remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ReportListItemView extends View | |
tagName: 'tr' | |
template: require 'views/templates/report_list_item' | |
events: | |
'click .remove': 'remove' | |
remove: (event) => | |
@model.destroy() | |
module.exports.ReportListView = class ReportListView extends CollectionView | |
container: '#page-container' | |
autoRender: yes | |
template: require 'views/templates/report_list' | |
className: 'report-list' | |
listSelector: '#list' | |
itemView: ReportListItemView |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment