merge admin master

This commit is contained in:
BDC 2013-04-17 16:49:52 -04:00
commit c29c90b19e
25 changed files with 3945 additions and 496 deletions

3
.gitignore vendored
View File

@ -6,6 +6,8 @@
# filetypes
*.bin
*.bz2
*.swo
*.swp
*.mov
*.mp4
*.m4v
@ -13,6 +15,7 @@
*.psd
*.sql
*.zip
*.DS_Store
*~
# config and specific files

View File

@ -30,7 +30,10 @@ class Controller_admin_restaurants extends Crunchbutton_Controller_Account
$view->communities = $communities;
$view->restaurantCommunity = $community;
$view->display('admin/restaurants/restaurant');
$view_name = c::getPagePiece(2) == 'legacy' ?
'admin/restaurants/legacy/restaurant' :
'admin/restaurants/restaurant' ;
$view->display($view_name);
}
/**
@ -52,15 +55,24 @@ class Controller_admin_restaurants extends Crunchbutton_Controller_Account
c::view()->layout('layout/admin');
c::view()->page = 'admin/restaurants';
$restaurant = Restaurant::o(c::getPagePiece(2));
if(c::getPagePiece(2) == 'legacy') {
c::view()->page = 'admin/restaurants';
$page_piece_index = 3;
}
else {
$page_piece_index = 2;
}
$restaurant = Restaurant::o(c::getPagePiece($page_piece_index));
/* @var $restaurant Crunchbutton_Restaurant */
$this->restaurant = $restaurant;
if (c::getPagePiece(2) == 'new') {
if (c::getPagePiece($page_piece_index) == 'new') {
$this->_restaurantForm();
} elseif ($restaurant->id_restaurant) {
c::view()->restaurant = $restaurant;
switch (c::getPagePiece(3)) {
switch (c::getPagePiece($page_piece_index+1)) {
case 'pay':
c::view()->display('admin/restaurants/pay');
break;
@ -93,4 +105,4 @@ class Controller_admin_restaurants extends Crunchbutton_Controller_Account
}
}
}

View File

@ -0,0 +1,54 @@
<?php
class Controller_admin_save extends Crunchbutton_Controller_Rest {
public function init() {
$req = $this->request();
$rsp = [];
$rsp['result'] = 'OK';
if($this->method() == 'get') {
$rsp['result'] = 'error';
$rsp['error'] = 'GET not supported';
}
if($this->method() == 'post') {
try {
$rsp['req'] = $req; // TODO this is not necessary
switch($req['obj']) {
case 'restaurant':
// uncomment here and in client-side requests to use serialization
// $data = array();
// parse_str($req['serialized_data'], $data);
$data = $req['data'];
$rsp['data'] = $this->save_restaurant($data);
$rsp['msg'] = 'Saved.';
break;
default:
$rsp['result'] = 'error';
$rsp['error'] = 'Unimplemented object type.';
break;
}
} catch (Exception $e) {
$rsp['result'] = 'error';
$rsp['error'] = 'Exception:' . $e->getMessage();
}
}
echo json_encode($rsp);
}
private function save_restaurant($restaurant) {
// a restaurant has a bunch of stuff in it
if($restaurant['id_restaurant']) {
$r = Restaurant::o($restaurant['id_restaurant']);
$r->imports($restaurant);
$r->save();
$where = [];
$where['Dish']['active'] = NULL;
return $r->exports($ignore=[], $where);
}
return 'no id.';
}
}
?>

View File

@ -12,6 +12,7 @@ class Controller_assets_css_bundle_css extends Crunchbutton_Controller_AssetBund
$file = c::config()->dirs->www.'assets/css/style.css';
$css = file_get_contents($file);
$css .= file_get_contents(c::config()->dirs->www.'assets/css/sprites.css');
$css .= file_get_contents(c::config()->dirs->www.'assets/css/font-awesome.css');
@ -50,4 +51,4 @@ class Controller_assets_css_bundle_css extends Crunchbutton_Controller_AssetBund
echo $css;
exit;
}
}
}

Binary file not shown.

View File

