-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always show CTA banner if no reading goal exists #8606
Merged
mekarpeles
merged 3 commits into
internetarchive:master
from
jimchamp:8580/bug/yrg-banner-visibility
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
$def with(component_times) | ||
|
||
$ component_times['Yearly Goal Banner'] = time() | ||
$ year = get_reading_goals_year() | ||
$ year = current_year() | ||
$ goal = get_reading_goals(year=year) | ||
$if not goal and not within_date_range(1, 1, 11, 30): | ||
$if not goal: | ||
$ cta_copy = _('Set your %(year)s Yearly Reading Goal:', year=year) | ||
$ btn_copy = _('Set my goal') | ||
$ announcement = '%s <a class="btn primary set-reading-goal-link" data-ol-link-track="MyBooksLandingPage|SetReadingGoal"href="javascript:;">%s</a>' % (cta_copy, btn_copy) | ||
$ cookie_name = 'yrg' | ||
$:render_template('site/banner', announcement, cookie_name, cookie_duration_days=65) | ||
$ cookie_name = 'yrg%d' % (year % 100) | ||
$:render_template('site/banner', announcement, cookie_name, cookie_duration_days=365) | ||
$ component_times['Yearly Goal Banner'] = time() - component_times['Yearly Goal Banner'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of 365, we should use the number of days until the end of the year.
Note: either way, this shouldn't impact site behavior because the cookie name is pinned to the year and so one year cannot bleed and effect another year.