seo title and some rich content shit

This commit is contained in:
arzynik 2012-10-16 21:01:38 -04:00
parent 46c1d5ef25
commit 370ea6d877
3 changed files with 50 additions and 31 deletions

View File

@ -429,6 +429,27 @@ class Crunchbutton_Restaurant extends Cana_Table {
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() {
if (!$this->timezone) {
$this->timezone = 'America/New_York';

View File

@ -1,6 +1,6 @@
<? 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()) : ?>
@ -10,38 +10,38 @@
<? endif ; ?>
<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="image" href="<?=$this->restaurant->image() ? '/cache/images/'.$this->restaurant->image()->getFileName() : ''?>"/>
</div>
<div class="restaurant-name"><h1><?=$this->restaurant->name?></h1></div>
<div class="restaurant-pic-wrapper">
<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="content-item-name content-item-main-name"><h1>Add to your order</h1></div>
<? foreach ($this->restaurant->categories() as $category) : ?>
<div class="restaurant-item-title"><?=$category->name()?></div>
<ul class="resturant-dishes resturant-dish-container" date-id_category="1">
<? foreach ($category->dishes() as $dish) : ?>
<li>
<a href="javascript:;" data-id_dish="1">
<span class="dish-name"><?=$dish->name?></span><span class="dish-price">($<?=number_format($dish->price,2)?>)</span>
</a>
</li>
<? endforeach ; ?>
</ul>
<? endforeach ; ?>
<link itemprop="photo" href="<?=$this->restaurant->image() ? '/cache/images/'.$this->restaurant->image()->getFileName() : ''?>"/>
<!--span itemprop="priceRange"><?=$this->restaurant->priceRange()?></span -->
<div itemprop="name" class="restaurant-name"><h1><?=$this->restaurant->name?></h1></div>
<div class="restaurant-pic-wrapper">
<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="content-item-name content-item-main-name"><h1>Add to your order</h1></div>
<? foreach ($this->restaurant->categories() as $category) : ?>
<div class="restaurant-item-title"><?=$category->name()?></div>
<ul class="resturant-dishes resturant-dish-container" date-id_category="1">
<? foreach ($category->dishes() as $dish) : ?>
<li>
<a href="javascript:;" data-id_dish="1">
<span class="dish-name"><?=$dish->name?></span><span class="dish-price">($<?=number_format($dish->price,2)?>)</span>
</a>
</li>
<? endforeach ; ?>
</ul>
<? endforeach ; ?>
</div>
</div>
</div>
<? 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()) : ?>
<div class="home-text">

View File

@ -180,7 +180,7 @@ App.page.community = function(id) {
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 sloganReplace = App.community.prep + ' ' + App.community.name;
@ -231,7 +231,6 @@ App.page.community = function(id) {
};
App.page.restaurant = function(id) {
App.currentPage = 'restaurant';
App.cartHighlightEnabled = false;
@ -246,8 +245,7 @@ App.page.restaurant = function(id) {
App.restaurant = this;
App.track('Restaurant page loaded', {restaurant: App.restaurant.name});
document.title = 'Crunchbutton - ' + 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';
$('.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>' +