forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 2
Clean up timezone selector behavior and add back to agenda RH panel #4
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
Merged
jennifer-richards
merged 12 commits into
jennifer/agenda-tz-widget
from
jennifer/tix3737
Apr 7, 2022
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e1b9392
feat: render second tz select widget on agenda RH panel
jennifer-richards 7a601e1
refactor: convert "local" to local timezone on init
jennifer-richards e418a1d
fix: use renamed variable in tz-display template
jennifer-richards a501561
fix: allow omission of id_suffix param to tz-display.html
jennifer-richards 18019b1
fix: clean up positioning of secondary timezone selector
jennifer-richards 3a220a7
feat: hide "Current session" link when meeting is over
jennifer-richards 0b94e32
fix: remove "Meeting" option for upcoming meeting timezone
jennifer-richards 678d1c6
fix: accept 'local' as the initially selected time zone
jennifer-richards 079a523
feat: keep select2 widget in sync with time zone set on page
jennifer-richards 3e45260
refactor: clean up some javascript/jquery syntax
jennifer-richards 9e18504
style: remove outdated comment; compare with '==='
jennifer-richards b618af2
Merge remote-tracking branch 'origin/jennifer/agenda-tz-widget' into …
jennifer-richards File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,35 +1,47 @@ | ||
| {% comment %} | ||
| Include this to display a timezone select widget. Must also include timezone.js as a script. | ||
| {% import "meeting/tz-display.html" with meeting_timezone="America/Halifax" id_suffix="" minimal=False only %} | ||
|
|
||
| Must provide the meeting_timezone option, which is the timezone to be used when the "Meeting" radio is | ||
| selected. If id_suffix is given, it is appended to the element IDs and radio input names to differentiate | ||
| multiple instances of the widget. If minimal is True, only the Meeting/Local/UTC radios are shown and no | ||
| arbitrary timezone select input is included in the widget. | ||
|
|
||
| As long as id_suffix is different, should allow for as many copies of the widget on a page as you'd like. | ||
| {% endcomment %} | ||
| {% load origin %} | ||
| {% origin %} | ||
| <div class="tz-display input-group my-3"> | ||
| <label class="input-group-text border-primary bg-white fw-bold">Time zone:</label> | ||
| {% firstof id_suffix "" as suffix %} | ||
| <div class="tz-display {% if minimal %}btn-group{% else %}input-group{% endif %} my-3"> | ||
| {% if not minimal %}<label class="input-group-text border-primary bg-white fw-bold">Time zone:</label>{% endif %} | ||
| {% if meeting_timezone is not None %} | ||
| <input type="radio" | ||
| name="tzradio{{ suffix }}" | ||
| class="btn-check tz-select" | ||
| id="meeting-timezone{{ suffix }}" | ||
| value="{{ meeting_timezone }}"> | ||
| <label class="btn btn-outline-primary" for="meeting-timezone{{ suffix }}">Meeting</label> | ||
| {% endif %} | ||
| <input type="radio" | ||
| {% if timezone == "meeting" %}checked{% endif %} | ||
| name="tzradio" | ||
| class="btn-check" | ||
| id="meeting-timezone{{ id_suffix }}" | ||
| onclick="ietf_timezone.use('{{ timezone }}')"> | ||
| <label class="btn btn-outline-primary" for="meeting-timezone{{ id_suffix }}">Meeting</label> | ||
| name="tzradio{{ suffix }}" | ||
| class="btn-check tz-select" | ||
| id="local-timezone{{ suffix }}" | ||
| value="local"> | ||
| <label class="btn btn-outline-primary" for="local-timezone{{ suffix }}">Local</label> | ||
| <input type="radio" | ||
| {% if timezone == "local" %}checked{% endif %} | ||
| name="tzradio" | ||
| class="btn-check" | ||
| id="local-timezone{{ id_suffix }}" | ||
| onclick="ietf_timezone.use('local')"> | ||
| <label class="btn btn-outline-primary" for="local-timezone{{ id_suffix }}">Local</label> | ||
| <input type="radio" | ||
| {% if timezone == "UTC" %}checked{% endif %} | ||
| name="tzradio" | ||
| class="btn-check" | ||
| id="utc-timezone{{ id_suffix }}" | ||
| onclick="ietf_timezone.use('UTC')"> | ||
| <label class="btn btn-outline-primary" for="utc-timezone{{ id_suffix }}">UTC</label> | ||
| <select id="timezone-select{{ id_suffix }}" | ||
| class="tz-select select2-field form-select border-primary" | ||
| data-max-entries="1" data-minimum-input-length="0" | ||
| onchange="$('.tz-display input[name=tzradio]').prop('checked', false);"> | ||
| {# Avoid blank while loading. JavaScript replaces the option list after init. #} | ||
| <option selected> | ||
| {{ timezone }} | ||
| </option> | ||
| </select> | ||
| </div> | ||
| name="tzradio{{ suffix }}" | ||
| class="btn-check tz-select" | ||
| id="utc-timezone{{ suffix }}" | ||
| value="UTC"> | ||
| <label class="btn btn-outline-primary" for="utc-timezone{{ suffix }}">UTC</label> | ||
| {% if not minimal %} | ||
| <select id="timezone-select{{ suffix }}" | ||
| class="tz-select select2-field form-select border-primary" | ||
| data-max-entries="1" data-minimum-input-length="0"> | ||
| {# Avoid blank while loading. JavaScript replaces the option list after init. #} | ||
| <option selected> | ||
| {{ meeting_timezone }} | ||
| </option> | ||
| </select> | ||
| {% endif %} | ||
| </div> |
This file contains hidden or 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.
What does this do?
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.
It notifies eslint that 'moment' is a globally defined symbol
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.
(though it certainly looks like something that we should all share on Earth Day)