Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osuny
Admin
Commits
61b7b88e
Commit
61b7b88e
authored
3 years ago
by
pabois
Browse files
Options
Downloads
Patches
Plain Diff
treeview save
parent
b17c11d4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/admin/communication/website/pages_controller.rb
+3
-5
3 additions, 5 deletions
...ntrollers/admin/communication/website/pages_controller.rb
app/controllers/admin/education/programs_controller.rb
+9
-4
9 additions, 4 deletions
app/controllers/admin/education/programs_controller.rb
with
12 additions
and
9 deletions
app/controllers/admin/communication/website/pages_controller.rb
+
3
−
5
View file @
61b7b88e
...
...
@@ -8,18 +8,16 @@ class Admin::Communication::Website::PagesController < Admin::Communication::Web
end
def
reorder
parent_
id
=
params
[
:parentId
].
blank?
?
nil
:
params
[
:parentId
]
parent_
page
=
@website
.
pages
.
find
(
params
[
:parentId
]
)
ids
=
params
[
:ids
]
||
[]
first_page
=
nil
ids
.
each
.
with_index
do
|
id
,
index
|
page
=
@website
.
pages
.
find
(
id
)
first_page
=
page
if
index
==
0
page
.
update
(
parent_id:
parent_id
,
parent_id:
parent_
page
.
id
,
position:
index
+
1
)
end
firs
t_page
.
sync_with_git
if
first_page
paren
t_page
.
sync_with_git
end
def
children
...
...
This diff is collapsed.
Click to expand it.
app/controllers/admin/education/programs_controller.rb
+
9
−
4
View file @
61b7b88e
...
...
@@ -13,18 +13,23 @@ class Admin::Education::ProgramsController < Admin::Education::ApplicationContro
def
reorder
parent_id
=
params
[
:parentId
].
blank?
?
nil
:
params
[
:parentId
]
ids
=
params
[
:ids
]
||
[]
first_program
=
nil
ids
.
each
.
with_index
do
|
id
,
index
|
program
=
current_university
.
education_programs
.
find
(
id
)
first_program
=
program
if
index
==
0
program
.
update
(
parent_id:
parent_id
,
position:
index
+
1
,
skip_websites_categories_callback:
true
)
unless
parent_id
program
.
set_websites_categories
program
.
sync_with_git
end
end
if
parent_id
parent
=
current_university
.
education_programs
.
find
(
parent_id
)
parent
.
set_websites_categories
parent
.
sync_with_git
end
first_program
.
set_websites_categories
if
first_program
first_program
.
sync_with_git
if
first_program
end
def
children
...
...
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