@ -308,10 +308,13 @@ class Crunchbutton_Restaurant extends Cana_Table
$do = new Dish_Option;
$do->id_dish = $dishO->id_dish;
$do->id_option = $group->id_option;
$do->sort = $optionGroup['sort'];
$do->save();
} else {
$do = new Dish_Option($doid);
$do->default = $opt->default;
$do->sort = $optionGroup['sort'];
$do->save();
}
}
@ -331,7 +334,8 @@ class Crunchbutton_Restaurant extends Cana_Table
$option->type = 'check';
$option->save();
$newOptions[$option->id_option] = $option->id_option;
$opt['default'] = $opt['default'] == 'true' ? 1 : 0;
$opt['default'] =
(in_array($opt['default'], ['true','1',1]) ? 1 : 0);
if (!$doid = $this->_hasOption($option, $options)) {
$do = new Dish_Option;
@ -532,12 +536,14 @@ class Crunchbutton_Restaurant extends Cana_Table
* @param array $elements
*/
public function saveNotifications($elements) {
// c::db()->query('DELETE FROM notification WHERE id_restaurant="'.$this->id_restaurant.'"');
c::db()->query('DELETE FROM notification WHERE id_restaurant="'.$this->id_restaurant.'"');
if(!$elements)
return;
foreach ($elements as $data) {
if (!$data['value']) continue;
$element = new Crunchbutton_Notification($data['id_notification']);
$element->id_restaurant = $this->id_restaurant;
$element->active = ($data['active'] == 'true') ? "1" : "0";
$element->active = ($data['active'] == 'true' || $data['active'] == '1') ? "1" : "0";
$element->type = $data['type'];
$element->value = $data['value'];
$element->save();
@ -894,6 +900,84 @@ class Crunchbutton_Restaurant extends Cana_Table
return $out;
}
/**
* Imports an array with all the information for a Restaurant.
*
* Should be an exact inverse of exports()
* for starters, it's an approximation
*
* @return null
*/
public function imports($restaurant) {
foreach($this->properties() as $key=>$val) {
if(in_array($key, array_keys($restaurant))) {
$this->$key = $restaurant[$key];
}
}
$this->saveHours($restaurant['_hours']);
$this->saveNotifications($restaurant['_notifications']);
$this->saveCategories($restaurant['_categories']);
// dishes with options are the awful part
$all_dishes = [];
if(!array_key_exists('_categories', $restaurant)) {
$restaurant['_categories'] = [];
}
foreach($restaurant['_categories'] as $category) {
if(!array_key_exists('_dishes', $category)) {
$category['_dishes'] = [];
}
foreach($category['_dishes'] as &$dish) {
$dish['optionGroups'] = [];
if(!intval($dish['id_category'])) {
$sql = 'SELECT * FROM category WHERE name like \''.$category['name'].'\' ORDER BY sort ASC LIMIT 1';
$c = Crunchbutton_Category::q($sql);
$dish['id_category'] = $c->id_category;
}
if(!array_key_exists('_options', $dish)) {
$dish['_options'] = [];
}
$basicOptionsIds = [];
$optionGroupsIds = [];
$optionsInGroupsIds = [];
$optionGroups = [];
foreach($dish['_options'] as $option) {
if($option['id_option_parent']) {
$optionGroupsIds[] = $option['id_option_parent'];
$optionsInGroupsIds[] = $option['id_option'];
}
}
foreach($dish['_options'] as $option) {
if(in_array($option['id_option'], $optionGroupsIds)) continue;
if(in_array($option['id_option'], $optionsInGroupsIds)) continue;
$option['id_option_parent'] = 'BASIC';
$basicOptionsIds[] = $option['id_option'];
}
$optionGroupsIds[] = 'BASIC';
$optionGroups['BASIC'] = array('id_option'=>'BASIC');
// option groups
foreach($dish['_options'] as $option) {
if(in_array($option['id_option'], $optionGroupsIds)) {
$optionGroups[$option['id_option']] = $option;
$optionGroups[$option['id_option']]['options'] = [];
}
}
// regular options
foreach($dish['_options'] as $option) {
if(!in_array($option['id_option'], $optionGroupsIds)) {
$optionGroups[$option['id_option_parent']]['options'][] = $option;
}
}
$dish['optionGroups'] = $optionGroups;
$all_dishes[] = $dish;
}
}
$this->saveDishes($all_dishes);
return null;
}
public function priceRange() {
if (!isset($this->_priceRange)) {
$price = 0;
@ -977,4 +1061,4 @@ class Crunchbutton_Restaurant extends Cana_Table
}
parent::save();
}
}
}

View File

@ -0,0 +1,40 @@
<div class="admin-content-wrapper" style="width: 700px;">
<div class="admin-content">
<? if (!$this->notification) : ?>
<b>This restaurant does not currently have a fax # set up</b>
<? else : ?>
<h1 class="restaurant-item-title">Send a fax to <?=$this->notification?></h1>
<br /><br />
<form enctype="multipart/form-data" id="restaurant-fax" method="post" action="/admin/fax">
<input type="hidden" name="id_restaurant" value="<?=$this->restaurant->id_restaurant?>">
<table class="admin-restaurant-pay-form">
<tr>
<td>File</td>
<td>
<input type="file" name="fax">
</td>
</tr>
<tr>
<td colspan="2">
<br />
<div class="action-button action-button-small green restaurant-fax-button" style="float: left;"><span>Send</span></div>
</td>
</tr>
</table>
</form>
<? endif ; ?>
</div>
</div>
<script>
$(function() {
$('.restaurant-fax-button').click(function() {
$('#restaurant-fax').submit();
});
});
</script>

View File

@ -0,0 +1,38 @@
<div class="admin-content-wrapper" style="width: 700px;">
<div class="admin-content">
<form id="restaurant-image" action="" method="post" enctype="multipart/form-data">
<table class="admin-restaurant-pay-form">
<tr>
<td>
<img src="http://i.crunchr.co/600x600/<?=$this->restaurant->image?>" style="max-width: 600px;">
</td>
</tr>
<tr>
<td>
<input type="file" name="image">
</td>
</tr>
<tr>
<td>
<br />
<div class="action-button action-button-small green restaurant-image-button" style="float: left;"><span>Upload</span></div>
</td>
</tr>
</table>
</form>
</div>
</div>
<script>
$(function() {
$('.restaurant-image-button').click(function() {
var form = $(this).closest('form');
form.get(0).submit();
});
});
</script>

View File

