Skip to content

Commit 60c8bf9

Browse files
committed
Merged in [18186] from rjsparks@nostrum.com:
Let the weekview in the customized agenda show more than just the traditional meeting 'week'. Fixes ietf-tools#3022. - Legacy-Id: 18209 Note: SVN reference [18186] has been migrated to Git commit b46a696
2 parents 5b8442e + b46a696 commit 60c8bf9

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

ietf/meeting/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,16 +1202,16 @@ def week_view(request, num=None, name=None, owner=None):
12021202
# We'll determine this using the saturday before the first scheduled regular session.
12031203
first_regular_session_time = meeting.schedule.qs_assignments_with_sessions.filter(session__type_id='regular').order_by('timeslot__time').first().timeslot.time
12041204
saturday_before = first_regular_session_time - datetime.timedelta(days=(first_regular_session_time.weekday() - 5)%7)
1205-
saturday_after = saturday_before + datetime.timedelta(days=7)
1206-
filtered_assignments = filtered_assignments.filter(timeslot__time__gte=saturday_before,timeslot__time__lt=saturday_after)
1205+
# saturday_after = saturday_before + datetime.timedelta(days=7)
1206+
# filtered_assignments = filtered_assignments.filter(timeslot__time__gte=saturday_before,timeslot__time__lt=saturday_after)
12071207
filtered_assignments = preprocess_assignments_for_agenda(filtered_assignments, meeting)
12081208

12091209
items = []
12101210
for a in filtered_assignments:
12111211
# we don't HTML escape any of these as the week-view code is using createTextNode
12121212
item = {
12131213
"key": str(a.timeslot.pk),
1214-
"day": a.timeslot.time.strftime("%w"),
1214+
"day": (a.timeslot.time - saturday_before).days - 1,
12151215
"time": a.timeslot.time.strftime("%H%M") + "-" + a.timeslot.end_time().strftime("%H%M"),
12161216
"duration": a.timeslot.duration.seconds,
12171217
"time_id": a.timeslot.time.strftime("%m%d%H%M"),

ietf/templates/meeting/week-view.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66

77
var all_items = {{ items|safe }};
88

9-
/* Saturday events need to be moved to the day -1 */
109
/* Also, process clock times to "minutes past midnight" */
1110
all_items.forEach(function(item) {
12-
if (item.day == 6) { item.day = -1; }
1311
item.start_time = parseInt(item.time.substr(0,2),10) * 60 +
1412
parseInt(item.time.substr(2,2),10);
1513
item.end_time = item.start_time + (item.duration / 60)
@@ -210,7 +208,7 @@
210208
e.style.textAlign="center";
211209

212210
var div = document.createElement("div");
213-
div.appendChild(document.createTextNode(day[j+1]));
211+
div.appendChild(document.createTextNode(day[((j+1)%7+7)%7])); // js % is remainder, not modulus
214212
j++;
215213
e.appendChild(div);
216214
document.body.appendChild(e);

0 commit comments

Comments
 (0)