Skip to content

Commit

Permalink
add config option show_reps_done_today
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsumoto-ren committed Sep 18, 2024
1 parent 3f0f743 commit 77a861c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"pass_fail": true,
"flexible_grading": true,
"show_last_review": true,
"show_reps_done_today": true,
"set_zoom_shortcuts": true,
"remember_zoom_level": true,
"tooltip_on_zoom_change": true,
Expand Down
4 changes: 4 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,9 @@ def get_zoom_state(self, state: str) -> float:
def set_zoom_state(self, state: str, value: float) -> None:
self._config.setdefault("zoom_states", {})[state] = value

@property
def show_reps_done_today(self) -> bool:
return bool(self["show_reps_done_today"])


config = FlexibleGradingConfig()
2 changes: 2 additions & 0 deletions remaining.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def studied_today_count(col: Collection) -> int:


def format_studied_today(col: Collection) -> str:
if not config.show_reps_done_today:
return ""
return f'<span class="ajt__studied-today">Reps: {studied_today_count(col)}</span>'


Expand Down

0 comments on commit 77a861c

Please # to comment.