Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: dziamid/Lunch-time
base: 7fe25c7e78
...
head fork: dziamid/Lunch-time
compare: ae987270ef
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
View
10 src/LunchTime/DeliveryBundle/Controller/OrderController.php
@@ -74,14 +74,10 @@ public function createItemAction()
}
$em->flush();
- if (count($items) == count($_items)) {
- return new Response(json_encode($this->serializeItems($items)));
- }
+ $_items = $this->serializeItems($items);
+ return new Response(json_encode($_items));
+
- return new Response(json_encode(array(
- 'error' => true,
- 'msg' => 'Some items have not been persisted',
- )));
}
protected function serializeOrder($order)
View
12 src/LunchTime/DeliveryBundle/Resources/public/js/lib/adapter.js
@@ -77,10 +77,7 @@ DS.SymfonyAdapter = DS.RESTAdapter.extend({
getUrl: function (type) {
return this.getBaseUrl() + type.url;
},
-
- getFormName: function (type) {
- return type.paramName;
- },
+
/**
* Returns a base url without the trailing slash, optionally with symfony controller
@@ -97,6 +94,13 @@ DS.SymfonyAdapter = DS.RESTAdapter.extend({
url = url + "/" + controller;
}
return url;
+ },
+
+ sideload: function (store, type, json) {
+ json.forEach(function(item) {
+ store.load(type, item);
+ });
}
+
});
View
2  ...ndle/Resources/public/js/view/active-menu-view.js → ...iveryBundle/Resources/public/js/view/menu-view.js
@@ -1,4 +1,4 @@
-App.ActiveMenuView = Em.View.extend({
+App.MenuView = Em.View.extend({
menuBinding: 'App.ActiveMenuController.content'
});
View
6 src/LunchTime/DeliveryBundle/Resources/public/js/view/order-view.js
@@ -1,3 +1,7 @@
App.ActiveOrderView = Em.View.extend({
- orderBinding: 'App.ActiveOrderController.content'
+ orderBinding: 'App.ActiveOrderController.content',
+ commit: function () {
+ App.store.commit();
+ }
});
+
View
2  src/LunchTime/DeliveryBundle/Resources/views/Default/index.html.twig
@@ -5,7 +5,7 @@
<div class="section clear-float">
<div class="col">
- {% include 'LTDeliveryBundle:Default:active-menu.html.handlebars' %}
+ {% include 'LTDeliveryBundle:Default:menu.html.handlebars' %}
</div>
<div class="col">
{% include 'LTDeliveryBundle:Default:order.html.handlebars' %}
View
2  ...sources/views/Default/active-menu.html.handlebars → ...ndle/Resources/views/Default/menu.html.handlebars
@@ -1,5 +1,5 @@
{% raw %}
-{{#view App.ActiveMenuView id="active-menu"}}
+{{#view App.MenuView id="menu"}}
<h1>{{menu.dueDateString}}</h1>
{{#with menu }}
{{#each items}}
View
2  src/LunchTime/DeliveryBundle/Resources/views/Default/order.html.handlebars
@@ -10,5 +10,7 @@
{{/each}}
</ul>
{{/with}}
+
+ <a href="#" {{action "commit"}}>Save order</a>
{{/view}}
{% endraw %}

No commit comments for this range

Something went wrong with that request. Please try again.