* 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

@ -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]'));
}
});