diff --git a/app/Models/Result.php b/app/Models/Result.php index 1a60403dee5bf81ad5c8f5de443a5e701bdb1ac7..81b887750ea6f85c165c387b564644b67fc85c64 100644 --- a/app/Models/Result.php +++ b/app/Models/Result.php @@ -65,9 +65,22 @@ class Result $this->partnershop = isset($additionalInformation["partnershop"]) ? $additionalInformation["partnershop"] : false; $this->image = isset($additionalInformation["image"]) ? $additionalInformation["image"] : ""; $this->price = isset($additionalInformation["price"]) ? $additionalInformation["price"] : 0; + $this->price_text = $this->price_to_text($this->price); $this->additionalInformation = $additionalInformation; } + private function price_to_text($price) + { + $euros = $price / 100; + $cents = $price % 100; + $price_text = $euros . ','; + if ($cents < 10) { + $price_text .= '0'; + } + $price_text .= $cents . ' €'; + return $price_text; + } + /* Ranked das Ergebnis nach folgenden Aspekten: * Startwert 0 * + 0.02 * Sourcerank (20 - Position in Ergebnisliste des Suchanbieters) diff --git a/resources/assets/less/metager/result.less b/resources/assets/less/metager/result.less index 9d5c59b7219ef16c43b5534ec3a0482369c9a428..079458a66ca3142df88e3fd22e7696158db35490 100644 --- a/resources/assets/less/metager/result.less +++ b/resources/assets/less/metager/result.less @@ -14,7 +14,16 @@ justify-content: space-between; .result-title { margin: 0px; + &>* { + font-size: @result-font-large; + } .overflow-ellipsis; + .result-price { + padding: 0px 10px; + color: white; + background-color: #ff8000; + border-radius: 3px; + } a { &, &:active, @@ -23,7 +32,6 @@ &:visited { color: black; text-decoration: none; - font-size: @result-font-large; } } } @@ -50,10 +58,23 @@ } } } - .resultpage-body { + .result-body { margin-top: 10px; width: 90%; + display: flex; text-align: justify; + .result-image { + width: 180px; + padding-right: 10px; + margin-right: 10px; + & img { + display: block; + max-width: 160px; + max-height: 120px; + width: auto; + height: auto; + } + } .result-description { margin-bottom: 3px; word-break: break-word; @@ -79,11 +100,6 @@ border: solid 1px @result-description-img-border-color; } } - .result-image>img { - height: 100px; - padding: 10px; - max-width: 100%; - } } .result-footer { margin-top: 10px; diff --git a/resources/views/layouts/ad.blade.php b/resources/views/layouts/ad.blade.php index 3ad6119e7d72d917d2c93e450eed3d56fdad9427..09476d1adfe406b1dc6e527f4621b205d88a200e 100644 --- a/resources/views/layouts/ad.blade.php +++ b/resources/views/layouts/ad.blade.php @@ -14,7 +14,7 @@ {{ $ad->anzeigeLink }} </a> </div> - <div class="resultpage-body"> + <div class="result-body"> <div class="result-description"> {{ $ad->descr }} </div> diff --git a/resources/views/layouts/result.blade.php b/resources/views/layouts/result.blade.php index 0f7635b22c6b43a51e27729587894e7ebe2f2da2..4927b370f99219cf367ed56c3402662ebee774a3 100644 --- a/resources/views/layouts/result.blade.php +++ b/resources/views/layouts/result.blade.php @@ -5,6 +5,9 @@ @if(stripos($result->anzeigeLink, "twitter.com") !== false) <i class="fa fa-twitter" aria-hidden="true"></i> @endif + @if( isset($result->price) && $result->price != 0) + <span class="result-price">{!! $result->price_text !!}</span> + @endif <a href="{{ $result->link }}" target="{{ $metager->getNewtab() }}" rel="noopener"> {!! $result->titel !!} </a> @@ -21,7 +24,7 @@ </span> @endif </div> - <div class="resultpage-body"> + <div class="result-body"> @if( isset($result->logo) ) <div class="result-logo"> <a href="{{ $result->link }}" target="{{ $metager->getNewtab() }}" rel="noopener"> @@ -30,22 +33,20 @@ </div> @endif @if( $result->image !== "" ) - <div class="result-image result-description"> + <div class="result-image"> <a href="{{ $result->link }}" target="{{ $metager->getNewtab() }}" rel="noopener"> <img src="{{ $metager->getImageProxyLink($result->image) }}" align="left" width="120px" height="60px" alt="" /> </a> - {!! $result->descr !!} + </div> + @endif + @if( $metager->getFokus() == "nachrichten" ) + <div class="result-description"> + <span class="date">{{ isset($result->additionalInformation["date"])?date("Y-m-d H:i:s", $result->additionalInformation["date"]):"" }}</span> {{ $result->descr }} </div> @else - @if( $metager->getFokus() == "nachrichten" ) - <div class="result-description"> - <span class="date">{{ isset($result->additionalInformation["date"])?date("Y-m-d H:i:s", $result->additionalInformation["date"]):"" }}</span> {{ $result->descr }} - </div> - @else - <div class="result-description"> - {{ $result->descr }} - </div> - @endif + <div class="result-description"> + {!! $result->descr !!} + </div> @endif </div> <div class="result-footer">