@ -0,0 +1,80 @@
<?
/**
* List all restaurants and the add-new-restaurant button
*
* @package Crunchbutton.Restaurant
* @category view
*/
?>
<? ob_start() ?>
<? foreach ($this->communities as $community) : ?>
<? /* @var $community Crunchbutton_Community */ ?>
<option value="<?=$community->id_community?>">
<?=$community->name?>
</option>
<? endforeach ?>
<? $communityOptions = preg_replace('/\s+/', ' ', ob_get_clean());?>
<script type="text/javascript">
$(function() {
$('a[href="/admin/restaurants/new"]').click(function(){
$('<div id="admin-new-restaurant-form" class="labeled-form" title="Create New Restaurant">'+
'<label><span class="label">Name</span> <input class="dataset-restaurant" name="name" /></label>' +
'<label><span class="label">Community</span> <select class="dataset-restaurant" name="id_community"><?=$communityOptions?></select></label>' +
'</div>').dialog({
height: 200,
width: 350,
modal: true,
buttons: {
'save': function() {
/* App.busy.makeBusy(); */
saveRestaurant();
$(this).dialog('destroy');
/* App.busy.unBusy(); */
},
'cancel': function() {
$(this).dialog('destroy');
}
},
close: function() {
$(this).dialog('destroy');
}
});
return false;
});
});
</script>
<style>
.labeled-form label { display: block; }
.labeled-form span.label {
display: inline-block;
margin-bottom: 10px;
width: 100px;
}
</style>
<div class="admin-content-wrapper">
<div class="admin-content">
<a href="/admin/restaurants/new">
<div class="admin-food-item admin-restaurant-item">
<span class="food-name">Create New</span>
</div>
</a>
<hr class="divider" />
<? foreach (Restaurant::q('select * from restaurant') as $restaurant) : ?>
<a href="/admin/restaurants/<?=$restaurant->id_restaurant?>">
<div class="admin-food-item admin-restaurant-item">
<span class="food-name"><?=$restaurant->name?></span>
</div>
</a>
<? endforeach ?>
<div class="divider"></div>
</div>
</div>
<div class="divider"></div>

View File

@ -0,0 +1,230 @@
<div class="admin-content-wrapper" style="width: 700px;">
<div class="admin-content">
<? if ($this->restaurant->balanced_id == c::config()->balanced->sharedMerchant) : ?>
<b><?=$this->restaurant->name?> is using a fake merchant configuration. <a href="javascript:;" class="restaurant-merchant-button-fakeremove">Remove</a></b>
<? elseif ($this->restaurant->balanced_id) : ?>
<b><?=$this->restaurant->name?> already has a merchant configuration. <a href="javascript:;" class="restaurant-merchant-button-fakeremove">Remove</a></b>
<? else : ?>
<h1 class="restaurant-item-title">Create a Merchant Account</h1>
<br /><br />
<form id="restaurant-merchant" onsubmit="return false;">
<table class="admin-restaurant-pay-form">
<? /*
<tr>
<td class="label-sub">Merchant Type</td>
<td class="content-sub">
<select name="type">
<option value="person">Person</option>
<option value="business">Business</option>
</select>
</td>
</tr>
<tr>
<td>taxid (business)</td>
<td>
<input type="text" name="taxid">
</td>
</tr>
<tr>
<td>person name (business)</td>
<td>
<input type="text" name="person">
</td>
</tr>
*/ ?>
<tr>
<td>Name</td>
<td>
<input type="text" name="name">
</td>
</tr>
<tr>
<td>Date of Birth (YYYY-MM)</td>
<td>
<input type="text" name="dob">
</td>
</tr>
<tr>
<td>Address</td>
<td>
<input type="text" name="address">
</td>
</tr>
<tr>
<td>ZIP code</td>
<td>
<input type="text" name="zip">
</td>
</tr>
<tr>
<td colspan="2">
<br />
<div class="action-button action-button-small green restaurant-merchant-button" style="float: left;"><span>Save</span></div>
<div class="action-button action-button-small red restaurant-merchant-button-fake" style="float: left; margin-left: 15px"><span>Use fake merchant</span></div>
</td>
</tr>
</table>
</form>
<? endif ; ?>
<br /><br />
<div class="divider dots"></div>
<br />
<? if ($this->restaurant->balanced_bank) : ?>
<b>This restaurant already has a bank account. <a href="javascript:;" class="restaurant-merchant-button-accountremove">Remove</a></b>
<? else : ?>
<br />
<h1 class="restaurant-item-title">Add <?=$this->restaurant->balanced_bank ? 'New ' : ''?>Bank Info</h1>
<br /><br />
<form id="restaurant-bank-info" onsubmit="return false;">
<table class="admin-restaurant-pay-form">
<tr>
<td>Routing #</td>
<td>
<input type="text" name="routing">
</td>
</tr>
<tr>
<td>Account #</td>
<td>
<input type="text" name="account">
</td>
</tr>
<tr>
<td>Name on Account</td>
<td>
<input type="text" name="name">
</td>
</tr>
<tr>
<td colspan="2">
<br />
<div class="action-button action-button-small green restaurant-bank-info-button" style="float: left;"><span>Save</span></div>
</td>
</tr>
</table>
</form>
<? endif ; ?>
<br /><br />
<div class="divider dots"></div>
<br /><br />
<h1 class="restaurant-item-title">Send Payment</h1>
<br /><br />
<form id="restaurant-pay" onsubmit="return false;">
<table class="admin-restaurant-pay-form">
<tr>
<td>Amount</td>
<td>
<input type="text" name="amount">
</td>
</tr>
<tr>
<td>Note</td>
<td>
<input type="text" name="note">
</td>
</tr>
<tr>
<td colspan="2">
<br />
<div class="action-button action-button-small green restaurant-pay-button" style="float: left;"><span>Save</span></div>
</td>
</tr>
</table>
</form>
<br /><br />
<div class="divider dots"></div>
<br /><br />
<h1 class="restaurant-item-title">Recent Payments</h1>
<br /><br />
<table width="100%" cellpadding="4" cellspacing="4">
<tr>
<th>Date</th>
<th>Amount</th>
<th>Note</th>
</tr>
<? foreach ($this->restaurant->payments() as $payment) : ?>
<tr>
<td><?=$payment->date?></td>
<td>$<?=$payment->amount?></td>
<td><?=$payment->note?></td>
</tr>
<? endforeach; ?>
</table>
</div>
</div>
<script>
$(function() {
$('.restaurant-merchant-button').click(function() {
var form = $(this).closest('form');
$.post('/api/restaurant/<?=$this->restaurant->id_restaurant?>/merchant', {
type: 'person', /* form.find('[name="type"]').val() */
name: form.find('[name="name"]').val(),
address: form.find('[name="address"]').val(),
zip: form.find('[name="zip"]').val(),
/* person: form.find('[name="person"]').val(),
taxid: form.find('[name="taxid"]').val(), */
dob: form.find('[name="dob"]').val()
}, function() {
location.href = location.href;
});
});
$('.restaurant-merchant-button-fake').click(function() {
$.post('/api/restaurant/<?=$this->restaurant->id_restaurant?>/fake-merchant', function() {
location.href = location.href;
});
});
$('.restaurant-merchant-button-fakeremove').click(function() {
$.post('/api/restaurant/<?=$this->restaurant->id_restaurant?>/fakeremove-merchant', function() {
location.href = location.href;
});
});
$('.restaurant-merchant-button-accountremove').click(function() {
$.post('/api/restaurant/<?=$this->restaurant->id_restaurant?>/remove-bankinfo', function() {
location.href = location.href;
});
});
$('.restaurant-bank-info-button').click(function() {
var form = $(this).closest('form');
$.post('/api/restaurant/<?=$this->restaurant->id_restaurant?>/bankinfo', {
routing: form.find('[name="routing"]').val(),
account: form.find('[name="account"]').val(),
name: form.find('[name="name"]').val()
}, function() {
location.href = location.href;
});
});
$('.restaurant-pay-button').click(function() {
var form = $(this).closest('form');
$.post('/api/restaurant/<?=$this->restaurant->id_restaurant?>/credit', {
amount: form.find('[name="amount"]').val(),
note: form.find('[name="note"]').val()
}, function() {
location.href = location.href;
});
});
});
</script>

