Skip to content

Commit 19796c5

Browse files
authored
fix: Stretch righthand-nav to viewport edge (ietf-tools#3921)
* fix: Stretch righthand-nav to viewport edge Fixes ietf-tools#3848 * Also improve tz-select display, while we're here * Change func name
1 parent 169ab1c commit 19796c5

5 files changed

Lines changed: 23 additions & 15 deletions

File tree

ietf/static/js/agenda_timezone.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
// Update times on the agenda based on the selected timezone
178178
function update_times(newtz) {
179179
$('.current-tz')
180-
.html(newtz);
180+
.html(newtz.replaceAll("_", " ").replaceAll("/", " / "));
181181
$('.time')
182182
.each(function () {
183183
if (this.format === 4) {
@@ -226,7 +226,7 @@
226226
} else {
227227
// No sessions in the future - meeting has apparently ended
228228
links_to_update.attr('href', '#');
229-
links_to_update.addClass('text-muted text-decoration-line-through'); // mark link
229+
links_to_update.addClass('disabled'); // mark link
230230
}
231231
}
232232

@@ -303,4 +303,4 @@
303303
window.set_current_tz_cb = function (fn) {
304304
get_current_tz_cb = fn;
305305
};
306-
})();
306+
})();

ietf/static/js/ietf.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,14 @@ $(function () {
184184
.attr("tabindex", 0)
185185
.after($(`
186186
<div class="col-xl-2 ps-0 small">
187-
<div id="righthand-panel" class="position-fixed d-flex flex-column justify-content-between align-items-start">
188-
<nav id="righthand-nav" class="navbar navbar-light bg-light overflow-auto align-items-start flex-fill"></nav>
187+
<div id="righthand-panel" class="position-fixed col-xl-2 bg-light d-flex flex-column justify-content-between align-items-start">
188+
<nav id="righthand-nav" class="navbar navbar-light w-100 overflow-auto align-items-start flex-fill"></nav>
189189
</div></div>
190190
</div>
191191
`));
192192

193193
const nav = $("#righthand-nav")
194-
.append(`<nav class="nav nav-pills flex-column px-2">`)
194+
.append(`<nav class="nav nav-pills flex-column w-100 px-2">`)
195195
.children()
196196
.last();
197197

@@ -236,7 +236,7 @@ $(function () {
236236
});
237237

238238
if (haveExtraNav) {
239-
$('#righthand-panel').append('<div id="righthand-extra" class="py-3"></div>');
239+
$('#righthand-panel').append('<div id="righthand-extra" class="w-100 py-3"></div>');
240240
extraNav.children().appendTo('#righthand-extra');
241241
extraNav.remove();
242242
}

ietf/static/js/select2.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ $.fn.select2.defaults.set("escapeMarkup", function (m) {
1515
return m;
1616
});
1717

18+
function prettify_tz(x) {
19+
return x.text.replaceAll("_", " ").replaceAll("/", " / ");
20+
}
21+
1822
// Copyright The IETF Trust 2015-2021, All Rights Reserved
1923
// JS for ietf.utils.fields.SearchableField subclasses
2024
window.setupSelect2Field = function (e) {
@@ -26,9 +30,13 @@ window.setupSelect2Field = function (e) {
2630
e.append(new Option(options[id].text, options[id].id, false, options[id].selected));
2731
}
2832

33+
template_modify = e.hasClass("tz-select") ? prettify_tz : undefined;
34+
2935
e.select2({
3036
multiple: maxEntries !== 1,
3137
maximumSelectionSize: maxEntries,
38+
templateResult: template_modify,
39+
templateSelection: template_modify,
3240
ajax: url ? {
3341
url: url,
3442
dataType: "json",
@@ -66,4 +74,4 @@ $(document)
6674
return;
6775
setupSelect2Field($(this));
6876
});
69-
});
77+
});

ietf/templates/meeting/agenda.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
{% endif %}
2626
{# the contents of #extra-nav will be moved into the RH nav panel #}
2727
<div id="extra-nav" class="d-none">
28-
<div class="d-flex flex-column">
28+
<div class="d-flex flex-column px-2">
2929
{% if now.date <= schedule.meeting.end_date %}
30-
<a class="nav-link now-link" href="#">Current session</a>
30+
<a class="btn btn-sm btn-primary my-3 now-link" href="#">Jump to current session</a>
3131
{% endif %}
32-
<div class="px-3">
33-
Showing <span class="current-tz">{{ timezone }}</span> time
34-
</div>
35-
<div class="align-self-center">
32+
<div class="d-flex">
3633
{% include 'meeting/tz-display.html' with id_suffix="-rh" meeting_timezone=timezone minimal=True only %}
3734
</div>
35+
<div class="small text-muted">
36+
Showing <span class="current-tz">{{ timezone|split:"_"|join:" "|split:"/"|join:" / " }}</span> time
37+
</div>
3838
</div>
3939
</div>
4040
{# cache this part -- it takes 3-6 seconds to generate #}

ietf/templates/meeting/tz-display.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{% load origin %}
1313
{% origin %}
1414
{% firstof id_suffix "" as suffix %}
15-
<div class="tz-display {% if minimal %}btn-group btn-group-sm my-2{% else %}input-group my-3{% endif %} flex-wrap">
15+
<div class="tz-display flex-fill {% if minimal %}btn-group btn-group-sm my-2{% else %}input-group my-3{% endif %} flex-wrap">
1616
{% if not minimal %}<label class="input-group-text border-primary bg-white fw-bold">Time zone:</label>{% endif %}
1717
{% if meeting_timezone is not None %}
1818
<input type="radio"

0 commit comments

Comments
 (0)