Skip to content

Commit

Permalink
Merge branch 'main' into jennifer/generator-purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-richards authored Jan 30, 2023
2 parents 91e0786 + b95f510 commit 6f3c6d1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/report-a-bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ body:
options:
- label: I agree to follow the [IETF's Code of Conduct](https://github.com/ietf-tools/.github/blob/main/CODE_OF_CONDUCT.md)
required: true
- type: markdown
attributes:
value: |
If you are having trouble logging into the datatracker, please do not open an issue here. Instead, please send email to [email protected] providing your name and username.
6 changes: 3 additions & 3 deletions ietf/meeting/tests_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def test_edit_meeting_schedule(self):
self.assertEqual(session_info_container.find_element(By.CSS_SELECTOR, ".other-session .time").text, "not yet scheduled")

# deselect
self.driver.find_element(By.CSS_SELECTOR, '.drop-target').click()
self.driver.find_element(By.CSS_SELECTOR, '.timeslot[data-type="regular"] .drop-target').click()

self.assertEqual(session_info_container.find_elements(By.CSS_SELECTOR, ".title"), [])
self.assertNotIn('other-session-selected', s2b_element.get_attribute('class'))
Expand Down Expand Up @@ -193,9 +193,9 @@ def test_edit_meeting_schedule(self):

# violated due to constraints - both the timeslot and its timeslot label
self.assertTrue(self.driver.find_elements(By.CSS_SELECTOR, '#timeslot{}.would-violate-hint'.format(slot1.pk)))
# Find the timeslot label for slot1 - it's the first timeslot in the first room group
# Find the timeslot label for slot1 - it's the first timeslot in the room group containing room 1
slot1_roomgroup_elt = self.driver.find_element(By.CSS_SELECTOR,
'.day-flow .day:first-child .room-group:nth-child(2)' # count from 2 - first-child is the day label
'.day-flow .day:first-child .room-group[data-rooms="1"]'
)
self.assertTrue(
slot1_roomgroup_elt.find_elements(By.CSS_SELECTOR,
Expand Down
6 changes: 3 additions & 3 deletions ietf/meeting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,9 @@ def prepare_timeslots_for_display(timeslots, rooms):
sorted_rooms = sorted(
rooms_with_timeslots,
key=lambda room: (
# First, sort regular session rooms ahead of others - these will usually
# Sort higher capacity rooms first.
-room.capacity if room.capacity is not None else 1, # sort rooms with capacity = None at end
# Sort regular session rooms ahead of others - these will usually
# have more timeslots than other room types.
0 if room_data[room.pk]['timeslot_count'] == max_timeslots else 1,
# Sort rooms with earlier timeslots ahead of later
Expand All @@ -669,8 +671,6 @@ def prepare_timeslots_for_display(timeslots, rooms):
# Sort by list of starting time and duration so that groups with identical
# timeslot structure will be neighbors. The grouping algorithm relies on this!
room_data[room.pk]['start_and_duration'],
# Within each group, sort higher capacity rooms first.
-room.capacity if room.capacity is not None else 1, # sort rooms with capacity = None at end
# Finally, sort alphabetically by name
room.name
)
Expand Down
9 changes: 3 additions & 6 deletions ietf/static/js/edit-meeting-schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -647,12 +647,9 @@ $(function () {

function updateTimeSlotDurationViolations() {
timeslots.each(function () {
let total = 0;
jQuery(this).find(".session").each(function () {
total += +jQuery(this).data("duration");
});

jQuery(this).toggleClass("overfull", total > +jQuery(this).data("duration"));
const sessionsInSlot = Array.from(this.getElementsByClassName('session'));
const requiredDuration = Math.max(sessionsInSlot.map(elt => Number(elt.dataset.duration)));
this.classList.toggle('overfull', requiredDuration > Number(this.dataset.duration));
});
}

Expand Down
1 change: 1 addition & 0 deletions ietf/templates/liaisons/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ <h1>
{% csrf_token %}
<button class="btn btn-warning btn-sm"
type="submit"
value="Mark as action taken"
name="do_action_taken">
Mark as action taken
</button>
Expand Down

0 comments on commit 6f3c6d1

Please sign in to comment.