Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
MetaGer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
54
Issues
54
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
open-source
MetaGer
Commits
6051ab78
Commit
6051ab78
authored
Nov 10, 2016
by
Karl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Die Wettersuche ist jetzt unter den Quicktips eingebaut
parent
607e8271
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
100 additions
and
7 deletions
+100
-7
app/Http/Controllers/MetaGerSearch.php
app/Http/Controllers/MetaGerSearch.php
+37
-1
public/css/themes/default.css
public/css/themes/default.css
+16
-0
public/css/themes/default.css.map
public/css/themes/default.css.map
+1
-1
resources/assets/less/metager/metager.less
resources/assets/less/metager/metager.less
+1
-0
resources/assets/less/metager/quicktips.less
resources/assets/less/metager/quicktips.less
+19
-0
resources/views/quicktip.blade.php
resources/views/quicktip.blade.php
+26
-5
No files found.
app/Http/Controllers/MetaGerSearch.php
View file @
6051ab78
...
...
@@ -85,8 +85,44 @@ class MetaGerSearch extends Controller
fclose
(
$file
);
}
# Wikipedia Quicktip
$quicktips
=
[];
# Das Wetter
try
{
if
(
App
::
isLocale
(
'en'
))
{
$url
=
"http://api.openweathermap.org/data/2.5/weather?type=like&units=metric&lang=en&q="
.
urlencode
(
$q
)
.
"&APPID="
.
getenv
(
"openweathermap"
);
}
else
{
$url
=
"http://api.openweathermap.org/data/2.5/weather?type=like&units=metric&lang=de&q="
.
urlencode
(
$q
)
.
"&APPID="
.
getenv
(
"openweathermap"
);
}
$result
=
json_decode
(
$this
->
get
(
$url
),
true
);
$weather
=
[];
$weather
[
"title"
]
=
"Wetter in "
.
$result
[
"name"
];
$weather
[
"URL"
]
=
"http://openweathermap.org/city/"
.
$result
[
"id"
];
$descr
=
'<b class="detail-short">'
.
$result
[
"main"
][
"temp"
]
.
" °C, "
.
$result
[
"weather"
][
0
][
"description"
]
.
"</b>"
;
$details
=
'<table class="table table-condensed"><tr><td>Temperatur</td><td>'
.
$result
[
"main"
][
"temp_min"
]
.
" bis "
.
$result
[
"main"
][
"temp_max"
]
.
" °C</td></tr>"
;
$details
.
=
"<tr><td>Druck</td><td>"
.
$result
[
"main"
][
"pressure"
]
.
" hPa</td></tr>"
;
$details
.
=
"<tr><td>Luftfeuchtigkeit</td><td>"
.
$result
[
"main"
][
"humidity"
]
.
" %</td></tr>"
;
$details
.
=
"<tr><td>Wind</td><td>"
.
$result
[
"wind"
][
"speed"
]
.
" m/s, "
.
$result
[
"wind"
][
"deg"
]
.
"°</td></tr>"
;
$details
.
=
"<tr><td>Bewölkung</td><td>"
.
$result
[
"clouds"
][
"all"
]
.
" %</td></tr>"
;
if
(
isset
(
$result
->
rain
))
{
$details
.
=
" | Regen letzte drei Stunden: "
.
$result
[
"rain"
][
"3h"
]
.
" h"
;
}
$details
.
=
"</table>"
;
$weather
[
"descr"
]
=
$descr
;
$weather
[
"details"
]
=
$details
;
$weather
[
"gefVon"
]
=
"von <a href =
\"
https://openweathermap.org
\"
target=
\"
_blank
\"
rel=
\"
noopener
\"
>Openweathermap</a>"
;
$requestData
=
[];
$requestData
[
"url"
]
=
"http://openweathermap.org/img/w/"
;
$weather
[
"image"
]
=
action
(
'Pictureproxy@get'
,
$requestData
)
.
$result
[
"weather"
][
0
][
"icon"
]
.
".png"
;
$weather
[
"image-alt"
]
=
$result
[
"weather"
][
0
][
"main"
];
$mquicktips
[]
=
$weather
;
}
catch
(
\
ErrorException
$e
)
{
}
# Wikipedia Quicktip
if
(
App
::
isLocale
(
'en'
))
{
$url
=
"https://en.wikipedia.org/w/api.php?action=opensearch&search="
.
urlencode
(
$q
)
.
"&limit=1&namespace=0&format=json"
;
}
else
{
...
...
public/css/themes/default.css
View file @
6051ab78
...
...
@@ -6672,6 +6672,22 @@ button.close {
display
:
none
!important
;
}
}
.qtheader
{
font-size
:
16px
;
margin
:
0px
;
font-weight
:
bold
;
}
.info-details-available
{
cursor
:
pointer
;
}
.detail-short
{
font-weight
:
bold
;
font-size
:
18px
;
line-height
:
60px
;
}
.qt-icon
{
height
:
60px
;
}
#spruch
.author
{
font-size
:
14px
;
color
:
#888
;
...
...
public/css/themes/default.css.map
View file @
6051ab78
This diff is collapsed.
Click to expand it.
resources/assets/less/metager/metager.less
View file @
6051ab78
//@import "./result-page.less";
@import "./quicktips.less";
#spruch .author {
...
...
resources/assets/less/metager/quicktips.less
0 → 100644
View file @
6051ab78
.qtheader {
font-size: 16px;
margin: 0px;
font-weight: bold;
}
.info-details-available {
cursor: pointer;
}
.detail-short {
font-weight: bold;
font-size: 18px;
line-height: 60px;
}
.qt-icon {
height: 60px;
}
\ No newline at end of file
resources/views/quicktip.blade.php
View file @
6051ab78
...
...
@@ -9,11 +9,32 @@
@endif
@foreach( $mqs as $mq)
<div
class=
"quicktip"
>
<b
class=
"qtheader"
><a
href=
"{{ $mq['URL'] }}"
target=
"_blank"
rel=
"noopener"
>
{{ $mq['title'] }}
</a></b><br>
<div>
{!! $mq['descr'] !!}
</div>
@if( isset($mq['gefVon']) )
<div
class=
"pull-right"
>
{!! $mq['gefVon'] !!}
</div>
@endif
<h2
class=
"qtheader"
><a
href=
"{{ $mq['URL'] }}"
target=
"_blank"
rel=
"noopener"
>
{{ $mq['title'] }}
</a></h2>
<details>
<summary>
<div
class=
"media"
>
@if( isset($mq['image'])
&&
isset($mq['image-alt'] ))
<div
class=
"media-left"
>
<img
class=
"qt-icon"
src=
"{!! $mq['image'] !!}"
alt=
"{!! $mq['image-alt'] !!}"
>
</div>
@endif
<div
class=
"media-body"
>
<div>
{!! $mq['descr'] !!}
</div>
</div>
@if( isset($mq['details']) )
<div
class=
"media-right"
>
<span
class=
"glyphicon glyphicon-info-sign info-details-available"
aria-hidden=
"true"
></span>
</div>
@endif
</div>
</summary>
@if( isset($mq['details']) )
{!! $mq['details'] !!}
@endif
</details>
@if( isset($mq['gefVon']) )
<div
class=
"pull-right"
>
{!! $mq['gefVon'] !!}
</div>
@endif
</div>
@endforeach
</body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment