Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
open-source
MetaGer
Commits
c1cf1208
Commit
c1cf1208
authored
6 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
We now catch the error in case of Database connection issues so that MetaGer works anyways
parent
58c80d4a
No related branches found
Branches containing commit
No related tags found
1 merge request
!1365
Resolve "Filter Options for MetaGer"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Http/Controllers/StartpageController.php
+11
-0
11 additions, 0 deletions
app/Http/Controllers/StartpageController.php
resources/views/index.blade.php
+1
-1
1 addition, 1 deletion
resources/views/index.blade.php
with
12 additions
and
1 deletion
app/Http/Controllers/StartpageController.php
+
11
−
0
View file @
c1cf1208
...
...
@@ -7,6 +7,8 @@ use Illuminate\Http\Request;
use
Jenssegers\Agent\Agent
;
use
LaravelLocalization
;
use
Response
;
use
DB
;
use
Log
;
class
StartpageController
extends
Controller
{
...
...
@@ -41,6 +43,14 @@ class StartpageController extends Controller
if
(
$lang
===
'de'
||
$lang
===
"en"
)
{
$lang
=
'all'
;
}
# Sponsorenlinks
$sponsors
=
[];
try
{
$sponsors
=
DB
::
table
(
'sponsorenlinks'
)
->
where
(
'langcode'
,
'de'
)
->
orderByRaw
(
'LENGTH(linktext)'
,
'ASC'
)
->
get
();
}
catch
(
\Illuminate\Database\QueryException
$e
){
Log
::
info
(
$e
);
}
return
view
(
'index'
)
->
with
(
'title'
,
trans
(
'titles.index'
))
...
...
@@ -52,6 +62,7 @@ class StartpageController extends Controller
->
with
(
'request'
,
$request
->
input
(
'request'
,
'GET'
))
->
with
(
'option_values'
,
$option_values
)
->
with
(
'autocomplete'
,
$autocomplete
)
->
with
(
'sponsors'
,
$sponsors
)
->
with
(
'pluginmodal'
,
$request
->
input
(
'plugin-modal'
,
'off'
));
}
...
...
This diff is collapsed.
Click to expand it.
resources/views/index.blade.php
+
1
−
1
View file @
c1cf1208
...
...
@@ -25,7 +25,7 @@
<
div
id
=
"sponsors"
>
<
h2
>
{{
trans
(
'index.sponsors.head.2'
)
}}
</
h2
>
<
ul
class
=
"startpage"
>
@
foreach
(
DB
::
table
(
'sponsorenlinks'
)
->
where
(
'langcode'
,
'de'
)
->
orderByRaw
(
'LENGTH(linktext)'
,
'ASC'
)
->
get
()
as
$link
)
@
foreach
(
$sponsors
as
$link
)
<
li
class
=
"sponsor"
>
<
a
href
=
"{{
$link->link
}}"
target
=
"_blank"
rel
=
"noopener"
><
p
>
{{
$link
->
linktext
}}
</
p
>
<
i
class
=
"fa fa-external-link"
></
i
></
a
>
</
li
>
...
...
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