* Behoben: Doppelter title, fehlender description-Tag, meta Tag für canonical-URL funktioniert nicht immer; fehlender robots-meta-tag

* Im Entwickler-Modus werden jetzt im Quellcode Hinweise angezeigt: Ganz oben, die Seiten-ID und z.B. bei den meta-Tags, wie sie entstehen oder warum sie fehlen
* Neue Links verwenden für Reiseführer und Reisemagazin und "Über uns"; Social-Media-Link-URLs (Google, Facebook); ARBs im Footer verlinken
* "Jugendreisen"-Tab im Header entfernt
* Behoben: Traveltainment-Suchmaske fehlt auf der Traveltainment-Suchergebnisseite (/tt-suche)
* End-Datum in Suchmasken automatisch 14 Tage setzen, falls der Nutzer das Start-Datum später als das Enddatum setzt
* Überschrift über Angebotsboxen im Body (Betrifft das CMS-Template "offers")
* In der Traveltainment-Suchmaske automatisch nur noch für das Land der Seite passende Destinationen im Dropdown vorschlagen
* Statt Text-"Slider" den "Slider" mit Bildern für Reisemagzin und Reiseführer in der Sidebar verwenden
* Sidebar-"Slider": Automatisches Blättern alle 5 Sekunden deaktiviert

git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3308 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
uli 2017-02-28 12:48:22 +00:00
parent fc8e9a9113
commit 6f51f420e0
18 changed files with 201 additions and 57 deletions

View file

@ -0,0 +1,7 @@
{% extends get_base_template() %}
{% block body %}
<h1>Fehler</h1>
<div class="alert alert-danger">Es ist ein Fehler aufgetreten. Ihre Anfrage konnte nicht verarbeitet werden</div>
{% endblock %}

View file

@ -0,0 +1,19 @@
{% extends get_base_template() %}
{% block body %}
<h1>Fehler 404</h1>
<h4>Leider konnte die von Ihnen angeforderte Seite nicht gefunden werden.</h4>
<p>
Bitte überprüfen Sie:
</p>
<ul style="list-style-type: disc; padding-left: 40px; margin-top: 20px;">
<li>die Schreibweise der URL (Groß- und Kleinschreibung)</li>
<li>Ihren Bookmark (Lesezeichen)</li>
<li>die Seite, von der Sie gekommen sind</li>
</ul>
<p style="margin-top: 20px;">
Versuchen Sie ggf. die gewünschte Seite über unsere <a href="/">Homepage</a> zu finden.
</p>
{% endblock body %}

View file

@ -1,4 +1,8 @@
<!DOCTYPE html>
{% if app.debug -%}
<!-- {% if page is defined %}page-Eintrag mit ID {{ page.id }}{% else %}Für diese Seite existiert kein page-Eintrag, sondern ein Twig-Seitetemplate in app/Resources/views/default/pages{% endif %} -->
{%- endif %}
<!--[if lt IE 7 ]><html class="ie ie6" lang="de"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="de"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="de"> <![endif]-->
@ -15,10 +19,19 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
{% block meta_description -%}
{%- if page is defined and page.description is not empty -%}
<meta name="description" content="{{ page.description }}" >
{%- elseif app.debug -%}
<!-- <meta name="description" > {% if page is not defined %} muss im Twig-Seitentemplate im Block meta_description festgelegt werden.{% else %} fehlt, da das Feld "description" im page Eintrag mit der ID {{ page.id }} fehlt.{% endif %} -->
{%- endif -%}
{%- endblock %}
{% block meta_robots %}
<meta name="robots" content="follow,index" />
{% if app.debug %}<!-- Falls der meta-robots-Tag für diese Seite falsch ist, kann der Block "meta_robots" im Twig-Template überschrieben werden -->{% endif %}
{% endblock %}
{% endblock %}
<title>STERNTOURS</title>
<!-- Favicons -->
<link rel="shortcut icon" href="/bundles/app/images/favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon" href="/bundles/app/images/apple-icon.png" />
@ -26,18 +39,22 @@
<link rel="apple-touch-icon" sizes="114x114" href="/bundles/app/images/apple-icon-114x114.png" />
{% block canonical_tag %}
{% block canonical_url %}
{% if canonical_url is not defined and page is defined %}
{% if page.canonicalUrl is not empty %}
{% set canonical_url = (page.canonicalUrl starts with '/' ? get_base_url()) ~ page.canonicalUrl %}
{% else %}
{% set canonical_url = get_base_url() ~ page.urlPath %}
{% endif %}
{% if canonical_url is not defined and page is defined %}
{% if page.canonicalUrl is not empty %}
{% set canonical_url = (page.canonicalUrl starts with '/' ? get_base_url()) ~ page.canonicalUrl %}
{% if app.debug %}<!-- Die canonical URL wurde über das Feld "canonical_url" des page-Eintrags ermittelt -->{% endif %}
{% else %}
{% set canonical_url = get_base_url() ~ page.urlPath %}
{% if app.debug %}<!-- Die canonical URL wurde über den URL-Pfad des page-Eintrags berechnet, also entweder über das Feld "real_url_path" oder den "slug"-Werten der Seitenhierarchie -->{% endif %}
{% endif %}
{% endblock %}
{% elseif app.debug and canonical_url is defined %}
<!-- Die canonical_url wurde im Controller festgelegt -->
{% endif %}
{% if canonical_url is defined %}
<link rel="canonical" href="{{ canonical_url }}" />
<link rel="alternate" hreflang="de-de" href="{{ canonical_url }}" />
{% elseif app.debug %}
<!-- Die canonical_url konnte nicht automatisch ermittelt werden und muss daher entweder durch den Controller festgelegt werden, oder der Block "canonical_tag" im Seiten-Template überschrieben werden -->
{% endif %}
{% endblock %}

