heikkilevanto / beertracker

Simple script to track the beers I drink
GNU General Public License v2.0
2 stars 1 forks source link

Ratings and comments #277

Closed heikkilevanto closed 7 months ago

heikkilevanto commented 8 months ago

After entering or copying a beer, the input form gets filled with all the values. That is nominally for making it easier to enter a new beer. But it would be cool if it could also be used for adding a rating and a comment for the just entered beer.

Here is one way to do it: Keep track o f the state of the input form. When ever fields are cleared, mark the form as working as a new entry.

When changing the rating, check if we are working on a new entry, and don't do anything special. But if not, submit the form to a back-end routine that takes the time stamp (which will have to be added to the form), and adds the comment and rating to that record.

heikkilevanto commented 8 months ago

Maybe the magic of the rating pulldown is too messy. Perhaps it would be better to add a new button "Rate" that did the same thing.

heikkilevanto commented 8 months ago

Even better: Make the whole form either edit (the latest) record, or copy a new one, depending which button is pressed.

At the same time, clean up the date and time edit fields.

Add leading spaces to date, and time. If the space is still there when submitting a new record, consider them to be empty, and fill in current values. But if editing, just remove the leading space.