Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nodehive_core
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
project
nodehive_core
Commits
9fee24c5
Commit
9fee24c5
authored
1 year ago
by
Nejc Koporec
Browse files
Options
Downloads
Patches
Plain Diff
If no spaces, prompt the user to create one
parent
94d44090
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/SpaceListBuilder.php
+20
-2
20 additions, 2 deletions
src/SpaceListBuilder.php
with
20 additions
and
2 deletions
src/SpaceListBuilder.php
+
20
−
2
View file @
9fee24c5
...
...
@@ -53,13 +53,31 @@ class SpaceListBuilder extends EntityListBuilder {
* {@inheritdoc}
*/
public
function
render
()
{
$build
[
'table'
]
=
parent
::
render
();
$build
=
parent
::
render
();
$build
[
'table'
][
'#empty'
]
=
$this
->
t
(
"No spaces available, please <a href='@link'>create a new space.</a>"
,
[
'@link'
=>
Url
::
fromUserInput
(
'/space/add'
)
->
toString
(),
]
);
$total
=
$this
->
getStorage
()
->
getQuery
()
->
accessCheck
(
FALSE
)
->
count
()
->
execute
();
->
execute
();
if
(
!
$total
)
{
$this
->
messenger
()
->
addWarning
(
$this
->
t
(
"No spaces available, please <a href='@link'>create a new space.</a>"
,
[
'@link'
=>
Url
::
fromUserInput
(
'/space/add'
)
->
toString
(),
]
)
);
}
$build
[
'summary'
][
'#markup'
]
=
$this
->
t
(
'Total spaces: @total'
,
[
'@total'
=>
$total
]);
$build
[
'summary'
][
'#weight'
]
=
0
;
...
...
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