View File

@ -0,0 +1,507 @@
<?
/**
* Shows the Restaurant form for the admin
*
* @package Crunchbutton.Admin.Restaurant
* @category view
*/
/* @var $this Cana_View */
/* @var $this->restaurantCommunity Crunchbutton_Community */
/**
* View helper to preselect the <select> community form input
*
* @param Crunchbutton_Community $current Which community is the current restaurant linked to
* @param Crunchbutton_Community $tested Which community we are listing in the <select>
*
* @return string
*/
function _selectedCommunity(Crunchbutton_Community $current, Crunchbutton_Community $tested) {
$selected = '';
if ($current->id_community == $tested->id_community) {
$selected = ' selected="selected" ';
}
return $selected;
}
?>
<script>
$(function(){
$('body').on('mouseenter', '.jqui-button', function(){
$(this).removeClass('ui-state-default');
$(this).addClass ('ui-state-hover');
});
$('body').on('mouseleave', '.jqui-button', function(){
$(this).addClass ('ui-state-default');
$(this).removeClass('ui-state-hover');
});
});
</script>
<style>
/**
* sets the page one column only
*/
.admin-content-wrapper { width: 970px;}
.admin-restaurant-form { width: 100%; }
.check-wrap { width: 650px;}
/**
* Link buttons without underline
*/
.action-button, #sub-tasks > a {
text-decoration: none;
}
/**
* The buttons at the top
*/
#sub-tasks > a {
display: inline-block;
width: 200px;
}
/* adds/removes spacing where needed for the dishes */
.ui-accordion .ui-accordion-content { padding: 0.4em;}
.ui-accordion .ui-accordion-header { padding: 0.4em; padding-left: 2.2em; }
.fixed { position: fixed;}
.clear { clear: both;}
input.notification {width: 400px;}
.labeled-fields label {
float: none;
display: block;
margin-bottom: 5px;
}
.labeled-fields label span {
display: inline-block;
width: 115px;
}
.labeled-fields .clear + label { margin-top: 5px; }
#categories .button-delete {
cursor: pointer;
float: right;
margin: 2px;
padding: 4px 0;
}
</style>
<div class="admin-id_restaurant" data-id_restaurant=""></div>
<div class="admin-content-wrapper">
<?=Crunchbutton_Session::flashWidget()?>
<div class="admin-content">
<h1 class="restaurant-item-title">Restaurant Information</h1>
<br /><br />
<div id="sub-tasks">
<a href="/admin/restaurants/<?=$this->restaurant->id_restaurant?>/pay">
<div class="admin-food-item admin-restaurant-button">
<span class="food-name">Payments &amp; Settings</span>
</div>
</a>
<a href="/admin/restaurants/<?=$this->restaurant->id_restaurant?>/fax">
<div class="admin-food-item admin-restaurant-button">
<span class="food-name">Send a Fax</span>
</div>
</a>
<a href="/admin/restaurants/<?=$this->restaurant->id_restaurant?>/image">
<div class="admin-food-item admin-restaurant-button">
<span class="food-name">Upload image</span>
</div>
</a>
</div>
<table class="admin-restaurant-form">
<tr>
<td class="label-primary">Restaurant Name:</td>
<td class="content-primary"><input type="text" name="name" value="" class="input-primary dataset-restaurant"></td>
</tr>
<tr>
<td class="label-primary">Phone Number:</td>
<td class="content-primary"><input type="text" name="phone" value="" class="input-primary dataset-restaurant"></td>
</tr>
<tr>
<td class="label-primary">Order Notification Methods:</td>
<td class="content-primary" id="notifications">
<div class="check-wrap">
<div class="check">Text Message</div>
<div class="check-content sms"></div>
</div>
<div class="check-wrap">
<div class="check">Email</div>
<div class="check-content email"></div>
</div>
<div class="check-wrap">
<div class="check">Phone Call</div>
<div class="check-content phone"></div>
</div>
<div class="check-wrap">
<div class="check">URL</div>
<div class="check-content url"></div>
</div>
<div class="check-wrap">
<div class="check">Fax</div>
<div class="check-content fax"></div>
</div>
</td>
</tr>
<tr>
<td class="label-primary">Food Items:</td>
<td class="content-primary">
<div class="check-wrap">
<div class="check"><input type="checkbox" value="0" name="dish_check" class="bind-a-check"><label>No, I'll add some items later.</label></div>
</div>
<div class="check-wrap">
<div class="check"><input type="checkbox" value="1" name="dish_check" class="bind-a-check"><label>Our best items:</label></div>
<div class="check-content admin-restaurant-dishes">
<div class="admin-restaurant-content"></div>
<div class="admin-restaurant-dishes-controls">
<div class="control-link">
<a href="#" class="control-link-add-category">
<div class="control-icon-plus control-icon"></div>
<label class="control-label">Add another dish category?</label>
</a>
</div>
<div class="control-link">
<a href="#" class="control-link-add-dish">
<div class="control-icon-plus control-icon"></div>
<label class="control-label">Add another dish?</label>
</a>
</div>
</div>
<div class="divider"></div>
</div>
</div>
</td>
</tr>
<tr>
<td class="label-primary">Open Hours:</td>
<td class="content-primary">
<div class="check-wrap">
<div class="check"><input type="checkbox" value="0" name="hours_check" class="bind-a-check dataset-restaurant"><label>We're always open!</label></div>
</div>
<div class="check-wrap">
<div class="check"><input type="checkbox" value="1" name="hours_check" class="bind-a-check dataset-restaurant"><label>We're open during these hours</label></div>
<div class="check-content admin-restaurant-hours admin-restaurant-content"></div>
</div>
</td>
</tr>
<tr>
<td class="label-primary">Delivery Options:</td>
<td class="content-primary">
<div class="check-wrap">
<div class="check"><input type="checkbox" name="delivery" value="0" class="bind-a-check dataset-restaurant"><label>We do not offer delivery</label></div>
</div>
<div class="check-wrap">
<div class="check"><input type="checkbox" name="delivery" value="1" class="bind-a-check dataset-restaurant"><label>Yes! We deliver!</label></div>
<div class="check-content">
<table class="admin-restaurant-form-sub">
<tr>
<td class="label-sub">Average Delivery Time:</td>
<td class="content-sub"><input name="delivery_estimated_time" min="0" class="form-number dataset-restaurant"> minutes</td>
</tr>
<tr>
<td class="label-sub">Delivery Radius:</td>
<td class="content-sub"><input name="delivery_radius" min="0" class="form-number dataset-restaurant" step="any"> miles</td>
</tr>
<tr>
<td class="label-sub">Delivery Fee?</td>
<td class="content-sub">
<div class="check-wrap">
<div class="check"><input type="checkbox" name="delivery_fee_check" value="0" class="bind-a-check-values"><label>No</label></div>
</div>
<div class="check-wrap">
<div class="check"><input type="checkbox" name="delivery_fee_check" value="1" class="bind-a-check-values"><label>Yes</label></div>
<div class="check-content">
$ <input name="delivery_fee" step="any" min="0" class="form-number dataset-restaurant">
</div>
</div>
</td>
</tr>
<tr>
<td class="label-sub">Minimum order for delivery?</td>
<td class="content-sub">
<div class="check-wrap">
<div class="check"><input type="checkbox" name="delivery_min_check" value="0" class="bind-a-check-values"><label>No</label></div>
</div>
<div class="check-wrap">
<div class="check"><input type="checkbox" name="delivery_min_check" value="1" class="bind-a-check-values"><label>Yes</label></div>
<div class="check-content">
$ <input name="delivery_min" step="any" min="0" class="form-number dataset-restaurant">
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
<tr>
<td class="label-primary">More Information:</td>
<td class="content-primary">
<div class="check-wrap">
<div class="check-content">
<table class="admin-restaurant-form-sub">
<tr>
<td class="label-sub">Message:</td>
<td class="content-sub"><textarea class="form-sub dataset-restaurant" name="message"></textarea><br/>Some information you want to show at the restaurant's page:</td>
</tr>
<tr>
<td class="label-sub">Average Pickup Time:</td>
<td class="content-sub"><input name="pickup_estimated_time" min="0" class="form-number dataset-restaurant"> minutes</td>
</tr>
<tr>
<td class="label-sub">Restaurant Address:</td>
<td class="content-sub"><textarea class="form-sub dataset-restaurant" name="address"></textarea></td>
</tr>
<tr>
<td class="label-sub">Contact Email:</td>
<td class="content-sub"><input type="text" class="form-sub dataset-restaurant" name="email"></td>
</tr>
<tr>
<td class="label-sub">Manager/Owner can be reached at:</td>
<td class="content-sub"><textarea class="form-sub dataset-restaurant" name="notes_owner"></textarea></td>
</tr>
<tr>
<td class="label-sub">Include in a community?</td>
<td class="content-sub">
<div class="check-wrap">
<div class="check"><input type="checkbox" name="id_community_check" value="0" class="bind-a-check-values"><label>No</label></div>
</div>
<div class="check-wrap">
<div class="check"><input type="checkbox" name="id_community_check" value="1" class="bind-a-check-values"><label>Yes</label></div>
<div class="check-content">
<select name="id_community" class="dataset-restaurant">
<option value="0">[remove communites]</option>
<? foreach ($this->communities as $community) : ?>
<? /* @var $community Crunchbutton_Community */ ?>
<option value="<?=$community->id_community?>"
<?=($this->restaurantCommunity) ? _selectedCommunity($this->restaurantCommunity, $community) : ''?>
>
<?=$community->name?>
</option>
<? endforeach ; ?>
</select>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
<tr>
<td class="label-primary">Admin shit:</td>
<td class="content-primary">
<div class="check-wrap">
<div class="check-content">
<table class="admin-restaurant-form-sub">
<tr>
<td class="label-sub">Permalink:</td>
<td class="content-sub"><input type="text" name="permalink" value="" class="form-sub dataset-restaurant"></td>
</tr>
<tr>
<td class="label-sub">Timezone:</td>
<td class="content-sub"><input type="text" name="timezone" value="America/New_York" class="form-sub dataset-restaurant"></td>
</tr>
<tr>
<td class="label-sub">Location:</td>
<td class="content-sub">
<table class="admin-restaurant-form-sub">
<tr>
<td class="labcon-sub-sub">Lat:</td>
<td class="labcon-sub-sub"><input name="loc_lat" value="41.2" step="any" class="form-number dataset-restaurant"></td>
</tr>
<tr>
<td class="labcon-sub-sub">Long:</td>
<td class="labcon-sub-sub"><input name="loc_long" value="-70" step="any" class="form-number dataset-restaurant"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="label-sub">Sort Order:</td>
<td class="content-sub"><input name="sort" value="" step="any" min="0" class="form-number dataset-restaurant"></td>
</tr>
<tr>
<td class="label-sub">Tax:</td>
<td class="content-sub"><input name="tax" value="" step="any" min="0" class="form-number dataset-restaurant"> %</td>
</tr>
<tr>
<td class="label-sub">Deliv Min Applies to:</td>
<td class="content-sub">
<select name="delivery_min_amt" class="dataset-restaurant">
<option value="subtotal">Subtotal</option>
<option value="total">Total</option>
</select>
</td>
</tr>
<tr>
<td class="label-sub">Require confirmation?</td>
<td class="content-sub">
<div class="check-wrap">
<div class="check"><input type="checkbox" name="confirmation" value="0" class="dataset-restaurant bind-a-check"><label>No</label></div>
</div>
<div class="check-wrap">
<div class="check"><input type="checkbox" name="confirmation" value="1" class="dataset-restaurant bind-a-check"><label>Yes</label></div>
</div>
</td>
</tr>
<tr>
<td class="label-sub">Customer receipt on fax?</td>
<td class="content-sub">
<div class="check-wrap">
<div class="check"><input type="checkbox" name="customer_receipt" value="0" class="dataset-restaurant bind-a-check"><label>No</label></div>
</div>
<div class="check-wrap">
<div class="check"><input type="checkbox" name="customer_receipt" value="1" class="dataset-restaurant bind-a-check"><label>Yes</label></div>
</div>
</td>
</tr>
<tr>
<td class="label-sub">Restaurant Fee?</td>
<td class="content-sub">
<div class="check-wrap">
<div class="check"><input type="checkbox" name="fee_restaurant_check" value="0" class="dataset-restaurant bind-a-check-values"><label>No</label></div>
</div>
<div class="check-wrap">
<div class="check"><input type="checkbox" name="fee_restaurant_check" value="1" class="dataset-restaurant bind-a-check-values"><label>Yes</label></div>
<div class="check-content">
<input name="fee_restaurant" step="any" min="0" class="form-number dataset-restaurant change-a-check"> %
</div>
</div>
</td>
</tr>
<tr>
<td class="label-sub">Customer Fee?</td>
<td class="content-sub">
<div class="check-wrap">
<div class="check"><input type="checkbox" name="fee_customer_check" value="0" class="dataset-restaurant bind-a-check-values"><label>No</label></div>
</div>
<div class="check-wrap">
<div class="check"><input type="checkbox" name="fee_customer_check" value="1" class="dataset-restaurant bind-a-check-values"><label>Yes</label></div>
<div class="check-content">
<input name="fee_customer" step="any" min="0" class="form-number dataset-restaurant change-a-check"> %
</div>
</div>
</td>
</tr>
<tr>
<td class="label-sub">Accepts Credit Cards?</td>
<td class="content-sub">
<div class="check-wrap">
<div class="check"><input type="checkbox" name="credit" value="0" class="dataset-restaurant bind-a-check"><label>No</label></div>
</div>
<div class="check-wrap">
<div class="check"><input type="checkbox" name="credit" value="1" class="dataset-restaurant bind-a-check"><label>Yes</label></div>
</div>
</td>
</tr>
<tr>
<td class="label-sub">Accepts Cash?</td>
<td class="content-sub">
<div class="check-wrap">
<div class="check"><input type="checkbox" name="cash" value="0" class="dataset-restaurant bind-a-check"><label>No</label></div>
</div>
<div class="check-wrap">
<div class="check"><input type="checkbox" name="cash" value="1" class="dataset-restaurant bind-a-check"><label>Yes</label></div>
</div>
</td>
</tr>
<tr>
<td class="label-sub">Active?</td>
<td class="content-sub">
<div class="check-wrap">
<div class="check"><input type="checkbox" name="active" value="0" class="dataset-restaurant bind-a-check"><label>No</label></div>
</div>
<div class="check-wrap">
<div class="check"><input type="checkbox" name="active" value="1" class="dataset-restaurant bind-a-check"><label>Yes</label></div>
</div>
</td>
</tr>
<tr>
<td class="label-sub">Notes:</td>
<td class="content-sub"><textarea class="form-sub dataset-restaurant form-sub-big" name="notes"></textarea></td>
</tr>
<tr>
<td class="label-sub">Todo:</td>
<td class="content-sub"><textarea class="form-sub dataset-restaurant form-sub-big" name="notes_todo"></textarea></td>
</tr>
</table>
</div>
</div>
</td>
</tr>
</table>
<div class="hovering-container">
<div class="action-button action-button-small red admin-restaurant-revert">
<span>Revert</span>
</div>
<div class="action-button action-button-small green admin-restaurant-save" style="margin-right: 10px;">
<span>Save Restaurant</span>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div class="divider"></div>
<div id="dialog-option-group" title="Create Option Group" style="display: none;">
<table class="admin-restaurant-form-sub">
<tr>
<td colspan="2" class="label-sub"><input type="text" name="admin-option-name" placeholder="Name" class="form-sub"></td>
</tr>
<tr>
<td class="label-sub">Display type:</td>
<td class="content-sub">
<select name="admin-option-type">
<option value="check">Checkboxes</option>
<option value="select">Select</option>
</select>
</td>
</tr>
<tr>
<td class="label-sub">Modifies the base price?</td>
<td class="content-sub">
<input type="checkbox" name="admin-option-price">
</td>
</tr>
</table>
</div>
<div id="dialog-add-menu" title="Create Dish Category" style="display: none;">
<table class="admin-restaurant-form-sub">
<tr>
<td colspan="2" class="label-sub"><input type="text" name="admin-category-name" placeholder="Name" class="form-sub"></td>
</table>
</div>
<script>
$(function() {
App.loadRestaurant(<?=$this->restaurant->id_restaurant?>);
});
</script>

