This repository has been archived by the owner on May 6, 2019. It is now read-only.
Use Handlebars for client side rendering #19
+10,126
−1,684
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ok, this PR looks massive because the js files have had their APIs changed and whitespace is freaking out.
Description
There's no need for us to be doing server side rendering when the modal to choose from different sources is just going to mess with that anyway. Why not use the code that rerenders the client on startup because we have all the data available as well?
Changes
I'm simply using Handlebars and Handlebar templates/helpers here as the renderer. I felt there was the option of bringing in some sort of framework but it was overkill. To do this I've removed the relevant
erb
files and added in new ones that only contain the appropriate templates.The API of the other script files hava changed, just to make their process repeatable (and testable if I had tests here).