Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
Jan-Hendrik Willms
Stud.IP
Commits
cc617253
Commit
cc617253
authored
9 months ago
by
Moritz Strohm
Browse files
Options
Downloads
Patches
Plain Diff
display skip links for first and second navigagion layer only when there are elements, fixes #4049
Closes #4049 Merge request
studip/studip!2949
parent
e9806e73
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
app/controllers/start.php
+1
-0
1 addition, 0 deletions
app/controllers/start.php
lib/classes/sidebar/Sidebar.php
+2
-2
2 additions, 2 deletions
lib/classes/sidebar/Sidebar.php
templates/header.php
+6
-2
6 additions, 2 deletions
templates/header.php
templates/tabs.php
+2
-2
2 additions, 2 deletions
templates/tabs.php
with
11 additions
and
6 deletions
app/controllers/start.php
+
1
−
0
View file @
cc617253
...
...
@@ -59,6 +59,7 @@ class StartController extends AuthenticatedController
$nav
=
$sidebar
->
addWidget
(
new
NavigationWidget
());
$nav
->
setTitle
(
_
(
'Sprungmarken'
));
$nav
->
setId
(
'navigation-layer-3'
);
foreach
(
array_merge
(
...
$this
->
columns
)
as
$widget
)
{
$nav
->
addLink
(
$widget
->
getPluginName
(),
...
...
This diff is collapsed.
Click to expand it.
lib/classes/sidebar/Sidebar.php
+
2
−
2
View file @
cc617253
...
...
@@ -186,7 +186,7 @@ class Sidebar extends WidgetContainer
static
$actions_widget_added
=
false
;
if
(
$widget
instanceof
NavigationWidget
&&
!
$navigation_widget_added
)
{
if
(
$widget
instanceof
NavigationWidget
&&
!
$navigation_widget_added
&&
$widget
->
hasElements
()
)
{
SkipLinks
::
addIndex
(
_
(
'Dritte Navigationsebene'
),
$widget
->
getId
(),
...
...
@@ -197,7 +197,7 @@ class Sidebar extends WidgetContainer
$navigation_widget_added
=
true
;
}
if
(
$widget
instanceof
ActionsWidget
&&
!
$actions_widget_added
)
{
if
(
$widget
instanceof
ActionsWidget
&&
!
$actions_widget_added
&&
$widget
->
hasElements
()
)
{
if
(
!
$widget
->
getId
())
{
$widget
->
setId
(
'sidebar-actions'
);
}
...
...
This diff is collapsed.
Click to expand it.
templates/header.php
+
6
−
2
View file @
cc617253
...
...
@@ -216,7 +216,9 @@ if ($navigation) {
<!-- Main navigation and right-hand logo -->
<nav
id=
"navigation-level-1"
aria-label=
"
<?=
_
(
'Hauptnavigation'
)
?>
"
>
<?
SkipLinks
::
addIndex
(
_
(
'Hauptnavigation'
),
'navigation-level-1'
,
2
,
false
);
?>
<?
if
(
!
empty
(
$header_nav
[
'visible'
]))
:
?>
<?
SkipLinks
::
addIndex
(
_
(
'Hauptnavigation'
),
'navigation-level-1'
,
2
,
false
)
?>
<?
endif
?>
<ul
id=
"navigation-level-1-items"
<?
if
(
count
(
$header_nav
[
'hidden'
])
>
0
)
echo
'class="overflown"'
;
?>
>
<?
foreach
(
$header_nav
[
'visible'
]
as
$path
=>
$nav
)
:
?>
<?=
$this
->
render_partial
(
...
...
@@ -297,10 +299,12 @@ if ($navigation) {
</div>
<?
endif
?>
<?
SkipLinks
::
addIndex
(
_
(
'Zweite Navigationsebene'
),
'navigation-level-2'
,
910
)
?>
<nav
id=
"navigation-level-2"
aria-label=
"
<?=
_
(
'Zweite Navigationsebene'
)
?>
"
>
<?
if
(
PageLayout
::
isHeaderEnabled
()
/*&& isset($navigation)*/
)
:
?>
<?
if
(
!
empty
(
$navigation
))
:
?>
<?
SkipLinks
::
addIndex
(
_
(
'Zweite Navigationsebene'
),
'navigation-level-2'
,
910
)
?>
<?
endif
?>
<?=
$this
->
render_partial
(
'tabs'
,
compact
(
'navigation'
))
?>
<?
endif
;
?>
</nav>
...
...
This diff is collapsed.
Click to expand it.
templates/tabs.php
+
2
−
2
View file @
cc617253
...
...
@@ -7,10 +7,10 @@ foreach (Navigation::getItem("/")->getSubNavigation() as $path => $nav) {
}
?>
<div
class=
"tabs_wrapper"
>
<?
SkipLinks
::
addIndex
(
_
(
'Zweite Navigationsebene'
),
'navigation-level-2'
,
10
,
false
);
?>
<ul
id=
"tabs"
>
<?
if
(
!
empty
(
$navigation
))
:
?>
<?
foreach
(
$navigation
as
$path
=>
$nav
)
:
?>
<?
SkipLinks
::
addIndex
(
_
(
'Zweite Navigationsebene'
),
'navigation-level-2'
,
10
,
false
);
?>
<?
foreach
(
$navigation
as
$path
=>
$nav
)
:
?>
<?
if
(
$nav
->
isVisible
())
:
?>
<li
id=
"nav_
<?=
$path1
??
''
?>
_
<?=
$path
?>
"
<?=
$nav
->
isActive
()
?
' class="current"'
:
''
?>
>
<?
if
(
$nav
->
isEnabled
())
:
?>
...
...
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