summaryrefslogtreecommitdiff
path: root/site/resources
diff options
context:
space:
mode:
authorhorus2019-02-11 01:42:27 +0100
committerhorus2019-02-11 01:42:27 +0100
commit4e9193fd3b7b0784e6371c4a786b546c27d9d2a5 (patch)
tree09f6814cc0bf68d2810cdcd9abb2abdfe9f12c5b /site/resources
parent5774ad53ed9d72365fe3eea9eebe128c8ae4da0c (diff)
downloadalkobote-4e9193fd3b7b0784e6371c4a786b546c27d9d2a5.tar.gz
Support for inclusion in Wordpress. (site)
Diffstat (limited to 'site/resources')
-rw-r--r--site/resources/views/snippets/wpsortbuttons.blade.php62
-rw-r--r--site/resources/views/wpoffer.blade.php104
2 files changed, 166 insertions, 0 deletions
diff --git a/site/resources/views/snippets/wpsortbuttons.blade.php b/site/resources/views/snippets/wpsortbuttons.blade.php
new file mode 100644
index 0000000..3f283c0
--- /dev/null
+++ b/site/resources/views/snippets/wpsortbuttons.blade.php
@@ -0,0 +1,62 @@
+
+<div class="container" style="margin-bottom: 1rem;">
+<div class="row">
+<div class="btn-toolbar mb-2 align-top w-100" role="toolbar" aria-label="Sortieren">
+ <div class="btn-group" role="group" aria-label="Sortieren">
+ <div class="dropdown mr-2">
+ <button class="btn btn-tertiary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Preis
+ </button>
+ <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
+ <a class="dropdown-item" href="?_sort=price&_order=asc{!! Request::is('search') ? '&q=' : '' !!}{{ Request::is('search') ? $search_phrase : '' }}" oonclick="javascript:_paq.push(['trackEvent', 'Sort-Button', 'Preis', 'Niedrigster Preis']);">Niedrigster Preis</a>
+ <a class="dropdown-item" href="?_sort=price&_order=desc{!! Request::is('search') ? '&q=' : '' !!}{{ Request::is('search') ? $search_phrase : '' }}" oonclick="javascript:_paq.push(['trackEvent', 'Sort-Button', 'Preis', 'Höchster Preis']);">Höchster Preis</a>
+ </div>
+ </div>
+ <div class="dropdown mr-2">
+ <button class="btn btn-tertiary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Name
+ </button>
+ <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
+ <a class="dropdown-item" href="?_sort=name&_order=asc{!! Request::is('search') ? '&q=' : '' !!}{{ Request::is('search') ? $search_phrase : '' }}" oonclick="javascript:_paq.push(['trackEvent', 'Sort-Button', 'Name', 'Alphabetisch']);">Alphabetisch</a>
+ <a class="dropdown-item" href="?_sort=name&_order=desc{!! Request::is('search') ? '&q=' : '' !!}{{ Request::is('search') ? $search_phrase : '' }}" oonclick="javascript:_paq.push(['trackEvent', 'Sort-Button', 'Name', 'Umgekehrt']);">Umgekehrt</a>
+ </div>
+ </div>
+ <div class="dropdown mr-2">
+ <button class="btn btn-tertiary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Shop
+ </button>
+ <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
+ <a class="dropdown-item" href="?_sort=shop&_order=asc{!! Request::is('search') ? '&q=' : '' !!}{{ Request::is('search') ? $search_phrase : '' }}" oonclick="javascript:_paq.push(['trackEvent', 'Sort-Button', 'Shop', 'Alphabetisch']);">Alphabetisch</a>
+ <a class="dropdown-item" href="?_sort=shop&_order=desc{!! Request::is('search') ? '&q=' : '' !!}{{ Request::is('search') ? $search_phrase : '' }}" oonclick="javascript:_paq.push(['trackEvent', 'Sort-Button', 'Shop', 'Umgekehrt']);">Umgekehrt</a>
+ </div>
+ </div>
+ </div>
+ <div class="btn-group mr-auto" role="group" aria-label="Sortieren">
+ <div class="dropdown mr-2">
+ <button class="btn btn-tertiary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Preisnachlass
+ </button>
+ <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
+ <a class="dropdown-item" href="?_sort=procent&_order=asc{!! Request::is('search') ? '&q=' : '' !!}{{ Request::is('search') ? $search_phrase : '' }}" oonclick="javascript:_paq.push(['trackEvent', 'Sort-Button', 'Preisnachlass', 'Niedrigster Preisnachlass']);">Niedrigster Preisnachlass</a>
+ <a class="dropdown-item" href="?_sort=procent&_order=desc{!! Request::is('search') ? '&q=' : '' !!}{{ Request::is('search') ? $search_phrase : '' }}" oonclick="javascript:_paq.push(['trackEvent', 'Sort-Button', 'Preisnachlass', 'Höchster Preisnachlass']);">Höchster Preisnachlass</a>
+ </div>
+ </div>
+ <div class="dropdown">
+ <button class="btn btn-tertiary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Aktualität
+ </button>
+ <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
+ <a class="dropdown-item" href="?_sort=time&_order=desc{!! Request::is('search') ? '&q=' : '' !!}{{ Request::is('search') ? $search_phrase : '' }}" oonclick="javascript:_paq.push(['trackEvent', 'Sort-Button', 'Aktualität', 'Neueste zuerst']);">Neueste zuerst</a>
+ <a class="dropdown-item" href="?_sort=time&_order=asc{!! Request::is('search') ? '&q=' : '' !!}{{ Request::is('search') ? $search_phrase : '' }}" oonclick="javascript:_paq.push(['trackEvent', 'Sort-Button', 'Aktualität', 'Älteste zuerst']);">Älteste zuerst</a>
+ </div>
+ </div>
+ </div>
+ <div class="btn-group " role="group" aria-label="Sortieren" style="justify-content: flex-end;">
+ <a class="btn btn-rss text-white" href={{ secure_url($rss_feed) }} title="Link zum RSS-Feed" oonclick="javascript:_paq.push(['trackEvent', 'Sort-Button', 'RSS-Feed']);">
+ <span class="oi oi-rss-alt" title="RSS-Feed" aria-hidden="true"></span>
+ </a>
+ </div>
+</div>
+</div>
+</div>
+
diff --git a/site/resources/views/wpoffer.blade.php b/site/resources/views/wpoffer.blade.php
new file mode 100644
index 0000000..3243b26
--- /dev/null
+++ b/site/resources/views/wpoffer.blade.php
@@ -0,0 +1,104 @@
+<?php
+if ( !$data->count() ) {
+ /* Keine Angebote */
+?>
+<div class="alert alert-secondary" data-track-content data-content-name="{{ ucfirst($spirit_type) }}" data-content-piece="Keine Angebote" data-content-target="">
+ <h4 class="alert-heading">Keine Angebote</h4>
+ Momentan liegen keine {{ $title }} vor. Probieren Sie es später noch einmal.
+</div>
+<?php
+ /* Ende Keine Angebote */
+} else {
+ /* Liste Angebote */
+
+?>
+
+@include('snippets.wpsortbuttons')
+<?php
+ foreach( $data as $offer) {
+?>
+
+ <div class="card">
+ <div class="row ">
+ <div class="col-md-4">
+<?php
+if ( "Drankdozijn" == $offer->shop ) {
+ $img_style = 'style="padding-top: 0.75rem;"';
+ $badge_style = 'style="margin-bottom: 150% !important;"';
+ $badge_style = 'style="top: 0 !important;"';
+ #$badge_style = "";
+} else {
+ $img_style = "";
+ $badge_style = "";
+?>
+ <div class="card-header-dp-none">
+ <p><strong>
+ <span style="visibility: hidden;">
+ {{ ucfirst($spirit_type) }} <span class="float-right">{{ $offer->shop }}</span>
+ </span>
+ </strong></p>
+ </div>
+<?php
+}
+?>
+ <div class="card-img-overlay card-img-overlay-badge" {!! $badge_style !!}>
+ <p class="card-text float-right rounded off-badge" {!! $badge_style !!}>{{ $offer->procent}}%</p>
+ </div>
+ <img src="{{ $offer->image_url}}" class="w-100 card-img" {!! $img_style !!}>
+ </div>
+ <div class="col-md-8 px-10">
+ <div class="card-header">
+ <p><strong>
+ {{ ucfirst($spirit_type) }} <span class="float-right">{{ $offer->shop }}</span>
+ </strong></p>
+ </div>
+ <div class="card-block card-body px-3">
+ <h3 class="card-title">{{ $offer->name }}</h3>
+ <div class="row">
+ <p class="card-text col-md-6">
+ Preis: {{ TF::fF($offer->discounted_price) }} €
+ <br>
+ Alter Preis: {{ TF::fF($offer->original_price) }} €
+ <br>
+<?php
+ if ( "" != $offer->free_shipping ) {
+ # todo: remove € sign from $free_shipping variable
+ $free_shipping = str_replace("€", "", $offer->free_shipping);
+?>
+ Versand: {{ TF::fF($offer->shipping_costs) }} €, gratis ab {{ $free_shipping }} €
+<?php
+ } else {
+?>
+ Versand ist nie kostenlos
+<?php
+ }
+?>
+ </p>
+ <p class="card-text col-md-6">
+ Alkohol: {{ TF::fF($offer->abv) . " %" }}
+ <br>
+ Volumen: {{ TF::fF($offer->volume) . " Liter" }}
+ <br>
+ {{ TF::fF($offer->base_price ) }} € / Liter
+ </p>
+ </div>
+ </div>
+ <div class="card-footer">
+ <a href="{{ $offer->url }}" class="btn btn-primary">Zum Shop</a>
+ <p class="float-right">Preis vom {{ strftime("%d. %B", $offer->created_at) }}</p>
+ </div>
+ </div>
+
+ </div>
+ </div>
+<?php
+}
+?>
+
+{{ $data->appends(Input::except('page'))->links() }}
+
+<?php
+ /* Ende Liste Angebote */
+}
+
+?>