Commit 9cfba91d authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch '707-metager-spruche' into 'development'

Resolve "Metager-Sprüche"

Closes #707

See merge request !1298
parents 056efb8b e41600df
......@@ -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;
}
......
......@@ -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
);
......
......@@ -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
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment