Start refactoring for client-side routing.

Review Request #7468 — Created June 30, 2015 and discarded

david
student-sonar
master
student-sonar
Instead of creating different views that overlap a lot, I'm going to be adding
all the new features (status reports, etc.) as additional layers in a
single-page app sort of design. As part of this, we'll need some client-side
routing.

Rather than pull in all of backbone just for the router, I've implemented my
own. This maps regexes to URLs (passing any matched entities into the callback
as arguments), and manages the history stack in the browser.

This change also makes it so individual student views are located at
/student/XX instead of /?student=XX

Along with this, I've fixed up the component implementations to not shadow the
built in `setAttribute` method. The prior implementation was correctly plumbing
through into the javascript implementation but didn't make it possible to pull
the attribute out after the fact (which is needed with the new routing code).

Navigated around and checked that everything still worked correctly.

reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        lib/frontend/x-student-view.js
        views/student-list.handlebars
        views/layouts/main.handlebars
        lib/frontend/main.js
        lib/frontend/x-student-card.js
        lib/frontend/router.js
        lib/routes.js
        lib/frontend/x-event-day.js
        lib/frontend/x-summary-entry.js
    
    
    
    Tool: Pyflakes
    Ignored Files:
        lib/frontend/x-student-view.js
        views/student-list.handlebars
        views/layouts/main.handlebars
        lib/frontend/main.js
        lib/frontend/x-student-card.js
        lib/frontend/router.js
        lib/routes.js
        lib/frontend/x-event-day.js
        lib/frontend/x-summary-entry.js
    
    
  2. 
      
david
Review request changed

Status: Discarded

Loading...