View file

@ -15,9 +15,9 @@
</div>
<div class="col-md-3 col-sm-12 col-xs-12">
<div class="social-footer text-right">
<a href="/docs/ueber-uns.html" title="Über uns"><i class="fa fa-users"></i></a>
<a href="#" title="Facebook"><i class="fa fa-facebook"></i></a>
<a href="#" title="Google"><i class="fa fa-google-plus"></i></a>
<a href="/ueber-uns" title="Über uns"><i class="fa fa-users"></i></a>
<a href="https://de-de.facebook.com/sterntours/" title="Facebook"><i class="fa fa-facebook"></i></a>
<a href="https://plus.google.com/+sterntours" title="Google"><i class="fa fa-google-plus"></i></a>
</div>
</div>
</div>
@ -119,6 +119,7 @@
<div class="link-footer">
<a href="/impressum" title="Impressum">Impressum</a> |
<a href="/agb" title="AGB">AGB</a> |
<a href="/arb" 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>

View file

@ -15,7 +15,7 @@
</a>
</li>
<li>
<a href="/docs/ueber-uns.html" title="Über uns">
<a href="/ueber-uns" title="Über uns">
<i class="fa fa-users"></i> Über uns
</a>
</li>
@ -71,12 +71,12 @@
</a>
</li>
<li itemprop="name">
<a itemprop="url" href="/docs/urlaubsinfos.html" title="Reiseführer">
<a itemprop="url" href="/reisefuehrer" title="Reiseführer">
Reiseführer
</a>
</li>
<li itemprop="name">
<a itemprop="url" href="/docs/reisemagazin.html" title="Reisemagazin">
<a itemprop="url" href="/reisemagazin" title="Reisemagazin">
Reisemagazin
</a>
</li>

View file

@ -55,12 +55,11 @@
<ul class="nav nav-tabs nav-justified" role="tablist">
<li class="active"><a href="#tab_01" aria-controls="tab_01" role="tab" data-toggle="tab">Kulturreisen</a></li>
<li><a href="#tab_02" aria-controls="tab_02" role="tab" data-toggle="tab">Pauschalreisen weltweit</a></li>
<li><a href="/docs/jugendreisen.html" aria-controls="tab_03" role="tab" data-toggle="tab">Jugendreisen</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="tab_01">
<form class="bookform form-inline row" action="/suche" method="get">
<form class="bookform form-inline row st-search-form" action="/suche" method="get">
<div class="form-group col-md-3 col-sm-6 col-xs-12">
{{ form_field_pho(search_form.c) }}
</div>

View file

