This file contains hidden or 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
| (defun touch-file (my-file) | |
| (interactive (list (read-string "File to create:" default-directory))) | |
| (shell-command (format "touch %s" my-file)) | |
| (if (eq major-mode 'dired-mode) (revert-buffer))) | |
| (add-hook 'dired-mode-hook | |
| '(lambda () | |
| (define-key dired-mode-map | |
| "]" 'touch-file))) |
This file contains hidden or 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
| @Dialogs.module "EventsApp", (EventsApp, App, Backbone, Marionette, $, _) -> | |
| @startWithParent = false | |
| API = | |
| list: -> | |
| EventsApp.List.Controller.list() | |
| edit: (event) -> | |
| EventsApp.Edit.Controller.edit() | |
| App.vent.on "edit:event:clicked", (event) -> |
This file contains hidden or 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
| List.Controller = | |
| list: -> | |
| listView = @getListView events | |
| listView.on "itemview:edit:event:clicked", (args) -> | |
| console.log "edit:event:clicked", args | |
This file contains hidden or 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 List.Event extends Marionette.ItemView | |
| template: "events/list/templates/_event" | |
| tagName: "tr" | |
| events: | |
| "click button" : -> @trigger "edit:event:clicked", @model | |
This file contains hidden or 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
| List.Controller = | |
| listUsers: -> | |
| fetching_users = App.request "user:entities" | |
| @layout = @getLayoutView() | |
| @layout.on 'show', => | |
| @showLoading() | |
| fetching_users.done (users) => | |
| @showPanel users | |
| @showUsers users |
This file contains hidden or 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
| listUsers: -> | |
| fetching_users = App.request "user:entities" | |
| @layout = @getLayoutView() | |
| App.mainRegion.show @layout | |
| @layout.on 'show', -> | |
| @showLoading() | |
| fetching_users.done (users) => | |
| @showPanel users |
This file contains hidden or 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
| listUsers: -> | |
| fetching_users = App.request "user:entities" | |
| @layout = @getLayoutView() | |
| App.mainRegion.show @layout | |
| @showLoading() | |
| fetching_users.done (users) => | |
| @showPanel users | |
| @showUsers users |
This file contains hidden or 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
| listUsers: -> | |
| fetching_users = App.request "user:entities" | |
| @layout = @getLayoutView() | |
| App.mainRegion.show @layout | |
| @showLoading() | |
| fetching_users.done (users) => | |
| @showPanel users | |
| @showUsers users |
This file contains hidden or 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 Entities.UsersCollection extends Entities.Collection | |
| model: Entities.User | |
| url: Routes.users_path() | |
| API = | |
| setCurrentUser: (currentUser) -> | |
| new Entities.User currentUser | |
| getUserEntities: -> |
This file contains hidden or 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 List.Panel extends App.Views.ItemView | |
| template: "users/list/templates/_panel" | |
| collectionEvents: | |
| "reset" : "render" |