Skip to content
Snippets Groups Projects
Commit fae6fb6b authored by Nadja Geisler's avatar Nadja Geisler :sunny:
Browse files

more information in scheduling calendar

parent 95ee00c2
No related branches found
No related tags found
No related merge requests found
......@@ -245,6 +245,16 @@ class AK(models.Model):
return self.short_name
return self.name
@property
def details(self):
return f"""{self.name}{" (R)" if self.reso else ""}:
{self.owners_list}
{_("Requirements")}: {", ".join(str(r) for r in self.requirements.all())}
{_("Conflicts")}: {", ".join(str(c) for c in self.conflicts.all())}
{_("Prerequisites")}: {", ".join(str(p) for p in self.prerequisites.all())}"""
@property
def owners_list(self):
return ", ".join(str(owner) for owner in self.owners.all())
......
......@@ -42,8 +42,8 @@ class EventsView(LoginRequiredMixin, EventSlugMixin, ListView):
return JsonResponse(
[{
"slotID": slot.pk,
"title": slot.ak.short_name,
"description": slot.ak.name,
"title": f'{slot.ak.short_name}: \n{slot.ak.owners_list}',
"description": slot.ak.details,
"resourceId": slot.room.id,
"start": timezone.localtime(slot.start, self.event.timezone).strftime("%Y-%m-%d %H:%M:%S"),
"end": timezone.localtime(slot.end, self.event.timezone).strftime("%Y-%m-%d %H:%M:%S"),
......
......@@ -25,6 +25,10 @@
cursor: move;
}
.fc-v-event, .tooltip {
white-space: pre-line;
}
</style>
<script>
......@@ -45,12 +49,14 @@
}
return cookieValue;
}
const csrftoken = getCookie('csrftoken');
function csrfSafeMethod(method) {
// these HTTP methods do not require CSRF protection
return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
}
$.ajaxSetup({
beforeSend: function (xhr, settings) {
if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
......@@ -160,7 +166,8 @@
end: plan.formatIso(changeInfo.event.end),
roomId: room.id,
},
success: function(response) {},
success: function (response) {
},
error: function (response) {
changeInfo.revert();
alert("ERROR. Did not update " + changeInfo.event.title)
......@@ -181,7 +188,7 @@
{% for slot in slots_unscheduled %}
<div class="unscheduled-slot badge badge-primary" style='background-color: {{ slot.ak.category.color }}'
data-event='{ "title": "{{ slot.ak.short_name }}", "duration": {"hours": "{{ slot.duration|unlocalize }}"}, "description": "{{ slot.ak.name }}", "slotID": "{{ slot.pk }}"}'>{{ slot.ak.short_name }}
({{ slot.duration }} h)
({{ slot.duration }} h)<br>{{ slot.ak.owners_list }}
</div>
{% endfor %}
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment