Skip to content
Snippets Groups Projects
Verified Commit 0a23aac9 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch 'feature/ordering-of-dashboard-widgets' of...

Merge branch 'feature/ordering-of-dashboard-widgets' of edugit.org:AlekSIS/official/AlekSIS-Core into feature/ordering-of-dashboard-widgets
parents 27017cb8 8fbdabb3
No related branches found
No related tags found
1 merge request!411Ordering of dashboard widgets
Pipeline #4979 passed
function refreshOrder() {
$(".order-input").val(0);
$("#widgets > .col").each(function (i) {
const order = (i + 1) * 10;
$("#widgets > .col").each(function (index) {
const order = (index + 1) * 10;
let pk = $(this).attr("data-pk");
let sel = $("#order-form input[value=" + pk + "].pk-input").next();
sel.val(order);
......
......@@ -790,11 +790,11 @@ class EditDashboardView(View):
context["widgets"] = widgets
context["not_used_widgets"] = not_used_widgets
i = 10
order = 10
initial = []
for widget in widgets:
initial.append({"pk": widget, "order": i})
i += 10
initial.append({"pk": widget, "order": order})
order += 10
for widget in not_used_widgets:
initial.append({"pk": widget, "order": 0})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment