Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • konstantin/akplanning
  • matedealer/akplanning
  • kif/akplanning
  • mirco/akplanning
  • lordofthevoid/akplanning
  • voidptr/akplanning
  • xayomer/akplanning-fork
  • mollux/akplanning
  • neumantm/akplanning
  • mmarx/akplanning
  • nerf/akplanning
  • felix_bonn/akplanning
  • sebastian.uschmann/akplanning
13 results
Select Git revision
  • koma/feature/preference-polling-form
  • komasolver
  • main
  • renovate/django-5.x
  • renovate/django_csp-4.x
  • renovate/uwsgi-2.x
6 results
Show changes
......@@ -302,6 +302,13 @@ class AKOwnerCreateView(EventSlugMixin, EventInactiveRedirectMixin, CreateView):
form_class = AKOwnerForm
def get_success_url(self):
if "add_to_existing_ak" in self.request.GET:
ak_pk = self.request.GET['add_to_existing_ak']
ak = get_object_or_404(AK, pk=ak_pk)
ak.owners.add(self.object)
messages.add_message(self.request, messages.SUCCESS,
_("Added '{owner}' as new owner of '{ak.name}'").format(owner=self.object, ak=ak))
return reverse_lazy('submit:ak_detail', kwargs={'event_slug': self.kwargs['event_slug'], 'pk': ak.pk})
return reverse_lazy('submit:submit_ak',
kwargs={'event_slug': self.kwargs['event_slug'], 'owner_slug': self.object.slug})
......
......@@ -6,7 +6,7 @@
// It was significantly changed to deal with the newer fullcalendar version, event specific timezones,
// to remove the dependency to moments timezone and improve the visualization of deletion
function createAvailabilityEditors(timezone, language, startDate, endDate) {
function createAvailabilityEditors(timezone, language, startDate, endDate, slotResolution='00:30:00') {
$("input.availabilities-editor-data").each(function () {
const eventColor = '#28B62C';
......@@ -16,6 +16,20 @@ function createAvailabilityEditors(timezone, language, startDate, endDate) {
data_field.after(editor);
data_field.hide();
// Add inputs to add slots without the need to click and drag
let manualSlotAdderSource = "<form id='formManualAdd'><table class='table table-responsive mb-0'><tr>" +
"<td style='vertical-align: middle;'><input type='datetime-local' id='inputStart' value='" + startDate + "' min='" + startDate + "' max='" + endDate + "'></td>" +
"<td style='vertical-align: middle;'><i class=\"fas fa-long-arrow-alt-right\"></i></td>" +
"<td style='vertical-align: middle;'><input type='datetime-local' id='inputEnd' value='" + endDate + "' min='" + startDate + "' max='" + endDate + "'></td>" +
"<td><button class='btn btn-primary' type='submit'><i class=\"fas fa-plus\"></i></button></td></tr></table></form>";
let manualSlotAdder = $(manualSlotAdderSource);
editor.after(manualSlotAdder);
$('#formManualAdd').submit(function(event) {
add($('#inputStart').val(), $('#inputEnd').val());
event.preventDefault();
});
let editable = !Boolean(data_field.attr("disabled"));
let data = JSON.parse(data_field.attr("value"));
let events = data.availabilities.map(function (e) {
......@@ -58,15 +72,7 @@ function createAvailabilityEditors(timezone, language, startDate, endDate) {
events: data.availabilities,
eventBackgroundColor: eventColor,
select: function (info) {
resetDeletionCandidate();
plan.addEvent({
title: "",
start: info.start,
end: info.end,
id: 'new' + newEventsCounter
})
newEventsCounter++;
save_events();
add(info.start, info.end);
},
eventClick: function (info) {
if (eventMarkedForDeletion !== undefined && (eventMarkedForDeletion.id === info.event.id)) {
......@@ -84,9 +90,22 @@ function createAvailabilityEditors(timezone, language, startDate, endDate) {
selectOverlap: false,
eventOverlap: false,
eventChange: save_events,
slotDuration: slotResolution,
});
plan.render();
function add(start, end) {
resetDeletionCandidate();
plan.addEvent({
title: "",
start: start,
end: end,
id: 'new' + newEventsCounter
})
newEventsCounter++;
save_events();
}
function makeDeletionCandidate(el) {
el.classList.add("deleteEvent");
$(el).find(".fc-event-title").html("<i class='fas fa-trash'></i> <i class='fas fa-question'></i>");
......