diff --git a/app/Models/Quicktips/Quicktip.php b/app/Models/Quicktips/Quicktip.php index 30f9140411a422e4d4cdc1cc6898889548c5492f..4d7201ca2799b6dfef48f94663d37bc5fe076ca9 100644 --- a/app/Models/Quicktips/Quicktip.php +++ b/app/Models/Quicktips/Quicktip.php @@ -9,17 +9,19 @@ class Quicktip public $link; public $gefVonTitle; public $gefVonLink; + public $author; public $descr; public $details; # Erstellt ein neues Ergebnis - public function __construct($type, $title, $link, $gefVonTitle, $gefVonLink, $descr, $details) + public function __construct($type, $title, $link, $gefVonTitle, $gefVonLink, $author, $descr, $details) { $this->type = $type; $this->title = $title; $this->link = $link; $this->gefVonTitle = $gefVonTitle; $this->gefVonLink = $gefVonLink; + $this->author = $author; $this->descr = $descr; $this->details = $details; } diff --git a/app/Models/Quicktips/Quicktips.php b/app/Models/Quicktips/Quicktips.php index d143b6919c651f3c5e65430ae4e8554bf31d72f5..2c1d7ddf414cf970efff703935d4b61de76e66f0 100644 --- a/app/Models/Quicktips/Quicktips.php +++ b/app/Models/Quicktips/Quicktips.php @@ -12,7 +12,7 @@ class Quicktips { use DispatchesJobs; - const QUICKTIP_URL = "http://localhost:63825/quicktips.xml"; + const QUICKTIP_URL = "http://localhost:63825/1.1.0/quicktips.xml"; const QUICKTIP_NAME = "quicktips"; const CACHE_DURATION = 60; @@ -135,6 +135,14 @@ class Quicktips $gefVonLink = ""; } + $quicktip_xml->registerXPathNamespace('mg', 'http://metager.de/opensearch/quicktips/'); + $author = $quicktip_xml->xpath('mg:author'); + if (sizeof($author) > 0) { + $author = $author[0]->__toString(); + } else { + $author = ""; + } + // Description $descr = $quicktip_xml->content->__toString(); @@ -159,6 +167,7 @@ class Quicktips $link, $gefVonTitle, $gefVonLink, + $author, $descr, $details ); diff --git a/resources/assets/less/metager/quicktips.less b/resources/assets/less/metager/quicktips.less index 40eb8e85f6b771d64901e5924e9630b3051cec6c..2c2e8c6b5ca0bf47314ea2ee1b300e34d9cd6699 100644 --- a/resources/assets/less/metager/quicktips.less +++ b/resources/assets/less/metager/quicktips.less @@ -4,142 +4,151 @@ @quicktip-font-medium: @result-font-medium; @quicktip-font-small: @result-font-small; #quicktips { - display: flex; - flex-direction: column; - .quicktip { - .card-light; - position: relative; - details[open=""] .quicktip-extender { - animation-name: quicktip-extender-turn; - animation-fill-mode: forwards; - } - margin: 10px 0px; - padding: 10px 10px 10px 10px; - width: 100%; - border: 1px solid #ccc; - background-color: white; - details:not([open=""]) { - .quicktip-summary p { - .overflow-ellipsis; - } - } - .quicktip-summary { - .quicktip-headline { + display: flex; + flex-direction: column; + .quicktip { + .card-light; + position: relative; + details[open=""] .quicktip-extender { + animation-name: quicktip-extender-turn; + animation-fill-mode: forwards; + } + margin: 10px 0px; + padding: 10px 10px 10px 10px; width: 100%; - display: flex; - justify-content: space-between; - .quicktip-title, - .quicktip-title a { - flex-grow: 0; - margin: 0px 0px 5px 0px; - font-size: 13px; - display: flex; - justify-content: space-between; + border: 1px solid #ccc; + background-color: white; + details:not([open=""]) { + .quicktip-summary p { + .overflow-ellipsis; + } } - .space-taker { - flex-grow: 1; + .quicktip-summary { + .quicktip-headline { + width: 100%; + display: flex; + justify-content: space-between; + .quicktip-title, + .quicktip-title a { + flex-grow: 0; + margin: 0px 0px 5px 0px; + font-size: 13px; + display: flex; + justify-content: space-between; + } + .space-taker { + flex-grow: 1; + } + .quicktip-hoster { + flex-grow: 0; + font-size: @quicktip-font-small; + color: #808080; + white-space: nowrap; + } + .quicktip-extender { + flex-grow: 0; + color: #777; + font-size: 20px; + height: 20px; + font-size: @quicktip-font-large; + } + >* { + margin: 0px 5px; + &:first-child { + margin-left: 0px; + } + &:last-child { + margin-right: 0px; + } + } + } + .result-hoster { + font-size: @result-font-small; + margin-left: 20px; + color: #808080; + white-space: nowrap; + } + p { + font-size: 13px; + } } - .quicktip-hoster { - flex-grow: 0; - font-size: @quicktip-font-small; - color: #808080; - white-space: nowrap; + .quicktip-detail { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + h2 { + margin: 10px 0px; + font-size: 16px; + } + p { + display: none; + font-size: 14px; + } } - .quicktip-extender { - flex-grow: 0; - color: #777; - font-size: 20px; - height: 20px; - font-size: @quicktip-font-large; + &[type="spendenaufruf"] { + order: 100; + border: none; + box-shadow: none; + background-color: inherit; + .quicktip-summary { + display: flex; + justify-content: space-between; + align-items: center; + h1 { + margin: 0px; + } + p { + margin: 5px; + .spendenaufruf-btn { + color: white; + background-color: @link-color; + font-size: 16px; + } + } + } } - > * { - margin: 0px 5px; - &:first-child { - margin-left: 0px; - } - &:last-child { - margin-right: 0px; - } + &[type="spruch"] { + order: 1; + .quicktip-summary { + display: flex; + flex-direction: column; + p { + text-align: justify; + font-style: italic; + quotes: '„' 'â€'; + &:before { + content: open-quote; + } + &:after { + content: close-quote; + } + } + .author { + color: #404040; + align-self: flex-end; + } + } } - } - .result-hoster { - font-size: @result-font-small; - margin-left: 20px; - color: #808080; - white-space: nowrap; - } - p { - font-size: 13px; - } - } - .quicktip-detail { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - h2 { - margin: 10px 0px; - font-size: 16px; - } - p { - display: none; - font-size: 14px; - } - } - &[type="spendenaufruf"] { - order: 100; - border: none; - box-shadow: none; - background-color: inherit; - .quicktip-summary { - display: flex; - justify-content: space-between; - align-items: center; - h1 { - margin: 0px; + &[type="duckDuckGo-bang"] { + order: 2; + .bang-btn { + width: 100%; + margin-top: 5px; + color: #fff; + background-color: #286992; + font-size: 16px; + } } - p { - margin: 5px; - .spendenaufruf-btn { - color: white; - background-color: @link-color; - font-size: 16px; - } + &[type="wikipedia"] { + order: 3; } - } - } - &[type="spruch"] { - order: 1; - p { - display: flex; - flex-direction: column; - text-align: justify; - .author { - color: #404040; - font-style: italic; - align-self: flex-end; + &[type="dictCC"] { + order: 4; + } + &[type="tip"] { + order: 5; + } + &[type="ad"] { + order: 6; } - } - } - &[type="duckDuckGo-bang"] { - order: 2; - .bang-btn { - width: 100%; - margin-top: 5px; - color: #fff; - background-color: #286992; - font-size: 16px; - } - } - &[type="wikipedia"] { - order: 3; - } - &[type="dictCC"] { - order: 4; - } - &[type="tip"] { - order: 5; - } - &[type="ad"] { - order: 6; } - } -} +} \ No newline at end of file diff --git a/resources/views/parts/quicktip.blade.php b/resources/views/parts/quicktip.blade.php index 25f6425101606e423d2b8e8481f3473e0a116ae2..08dd26f334af78a72848d779049b398b4f0390cb 100644 --- a/resources/views/parts/quicktip.blade.php +++ b/resources/views/parts/quicktip.blade.php @@ -24,6 +24,9 @@ <i class="quicktip-extender fa fa-chevron-down"></i> </div> <p class="quicktip-description">{!! $quicktip->descr !!}</p> + @if ($quicktip->author != "") + <span class="author">{{ $quicktip->author }}</span> + @endif </summary> @foreach ($quicktip->details as $detail) <div class="quicktip-detail"> @@ -62,5 +65,8 @@ @endif </div> <p>{!! $quicktip->descr !!}</p> + @if ($quicktip->author != "") + <span class="author">{{ $quicktip->author }}</span> + @endif </div> -@endif \ No newline at end of file +@endif