diff --git a/openlibrary/i18n/messages.pot b/openlibrary/i18n/messages.pot index ee9aa5a69a5..e696842ebe7 100644 --- a/openlibrary/i18n/messages.pot +++ b/openlibrary/i18n/messages.pot @@ -898,7 +898,7 @@ msgstr "" msgid "Learn more about \"%(title)s\" at OpenLibrary" msgstr "" -#: widget.html +#: check_ins/reading_goal_form.html widget.html msgid "Learn More" msgstr "" @@ -1311,15 +1311,6 @@ msgstr "" msgid "Or, check out our special collections." msgstr "" -#: account/mybooks.html -#, python-format -msgid "Set %(year_span)s reading goal" -msgstr "" - -#: account/mybooks.html -msgid "Yearly Reading Goal" -msgstr "" - #: account/mybooks.html msgid "No books are on this shelf" msgstr "" @@ -1710,6 +1701,20 @@ msgstr "" msgid "My Feed" msgstr "" +#: account/sidebar.html +#, python-format +msgid "%(year)d Reading Goal" +msgstr "" + +#: account/sidebar.html +#, python-format +msgid "Set %(year_span)s reading goal" +msgstr "" + +#: account/sidebar.html +msgid "Yearly Reading Goal" +msgstr "" + #: account/sidebar.html search/sort_options.html type/user/view.html msgid "Reading Log" msgstr "" @@ -2880,7 +2885,6 @@ msgstr "" #: book_providers/openstax_read_button.html #: book_providers/standard_ebooks_read_button.html #: book_providers/wikisource_read_button.html -#: check_ins/reading_goal_progress.html msgid "Learn more" msgstr "" @@ -4246,17 +4250,12 @@ msgstr "" msgid "Enter \"0\" to unset your reading goal. Your check-ins will be preserved." msgstr "" -#: check_ins/reading_goal_progress.html -#, python-format -msgid "%(year)d Reading Goal:" -msgstr "" - #: check_ins/reading_goal_progress.html #, python-format msgid "" "%(books_read)d/%(goal)d books" +"progress__goal\">%(goal)d Books" msgstr "" #: check_ins/reading_goal_progress.html diff --git a/openlibrary/plugins/openlibrary/js/check-ins/index.js b/openlibrary/plugins/openlibrary/js/check-ins/index.js index 838c0e545fe..f38ac6ada94 100644 --- a/openlibrary/plugins/openlibrary/js/check-ins/index.js +++ b/openlibrary/plugins/openlibrary/js/check-ins/index.js @@ -530,8 +530,12 @@ function addGoalSubmissionListener(submitButton) { if (isDeleted) { const chipGroup = yearlyGoalSection.querySelector('.chip-group') const goalContainer = yearlyGoalSection.querySelector('#reading-goal-container') - goalContainer.remove() - chipGroup.classList.remove('hidden') + if (chipGroup) { + chipGroup.classList.remove('hidden') + } + if (goalContainer) { + goalContainer.remove() + } } else { const progressComponent = modal.closest('.reading-goal-progress') updateProgressComponent(progressComponent, Number(formData.get('goal'))) @@ -563,10 +567,8 @@ function updateProgressComponent(elem, goal) { // Update view: const goalSpan = elem.querySelector('.reading-goal-progress__goal') - const percentageSpan = elem.querySelector('.reading-goal-progress__percentage') const completedBar = elem.querySelector('.reading-goal-progress__completed') goalSpan.textContent = goal - percentageSpan.textContent = `(${percentComplete}%)` completedBar.style.width = `${Math.min(100, percentComplete)}%` } diff --git a/openlibrary/templates/account/mybooks.html b/openlibrary/templates/account/mybooks.html index 26d17190a16..e88cfc0af86 100644 --- a/openlibrary/templates/account/mybooks.html +++ b/openlibrary/templates/account/mybooks.html @@ -10,26 +10,6 @@