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 77e66e7a9c2bd013b17e6ec8d65629e1de40a133..4608c7f89146008c059c9a01318879b05dd3bc46 100644 --- a/app/Models/Quicktips/Quicktips.php +++ b/app/Models/Quicktips/Quicktips.php @@ -136,6 +136,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(); @@ -160,6 +168,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 46fcbefc7b4dd311967969d677c4f89fec533e86..222c2b0ba2dce0067223fc791389ec5db3759a0a 100644 --- a/resources/assets/less/metager/quicktips.less +++ b/resources/assets/less/metager/quicktips.less @@ -117,30 +117,41 @@ color: #404040; font-style: italic; align-self: flex-end; + quotes: '„' 'â€'; + &:before { + content: open-quote; + } + &:after { + content: close-quote; + } + } + .author { + color: #404040; + font-style: italic; + float: right; } } - } - &[type=duckDuckGo-bang] { - order: 2; - .bang-btn { - width: 100%; - margin-top: 5px; - color: #fff; - background-color: #286992; - font-size: 16px; + &[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; } } - &[type=wikipedia] { - order: 3; - } - &[type=dictCC] { - order: 4; - } - &[type=tip] { - order: 5; - } - &[type=ad] { - order: 6; - } - } -} \ No newline at end of file + } \ 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