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
| // Just a small addition to show method | |
| AppRouter = Backbone.Router.extend({ | |
| // ... | |
| show: function(id) { | |
| // Seem to have to reconstruct HomeView to allow "deep-linking" | |
| new HomeView(); | |
| this.toggleStyles(id); | |
| project = projectList.get(id); |
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
| <script id="project-show" type="text/template"> | |
| <h2><%= title %></h2> | |
| <p><strong>For discipline</strong>: <%= discipline %></p> | |
| <%= description %> | |
| <p> | |
| <strong>Supervisor</strong>: | |
| <%= supervisor.name %> | |
| (<%= supervisor.email %>),<br> | |
| <%= supervisor.centre.name %> | |
| ( <%= supervisor.centre.code %> ). |
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
| <!-- simplified item-home termplate --> | |
| <script id="item-home" type="text/template"> | |
| <!-- Example row of columns --> | |
| <div class="row-fluid"> | |
| <div class="span4"> | |
| <form id="selection" action="" method="post"> | |
| <h2>List of Projects</h2> | |
| <ul id="p-list"> | |
| <li>Loading projects...</li> | |
| </ul> |
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
| <!DOCTYPE html> | |
| <html class="no-js"> | |
| <body> | |
| : | |
| <!-- Note "Hero Unit" has been deleted --> | |
| <div class="container"> | |
| <div id="app"> | |
| <!-- content of item-home template was here --> | |
| </div> |
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
| <!DOCTYPE html> | |
| <html class="no-js"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| <title>Project Selctr - EG-259 Web Applictions Technology (2012-2013)</title> | |
| <meta name="description" content=""> | |
| <meta name="viewport" content="width=device-width"> | |
| <link rel="stylesheet" href="css/bootstrap.min.css"> |
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 AppName.Views.ProjectsIndex extends Backbone.View | |
| template: JST['projects/index'] |
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 Pselectr.Collections.Projects extends Backbone.Collection | |
| model: Pselectr.Models.Project |
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 Pselectr.Models.Project extends Backbone.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
| class AppName.Routers.Projects extends Backbone.Router | |
| routes: | |
| '': 'index' | |
| index: -> | |
| alert "home page" |
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
| (function() { | |
| window.AppName = { | |
| Models: {}, | |
| Collections: {}, | |
| Views: {}, | |
| Routers: {}, | |
| init: function() { | |
| new AppName.Routers.Projects; | |
| return Backbone.history.start(); | |
| } |