Commit Graph

124 Commits

Author SHA1 Message Date
Benjamin Häublein 1dca1cc050
Add option for hiding empty dashboard cards (#213)
* add option for hiding empty dashboard cards

* rework add option for hiding empty dashboard cards

missed statistics.html

* don't exit early in cards

* add forms test for dashboard_hide_empty

* add tests for cards

* fix early exit in card_diaperchange_latest

* change dependency of migration

* rename migration

* introduce hiding of cards in templates

* linting

* add context to test_card_diaperchange_last

* setup MockUserRequest

* add context to all cards test cases

* add test for settings_dashboard_hide_empty_on

* change dashboard_hide_test, but it doesn't work

* add test for _user_wants_hide

* fix test_user_wants_hide user object, simpliy check for data['empty']

* add test for user_wants_hide to every card

* linting

* fix trailing whitespace

* rename user_wants_hide to hide_empty

* fix hidden statistics

* add user.refresh_from_db to test case, add test case for dashboard_refresh_rate

* Follow redirect and correct assertion

Co-authored-by: jcgoette <jcgoette@gmail.com>
Co-authored-by: Benjamin Häublein <benjaminh@debian.vm.hp>
Co-authored-by: Christopher C. Wells <git@chris-wells.net>
2021-05-13 20:28:39 -07:00
Beni Cherniavsky-Paskin 29ef9f4f75 child slugs: allow unicode
This results in %-encoded URLs, but modern browsers display the unicode
chars (e.g. https://babybuddy.../children/мааян-паскин-чернявский).
2021-04-30 14:47:08 -07:00
Jean-Frederic Berthelot f29515a04d Add a "Today's Feeding" card
It is useful to know today's cumulated Feeding amount.

Right now, this can be inferred from the "Feeding Amount" report,
but is not made readily available in the dashboard, where the
Feeding-related cards are the last Feeding and its method.

This adds a new card `Today's Feeding`, heavily based on "Today's Sleep".
2020-07-21 00:48:07 +02:00
Christopher C. Wells a09ceadc40 Ensure naps are captured for both start and end time 2020-06-09 07:02:28 -07:00
Peter Hardy 120cbf35b6 Ensure date passed to filter is localtime. 2020-05-18 23:07:11 +10:00
Christopher C. Wells 4915f809e6 Update tests for feeding frequency changes (#135) 2020-03-17 05:03:09 -07:00
Benjamin Häublein aeba14f714 linting 2020-03-16 18:53:36 +01:00
Benjamin Häublein 853ab54b8c add enhanced feedings statistics 2020-03-15 17:18:21 +01:00
Christopher C. Wells d0b33c2b1b Use user first and last name, when available, in UI 2020-02-18 14:41:33 -08:00
Christopher C. Wells 0b437ae5cf Offset horizontal padding in cards with a carousel 2020-02-16 13:38:20 -08:00
Christopher C. Wells 8dd2aa9b3a Custom last feeding method text size 2020-02-16 13:38:20 -08:00
Christopher C. Wells 18b61581b7 Do not render carousel controls for single item 2020-02-16 13:38:20 -08:00
Christopher C. Wells 4d34a48652 Standardize card language for "no data" 2020-02-16 13:38:20 -08:00
Christopher C. Wells cb1712377b Include past three methods is Last Feeding Method card (#117) 2020-02-16 13:38:20 -08:00
Christopher C. Wells a0ec0591e4 Remove timezone overrides from tests
Tests will now use the timezone from a Settings model instance.
2020-02-14 10:56:13 -08:00
Christopher C. Wells bcfa352b9b Ensure naps card uses minimum date _without_ a time value 2020-02-14 10:56:13 -08:00
Christopher C. Wells c0db24555a Do not enforce two columns in dashboard 2020-02-04 11:00:24 -08:00
Christopher C. Wells 1b536ff6ed Update tests for timers list template tag 2020-01-31 09:09:01 -08:00
Christopher C. Wells eb9e2f3927 Display per-child timer lists on dashboard card 2020-01-31 09:09:01 -08:00
Christopher C. Wells c80ec252bc Add optional Child to Timer model 2020-01-31 09:09:01 -08:00
Christopher C. Wells 3a7c8c92fd Add a Diaper Change amounts report 2020-01-26 14:12:27 -08:00
Christopher C. Wells 746526d4ed Add "trimmed" key to `blocktrans` tags and update formatting 2020-01-23 20:00:32 -08:00
Christopher C. Wells b3fd5378d6 Fix missing user name in Timer info string 2020-01-23 19:20:55 -08:00
Christopher C. Wells fc820eb242 Add active timers to children dashboard (#73) 2020-01-04 06:14:40 -08:00
Christopher C. Wells b6733650dc Use get_FOO_display for choices fields in templates 2019-11-09 16:42:51 -08:00
Paul Calabro 326a6f448c Update dashboard.html
Centered the child photo within the card
2019-10-04 19:59:34 -07:00
Philip Rosenberg-Watt e1d9b813d9 Time last feeding from start
All our lactation consultants told us to time the feedings from start-to-start.
2019-08-22 19:57:38 -07:00
Matt Burke a2c13df57f Add dashboard sort clauses: first name and id
I have seen the dashboard sorting be inconsistent. Last name then
first name then id should produce a consistent and predictable
sort order.
2019-07-08 16:06:46 -04:00
Christopher C. Wells 3ba58c9352 Add "Feeding Amounts" report. (#68) 2019-05-29 10:06:50 -07:00
Christopher C. Wells 46846ace4f Add translation support to cards template tags. 2019-04-16 19:38:31 -07:00
Christopher C. Wells 9114a2d911 Prevent internationalization of numbers used for style parameters. 2019-04-16 19:30:50 -07:00
Christopher C. Wells 1e83fa2902 Remove functions/filters from blocktrans tags in templates. 2019-04-14 18:41:25 -07:00
Christopher C. Wells e20903c60b Add translatable strings support to dashboard app. 2019-04-14 08:40:08 -07:00
Christopher Charbonneau Wells f6ee24a271 Fix minor linting issue. 2018-07-31 20:43:49 -07:00
Christopher Charbonneau Wells 7382e74d78 Use Bootstrap card columns for Child Dashboard. 2018-07-31 19:57:01 -07:00
Christopher Charbonneau Wells 08488af718 Raise permission denied instead of redirecting to login (#49). 2018-05-20 14:40:09 -07:00
Christopher Charbonneau Wells a524259507 Replace Page Visibility API with focus event listener for dashboard refreshes.
This is a bit of a testing phase to see if the focus event listerner behaves any better than the Page Visibility API, particularly in mobile browsers.
2018-03-22 20:29:40 -07:00
Christopher Charbonneau Wells 911cde4f95 Remove ounces references for feeding amounts. 2018-03-13 19:10:21 -07:00
Christopher Charbonneau Wells 5dc372281b Remove all unicode_literals imports. 2018-02-17 17:09:40 -05:00
Christopher Charbonneau Wells a3fe999660 Remove strong from Diaper Changes types card solid figure. 2018-02-04 19:39:28 -05:00
Christopher Charbonneau Wells f2a8cdec2d Update URL definitions to Django 2.0 style. 2017-12-13 18:12:32 -05:00
Christopher Charbonneau Wells 23185f413f Move test data fixtures file to babybuddy app. 2017-12-07 13:45:48 -05:00
Christopher Charbonneau Wells 3b0002a211 Fix link with incorrect namespace. 2017-12-03 17:03:13 -05:00
Christopher Charbonneau Wells 238d0d40a1 Remove Python 2.7 support. 2017-12-03 16:58:53 -05:00
Christopher Charbonneau Wells e92d3f361e Misc. Django 2.0 update changes. 2017-12-03 16:52:27 -05:00
Christopher Charbonneau Wells 4272c9b075 Add a basic bar chart showing average feeding durations over time. 2017-11-29 21:28:54 -05:00
Christopher Charbonneau Wells 1798a493a6 Update fixtures test data to use correct time zone (default is now UTC). 2017-11-29 19:36:47 -05:00
Christopher Charbonneau Wells 9f7d84013e Add Python 2.7 workaround for Dashboard tests and add missing `__init__.py` file. 2017-11-19 12:39:59 -05:00
Christopher Charbonneau Wells 880d7ca19f Use floats for Diaper Change type data to prevent division issues in Python 2.7. 2017-11-19 12:32:46 -05:00
Christopher Charbonneau Wells 5194e80eb1 Simplify test fixtures data. 2017-11-19 12:19:11 -05:00