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