nurpax / hswtrack Goto Github PK
View Code? Open in Web Editor NEWweb scale in haskell
web scale in haskell
Chin-ups are bodyweight. When adding a new exercise for "chin-ups", this information should be recorded so that when add chin-up sets, the UI would know that the weight part of the input form is not mandatory and it could default to zero or null.
D3 is too big for what we need.
This looks good: http://www.chartjs.org/docs/#line-chart-introduction
Steps to repro:
The exercise type selector at the bottom should reset to unselected after adding a set.
Allow for /workout/:id URLs that takes one to a (possibly?) read-only copy of a workout.
self.router.route("/workout/:id", function(id) { ws.render(id); });
self.router.route("/workout", function(id) { ws.render(null); });
This seemed router https://github.com/browserstate/history.js seemed to work fine.
Instructions on http://snapframework.com/faq#how-do-i-run-my-app-in-development-mode work fine for Snap's default project template, but not for hswtrack. Figure out why.
One difference I spot is that in snap's default template main-is is defined as
Executable snaptest
hs-source-dirs: src
main-is: Main.hs
in hswtrack main-is is "Site/Main.hs". It's the Main module that cannot be found when reloading.
Currently the routes are defined such that if you do e.g.
GET /rest/note
(currently unknown entry point), the server will return static HTML (e.g. default to serveDirectory or similar). It'd be better if this case would just return an error.
/rest/note
/rest/notes
should be just one entry point where
GET /rest/note
will return a list of notes.
Currently GET /rest/note serves static HTML.
Need to review all of the entry points for the same principle.
I added snap-extras back into deps recently, but I think this was a mistake. It pulls in a whole bunch of libraries that I don't need just so that I can use getJSON and writeJSON.
Add a button that can be used to mark a specific workout public.
When a post is marked public, it should be viewable without a login.
The UI needs to be slightly different for non-logged in users - e.g. the button for marking the post public should only be enabled for logged in user that owns the post.
E.g., if you type in 92.2 for today's weight, you should see 92.2 in the UI, not 92.19999..
See
+-- TODO need to check for dupes by lower case name here, and return
+-- error if already exists
+restNewExerciseType :: H ()
+restNewExerciseType = jsonResponse put
+ where
+ put _user = do
+ name <- getTextParam "name"
+ lift $ withDb $ \conn -> do
+ Model.addExercise conn name
+ Model.queryExercises conn
+
https://github.com/nurpax/hswtrack/blob/master/src/Model/Db.hs#L268
use foldl' or foldr.
also add tests for the insertion order trick.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.