seo title and some rich content shit
This commit is contained in:
parent
46c1d5ef25
commit
370ea6d877
@ -429,6 +429,27 @@ class Crunchbutton_Restaurant extends Cana_Table {
|
|||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function priceRange() {
|
||||||
|
if (!isset($this->_priceRange)) {
|
||||||
|
$price = 0;
|
||||||
|
foreach ($this->dishes() as $dish) {
|
||||||
|
$price += $dish->price;
|
||||||
|
}
|
||||||
|
$price = $price / $this->dishes()->count();
|
||||||
|
|
||||||
|
if ($price > 60) {
|
||||||
|
$this->_priceRange = '$$$$';
|
||||||
|
} elseif ($price > 30) {
|
||||||
|
$this->_priceRange = '$$$';
|
||||||
|
} elseif ($price > 10) {
|
||||||
|
$this->_priceRange = '$$';
|
||||||
|
} else {
|
||||||
|
$this->_priceRange = '$';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->_priceRange;
|
||||||
|
}
|
||||||
|
|
||||||
public function save() {
|
public function save() {
|
||||||
if (!$this->timezone) {
|
if (!$this->timezone) {
|
||||||
$this->timezone = 'America/New_York';
|
$this->timezone = 'America/New_York';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<? if ($this->restaurant->id_restaurant) : ?>
|
<? if ($this->restaurant->id_restaurant) : ?>
|
||||||
<?
|
<?
|
||||||
$this->title = $this->restaurant->name.' Delivery | '.$this->restaurant->community()->name.' | Food Delivery | Order from Local Restaurants | Crunchbutton';
|
$this->title = $this->restaurant->name.' | '.$this->community->name.' Food Delivery | Order from '.($this->community->name_alt ? $this->community->name_alt : 'Local').' Restaurants | Crunchbutton';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<? if (c::app()->isBot()) : ?>
|
<? if (c::app()->isBot()) : ?>
|
||||||
@ -10,38 +10,38 @@
|
|||||||
<? endif ; ?>
|
<? endif ; ?>
|
||||||
|
|
||||||
<div itemscope itemtype="http://schema.org/Restaurant">
|
<div itemscope itemtype="http://schema.org/Restaurant">
|
||||||
<link itemprop="name" href="<?=$this->restaurant->name?>"/>
|
|
||||||
<link itemprop="description" href="Order food delivery or takeout from <?=$this->restaurant->name?> in <?=$this->community->name?> on Crunchbutton"/>
|
|
||||||
<link itemprop="url" href="/<?=$this->community->permalink?>/<?=$this->restaurant->permalink?>"/>
|
<link itemprop="url" href="/<?=$this->community->permalink?>/<?=$this->restaurant->permalink?>"/>
|
||||||
<link itemprop="image" href="<?=$this->restaurant->image() ? '/cache/images/'.$this->restaurant->image()->getFileName() : ''?>"/>
|
<link itemprop="image" href="<?=$this->restaurant->image() ? '/cache/images/'.$this->restaurant->image()->getFileName() : ''?>"/>
|
||||||
</div>
|
<link itemprop="photo" href="<?=$this->restaurant->image() ? '/cache/images/'.$this->restaurant->image()->getFileName() : ''?>"/>
|
||||||
|
<!--span itemprop="priceRange"><?=$this->restaurant->priceRange()?></span -->
|
||||||
<div class="restaurant-name"><h1><?=$this->restaurant->name?></h1></div>
|
|
||||||
<div class="restaurant-pic-wrapper">
|
<div itemprop="name" class="restaurant-name"><h1><?=$this->restaurant->name?></h1></div>
|
||||||
<div class="restaurant-pic" style="background: url(<?=$this->restaurant->image() ? '/cache/images/'.$this->restaurant->image()->getFileName() : ''?>);"></div>
|
<div class="restaurant-pic-wrapper">
|
||||||
</div>
|
<div class="restaurant-pic" style="background: url(<?=$this->restaurant->image() ? '/cache/images/'.$this->restaurant->image()->getFileName() : ''?>);"></div>
|
||||||
|
</div>
|
||||||
<div class="main-content-readable">
|
|
||||||
<div class="restaurant-items">
|
<div class="main-content-readable">
|
||||||
<div class="content-item-name content-item-main-name"><h1>Add to your order</h1></div>
|
<div class="restaurant-items">
|
||||||
<? foreach ($this->restaurant->categories() as $category) : ?>
|
<div class="content-item-name content-item-main-name"><h1>Add to your order</h1></div>
|
||||||
<div class="restaurant-item-title"><?=$category->name()?></div>
|
<? foreach ($this->restaurant->categories() as $category) : ?>
|
||||||
<ul class="resturant-dishes resturant-dish-container" date-id_category="1">
|
<div class="restaurant-item-title"><?=$category->name()?></div>
|
||||||
<? foreach ($category->dishes() as $dish) : ?>
|
<ul class="resturant-dishes resturant-dish-container" date-id_category="1">
|
||||||
<li>
|
<? foreach ($category->dishes() as $dish) : ?>
|
||||||
<a href="javascript:;" data-id_dish="1">
|
<li>
|
||||||
<span class="dish-name"><?=$dish->name?></span><span class="dish-price">($<?=number_format($dish->price,2)?>)</span>
|
<a href="javascript:;" data-id_dish="1">
|
||||||
</a>
|
<span class="dish-name"><?=$dish->name?></span><span class="dish-price">($<?=number_format($dish->price,2)?>)</span>
|
||||||
</li>
|
</a>
|
||||||
<? endforeach ; ?>
|
</li>
|
||||||
</ul>
|
<? endforeach ; ?>
|
||||||
<? endforeach ; ?>
|
</ul>
|
||||||
|
<? endforeach ; ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<? elseif ($this->community->id_community) : ?>
|
<? elseif ($this->community->id_community) : ?>
|
||||||
<?
|
<?
|
||||||
$this->title = $this->community->name.($this->community->name_alt ? ' | '.$this->community->name_alt : '').' Food Delivery | Order Food from Local Restaurants | Crunchbutton';
|
$this->title = $this->community->name.' Food Delivery | Order Food from '.($this->community->name_alt ? $this->community->name_alt : 'Local').' Restaurants | Crunchbutton';
|
||||||
?>
|
?>
|
||||||
<? if (c::app()->isBot()) : ?>
|
<? if (c::app()->isBot()) : ?>
|
||||||
<div class="home-text">
|
<div class="home-text">
|
||||||
|
|||||||
@ -180,7 +180,7 @@ App.page.community = function(id) {
|
|||||||
|
|
||||||
App.track('Community page loaded', {community: App.community.name});
|
App.track('Community page loaded', {community: App.community.name});
|
||||||
|
|
||||||
document.title = App.community.name + (App.community.name_alt ? ' | ' + App.community.name_alt : '') + ' Food Delivery | Order Food from Local Restaurants | Crunchbutton';
|
document.title = App.community.name + ' Food Delivery | Order Food from ' + (App.community.name_alt ? App.community.name_alt : 'Local') + ' Restaurants | Crunchbutton';
|
||||||
|
|
||||||
var slogan = App.slogans[Math.floor(Math.random()*App.slogans.length)];
|
var slogan = App.slogans[Math.floor(Math.random()*App.slogans.length)];
|
||||||
var sloganReplace = App.community.prep + ' ' + App.community.name;
|
var sloganReplace = App.community.prep + ' ' + App.community.name;
|
||||||
@ -231,7 +231,6 @@ App.page.community = function(id) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
App.page.restaurant = function(id) {
|
App.page.restaurant = function(id) {
|
||||||
|
|
||||||
App.currentPage = 'restaurant';
|
App.currentPage = 'restaurant';
|
||||||
App.cartHighlightEnabled = false;
|
App.cartHighlightEnabled = false;
|
||||||
|
|
||||||
@ -246,8 +245,7 @@ App.page.restaurant = function(id) {
|
|||||||
App.restaurant = this;
|
App.restaurant = this;
|
||||||
|
|
||||||
App.track('Restaurant page loaded', {restaurant: App.restaurant.name});
|
App.track('Restaurant page loaded', {restaurant: App.restaurant.name});
|
||||||
|
document.title = App.restaurant.name + ' | ' + App.community.name + ' Food Delivery | Order from ' + (App.community.name_alt ? App.community.name_alt : 'Local') + ' Restaurants | Crunchbutton';
|
||||||
document.title = 'Crunchbutton - ' + App.restaurant.name;
|
|
||||||
|
|
||||||
$('.main-content').html(
|
$('.main-content').html(
|
||||||
'<div class="cart-summary cart-summary-detail" data-role="header" data-position="fixed"><div class="cart-summary-icon"></div><div class="cart-summary-item-count"><span></span></div><div class="cart-summary-items"></div></div>' +
|
'<div class="cart-summary cart-summary-detail" data-role="header" data-position="fixed"><div class="cart-summary-icon"></div><div class="cart-summary-item-count"><span></span></div><div class="cart-summary-items"></div></div>' +
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user