Skip to content

Commit

Permalink
Blur sessions for hidden areas instead of hiding entirely. Fixes #3218.…
Browse files Browse the repository at this point in the history
… Commit ready for merge.

 - Legacy-Id: 19134
  • Loading branch information
jennifer-richards committed Jun 15, 2021
1 parent 1d12391 commit ba0a3ec
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
14 changes: 13 additions & 1 deletion ietf/meeting/tests_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,21 @@ def test_edit_meeting_schedule(self):
# hide sessions in area
self.assertTrue(s1_element.is_displayed())
self.driver.find_element_by_css_selector(".session-parent-toggles [value=\"{}\"]".format(s1.group.parent.acronym)).click()
self.assertTrue(not s1_element.is_displayed())
self.assertTrue(s1_element.is_displayed()) # should still be displayed
self.assertIn('hidden-parent', s1_element.get_attribute('class'),
'Session should be hidden when parent disabled')
s1_element.click() # try to select
self.assertNotIn('selected', s1_element.get_attribute('class'),
'Session should not be selectable when parent disabled')

self.driver.find_element_by_css_selector(".session-parent-toggles [value=\"{}\"]".format(s1.group.parent.acronym)).click()
self.assertTrue(s1_element.is_displayed())
self.assertNotIn('hidden-parent', s1_element.get_attribute('class'),
'Session should not be hidden when parent enabled')
s1_element.click() # try to select
self.assertIn('selected', s1_element.get_attribute('class'),
'Session should be selectable when parent enabled')


# hide timeslots
self.driver.find_element_by_css_selector(".timeslot-group-toggles button").click()
Expand Down
8 changes: 7 additions & 1 deletion ietf/static/ietf/css/ietf.css
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,12 @@ a.fc-event, .fc-event, .fc-content, .fc-title, .fc-event-container {
background-color: #ddd;
}

.edit-meeting-schedule .session.hidden-parent * {
/* This makes .session.hidden-parent's children transparent but keeps the
* .session itself opaque so the timeslot label does not show through. */
opacity: 0.7;
}

.edit-meeting-schedule .session.selected .session-label {
font-weight: bold;
}
Expand All @@ -1198,7 +1204,7 @@ a.fc-event, .fc-event, .fc-content, .fc-title, .fc-event-container {
}

.edit-meeting-schedule .timeslot.overfull .session {
border-radius: 0.4em 0 0 0.4em; /* remove bottom rounding to illude to being cut off */
border-radius: 0.4em 0 0 0.4em; /* remove right-side rounding to allude to being cut off */
margin-right: 0;
}

Expand Down
14 changes: 11 additions & 3 deletions ietf/static/ietf/js/edit-meeting-schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ jQuery(document).ready(function () {

sessions.on("click", function (event) {
event.stopPropagation();
selectSessionElement(this);
// do not allow hidden sessions to be selected
if (!jQuery(this).hasClass('hidden-parent')) {
selectSessionElement(this);
}
});


Expand Down Expand Up @@ -478,14 +481,19 @@ jQuery(document).ready(function () {
// toggling visible sessions by session parents
let sessionParentInputs = content.find(".session-parent-toggles input");

function setSessionHidden(sess, hide) {
sess.toggleClass('hidden-parent', hide);
sess.prop('draggable', !hide);
}

function updateSessionParentToggling() {
let checked = [];
sessionParentInputs.filter(":checked").each(function () {
checked.push(".parent-" + this.value);
});

sessions.not(".untoggleable").filter(checked.join(",")).show();
sessions.not(".untoggleable").not(checked.join(",")).hide();
setSessionHidden(sessions.not(".untoggleable").filter(checked.join(",")), false);
setSessionHidden(sessions.not(".untoggleable").not(checked.join(",")), true);
}

sessionParentInputs.on("click", updateSessionParentToggling);
Expand Down
3 changes: 2 additions & 1 deletion ietf/templates/meeting/edit_meeting_schedule.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
{% block morecss %}
{# set the group colors with CSS here #}
{% for parent in session_parents %}
.parent-{{ parent.acronym }} { background: linear-gradient(to right, {{ parent.scheduling_color }} 0.4em, transparent 0.5em); }
.parent-{{ parent.acronym }} { background-image: linear-gradient(to right, {{ parent.scheduling_color }} 0.4em, transparent 0.5em); }
.parent-{{ parent.acronym }}.hidden-parent { filter: blur(3px); }{# blur masks contents but keeps the parent color visible #}
.parent-{{ parent.acronym }}.selected { background-color: {{ parent.light_scheduling_color }}; }
{% endfor %}
{% endblock morecss %}
Expand Down

0 comments on commit ba0a3ec

Please sign in to comment.