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
fc94c2ef
Commit
fc94c2ef
authored
2 years ago
by
pabois
Browse files
Options
Downloads
Patches
Plain Diff
improve with_menus concern
parent
8f344fd0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/models/communication/website/with_menus.rb
+2
-41
2 additions, 41 deletions
app/models/communication/website/with_menus.rb
with
2 additions
and
41 deletions
app/models/communication/website/with_menus.rb
+
2
−
41
View file @
fc94c2ef
...
...
@@ -12,23 +12,11 @@ module Communication::Website::WithMenus
def
menu_item_kinds
Communication
::
Website
::
Menu
::
Item
.
kinds
.
reject
do
|
key
,
value
|
active
=
send
"menu_item_kind_
#{
key
}
?"
!
active
method_name
=
"menu_item_kind_
#{
key
}
?"
respond_to?
(
method_name
)
&&
!
public_send
(
method_name
)
end
end
def
menu_item_kind_blank?
true
end
def
menu_item_kind_url?
true
end
def
menu_item_kind_page?
pages
.
any?
end
def
menu_item_kind_programs?
has_education_programs?
end
...
...
@@ -45,37 +33,10 @@ module Communication::Website::WithMenus
has_education_diplomas?
end
def
menu_item_kind_posts?
has_communication_posts?
end
def
menu_item_kind_category?
has_communication_categories?
end
def
menu_item_kind_post?
has_communication_posts?
end
def
menu_item_kind_organizations?
# TODO: has_organization takes a looong time when having a lot of blocks.
# when we have a direct relation between website & organizations re-adjust this test.
# has_organizations?
true
end
def
menu_item_kind_persons?
has_persons?
end
def
menu_item_kind_administrators?
has_administrators?
end
def
menu_item_kind_authors?
has_authors?
end
def
menu_item_kind_researchers?
has_researchers?
end
...
...
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