@ -5,6 +5,12 @@
{% if search_sidebar_widget_block is null %}
{% if search_form is defined %}
{{ include('default/components/sidebar/searchSidebarWidget.html.twig') }}
{# #WORKAROUND Overriding this block doesn't work, probably due to a Symfony bug, see ttSearch.html.twig #}
{% elseif tt_search_form is defined %}
{{ include('default/components/sidebar/ttSearchSidebarWidget.html.twig') }}
{# END WORKAROUND #}
{% elseif page is defined %}
{{ render(controller('AppBundle:Component:searchSidebarWidget', {page: page})) }}
{% endif %}

View file

@ -4,7 +4,7 @@
<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">
<form action="/suche" method="get" class="searchform row st-search-form">
<div class="form-group col-md-12">
{{ form_field_pho(search_form.c, 'Reiseziel') }}
</div>

View file

@ -1,6 +1,6 @@
{% form_theme tt_search_form 'default/form/theme.html.twig' %}
<div class="widget clearfix">
<form action="/tt-suche" method="get" class="searchwidget searchform row">
<form action="/tt-suche" method="get" class="searchwidget searchform row st-tt-search-form">
<div class="form-group col-md-12">{{ form_field_pho(tt_search_form.termin, 'Früheste Anreise') }}</div>
<div class="form-group col-md-12">{{ form_field_pho(tt_search_form.ruecktermin, 'Späteste Abreise') }}</div>
<div class="form-group col-md-12">{{ form_field_pho(tt_search_form.dauer) }}</div>

View file

@ -1,6 +1,6 @@
{% form_theme tt_search_form 'default/form/theme.html.twig' %}
<form action="/tt-suche" method="get" class="bookform form-inline">
<form action="/tt-suche" method="get" class="bookform form-inline st-tt-search-form">
<div class="form-group row">
<div class="col-md-3 col-sm-6 col-xs-12">{{ form_field_pho(tt_search_form.termin, 'Früheste Anreise') }}</div>
<div class="col-md-3 col-sm-6 col-xs-12">{{ form_field_pho(tt_search_form.ruecktermin, 'Späteste Abreise') }}</div>

View file

@ -1,11 +1,11 @@
{% extends 'base.html.twig' %}
{% form_theme form 'default/form/theme.html.twig' %}
{% block metatags %}
{{ parent() }}
{% block meta_robots %}
<meta name="robots" content="noindex,nofollow" />
{% if app.debug %}<!-- meta-robots wurde durch das Twig-Seitentemplate festgelegt -->{% endif %}
{% endblock %}
{% block canonical_tag %}{% endblock %}
{% block canonical_tag %}{% if app.debug %}<!-- Die canonical URL wird für diese Seite bewusst nicht definiert, da sie vom Suchindex ausgeschlossen wurde (Siehe meta robots) -->{% endif %}{% endblock %}
{% block stylesheets %}
{{ parent() }}

View file

@ -9,6 +9,8 @@
</section>
<section class="clearfix">
<h3>Unsere beliebtesten Kulturreisen</h3>
{{ render(controller('AppBundle:Component:offersCarousel', {country: page.effectiveCountry})) }}
</section>
{% endblock %}

View file

@ -1,15 +1,20 @@
{% extends get_base_template() %}
{% block metatags %}
{{ parent() }}
{% block meta_robots %}
<meta name="robots" content="noindex,nofollow" />
{% if app.debug %}<!-- meta-robots wurde durch das Twig-Seitentemplate festgelegt -->{% endif %}
{% endblock %}
{% block canonical_tag %}{% if app.debug %}<!-- Die canonical URL wird für diese Seite bewusst nicht definiert, da sie vom Suchindex ausgeschlossen wurde (Siehe meta robots) -->{% endif %}{% endblock %}
{#
TODO: This doesn't work. Form labels are rendered, but widgets themselves not. Symfony / Twig bug?
{% block search_sidebar_widget %}
{{ include('default/components/sidebar/ttSearchSidebarWidget.html.twig') }}
{% include 'default/components/sidebar/ttSearchSidebarWidget.html.twig' %}
{% endblock %}
#}
{% block body %}
{% include 'default/components/sidebar/ttSearchSidebarWidget.html.twig' %}
{% if tt_url is defined %}
<iframe src="{{ tt_url }}" scrolling="no" width="100%" height="13500"
onload="window.parent.parent.scrollTo(0,0);"

View file

@ -91,7 +91,9 @@ class CmsController extends Controller
public function traveltainmentAction(Page $page)
{
$form = $this->createForm(TtSearchRequestType::class);
$form = $this->createForm(TtSearchRequestType::class, null, [
'country' => $page->getCountry(),
]);
return $this->render('default/pages/cms/traveltainment.html.twig', [
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,

View file

@ -2,19 +2,12 @@
namespace AppBundle\Controller;
use AppBundle\Entity\BreadcrumbEntry;
use AppBundle\Entity\ContactRequest;
use AppBundle\Entity\Page;
use AppBundle\Entity\TravelCountry;
use AppBundle\Form\ContactRequestType;
use AppBundle\Form\SearchRequestType;
use AppBundle\Form\TtSearchRequestType;
use AppBundle\Util;
use Doctrine\ORM\EntityManager;
use Gedmo\Tree\TreeListener;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
/**
* Controller for re-usable view components. They are normally included by a render twig-expression. Example:
@ -130,9 +123,9 @@ class ComponentController extends Controller
->getQuery()
->execute()
;
return $this->render('default/components/sidebar/textSliderSidebarWidget.html.twig', [
return $this->render('default/components/sidebar/pageSliderSidebarWidget.html.twig', [
'slider_title' => 'Reiseführer',
'slides' => $pages
'pages' => $pages
]);
}
@ -146,9 +139,9 @@ class ComponentController extends Controller
->getQuery()
->execute()
;
return $this->render('default/components/sidebar/textSliderSidebarWidget.html.twig', [
return $this->render('default/components/sidebar/pageSliderSidebarWidget.html.twig', [
'slider_title' => 'Reisemagazin',
'slides' => $pages
'pages' => $pages
]);
}

View file

@ -5,7 +5,6 @@ namespace AppBundle\Controller;
use AppBundle\Entity\BreadcrumbEntry;
use AppBundle\Entity\ContactRequest;
use AppBundle\Entity\Page;
use AppBundle\Entity\TravelCountry;
use AppBundle\Form\ContactRequestType;
use AppBundle\Form\SearchRequestType;
use AppBundle\Form\TtSearchRequestType;
@ -52,8 +51,6 @@ class DefaultController extends Controller
*/
public function searchAction(Request $request)
{
$em = $this->getEntityManager();
$form = $this->createForm(SearchRequestType::class);
$form->handleRequest($request);

View file

@ -16,12 +16,85 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class TtSearchRequestType extends AbstractType
{
/**
* @param OptionsResolver $resolver
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'csrf_protection' => false,
'country' => null,
));
$resolver->setAllowedTypes('country', ['AppBundle\Entity\TravelCountry', 'null']);
}
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
if ($options['country'])
{
// Find matching destinations.
// See the structure of the $DESTINATION_CHOICES array below, to understand the following algorithm
$countryName = $options['country']->getName();
$destChoices = [];
$childDestChoices = [];
$addChildrenState = false;
foreach (self::$DESTINATION_CHOICES as $label => $id)
{
if ($addChildrenState)
{
if ($label[0] == '-')
{
$destChoices[$label] = $id;
}
else
{
$addChildrenState = false;
}
}
if (mb_strpos($label, $countryName) !== false && !$addChildrenState)
{
if ($label[0] == '-')
{
$childDestChoices[$label] = $id;
}
else
{
$destChoices[$label] = $id;
$addChildrenState = true;
}
}
}
foreach ($childDestChoices as $label => $id)
{
if (!isset($destChoices[$label]))
{
// Add this matching entry (beginning with a "- "), which is the child of a non-matching entry
// to the result and act as if this entry is not a child (by removing the leading "- ").
//
// Example:
// "Naher Osten"
// "- Israel- Totes Meer"
// "- Iran"
// When looking for country "Israel", the second entry matches and will be added without the
// leading "- " (i.e. "Israel- Totes Meer") to the result list.
$destChoices[preg_replace('/^-\s*/', '', $label)] = $id;
}
}
}
else
{
$destChoices = self::$DESTINATION_CHOICES;
}
$childChoices = ['< 2 Jahre' => 1];
for ($i = 2; $i <= 16; ++$i)
{
@ -50,7 +123,7 @@ class TtSearchRequestType extends AbstractType
])
->add('topRegion', DatalistType::class, [
'required' => false,
'choices' => array_keys(self::$DESTINATION_CHOICES),
'choices' => array_keys($destChoices),
])
->add('t', ChoiceType::class, [
'choices' => self::$TRAVELER_CHOICES,
@ -113,16 +186,6 @@ class TtSearchRequestType extends AbstractType
;
}
/**
* @param OptionsResolver $resolver
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'csrf_protection' => false,
));
}
public function getBlockPrefix()
{
return null;

View file

@ -81,10 +81,20 @@ jQuery(document).ready(function($) {
SIDEBAR BOX SLIDER -->
=============================================== */
function createSlider(ctx$)
function createSlider(ctx$, interval)
{
if (!interval)
{
interval = 0;
}
function setSlideInterval()
{
if (interval <= 0)
{
return;
}
if(slideInterval)
{
clearInterval(slideInterval);
@ -92,7 +102,7 @@ jQuery(document).ready(function($) {
slideInterval = setInterval(function() {
jumpToNextSlide();
}, 5000);
}, interval);
}
function jumpToNextSlide()
@ -469,7 +479,7 @@ jQuery(document).ready(function($) {
/* ==============================================
DATAPICKER -->
DATEPICKER -->
=============================================== */
$(".datepicker").each(function(){
@ -495,6 +505,29 @@ jQuery(document).ready(function($) {
dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
firstDay: 1
});
});
function initAutoEndDate(startTxt$, endTxt$)
{
startTxt$.add(endTxt$).change(function() {
var startDate = startTxt$.datepicker('getDate');
if (startDate > endTxt$.datepicker('getDate'))
{
endTxt$.datepicker('setDate', new Date(startDate.getFullYear(), startDate.getMonth(),
startDate.getDate() + 14));
}
});
}
var ttSearchForm$ = $('.st-tt-search-form');
if (ttSearchForm$.length)
{
initAutoEndDate(ttSearchForm$.find('[name=termin]'), ttSearchForm$.find('[name=ruecktermin]'));
}
var searchForm$ = $('.st-search-form');
if (searchForm$.length)
{
initAutoEndDate(searchForm$.find('[name=b]'), searchForm$.find('[name=e]'));
}
});