View File

@ -8,6 +8,7 @@
<link rel="apple-touch-icon-precomposed" href="/assets/images/appicon.png">
<link rel="stylesheet" type="text/css" href="/assets/css/admin.css">
<link rel="stylesheet" type="text/css" href="/assets/css/sprites.css">
<link rel="stylesheet" type="text/css" href="/assets/css/datepicker.css">
<link rel="stylesheet" type="text/css" href="/assets/css/chosen.css">
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/base/jquery-ui.css">
@ -68,4 +69,4 @@ var _gmtServer = '<?php echo $utc_str;?>';
</div>
</body>
</html>
</html>

View File

@ -22,6 +22,7 @@ var _gmtServer = '<?php echo $utc_str;?>';
<link rel="stylesheet" type="text/css" href="/assets/css/bundle.css?v=<?=Cana_Util::gitVersion()?>">
<? else : ?>
<link rel="stylesheet" type="text/css" href="/assets/css/style.css?v=<?=Cana_Util::gitVersion()?>">
<link rel="stylesheet" type="text/css" href="/assets/css/sprites.css?v=<?=Cana_Util::gitVersion()?>">
<link rel="stylesheet" type="text/css" href="/assets/css/font-awesome.css?v=<?=Cana_Util::gitVersion()?>">
<? if (strpos($_SERVER['HTTP_USER_AGENT'],'Windows') !== false) : ?>
<link rel="stylesheet" type="text/css" href="/assets/css/windows.css?v=<?=Cana_Util::gitVersion()?>">

