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
6c37b9d2
Verified
Commit
6c37b9d2
authored
4 years ago
by
morre
Browse files
Options
Downloads
Patches
Plain Diff
Add banner to services overview
parent
308071ac
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
uffd/default_config.cfg
+7
-0
7 additions, 0 deletions
uffd/default_config.cfg
uffd/services/templates/overview.html
+8
-0
8 additions, 0 deletions
uffd/services/templates/overview.html
uffd/services/views.py
+8
-1
8 additions, 1 deletion
uffd/services/views.py
with
23 additions
and
1 deletion
uffd/default_config.cfg
+
7
−
0
View file @
6c37b9d2
...
@@ -122,6 +122,13 @@ SERVICES=[
...
@@ -122,6 +122,13 @@ SERVICES=[
# ]
# ]
# },
# },
]
]
# A banner text that will be displayed above the services list
SERVICES_BANNER
=
''
# If the banner should be shown to users who are not logged in
SERVICES_BANNER_PUBLIC
=
True
# Enable the service overview page for users who are not logged in
# Enable the service overview page for users who are not logged in
SERVICES_PUBLIC
=
True
SERVICES_PUBLIC
=
True
...
...
This diff is collapsed.
Click to expand it.
uffd/services/templates/overview.html
+
8
−
0
View file @
6c37b9d2
...
@@ -8,6 +8,14 @@
...
@@ -8,6 +8,14 @@
<div
class=
"alert alert-warning"
role=
"alert"
>
Some services may not be publicly listed! Log in to see all services you have access to.
</div>
<div
class=
"alert alert-warning"
role=
"alert"
>
Some services may not be publicly listed! Log in to see all services you have access to.
</div>
{% endif %}
{% endif %}
{% if banner %}
<div
class=
"card"
>
<div
class=
"card-body"
>
{{ banner|safe }}
</div>
</div>
{% endif %}
{% macro service_card(service) %}
{% macro service_card(service) %}
<div
class=
"col mb-4"
>
<div
class=
"col mb-4"
>
<div
class=
"card h-100 {{ 'text-muted' if not service.has_access }}"
>
<div
class=
"card h-100 {{ 'text-muted' if not service.has_access }}"
>
...
...
This diff is collapsed.
Click to expand it.
uffd/services/views.py
+
8
−
1
View file @
6c37b9d2
...
@@ -83,4 +83,11 @@ def index():
...
@@ -83,4 +83,11 @@ def index():
services
=
get_services
(
user
)
services
=
get_services
(
user
)
if
not
current_app
.
config
[
'
SERVICES
'
]:
if
not
current_app
.
config
[
'
SERVICES
'
]:
abort
(
404
)
abort
(
404
)
return
render_template
(
'
overview.html
'
,
user
=
user
,
services
=
services
)
banner
=
current_app
.
config
.
get
(
'
SERVICES_BANNER
'
)
# Set the banner to None if it is not public and no user is logged in
if
not
(
current_app
.
config
[
"
SERVICES_BANNER_PUBLIC
"
]
or
user
):
banner
=
None
return
render_template
(
'
overview.html
'
,
user
=
user
,
services
=
services
,
banner
=
banner
)
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