When a schedule is read only, only disable the part of the JS that

actually changes things so that the rest is still working
 - Legacy-Id: 17560
This commit is contained in:
Ole Laursen 2020-03-30 18:16:37 +00:00
parent e5943f814d
commit fa9b19e3a8
3 changed files with 79 additions and 80 deletions

View file

@ -623,7 +623,10 @@ def edit_meeting_schedule(request, num=None, owner=None, name=None):
# requesters
requested_by_lookup = {p.pk: p for p in Person.objects.filter(pk__in=set(s.requested_by for s in sessions if s.requested_by))}
# constraints
# constraints - convert the human-readable rules in the database
# to constraints on the actual sessions, compress them and output
# them, so that the JS simply has to detect violations and show
# the relevant preprocessed label
constraints = Constraint.objects.filter(meeting=meeting)
person_needed_for_groups = defaultdict(set)
for c in constraints:

View file

@ -1140,16 +1140,13 @@ a.fc-event, .fc-event, .fc-content, .fc-title, .fc-event-container {
margin: 0.2em;
border-radius: 0.4em;
overflow: hidden;
cursor: pointer;
}
.edit-meeting-schedule .session.selected {
border: 1px solid #bbb;
}
.edit-meeting-schedule .session[draggable] {
cursor: pointer;
}
.edit-meeting-schedule .session.dragging {
opacity: 0.3;
transition: opacity 0.4s;

View file

@ -1,7 +1,4 @@
jQuery(document).ready(function () {
if (!ietfData.can_edit)
return;
let content = jQuery(".edit-meeting-schedule");
function failHandler(xhr, textStatus, error) {
@ -49,6 +46,7 @@ jQuery(document).ready(function () {
});
if (ietfData.can_edit) {
// dragging
sessions.on("dragstart", function (event) {
event.originalEvent.dataTransfer.setData("text/plain", this.id);
@ -135,6 +133,7 @@ jQuery(document).ready(function () {
}).fail(failHandler).done(done);
}
});
}
// hints for the current schedule