A video of this class is (or will be) posted at: http://echo360.uml.edu/heines2016/comp4620-201.html
In response to a student request, I have now posted due dates on all the project-related assignments for this semester
In response to another student request, I have posted a proposal written by me
Related reading for this class: GetMEAN: Chap. 4
I must say that I am very pleased to see people discussing project management software on Piazza
This is *not* an area that I know much about, so it is wonderful to see fellow students sharing their experiences
Review of Assignment No. 2 write-up
“In chapter 3 you should have had an Express application running, set up in an MVC way, with Bootstrap included to help with building page layouts. Our next step is to build on this base, creating a static site that you can click through. This is a critical step in putting together any site or application. Even if you’ve been given a design or some wireframes to work from, there’s no substitute for rapidly creating a realistic prototype that you can use in the browser. Something always comes to light in terms of layout or usability that hadn’t been noticed before.” (p. 80)
Why else is it useful to have “a realistic prototype that you can use in the browser”?
The goal of this chapter is to “have intelligent views that can display data passed to them, and controllers passing hard-coded data to the views.” (p. 81)
What is a route?
Holmes’s “collections” of pages (p. 82)
File relationships (p. 83)
“The application includes the routes file, which in turn includes multiple controller files, each named according to the relevant collection.” (p. 83)
What’s where
Loc8r
└──app_server
├──controllers
│ locations.js
│ main.js
│ others.js
├──routes
│ index.js
│ users.js
└──views
error.jade
generic-text.jade
index.jade
layout.jade
location-info.jade
location-review-form.jade
locations-list.jade
The loc8r/app.js file
require statementsapp itself is an express object (line 121)
“A closure is an inner function that has access to the outer (enclosing) function’s variables—scope chain. The closure has three scope chains: it has access to its own scope (variables defined between its curly brackets), it has access to the outer function's variables, and it has access to the global variables.”
source: http://javascriptissexy.com/understand-javascript-closures-with-ease
module.exports statement at the very bottom of the fileThe loc8r/app_server/routes/index.js file
.js extension is optional (lines 216-217)router.get statements (lines 239-243)module.exports statement at the very bottom of the file (line 246)The loc8r/app_server/controllers/main.js file
The loc8r/app_server/controllers/others.js file (p. 85)
title property from 'Express' to 'About''index' to 'generic-text' was done later, after creating the generic-text.jade file)The loc8r/app_server/controllers/locations.js file (pp. 85-86)
This should now work if you enter the following URLs
This specification indicates that “the element it’s applied to will take up 6 columns on screens of size
smand larger.”
“The
col-xs-12class tells the layout to use 12 columns on extra-small devices, and thecol-sm-6class tells the layout to use 6 columns for small devices and above.” (p. 89)
“This framework for a layout is pretty simple, but it suits our needs. It will give a consistent look and feel, while allowing for all types of content layouts to go in the middle.” (p. 90)
“Creating the framework in a layout file means that you only have to do it once, and only have to maintain it in one place.” (p. 90)
The initial loc8r/app_server/views/layout.jade file (p. 90)
Adding a navigation section above teh content block and a footer below it (pp. 90-92)
div with a class of container causes the content to be “centered in the window, and constrained to sensible maximum widths on large displays.” (p. 91)container div with the content block(1) Create a new view file: loc8r/app_server/views/locations-list.jade
(2) Modify the controller for the homepage in loc8r/app_server/controllers/locations.js to use this view (p. 94)
module.exports.homelist = function(req, res){
res.render('locations-list', { title: 'Home' });
};
(3) Code the 3 main areas of the page (p. 95) — file loc8r/app_server/views/locations-list.jade