Add 'new' label

This commit is contained in:
Björn Fromme
2018-12-19 16:03:58 +01:00
parent 30a6c4fe32
commit 0f989d5110
10 changed files with 73 additions and 29 deletions
@@ -75,6 +75,11 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
*/ */
protected $earlybird = false; protected $earlybird = false;
/**
* @var bool
*/
protected $new = false;
/** /**
* @var bool * @var bool
*/ */
@@ -282,6 +287,22 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
$this->earlybird = $earlybird; $this->earlybird = $earlybird;
} }
/**
* @return bool
*/
public function isNew()
{
return $this->new;
}
/**
* @param bool $new
*/
public function setNew($new)
{
$this->new = $new;
}
/** /**
* @return bool * @return bool
*/ */
@@ -231,11 +231,11 @@ class HotelRepository extends AbstractRepository
'date.hotel as hotelUid', 'date.hotel_name as hotelName', 'date.hotel_teaser as hotelTeaser', 'date.hotel as hotelUid', 'date.hotel_name as hotelName', 'date.hotel_teaser as hotelTeaser',
'date.hotel_category as hotelCategory', 'date.hotel_detail_page as hotelDetailPage', 'date.hotel_category as hotelCategory', 'date.hotel_detail_page as hotelDetailPage',
'date.date_start as dateStart', 'date.date_end as dateEnd', 'date.earlybird as earlybird', 'date.date_start as dateStart', 'date.date_end as dateEnd', 'date.earlybird as earlybird',
'date.low_contingent as lowContingent', 'date.board as board', 'date.product_fact as productFact', 'date.new as new', 'date.low_contingent as lowContingent', 'date.board as board',
'date.hotel_fact as hotelFact', 'date.region_fact as regionFact', 'date.services_included as servicesIncluded', 'date.product_fact as productFact', 'date.hotel_fact as hotelFact', 'date.region_fact as regionFact',
'date.min_price as minPrice', 'date.pseudo_price as pseudoPrice', 'date.nights as nights', 'date.services_included as servicesIncluded', 'date.min_price as minPrice',
'date.available as available', 'date.country as country', 'date.country_code as countryCode', 'date.pseudo_price as pseudoPrice', 'date.nights as nights', 'date.available as available',
'date.region as region' 'date.country as country', 'date.country_code as countryCode', 'date.region as region'
) )
->from('tx_epproducts_domain_model_date', 'date') ->from('tx_epproducts_domain_model_date', 'date')
->leftJoin('date', 'tx_epproducts_product_region_mm', 'mm', 'mm.uid_local = date.product') ->leftJoin('date', 'tx_epproducts_product_region_mm', 'mm', 'mm.uid_local = date.product')
@@ -49,16 +49,17 @@ class ProductRepository extends AbstractRepository
$query = $qb $query = $qb
->select( ->select(
'date.concept as conceptUid', 'date.concept_name as conceptName', 'date.concept_code as conceptCode', 'date.concept as conceptUid', 'date.concept_name as conceptName', 'date.concept_code as conceptCode',
'date.product as productUid', 'date.product_name as productName', 'date.product_detail_page as productDetailPage', 'date.product as productUid', 'date.product_name as productName',
'date.product_feature as productFeature', 'date.product_detail_page as productDetailPage', 'date.product_feature as productFeature',
'date.country as countryUid','date.country_name as countryName', 'date.country_code as countryCode', 'date.country as countryUid','date.country_name as countryName', 'date.country_code as countryCode',
'date.region as regionUid', 'date.region_name as regionName', 'date.region_feature as regionFeature', 'date.region as regionUid', 'date.region_name as regionName', 'date.region_feature as regionFeature',
'date.date_start as dateStart', 'date.date_end as dateEnd', 'date.date_start as dateStart', 'date.date_end as dateEnd',
'date.hotel as hotelUid', 'date.hotel_name as hotelName', 'date.hotel_category as hotelCategory', 'date.hotel as hotelUid', 'date.hotel_name as hotelName', 'date.hotel_category as hotelCategory',
'date.earlybird as earlybird', 'date.low_contingent as lowContingent', 'date.board as board', 'date.earlybird as earlybird', 'date.new as new', 'date.low_contingent as lowContingent',
'date.product_fact as productFact', 'date.hotel_fact as hotelFact', 'date.region_fact as regionFact', 'date.board as board', 'date.product_fact as productFact', 'date.hotel_fact as hotelFact',
'date.services_included as servicesIncluded', 'date.min_price as minPrice', 'date.nights as nights', 'date.region_fact as regionFact', 'date.services_included as servicesIncluded',
'date.available as available', 'date.pseudo_price as pseudoPrice' 'date.min_price as minPrice', 'date.nights as nights', 'date.available as available',
'date.pseudo_price as pseudoPrice'
) )
->from('tx_epproducts_domain_model_date', 'date') ->from('tx_epproducts_domain_model_date', 'date')
->where('date.product IN (:productUids)') ->where('date.product IN (:productUids)')
@@ -89,16 +90,17 @@ class ProductRepository extends AbstractRepository
$query = $qb $query = $qb
->select( ->select(
'date.concept as conceptUid', 'date.concept_name as conceptName', 'date.concept_code as conceptCode', 'date.concept as conceptUid', 'date.concept_name as conceptName', 'date.concept_code as conceptCode',
'date.product as productUid', 'date.product_name as productName', 'date.product_detail_page as productDetailPage', 'date.product as productUid', 'date.product_name as productName',
'date.product_feature as productFeature', 'date.daytrip as daytrip', 'date.product_detail_page as productDetailPage', 'date.product_feature as productFeature',
'date.country as countryUid','date.country_name as countryName', 'date.country_code as countryCode', 'date.daytrip as daytrip', 'date.country as countryUid','date.country_name as countryName',
'date.region as regionUid', 'date.region_name as regionName', 'date.region_feature as regionFeature', 'date.country_code as countryCode', 'date.region as regionUid', 'date.region_name as regionName',
'date.date_start as dateStart', 'date.date_end as dateEnd', 'date.region_feature as regionFeature', 'date.date_start as dateStart', 'date.date_end as dateEnd',
'date.hotel as hotelUid', 'date.hotel_name as hotelName', 'date.hotel_category as hotelCategory', 'date.hotel as hotelUid', 'date.hotel_name as hotelName', 'date.hotel_category as hotelCategory',
'date.earlybird as earlybird', 'date.low_contingent as lowContingent', 'date.board as board', 'date.earlybird as earlybird', 'date.new as new', 'date.low_contingent as lowContingent',
'date.product_fact as productFact', 'date.hotel_fact as hotelFact', 'date.region_fact as regionFact', 'date.board as board', 'date.product_fact as productFact', 'date.hotel_fact as hotelFact',
'date.services_included as servicesIncluded', 'date.min_price as minPrice', 'date.nights as nights', 'date.region_fact as regionFact', 'date.services_included as servicesIncluded',
'date.available as available', 'date.pseudo_price as pseudoPrice' 'date.min_price as minPrice', 'date.nights as nights', 'date.available as available',
'date.pseudo_price as pseudoPrice'
) )
->from('tx_epproducts_domain_model_date', 'date') ->from('tx_epproducts_domain_model_date', 'date')
->leftJoin('date', 'tx_epproducts_domain_model_room', 'room', 'room.date = date.uid') ->leftJoin('date', 'tx_epproducts_domain_model_room', 'room', 'room.date = date.uid')
@@ -144,13 +146,14 @@ class ProductRepository extends AbstractRepository
->select( ->select(
'product as productUid', 'product_name as productName', 'product_detail_page as productDetailPage', 'product as productUid', 'product_name as productName', 'product_detail_page as productDetailPage',
'product_feature as productFeature', 'product_teaser as productTeaser', 'product_fact as productFact', 'product_feature as productFeature', 'product_teaser as productTeaser', 'product_fact as productFact',
'hotel as hotelUid', 'hotel_fact as hotelFact', 'hotel_name as hotelName', 'hotel_category as hotelCategory', 'hotel as hotelUid', 'hotel_fact as hotelFact', 'hotel_name as hotelName',
'region_fact as regionFact', 'region_name as regionName', 'region_feature as regionFeature', 'hotel_category as hotelCategory', 'region_fact as regionFact', 'region_name as regionName',
'region_feature as regionFeature',
'country_name as countryName', 'country_code as countryCode', 'country_name as countryName', 'country_code as countryCode',
'date_start as dateStart', 'date_end as dateEnd', 'uid as dateUid', 'min_price as minPrice', 'date_start as dateStart', 'date_end as dateEnd', 'uid as dateUid', 'min_price as minPrice',
'pseudo_price as pseudoPrice', 'nights as nights', 'available as available', 'pseudo_price as pseudoPrice', 'nights as nights', 'available as available',
'skipass_included as skipassIncluded', 'bus_included as busIncluded', 'skipass_included as skipassIncluded', 'bus_included as busIncluded',
'earlybird', 'daytrip', 'low_contingent as lowContingent', 'earlybird', 'new', 'daytrip', 'low_contingent as lowContingent',
'concept_code as conceptCode', 'concept_name as conceptName', 'concept_code as conceptCode', 'concept_name as conceptName',
'board' 'board'
) )
@@ -510,6 +510,8 @@ class DateImportService implements SingletonInterface
$date['hotel_category'] = $hotel['category']; $date['hotel_category'] = $hotel['category'];
$date['hotel_teaser'] = $hotel['teaser']; $date['hotel_teaser'] = $hotel['teaser'];
$date['hotel_detail_page'] = $hotel['detail_page']; $date['hotel_detail_page'] = $hotel['detail_page'];
$date['earlybird'] = $hotel['earlybird'];
$date['new'] = $hotel['new'];
return true; return true;
} }
@@ -732,7 +734,7 @@ class DateImportService implements SingletonInterface
{ {
$sql = ' $sql = '
SELECT u.code code, u.uid uid, h.name name, h.type type, SELECT u.code code, u.uid uid, h.name name, h.type type,
h.earlybird earlybird, h.low_contingent low_contingent, h.earlybird earlybird, h.new new, h.low_contingent low_contingent,
h.keywords keywords, h.header_title header_title, h.keywords keywords, h.header_title header_title,
h.category category, h.teaser teaser, h.detail_page detail_page h.category category, h.teaser teaser, h.detail_page detail_page
FROM ( FROM (
@@ -755,6 +757,7 @@ class DateImportService implements SingletonInterface
'type' => $row['type'], 'type' => $row['type'],
'name' => $row['name'], 'name' => $row['name'],
'earlybird' => $row['earlybird'], 'earlybird' => $row['earlybird'],
'new' => $row['new'],
'low_contingent' => $row['low_contingent'], 'low_contingent' => $row['low_contingent'],
'keywords' => $row['keywords'], 'keywords' => $row['keywords'],
'header_title' => $row['header_title'], 'header_title' => $row['header_title'],
@@ -233,6 +233,7 @@ class HotelDataService implements SingletonInterface
'available' => 0, 'available' => 0,
'board' => $row['board'], 'board' => $row['board'],
'earlybird' => $row['earlybird'], 'earlybird' => $row['earlybird'],
'new' => $row['new'],
'lowContingent' => $row['lowContingent'], 'lowContingent' => $row['lowContingent'],
'servicesIncluded' => unserialize($row['servicesIncluded']), 'servicesIncluded' => unserialize($row['servicesIncluded']),
'minDateStart' => null, 'minDateStart' => null,
@@ -195,6 +195,7 @@ class ProductDataService implements SingletonInterface
'pseudoPrice' => $teaserData['pseudoPrice'], 'pseudoPrice' => $teaserData['pseudoPrice'],
'board' => $teaserData['board'], 'board' => $teaserData['board'],
'earlybird' => $teaserData['earlybird'], 'earlybird' => $teaserData['earlybird'],
'new' => $teaserData['new'],
'daytrip' => $teaserData['daytrip'], 'daytrip' => $teaserData['daytrip'],
'lowContingent' => $teaserData['lowContingent'], 'lowContingent' => $teaserData['lowContingent'],
'servicesIncluded' => unserialize($teaserData['servicesIncluded']), 'servicesIncluded' => unserialize($teaserData['servicesIncluded']),
@@ -27,7 +27,8 @@ return [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, detail_page, keywords, 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, detail_page, keywords,
address, longitude, latitude, headline, teaser, description, features, room_types, additional_information, address, longitude, latitude, headline, teaser, description, features, room_types, additional_information,
teaser_images, header_images, images, reseller_images, code, type, category, country, region, city, facts, teaser_images, header_images, images, reseller_images, code, type, category, country, region, city, facts,
teamer, products, header_title,header_subtitle, earlybird, low_contingent, show_as_teaser, external_link', teamer, products, header_title,header_subtitle, earlybird, new, low_contingent, show_as_teaser,
external_link',
], ],
'types' => [ 'types' => [
'1' => [ '1' => [
@@ -39,7 +40,8 @@ return [
], ],
], ],
'palettes' => [ 'palettes' => [
'top' => ['showitem' => 'hidden,earlybird,low_contingent,show_as_teaser,--linebreak--,groupsch_id,detail_page,--linebreak--,external_link'], 'top' => ['showitem' => 'hidden,earlybird,new,low_contingent,show_as_teaser,
--linebreak--,groupsch_id,detail_page,--linebreak--,external_link'],
'geolocation' => ['showitem' => 'address, longitude, latitude'], 'geolocation' => ['showitem' => 'address, longitude, latitude'],
'destinations' => ['showitem' => 'country,region,city'], 'destinations' => ['showitem' => 'country,region,city'],
'name' => ['showitem' => 'name,code,--linebreak--,header_title,header_subtitle'], 'name' => ['showitem' => 'name,code,--linebreak--,header_title,header_subtitle'],
@@ -134,6 +136,13 @@ return [
], ],
], ],
'new' => [
'exclude' => 0,
'label' => 'Neu',
'config' => [
'type' => 'check',
],
],
'earlybird' => [ 'earlybird' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Frühbucher', 'label' => 'Frühbucher',
@@ -151,6 +151,7 @@ CREATE TABLE tx_epproducts_domain_model_date (
hotel_teaser text NOT NULL, hotel_teaser text NOT NULL,
hotel_detail_page varchar(255) DEFAULT '' NOT NULL, hotel_detail_page varchar(255) DEFAULT '' NOT NULL,
earlybird tinyint(4) unsigned DEFAULT '0' NOT NULL, earlybird tinyint(4) unsigned DEFAULT '0' NOT NULL,
new tinyint(4) unsigned DEFAULT '0' NOT NULL,
low_contingent tinyint(4) unsigned DEFAULT '0' NOT NULL, low_contingent tinyint(4) unsigned DEFAULT '0' NOT NULL,
rooms int(11) unsigned DEFAULT '0', rooms int(11) unsigned DEFAULT '0',
@@ -195,6 +196,7 @@ CREATE TABLE tx_epproducts_domain_model_hotel (
pid int(11) DEFAULT '0' NOT NULL, pid int(11) DEFAULT '0' NOT NULL,
earlybird tinyint(4) unsigned DEFAULT '0' NOT NULL, earlybird tinyint(4) unsigned DEFAULT '0' NOT NULL,
new tinyint(4) unsigned DEFAULT '0' NOT NULL,
low_contingent tinyint(4) unsigned DEFAULT '0' NOT NULL, low_contingent tinyint(4) unsigned DEFAULT '0' NOT NULL,
show_as_teaser tinyint(4) unsigned DEFAULT '0' NOT NULL, show_as_teaser tinyint(4) unsigned DEFAULT '0' NOT NULL,
detail_page varchar(255) DEFAULT '' NOT NULL, detail_page varchar(255) DEFAULT '' NOT NULL,
@@ -120,6 +120,10 @@
text-transform: uppercase; text-transform: uppercase;
white-space: nowrap; white-space: nowrap;
&--new {
color: $color-label-earlybird;
}
&--earlybird { &--earlybird {
color: $color-label-earlybird; color: $color-label-earlybird;
} }
@@ -67,9 +67,9 @@
<span class="product-teaser__price"><strong>ab {teaser.minPrice} €</strong>{f:if(condition: teaser.pseudoPrice, then: ' <s class="product-teaser__pseudo-price">{teaser.pseudoPrice} €</s>')}</span> <span class="product-teaser__price"><strong>ab {teaser.minPrice} €</strong>{f:if(condition: teaser.pseudoPrice, then: ' <s class="product-teaser__pseudo-price">{teaser.pseudoPrice} €</s>')}</span>
<f:if condition="{date.pseudoPrice}"> <f:if condition="{date.pseudoPrice}">
<f:else> <f:else>
<div class="product-teaser__labels{f:if(condition: '{0: teaser.date.earlybird, 1: teaser.date.lowContingent} == {0: 1, 1: 1}', then: ' product-teaser__labels--multiple')}"> <div class="product-teaser__labels{f:if(condition: '{teaser.new} == 1 && {teaser.date.lowContingent} == 1', then: ' product-teaser__labels--multiple')}">
<f:if condition="{teaser.date.earlybird}"> <f:if condition="{teaser.new}">
<span class="teaser-label teaser-label--earlybird">Frühbucher</span> <span class="teaser-label teaser-label--new">Neu</span>
</f:if> </f:if>
<f:if condition="{teaser.date.lowContingent}"> <f:if condition="{teaser.date.lowContingent}">
<span class="teaser-label teaser-label--low-contingent">Wenige Betten</span> <span class="teaser-label teaser-label--low-contingent">Wenige Betten</span>