Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
8fbdabb3
Verified
Commit
8fbdabb3
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Improve variable names (replace i by speaking names)
parent
f1f1728f
No related branches found
No related tags found
Loading
Pipeline
#4978
passed
4 years ago
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/core/static/js/edit_dashboard.js
+2
-2
2 additions, 2 deletions
aleksis/core/static/js/edit_dashboard.js
aleksis/core/views.py
+3
-3
3 additions, 3 deletions
aleksis/core/views.py
with
5 additions
and
5 deletions
aleksis/core/static/js/edit_dashboard.js
+
2
−
2
View file @
8fbdabb3
function
refreshOrder
()
{
function
refreshOrder
()
{
$
(
"
.order-input
"
).
val
(
0
);
$
(
"
.order-input
"
).
val
(
0
);
$
(
"
#widgets > .col
"
).
each
(
function
(
i
)
{
$
(
"
#widgets > .col
"
).
each
(
function
(
i
ndex
)
{
const
order
=
(
i
+
1
)
*
10
;
const
order
=
(
i
ndex
+
1
)
*
10
;
let
pk
=
$
(
this
).
attr
(
"
data-pk
"
);
let
pk
=
$
(
this
).
attr
(
"
data-pk
"
);
let
sel
=
$
(
"
#order-form input[value=
"
+
pk
+
"
].pk-input
"
).
next
();
let
sel
=
$
(
"
#order-form input[value=
"
+
pk
+
"
].pk-input
"
).
next
();
sel
.
val
(
order
);
sel
.
val
(
order
);
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/views.py
+
3
−
3
View file @
8fbdabb3
...
@@ -790,11 +790,11 @@ class EditDashboardView(View):
...
@@ -790,11 +790,11 @@ class EditDashboardView(View):
context
[
"
widgets
"
]
=
widgets
context
[
"
widgets
"
]
=
widgets
context
[
"
not_used_widgets
"
]
=
not_used_widgets
context
[
"
not_used_widgets
"
]
=
not_used_widgets
i
=
10
order
=
10
initial
=
[]
initial
=
[]
for
widget
in
widgets
:
for
widget
in
widgets
:
initial
.
append
({
"
pk
"
:
widget
,
"
order
"
:
i
})
initial
.
append
({
"
pk
"
:
widget
,
"
order
"
:
order
})
i
+=
10
order
+=
10
for
widget
in
not_used_widgets
:
for
widget
in
not_used_widgets
:
initial
.
append
({
"
pk
"
:
widget
,
"
order
"
:
0
})
initial
.
append
({
"
pk
"
:
widget
,
"
order
"
:
0
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment