Let the weekview in the customized agenda show more than just the traditional meeting "week". Fixes #3022. Commit ready for merge.
- Legacy-Id: 18186
This commit is contained in:
parent
55550ce9e6
commit
b46a696b1e
|
@ -1202,8 +1202,8 @@ def week_view(request, num=None, name=None, owner=None):
|
|||
# We'll determine this using the saturday before the first scheduled regular session.
|
||||
first_regular_session_time = meeting.schedule.qs_assignments_with_sessions.filter(session__type_id='regular').order_by('timeslot__time').first().timeslot.time
|
||||
saturday_before = first_regular_session_time - datetime.timedelta(days=(first_regular_session_time.weekday() - 5)%7)
|
||||
saturday_after = saturday_before + datetime.timedelta(days=7)
|
||||
filtered_assignments = filtered_assignments.filter(timeslot__time__gte=saturday_before,timeslot__time__lt=saturday_after)
|
||||
# saturday_after = saturday_before + datetime.timedelta(days=7)
|
||||
# filtered_assignments = filtered_assignments.filter(timeslot__time__gte=saturday_before,timeslot__time__lt=saturday_after)
|
||||
filtered_assignments = preprocess_assignments_for_agenda(filtered_assignments, meeting)
|
||||
|
||||
items = []
|
||||
|
@ -1211,7 +1211,7 @@ def week_view(request, num=None, name=None, owner=None):
|
|||
# we don't HTML escape any of these as the week-view code is using createTextNode
|
||||
item = {
|
||||
"key": str(a.timeslot.pk),
|
||||
"day": a.timeslot.time.strftime("%w"),
|
||||
"day": (a.timeslot.time - saturday_before).days - 1,
|
||||
"time": a.timeslot.time.strftime("%H%M") + "-" + a.timeslot.end_time().strftime("%H%M"),
|
||||
"duration": a.timeslot.duration.seconds,
|
||||
"time_id": a.timeslot.time.strftime("%m%d%H%M"),
|
||||
|
|
|
@ -6,10 +6,8 @@
|
|||
|
||||
var all_items = {{ items|safe }};
|
||||
|
||||
/* Saturday events need to be moved to the day -1 */
|
||||
/* Also, process clock times to "minutes past midnight" */
|
||||
all_items.forEach(function(item) {
|
||||
if (item.day == 6) { item.day = -1; }
|
||||
item.start_time = parseInt(item.time.substr(0,2),10) * 60 +
|
||||
parseInt(item.time.substr(2,2),10);
|
||||
item.end_time = item.start_time + (item.duration / 60)
|
||||
|
@ -210,7 +208,7 @@
|
|||
e.style.textAlign="center";
|
||||
|
||||
var div = document.createElement("div");
|
||||
div.appendChild(document.createTextNode(day[j+1]));
|
||||
div.appendChild(document.createTextNode(day[((j+1)%7+7)%7])); // js % is remainder, not modulus
|
||||
j++;
|
||||
e.appendChild(div);
|
||||
document.body.appendChild(e);
|
||||
|
|
Loading…
Reference in a new issue