View File

@ -10,6 +10,8 @@ RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?__url=$1 [L,QSA]
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css)$">
Header set Cache-Control "max-age=290304000, public"
</FilesMatch>
@ -20,6 +22,8 @@ AddType font/otf .otf
AddType font/woff .woff
AddType image/svg+xml .svg .svgz
php_value max_input_vars 100000
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
@ -31,4 +35,4 @@ AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddDefaultCharset UTF-8
AddDefaultCharset UTF-8

Binary file not shown.

View File

@ -141,7 +141,6 @@ body {
.admin-content-wrapper {
border: 1px solid #2b323b;
box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
padding: 12px;
border-radius: 5px;
background: #49525f;
@ -172,11 +171,10 @@ body {
}
.admin-tab-active {
background: #49525f;
color: #fff;
color: #444;
z-index: 900;
box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
background: #49525f -webkit-linear-gradient(top, #586372 0%,#49525f 90%);
background: #bbbbbb -webkit-linear-gradient(top, #bbbbbb 0%, #eeeeee 90%);
}
/**
@ -307,12 +305,12 @@ textarea {
.action-button {
width: 300px;
color: #fff;
font-size: 21px;
font-size: 16px;
font-weight: bold;
text-shadow: 1px 1px rgba(0,0,0,.3);
box-shadow: 0 2px 2px 0px rgba(0, 0, 0, 0.35);
border-radius: 3px;
padding: 18px 0 18px 0;
padding: 12px 0 12px 0;
text-align: center;
float: right;
cursor: pointer;
@ -744,5 +742,277 @@ table.list tr:nth-of-type(even) {
}
/* new admin */
#admin-msg {
bottom: 50px;
padding: 20px;
border: 1px solid #888888;
border-radius: 3px;
background-color: #ffffdd;
font-family: serif;
font-size: 24px;
}
.admin-button {
display: inline-block;
width: 120px;
color: #eeeeee;
font-size: 18px;
font-weight: bold;
padding: 6px;
margin: 5px;
text-align: center;
cursor: pointer;
background: #339900 -webkit-linear-gradient(top, #339900 0%, #228800 90%);
border: 1px solid #888888;
-webkit-border-radius: 4px;
}
.admin-button:hover {
background: #55aa00;
}
#admin-top-content-bar {
padding: 10px 0px 10px 0px;
}
#admin-top-button-group {
text-align: right;
float: right;
display: inline-block;
}
.admin-jump-list {
display: inline-block;
}
#float-bottom-right-container {
position: fixed;
right: 50px;
bottom: 50px;
padding: 8px;
border-radius: 5px;
background-color: rgba(128,128,128,0.2);
}
#float-bottom-left-container {
position: fixed;
left: 50px;
bottom: 50px;
padding: 8px;
border-radius: 3px;
background-color: rgba(128,128,128,0.2);
display: none; /* for messages to appear */
}
#admin-body-content {
background-color: #eeeeee;
border: 3px solid #222222;
padding: 12px;
}
.admin-h3 {
font-family: sans-serif;
font-weight: bold;
font-size: 24px;
margin: 15px 0px 15px 0px;
}
.admin-item {
border-top: 1px solid #888888;
padding: 5px 0px 5px 0px;
}
.admin-item-left {
padding-right: 20px;
display: inline-block;
width: 300px;
}
.admin-item-right {
display: inline-block;
vertical-align: top;
width: 600px;
}
.admin-item-name {
font-family: sans-serif;
font-size: 16px;
}
.admin-item-desc {
font-family: serif;
font-size: 12px;
}
.admin-item-right input, .admin-item-left input {
width: 100%;
font-size: 20px;
font-family: serif;
}
.admin-item-right textarea {
width: 98%;
font-size: 16px;
font-family: serif;
color: black;
background: #ffffff;
height: 100px;
}
.admin-item-right textarea.small {
height: 40px;
}
.admin-item-right select {
width: 100%;
font-size: 40px;
font-family: serif;
}
.invalid {
color: red;
}
.admin-item-right-row {
width: 100%;
}
.admin-item-col-x-wide {
width: 70%;
display: inline-block;
padding-right: 15px;
}
.admin-item-col-wide {
width: 48%;
display: inline-block;
padding-right: 15px;
}
.admin-item-col-med {
width: 24%;
display: inline-block;
padding-right: 15px;
}
.admin-item-col-med-2 {
width: 36%;
display: inline-block;
padding-right: 15px;
}
.admin-item-col-small {
width: 12%;
display: inline-block;
padding-right: 15px;
}
.admin-item-col-tab {
width: 30px;
display: inline-block;
padding-right: 15px;
}
.admin-item-col-fit {
display: inline-block;
padding-right: 15px;
}
.position-relative {
position: relative;
}
.fill-height {
position: absolute;
top: 0;
bottom: 0;
background-color: blue;
}
.admin-button-workflow, .admin-button-workflow-fit {
text-align: center;
display: inline-block;
border: 1px solid #888888;
-webkit-border-radius: 3px;
padding: 2px;
cursor: pointer;
}
.admin-button-workflow {
width: 120px;
}
.admin-button-workflow-fit {
width: 100%;
}
.admin-button-workflow:hover, .admin-button-workflow-fit:hover {
background: #ffffdd;
}
.admin-toggle-active, .admin-toggle-inactive {
text-align: center;
display: inline-block;
width: 100%;
border: 1px solid #888888;
-webkit-border-radius: 3px;
padding: 2px;
cursor: pointer;
margin-right: 5px;
}
.admin-toggle-inactive {
background: #ffdddd;
}
.admin-toggle-active {
background: #ddffdd;
}
.admin-toggle-active:hover, .admin-toggle-inactive:hover {
background: #ffffdd;
}
.template-container, .hidden {
display: none;
}
.admin-map {
height: 200px;
}
.admin-menu-category-indent {
display: inline-block;
}
.admin-menu-category-indent {
height: 100%;
width: 0px;
}
.admin-menu-dish-details {
border: 1px solid #888888;
padding: 10px;
-webkit-border-radius: 3px;
}
.admin-option-group-hr {
border-bottom: 1px solid #888888;
margin: 10px 0px 10px 0px;
}
.admin-menu-option input {
font-size: 12px;
font-family: serif;
}

1078
www/assets/css/sprites.css Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff