jamesmaniscalco / gearstack

Gearstack - track your gear.
0 stars 0 forks source link

Format weights depending on preferred unit #19

Open jamesmaniscalco opened 11 years ago

jamesmaniscalco commented 11 years ago

And remember the unit.

Store in grams in the db. Filter in the template. Store the variable for unit on User. Convert to grams when saving.

jamesmaniscalco commented 11 years ago

ACTUALLY:

This shouldn't be a setting that's adjustable in Angular. It's doable, but a bit out of the scope (heheh).

Instead, there should be a user settings page. There we can keep things like the weight unit, weight precision, etc.

jamesmaniscalco commented 11 years ago

Two sub-issues:

Angular - gear item being edited should be transformed to the correct unit when it goes into the edit form. Then, on save, it should get transformed into grams for the model (though it will then get passed through the filter in the view) before saving to the server.

Rails - User settings controller. There's probably some Devise thing. Make a standard rails form for updating the custom settings. Maybe this can be angularized later, but it's not critical.

jamesmaniscalco commented 11 years ago

Oh, and precision needs to get added as a dynamic property. After the rails part, keep it fixed at 2 for now.

jamesmaniscalco commented 11 years ago

I think the first bit is done.

jamesmaniscalco commented 11 years ago

Did the second part with Angular anyway - made a second page with a new controller and new template.

jamesmaniscalco commented 11 years ago

Needs error handling!