Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uffd
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rixx
uffd
Commits
ee4179e0
Commit
ee4179e0
authored
4 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Fixed navbar behaviour if bar is empty and collapsed
parent
c1bfe644
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
uffd/navbar.py
+2
-2
2 additions, 2 deletions
uffd/navbar.py
uffd/templates/base.html
+4
-4
4 additions, 4 deletions
uffd/templates/base.html
with
6 additions
and
6 deletions
uffd/navbar.py
+
2
−
2
View file @
ee4179e0
...
...
@@ -3,7 +3,7 @@ navbarList = []
# pylint: enable=invalid-name
def
setup_navbar
(
app
):
app
.
jinja_env
.
globals
[
'
navbar
'
]
=
navbarList
app
.
jinja_env
.
globals
[
'
get
navbar
'
]
=
lambda
:
[
n
for
n
in
navbarList
if
n
[
'
visible
'
]()]
# iconlib can be 'bootstrap'
# ( see: http://getbootstrap.com/components/#glyphicons )
...
...
@@ -27,7 +27,7 @@ def register_navbar(name, iconlib='fa', icon=None, group=None, endpoint=None, bl
item
[
'
endpoint
'
]
=
urlendpoint
item
[
'
name
'
]
=
name
item
[
'
blueprint
'
]
=
blueprint
item
[
'
visible
'
]
=
visible
item
[
'
visible
'
]
=
visible
or
(
lambda
:
True
)
navbarList
.
append
(
item
)
return
func
return
wrapper
This diff is collapsed.
Click to expand it.
uffd/templates/base.html
+
4
−
4
View file @
ee4179e0
...
...
@@ -36,17 +36,18 @@
<nav
class=
"navbar navbar-expand-md navbar-dark bg-dark static-top"
>
<a
class=
"navbar-brand"
href=
"{{ url_for('index') }}"
>
uffd
</a>
{% if getnavbar() %}
<button
class=
"navbar-toggler"
type=
"button"
data-toggle=
"collapse"
data-target=
"#baseNavbar"
aria-controls=
"baseNavbar"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
>
<span
class=
"navbar-toggler-icon"
></span>
</button>
<div
class=
"collapse navbar-collapse"
id=
"baseNavbar"
>
<ul
class=
"navbar-nav mr-auto"
>
{% for n in navbar if
(
not n.group
) and (not n.visible or n.visible())
%}
{% for n in
get
navbar
()
if not n.group %}
{{ navbaricon(n) }}
{% endfor %}
{% for grouper, list in navbar|rejectattr("group", "none")|groupby("group") %}
{% for grouper, list in
get
navbar
()
|rejectattr("group", "none")|groupby("group") %}
<li
class=
"nav-item dropdown {% if request.endpoint in list|map(attribute='endpoint') %} active{% endif %}"
>
<a
class=
"nav-link dropdown-toggle dropdow-clickable"
...
...
@@ -76,9 +77,8 @@
</li>
</ul>
{% endif %}
</div>
{% endif %}
</nav>
{% endblock navbar %}
...
...
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