* Sidebar-Suchmaske
* Letzter Breadcrum-Eintrag ist kein Link * Sonstige Links im Layout (Impressum, etc.) * Vorschaubox-Anpassungen: page.box_body wurde nicht berücksichtigt; page.box_image_url wird jetzt gegenüber travelProgram.previewImage bevorzugt; Standard-Vorschaubild geändert * page.pagetitle gegenüber page.title als Seitenüberschrift bevorzugen * Fertigstellung Reiseprogrammseite; zu Tab-Inhalt scrollen; Bei Klick auf Buchen-Knopf zu Termintabelle scrollen (auch von der Suchseite aus) * Aufteilung der Vorschau-Boxen in vermittelte und nicht-vermittelte Reisen, falls es beide gibt * Falls page.real_path_url gesetzt wird => Eine Seite kann nicht mehr über den slug-Pfad (<eltern-seite>/<seite>) aufgerufen werden (Sonst gäbe es mehrere URLs für die gleiche Seite) git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3295 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
4c2fb2fd08
commit
20beca7c4d
25 changed files with 564 additions and 112 deletions
|
|
@ -74,6 +74,8 @@
|
|||
{% block breadcrumb %}
|
||||
{% if page is defined %}
|
||||
{{ render(controller('AppBundle:Default:breadcrumb', {'page': page})) }}
|
||||
{% elseif breadcrumb_entries is defined %}
|
||||
{{ include('default/components/breadcrumb.html.twig') }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
@ -81,7 +83,8 @@
|
|||
<div class="row">
|
||||
|
||||
{% include 'default/components/sidebar.html.twig' with {
|
||||
nav_sidebar_widget_block: block('nav_sidebar_widget')
|
||||
nav_sidebar_widget_block: block('nav_sidebar_widget'),
|
||||
search_sidebar_widget_block: block('search_sidebar_widget'),
|
||||
} %}
|
||||
|
||||
<div id="content" class="col-md-9 col-sm-8 col-xs-12">
|
||||
|
|
|
|||
|
|
@ -8,9 +8,13 @@
|
|||
{% for breadcrumb_entry in breadcrumb_entries %}
|
||||
{# @var breadcrumb_entry \AppBundle\Entity\BreadcrumbEntry #}
|
||||
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
|
||||
{% if not loop.last %}
|
||||
<a itemprop="item" href="{{ breadcrumb_entry.url }}">
|
||||
<span itemprop="name">{{ breadcrumb_entry.title }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<span itemprop="name">{{ breadcrumb_entry.title }}</span>
|
||||
{% endif %}
|
||||
<meta itemprop="position" property="position" content="{{ loop.index0 + 2 }}" />
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
|
|
|||
|
|
@ -117,11 +117,11 @@
|
|||
|
||||
<div class="col-md-6 text-right">
|
||||
<div class="link-footer">
|
||||
<a href="#" title="">Impressum</a> |
|
||||
<a href="#" title="">AGB</a> |
|
||||
<a href="#" title="">Datenschutz</a> |
|
||||
<a href="#" title="">Bildnachweise</a> |
|
||||
<a href="#" title="">Sitemap</a>
|
||||
<a href="/impressum" title="Impressum">Impressum</a> |
|
||||
<a href="/agb" title="AGB">AGB</a> |
|
||||
<a href="/datenschutz" title="Datenschutz">Datenschutz</a> |
|
||||
<a href="/bildnachweis" title="Bildnachweise">Bildnachweise</a> |
|
||||
<a href="/sitemap" title="Sitemap">Sitemap</a>
|
||||
</div><!-- end social-footer -->
|
||||
</div><!-- end col -->
|
||||
</div><!-- end row -->
|
||||
|
|
|
|||
|
|
@ -4,9 +4,21 @@
|
|||
<div class="pull-right">
|
||||
<ul class="topbar-drops list-inline">
|
||||
<li class="nohover"><i class="fa fa-phone"></i> 030 - 700 94 100</li>
|
||||
<li><a href="#" title=""><i class="fa fa-envelope"></i> E-Mail</a></li>
|
||||
<li><a href="#" title=""><i class="fa fa-comments"></i> Chat</a></li>
|
||||
<li><a href="#" title=""><i class="fa fa-users"></i> Über uns</a></li>
|
||||
<li>
|
||||
<a href="/kontakt" title=""><i class="fa fa-envelope"></i> Kontakt</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(window.open('/server/chat.php','','width=590,height=610,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes'))"
|
||||
title="Chat-Fenster öffnen"
|
||||
>
|
||||
<i class="fa fa-comments"></i> Chat
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/docs/ueber-uns.html" title="Über uns">
|
||||
<i class="fa fa-users"></i> Über uns
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- end container -->
|
||||
|
|
|
|||
|
|
@ -14,19 +14,23 @@
|
|||
<div class="cdiscount">{{ child_page.boxDiscount|raw }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if child_page.travelProgram is not empty and child_page.travelProgram.previewImage is not empty %}
|
||||
<img src="https://www.sterntours.de/uploads/travel_program/{{ child_page.travelProgram.previewImage.fileNameWithExtension }}"
|
||||
alt="{{ child_page.title }}"
|
||||
>
|
||||
|
||||
{% if child_page.boxImageUrl is not empty %}
|
||||
{% set image_url = child_page.boxImageUrl %}
|
||||
{% set image_alt = child_page.travelProgram.title|default(child_page.title) %}
|
||||
{% elseif child_page.boxImageUrl is not empty %}
|
||||
{% set image_url = '/uploads/travel_program/' ~ child_page.travelProgram.previewImage.fileNameWithExtension %}
|
||||
{% set image_alt = child_page.title %}
|
||||
{% else %}
|
||||
<img src="{{ child_page.boxImageUrl ~ '/bundles/app/images/page1_img1.jpg' }}"
|
||||
alt="{{ child_page.title }}"
|
||||
>
|
||||
{% set image_url = '/bundles/app/images/no-picture.png' %}
|
||||
{% set image_alt = 'Kein Vorschaubild vorhanden' %}
|
||||
{% endif %}
|
||||
<img src="{{ image_url }}" alt="{{ image_alt }}" style="width: 265px; height: 190px;{# #TODO! #}">
|
||||
|
||||
</div>
|
||||
<div class="box_mid">
|
||||
<div class="hl5">{{ child_page.title }}</div>
|
||||
<p>{{ child_page.description }}</p>
|
||||
<p>{{ child_page.boxBody ?? child_page.description }}</p>
|
||||
</div>
|
||||
<a class="item-button is-box-link dobble_line" href="{{ child_page.urlPath }}" title="{{ child_page.title }}">
|
||||
{{ child_page.title }}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,17 @@
|
|||
<div id="sidebar" class="col-md-3 col-sm-4 col-xs-12 hidden-xs">
|
||||
|
||||
{% if show_search_sidebar_widget ?? true %} {# TODO #}
|
||||
{% if search_sidebar_widget_block is empty %}
|
||||
{% if search_form is defined %}
|
||||
{{ include('default/components/sidebar/searchSidebarWidget.html.twig') }}
|
||||
{% elseif page is defined %}
|
||||
{{ render(controller('AppBundle:Default:searchSidebarWidget', {page: page})) }}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ search_sidebar_widget_block|raw }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if show_nav_sidebar_widget ?? true and page is defined %} {# TODO #}
|
||||
{% if nav_sidebar_widget_block is empty %}
|
||||
{{ render(controller('AppBundle:Default:navSidebarWidget', {page: page})) }}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
{% form_theme search_form 'default/form/theme.html.twig' %}
|
||||
<div class="widget clearfix">
|
||||
<div class="widget-title">
|
||||
<a class="collapse-widget" href="#search-widget" data-toggle="collapse">Kulturreisen suchen</a>
|
||||
</div><!-- end title -->
|
||||
<div class="searchwidget collapse in" id="search-widget">
|
||||
<form action="/suche" method="get" class="searchform row">
|
||||
<div class="form-group col-md-12">
|
||||
{{ form_field_pho(search_form.c, 'Reiseziel') }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
{{ form_field_pho(search_form.b, 'Anreise') }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12 form-bottom">
|
||||
{{ form_field_pho(search_form.e, 'Abreise') }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
Kombinieren mit
|
||||
<div class="pull-right">
|
||||
<i class="fa fa-question" data-toggle="tooltip" data-placement="top" title="Hier steht ein Infotext Hier steht ein Infotext"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
{{ form_field_pho(search_form.c2, 'Kombinieren mit') }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12 col-sm-12 col-xs-12 text-center form-bottom">
|
||||
<button type="submit" class="btn btn-primary btn-block">Angebote suchen</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div><!-- end boxwidget -->
|
||||
</div>
|
||||
|
|
@ -16,6 +16,14 @@
|
|||
</div>
|
||||
{%- endblock %}
|
||||
|
||||
{% block date_widget -%}
|
||||
{% set attr = attr|merge({class: (attr.class|default('') ~ ' datepicker')|trim}) -%}
|
||||
<div class="input-group">
|
||||
{{ parent() -}}
|
||||
<div class="input-group-addon"><i class="fa fa-calendar"></i></div>
|
||||
</div>
|
||||
{%- endblock %}
|
||||
|
||||
{% block checkbox_widget -%}
|
||||
{{- block('base_checkbox_widget') -}}
|
||||
{%- endblock checkbox_widget %}
|
||||
|
|
|
|||
|
|
@ -20,10 +20,6 @@
|
|||
{% endjavascripts %}
|
||||
{% endblock %}
|
||||
|
||||
{% block breadcrumb %}
|
||||
{{ include('default/components/breadcrumb.html.twig') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<section class="clearfix">
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
{% block body %}
|
||||
<section class="clearfix">
|
||||
<div class="hl2">{{ page.pagetitle ?? page.title }}</div>
|
||||
<div class="hl2">{{ page.pagetitle|default(page.title) }}</div>
|
||||
|
||||
{#{% for i in 0..page.children|length//3 %}#}
|
||||
<div class="row">
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@
|
|||
|
||||
<div class="result-wrapper">
|
||||
|
||||
{% for travel_program in travel_programs %}
|
||||
{% for travel_program in travel_programs if travel_program.travelDates is not empty %}
|
||||
<div class="result">
|
||||
<div class="row">
|
||||
<div class="image col-md-3">
|
||||
<img src="https://www.sterntours.de/{{ travel_program.images.empty
|
||||
<img src="/{{ travel_program.images.empty
|
||||
? 'images/icons/no-picture.png'
|
||||
: ('uploads/travel_program/' ~ travel_program.images.first.fileNameWithExtension)
|
||||
}}" class="img-responsive"
|
||||
|
|
@ -40,8 +40,7 @@
|
|||
<div class="price pull-left"><span class="small">p.P.</span> ab {{ travel_program.lowestPrice|number_format }} €</div>
|
||||
|
||||
<div class="pull-right">
|
||||
{# #TODO #}
|
||||
<a href=""
|
||||
<a href="{{ travel_program.page.urlPath }}"
|
||||
class="btn btn-primary btn-sm border-radius"
|
||||
target="_blank"
|
||||
>
|
||||
|
|
@ -99,7 +98,7 @@
|
|||
|
||||
<td data-title="">
|
||||
{# #TODO Bad performance #}
|
||||
<a href="{{ travel_program.page.urlPath }}" class="btn btn-primary">Details</a>
|
||||
<a href="{{ travel_program.page.urlPath }}#travel-dates-content-tab" class="btn btn-primary">Details</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,31 @@
|
|||
{# @var travel_program \AppBundle\Entity\TravelProgram #}
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
{% javascripts '@AppBundle/Resources/public/js/travelProgram.js' %}
|
||||
<script src="{{ asset_url }}"></script>
|
||||
{% endjavascripts %}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
|
||||
<section class="clearfix">
|
||||
<div class="content-copy">
|
||||
|
||||
<h1>{{ travel_program.title }}</h1>
|
||||
<h1>{{ travel_program.title|default(page.pagetitle)|default(page.title) }}</h1>
|
||||
|
||||
{#
|
||||
********* SLIDER *********
|
||||
#}
|
||||
|
||||
<div class="pull-right btn-over-slider">
|
||||
<button type="submit" class="btn btn-primary btn-lg border-radius">Jetzt Buchen</button>
|
||||
<button type="button"
|
||||
class="btn btn-primary btn-lg border-radius st-slider-booking-btn"
|
||||
onclick=
|
||||
>
|
||||
Jetzt Buchen
|
||||
</button>
|
||||
</div>
|
||||
<section class="section fullscreen background padding-0 margin-bottom-20">
|
||||
<div id="myCarousel" class="carousel slide">
|
||||
|
|
@ -43,52 +60,105 @@
|
|||
</div>
|
||||
</section><!-- end section -->
|
||||
|
||||
<div class="">
|
||||
{#
|
||||
********* TAB BAR *********
|
||||
#}
|
||||
|
||||
{% block travel_program_tab_bar %}
|
||||
<div class="scroller-nav-tabs scroller-left-nav-tabs"><i class="glyphicon glyphicon-chevron-left"></i></div>
|
||||
<div class="scroller-nav-tabs scroller-right-nav-tabs"><i class="glyphicon glyphicon-chevron-right"></i></div>
|
||||
<div class="wrapper-nav-tabs">
|
||||
<ul class="nav nav-tabs nav-justified list-nav-tabs">
|
||||
<li class="active"><a href="#content_tab_01" aria-controls="content_tab_01" role="tab" data-toggle="tab">Reiseablauf</a></li>
|
||||
<li><a href="#content_tab_02" aria-controls="content_tab_02" role="tab" data-toggle="tab">Leistungen</a></li>
|
||||
<li><a href="#content_tab_03" aria-controls="content_tab_03" role="tab" data-toggle="tab">Termine <i class="fa fa-star"></i> Preise</a></li>
|
||||
<li><a href="#content_tab_04" aria-controls="content_tab_04" role="tab" data-toggle="tab">Karte</a></li>
|
||||
<li><a href="#content_tab_05" aria-controls="content_tab_05" role="tab" data-toggle="tab">Landinfos</a></li>
|
||||
<li><a href="#content_tab_07" aria-controls="content_tab_07" role="tab" data-toggle="tab">Team vor Ort</a></li>
|
||||
<li class="active">
|
||||
<a href="#travel-description-content-tab" aria-controls="travel-description-content-tab" role="tab" data-toggle="tab">
|
||||
Reiseablauf
|
||||
</a>
|
||||
</li>
|
||||
{% if travel_program.included is not empty or
|
||||
travel_program.excluded is not empty or
|
||||
travel_program.classDescription is not empty
|
||||
%}
|
||||
<li>
|
||||
<a href="#travel-service-content-tab" aria-controls="travel-service-content-tab" role="tab" data-toggle="tab">
|
||||
Leistungen
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if travel_program.travelDates is not empty %}
|
||||
<li>
|
||||
<a href="#travel-dates-content-tab" aria-controls="travel-dates-content-tab" role="tab" data-toggle="tab">
|
||||
Termine <i class="fa fa-star"></i> Preise
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if travel_program.hasMap %}
|
||||
<li>
|
||||
<a href="#travel-map-content-tab" aria-controls="travel-map-content-tab" role="tab" data-toggle="tab">
|
||||
Karte
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<a href="#travel-info-content-tab" aria-controls="travel-info-content-tab" role="tab" data-toggle="tab">
|
||||
Landinfos
|
||||
</a>
|
||||
</li>
|
||||
{#<li><a href="#content_tab_07" aria-controls="content_tab_07" role="tab" data-toggle="tab">Team vor Ort</a></li>#}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock travel_program_tab_bar %}
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div role="tabpanel" class="tab-pane active" id="content_tab_01">
|
||||
{#
|
||||
********* REISEABLAUF *********
|
||||
#}
|
||||
|
||||
<div role="tabpanel" class="tab-pane active" id="travel-description-content-tab">
|
||||
|
||||
{{ travel_program.htmlDescription|raw }}
|
||||
|
||||
{% if travel_program.advices is not empty %}
|
||||
<h3>Hinweise</h3>
|
||||
<ul>
|
||||
{% for travel_program_advice in travel_program.advices|trim|split('\n') %}
|
||||
<li>{{ travel_program_advice|raw }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
</div> <!-- END tabpanel -->
|
||||
|
||||
<div role="tabpanel" class="tab-pane" id="content_tab_02">
|
||||
{#
|
||||
********* LEISTUNGEN *********
|
||||
#}
|
||||
|
||||
<div role="tabpanel" class="tab-pane" id="travel-service-content-tab">
|
||||
|
||||
<h2>Eingeschlossene Leistungen</h2>
|
||||
<ul>
|
||||
{% for travel_program_service in travel_program.included|replace({'*': '<img src="/bundles/app/images/star-mini.png" >'})|split('\n') %}
|
||||
<li>{{ travel_program_service|raw }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{#
|
||||
<h1>Unser Video</h1>
|
||||
<div itemprop="video" itemscope itemtype="http://schema.org/VideoObject">
|
||||
<h2 itemprop="name">Video Headline</h2>
|
||||
<div class="embed-responsive embed-responsive-16by9">
|
||||
<meta itemprop="embedURL" content="http://www.youtube.com/watch?v=XzgjEBOlC8I">
|
||||
<meta itemprop="thumbnailUrl" content="http://exampel.com/Party_Thumbnail.png">
|
||||
<meta itemprop="description" content="Lorem ipsum dolor sit amet, consectetuer adipiscing elit.">
|
||||
<meta itemprop="uploadDate" content="2013-10-01T08:00:00+08:00">
|
||||
<meta itemprop="duration" content="T3M35S">
|
||||
<iframe class="embed-responsive-item" width="560" height="315" src="https://www.youtube.com/embed/XzgjEBOlC8I" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
#}
|
||||
|
||||
{% if travel_program.excluded is not empty or travel_program.classDescription is not empty %}
|
||||
<h2>Nicht eingeschlossene Leistungen</h2>
|
||||
{{ travel_program.classDescription|replace({'*': '<img src="/bundles/app/images/star-mini.png" >'})|raw }}
|
||||
<ul>
|
||||
{% for travel_program_service in travel_program.excluded|replace({'*': '<img src="/bundles/app/images/star-mini.png" >'})|split('\n') %}
|
||||
<li>{{ travel_program_service|raw }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
</div> <!-- END tabpanel -->
|
||||
|
||||
<div role="tabpanel" class="tab-pane" id="content_tab_03">
|
||||
{#
|
||||
********* TERMINE UND PREISE *********
|
||||
#}
|
||||
|
||||
<div role="tabpanel" class="tab-pane" id="travel-dates-content-tab">
|
||||
|
||||
<h2>{{ travel_program.subtitle }}</h2>
|
||||
|
||||
|
|
@ -194,21 +264,47 @@
|
|||
</div>
|
||||
|
||||
</div> <!-- END tabpanel -->
|
||||
|
||||
{#
|
||||
********* LANDKARTE *********
|
||||
#}
|
||||
|
||||
{% if travel_program.hasMap %}
|
||||
<div role="tabpanel" class="tab-pane" id="travel-map-content-tab">
|
||||
|
||||
{% if travel_program.mapHtml is not empty %}
|
||||
{{ travel_program.mapHtml|raw|stripslashes }}
|
||||
{% else %}
|
||||
<a href="/uploads/maps/{{ travel_program.mapImage ~ travel_program.mapImageExt }}"
|
||||
target="_blank" rel="galerie" title="Karte zum Reiseablauf"
|
||||
>
|
||||
<img src="{{ travel_program.mapImage ~ travel_program.mapImageExt }}" width="100%"
|
||||
alt="Karte zum Reiseablauf"
|
||||
>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
</div> <!-- END tabpanel -->
|
||||
{% endif %}
|
||||
|
||||
{#
|
||||
********* LANDINFOS *********
|
||||
#}
|
||||
|
||||
<div role="tabpanel" class="tab-pane" id="travel-info-content-tab">
|
||||
|
||||
{% for country in travel_program.countries %}
|
||||
|
||||
<h2>{{ country.name }}</h2>
|
||||
{{ country.htmlInformation|raw }}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</div> <!-- END tabpanel -->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="">
|
||||
<div class="scroller-nav-tabs scroller-left-nav-tabs"><i class="glyphicon glyphicon-chevron-left"></i></div>
|
||||
<div class="scroller-nav-tabs scroller-right-nav-tabs"><i class="glyphicon glyphicon-chevron-right"></i></div>
|
||||
<div class="wrapper-nav-tabs">
|
||||
<ul class="nav nav-tabs nav-justified list-nav-tabs">
|
||||
<li class="active"><a href="#content_tab_01" aria-controls="content_tab_01" role="tab" data-toggle="tab">Reiseablauf</a></li>
|
||||
<li><a href="#content_tab_02" aria-controls="content_tab_02" role="tab" data-toggle="tab">Leistungen</a></li>
|
||||
<li><a href="#content_tab_03" aria-controls="content_tab_03" role="tab" data-toggle="tab">Termine <i class="fa fa-star"></i> Preise</a></li>
|
||||
<li><a href="#content_tab_04" aria-controls="content_tab_04" role="tab" data-toggle="tab">Karte</a></li>
|
||||
<li><a href="#content_tab_05" aria-controls="content_tab_05" role="tab" data-toggle="tab">Landinfos</a></li>
|
||||
<li><a href="#content_tab_07" aria-controls="content_tab_07" role="tab" data-toggle="tab">Team vor Ort</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{{ block('travel_program_tab_bar') }}
|
||||
</div>
|
||||
</section><!-- end section -->
|
||||
{% endblock body %}
|
||||
|
|
@ -2,16 +2,33 @@
|
|||
|
||||
{% block body %}
|
||||
<section class="clearfix">
|
||||
<div class="hl2">{{ page.pagetitle ?? page.title }}</div>
|
||||
<div class="hl2">{{ page.pagetitle|default(page.title) }}</div>
|
||||
|
||||
{#{% for i in 0..page.children|length//3 %}#}
|
||||
<div class="row">
|
||||
{% for child_page in child_pages if child_page.status == 1 and child_page.travelProgram is defined %}
|
||||
{% for child_page in child_pages if child_page.status == 1 and child_page.travelProgram is not empty %}
|
||||
|
||||
{% include 'default/components/pageBox.html.twig' %}
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% if mediated_child_pages is not empty %}
|
||||
|
||||
<h2>
|
||||
Vermittelte Rundreisen vom {{ page.country is not empty ? (page.country.name ~ '-') }}Spezialisten
|
||||
STERN TOURS aus Berlin
|
||||
</h2>
|
||||
|
||||
<div class="row">
|
||||
{% for child_page in mediated_child_pages %}
|
||||
|
||||
{% include 'default/components/pageBox.html.twig' %}
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</section>
|
||||
|
||||
<section class="clearfix">
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ monolog:
|
|||
channels: [!event, !doctrine]
|
||||
browser_console:
|
||||
type: browser_console
|
||||
level: debug
|
||||
level: warning
|
||||
# uncomment to get logging in your browser
|
||||
# you may have to allow bigger header sizes in your Web server configuration
|
||||
#firephp:
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class BookingController extends Controller
|
|||
if ($action == '/buchen')
|
||||
{
|
||||
$breadcrumbEntries = Util::createBreadcrumb($travelProgramPage);
|
||||
$breadcrumbEntries[] = new BreadcrumbEntry('Buchen', $travelProgramPage->getUrlPath() .'/buchen');
|
||||
$breadcrumbEntries[] = new BreadcrumbEntry('Buchen');
|
||||
|
||||
if ($request->getMethod() == 'POST' && $form->isValid())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@
|
|||
|
||||
namespace AppBundle\Controller;
|
||||
|
||||
use AppBundle\Entity\BreadcrumbEntry;
|
||||
use AppBundle\Entity\Page;
|
||||
use AppBundle\Entity\TravelProgram;
|
||||
use AppBundle\Form\SearchRequestType;
|
||||
use AppBundle\Util;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use Doctrine\ORM\Query\Expr;
|
||||
|
|
@ -74,10 +76,35 @@ class DefaultController extends Controller
|
|||
$childPages =
|
||||
$this->getEntityManager()->getRepository('AppBundle:Page')->getChildrenWithTravelProgramsAndDates($page);
|
||||
|
||||
$nonMediated = [];
|
||||
$mediated = [];
|
||||
foreach ($childPages as $childPage)
|
||||
{
|
||||
if ($childPage->getStatus() == 1 && $childPage->getTravelProgram() &&
|
||||
$childPage->getTravelProgram()->getIsMediated())
|
||||
{
|
||||
$mediated[] = $childPage;
|
||||
}
|
||||
else
|
||||
{
|
||||
$nonMediated[] = $childPage;
|
||||
}
|
||||
}
|
||||
// We only need a separation if there are mediated AND non mediated travel programs
|
||||
if (empty($nonMediated) && !empty($mediated))
|
||||
{
|
||||
$childPages = $mediated;
|
||||
}
|
||||
else
|
||||
{
|
||||
$childPages = $nonMediated;
|
||||
}
|
||||
|
||||
return $this->render('default/pages/travelProgramOverview.html.twig', [
|
||||
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
||||
'page' => $page,
|
||||
'child_pages' => $childPages
|
||||
'child_pages' => $childPages,
|
||||
'mediated_child_pages' => $mediated,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -98,28 +125,38 @@ class DefaultController extends Controller
|
|||
*/
|
||||
public function searchAction(Request $request)
|
||||
{
|
||||
$stopwatch = $this->get('debug.stopwatch');
|
||||
$em = $this->getEntityManager();
|
||||
|
||||
$destinationIds = null;
|
||||
$destination = $em->getRepository('AppBundle:TravelCountry')->find($request->query->get('c'));
|
||||
if ($destination)
|
||||
{
|
||||
$destinationsIds = [$destination->getId()];
|
||||
}
|
||||
$startDate = $request->query->has('b')
|
||||
? \DateTime::createFromFormat('d.m.Y', $request->query->get('b'))
|
||||
: new \DateTime();
|
||||
$endDate = \DateTime::createFromFormat('d.m.Y', $request->query->get('e'));
|
||||
$form = $this->createForm(SearchRequestType::class);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid())
|
||||
{
|
||||
$data = $form->getData();
|
||||
|
||||
$destinationIds = [];
|
||||
if (!empty($data['c']))
|
||||
{
|
||||
$destinationIds = [$data['c']->getId()];
|
||||
}
|
||||
if (!empty($destinationIds) && !empty($data['c2']))
|
||||
{
|
||||
$destinationIds[] = $data['c2']->getId();
|
||||
}
|
||||
|
||||
$stopwatch->start('search');
|
||||
$r = $this->getDoctrine()->getRepository('AppBundle:TravelPeriod')->getTravelProgramsWithTravelDatesForTimePeriod(
|
||||
$startDate, $endDate, $destinationIds, true);
|
||||
$stopwatch->stop('search');
|
||||
$data['b'], $data['e'], $destinationIds, count($destinationIds) > 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$r = [];
|
||||
}
|
||||
|
||||
return $this->render('default/pages/search.html.twig', [
|
||||
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
||||
'travel_programs' => $r
|
||||
'breadcrumb_entries' => [new BreadcrumbEntry('Suchen')],
|
||||
'search_form' => $form->createView(),
|
||||
'travel_programs' => $r,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -140,7 +177,7 @@ class DefaultController extends Controller
|
|||
;
|
||||
return $this->render('default/components/header.html.twig', [
|
||||
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
||||
'nav_pages' => $navPages
|
||||
'nav_pages' => $navPages,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -148,7 +185,7 @@ class DefaultController extends Controller
|
|||
{
|
||||
return $this->render('default/components/breadcrumb.html.twig', [
|
||||
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
||||
'breadcrumb_entries' => Util::createBreadcrumb($page)
|
||||
'breadcrumb_entries' => Util::createBreadcrumb($page),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -200,6 +237,32 @@ class DefaultController extends Controller
|
|||
return $this->render('default/components/sidebar/navSidebarWidget.html.twig', $view);
|
||||
}
|
||||
|
||||
public function searchSidebarWidgetAction(Page $page)
|
||||
{
|
||||
$combinedDestination = null;
|
||||
if ($page->getTravelProgram())
|
||||
{
|
||||
$countries = $page->getTravelProgram()->getCountries();
|
||||
$destination = $countries->first();
|
||||
if (count($countries) > 1)
|
||||
{
|
||||
$combinedDestination = $countries[1];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$destination = $page->getCountry();
|
||||
}
|
||||
return $this->render('default/components/sidebar/searchSidebarWidget.html.twig', [
|
||||
'search_form' => $this->createForm(SearchRequestType::class, [
|
||||
'b' => new \DateTime('+5 day'),
|
||||
'e' => new \DateTime('+19 day'),
|
||||
'c' => $destination,
|
||||
'c2' => $combinedDestination,
|
||||
])->createView()
|
||||
]);
|
||||
}
|
||||
|
||||
/*
|
||||
Suche Kindknoten
|
||||
Für jeden Kindknoten
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class BreadcrumbEntry
|
|||
* @param $title
|
||||
* @param $url
|
||||
*/
|
||||
public function __construct($title, $url)
|
||||
public function __construct($title, $url = null)
|
||||
{
|
||||
$this->title = $title;
|
||||
$this->url = $url;
|
||||
|
|
|
|||
|
|
@ -174,4 +174,11 @@ class TravelCountry
|
|||
{
|
||||
return $this->programs;
|
||||
}
|
||||
|
||||
function __toString()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -792,7 +792,7 @@ class TravelProgram
|
|||
/**
|
||||
* Get showMap
|
||||
*
|
||||
* @return boolean
|
||||
* @return int 1 for mapHtml, 2 for mapImage
|
||||
*/
|
||||
public function getShowMap()
|
||||
{
|
||||
|
|
@ -1365,7 +1365,7 @@ class TravelProgram
|
|||
/**
|
||||
* Get countries
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
* @return \AppBundle\Entity\TravelCountry[]|\Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getCountries()
|
||||
{
|
||||
|
|
@ -1551,4 +1551,9 @@ class TravelProgram
|
|||
{
|
||||
return $this->page;
|
||||
}
|
||||
|
||||
public function getHasMap()
|
||||
{
|
||||
return ($this->showMap ?? 0) > 0 && ($this->mapHtml or $this->mapHtml);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
54
trunk/src/AppBundle/Form/SearchRequestType.php
Normal file
54
trunk/src/AppBundle/Form/SearchRequestType.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
/**
|
||||
* @author Ulrich Hecht <ulrich.hecht@hecht-software.de>
|
||||
* @date 02/16/2017
|
||||
*/
|
||||
|
||||
namespace AppBundle\Form;
|
||||
|
||||
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class SearchRequestType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* @param FormBuilderInterface $builder
|
||||
* @param array $options
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->setMethod('GET');
|
||||
$builder
|
||||
->add('b', StDateType::class, ['required' => false])
|
||||
->add('e', StDateType::class, ['required' => false])
|
||||
->add('c', EntityType::class, [
|
||||
'required' => false,
|
||||
'placeholder' => 'beliebiges Reiseziel',
|
||||
'class' => 'AppBundle\Entity\TravelCountry',
|
||||
])
|
||||
->add('c2', EntityType::class, [
|
||||
'required' => false,
|
||||
'placeholder' => 'Bitte wählen (optional)',
|
||||
'class' => 'AppBundle\Entity\TravelCountry',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OptionsResolver $resolver
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'csrf_protection' => false,
|
||||
));
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
29
trunk/src/AppBundle/Form/StDateType.php
Normal file
29
trunk/src/AppBundle/Form/StDateType.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
/**
|
||||
* @author Ulrich Hecht <ulrich.hecht@hecht-software.de>
|
||||
* @date 02/16/2017
|
||||
*/
|
||||
|
||||
namespace AppBundle\Form;
|
||||
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class StDateType extends AbstractType
|
||||
{
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'placeholder' => 'TT.MM.JJJJ',
|
||||
'widget' => 'single_text',
|
||||
'format' => 'dd.MM.yyyy'
|
||||
]);
|
||||
}
|
||||
|
||||
public function getParent()
|
||||
{
|
||||
return DateType::class;
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,7 @@ use Symfony\Bundle\FrameworkBundle\Routing\Router;
|
|||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
|
||||
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
class KernelControllerListener
|
||||
{
|
||||
|
|
@ -89,6 +90,15 @@ class KernelControllerListener
|
|||
$node = $childNode;
|
||||
++$i;
|
||||
}
|
||||
if ($node && $node->getRealUrlPath() && $node->getRealUrlPath() != '/'. $path)
|
||||
{
|
||||
// If there realUrlPath is set and the slug path differs from realUrlPath, then the slug path is
|
||||
// not a valid URL. Otherwise, there would be two different URLs representing the same page.
|
||||
$event->setController(function() {
|
||||
throw new NotFoundHttpException('Invalid URL');
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$node)
|
||||
|
|
|
|||
BIN
trunk/src/AppBundle/Resources/public/images/no-picture.png
Normal file
BIN
trunk/src/AppBundle/Resources/public/images/no-picture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
82
trunk/src/AppBundle/Resources/public/js/travelProgram.js
Normal file
82
trunk/src/AppBundle/Resources/public/js/travelProgram.js
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
$(document).ready(function() {
|
||||
|
||||
function scrollToTabContent(tabSelector)
|
||||
{
|
||||
$(document.body).animate({
|
||||
scrollTop: $(tabSelector).offset().top - 220
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function activateTravelDatesTab()
|
||||
{
|
||||
$('[href=\'#travel-dates-content-tab\']').tab('show');
|
||||
scrollToTabContent('#travel-dates-content-tab');
|
||||
}
|
||||
|
||||
$('.nav-tabs > li > a').click(function() {
|
||||
scrollToTabContent($(this).attr('href'));
|
||||
});
|
||||
|
||||
$('.st-slider-booking-btn').click(activateTravelDatesTab);
|
||||
|
||||
if (location.hash === '#travel-dates-content-tab')
|
||||
{
|
||||
activateTravelDatesTab();
|
||||
}
|
||||
|
||||
|
||||
|
||||
var videos$ = $('a[id^="video_"]');
|
||||
|
||||
videos$.each(function() {
|
||||
|
||||
var el$ = $(this);
|
||||
|
||||
var text = el$.text();
|
||||
var length = text.length - 11;
|
||||
var caption = text.substring(0, length);
|
||||
var expl = this.id.substring(6, this.id.length);
|
||||
|
||||
$('<iframe />')
|
||||
.attr({
|
||||
width: 680,
|
||||
height: 466,
|
||||
src: '//www.youtube.com/embed/'+ expl,
|
||||
frameborder: 0,
|
||||
allowfullscreen: true,
|
||||
'data-st-video': this.id
|
||||
})
|
||||
.addClass('st-collapsed')
|
||||
.hide()
|
||||
.insertAfter(this)
|
||||
;
|
||||
el$
|
||||
.css('background-image', 'url(/images/st2/icons/arrowup.gif)')
|
||||
.text(caption + ' einblenden')
|
||||
.attr('href', 'javascript:void(0);')
|
||||
;
|
||||
});
|
||||
|
||||
videos$.click(function() {
|
||||
|
||||
var el$ = $(this);
|
||||
var video$ = $('[data-st-video='+ this.id +']');
|
||||
var text = el$.text();
|
||||
var length = text.length - 11;
|
||||
var caption = text.substring(0, length);
|
||||
|
||||
if (el$.hasClass('st-collapsed'))
|
||||
{
|
||||
video$.slideDown('slow');
|
||||
el$.text(caption + ' ausblenden');
|
||||
el$.removeClass('st-collapsed');
|
||||
}
|
||||
else
|
||||
{
|
||||
video$.slideUp(400);
|
||||
el$.text(caption + ' einblenden');
|
||||
el$.addClass('st-collapsed');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
|
@ -17,27 +17,40 @@ class AppExtension extends \Twig_Extension
|
|||
$this->environment = $env;
|
||||
}
|
||||
|
||||
public function getFilters()
|
||||
{
|
||||
return [
|
||||
'stripslashes' => new \Twig_SimpleFilter('stripslashes', [$this, 'stripslashesFilter'], [
|
||||
'is_safe' => ['html']
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
'form_field' => new \Twig_SimpleFunction('form_field', array($this, 'formField'), array(
|
||||
'is_safe' => array('html')
|
||||
)),
|
||||
'form_field_pho' => new \Twig_SimpleFunction('form_field_pho', array($this, 'formFieldPho'), array(
|
||||
'is_safe' => array('html')
|
||||
)),
|
||||
);
|
||||
return [
|
||||
'form_field' => new \Twig_SimpleFunction('form_field', [$this, 'formField'], [
|
||||
'is_safe' => ['html']
|
||||
]),
|
||||
'form_field_pho' => new \Twig_SimpleFunction('form_field_pho', [$this, 'formFieldPho'], [
|
||||
'is_safe' => ['html']
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
public function stripslashesFilter($v)
|
||||
{
|
||||
return stripslashes($v);
|
||||
}
|
||||
|
||||
public function formField($form, $label = null, $opt = null)
|
||||
{
|
||||
$this->template = $this->environment->loadTemplate( '::default/form/helpers.html.twig' );
|
||||
return $this->template->renderBlock('form_field', array(
|
||||
return $this->template->renderBlock('form_field', [
|
||||
'form' => $form,
|
||||
'label' => $label,
|
||||
'opt' => $opt
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -53,11 +66,11 @@ class AppExtension extends \Twig_Extension
|
|||
{
|
||||
$this->template = $this->environment->loadTemplate( '::default/form/helpers.html.twig' );
|
||||
|
||||
return $this->template->renderBlock('form_field_pho', array(
|
||||
return $this->template->renderBlock('form_field_pho', [
|
||||
'form' => $form,
|
||||
'label' => $label,
|
||||
'opt' => $opt
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue