From a6d58aa498aa3e03d8ab6540109c3be29875d7ed Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 14 Feb 2014 14:40:58 +1100 Subject: [PATCH] Partializing and adding yield blocks --- .../stylesheets/darkswarm/shop.css.sass | 2 +- app/views/shop/_details.html.haml | 11 +++++++ app/views/shop/checkout/edit.html.haml | 33 +++++++++++-------- app/views/shop/shop/_order_cycles.html.haml | 14 +------- app/views/shop/shop/show.html.haml | 25 +++++++------- 5 files changed, 46 insertions(+), 39 deletions(-) create mode 100644 app/views/shop/_details.html.haml diff --git a/app/assets/stylesheets/darkswarm/shop.css.sass b/app/assets/stylesheets/darkswarm/shop.css.sass index 3781b380f8..6127a84faf 100644 --- a/app/assets/stylesheets/darkswarm/shop.css.sass +++ b/app/assets/stylesheets/darkswarm/shop.css.sass @@ -4,7 +4,7 @@ product display: block -shop +.darkswarm #search font-size: 2em @include big-input diff --git a/app/views/shop/_details.html.haml b/app/views/shop/_details.html.haml new file mode 100644 index 0000000000..6b77e45a27 --- /dev/null +++ b/app/views/shop/_details.html.haml @@ -0,0 +1,11 @@ +%navigation + %distributor.details.row + #distributor_title + %img.left{src: current_distributor.logo.url(:thumb)} + %h4 + = current_distributor.name + %location= current_distributor.address.city + %small + %a{href: "/"} Change location + + = render partial: "shop/shop/order_cycles" diff --git a/app/views/shop/checkout/edit.html.haml b/app/views/shop/checkout/edit.html.haml index 4d4d7dddd8..6ef3039d85 100644 --- a/app/views/shop/checkout/edit.html.haml +++ b/app/views/shop/checkout/edit.html.haml @@ -1,15 +1,22 @@ -- unless spree_current_user +%checkout.darkswarm + - content_for :order_cycle_form do + %form.custom + %strong.avenir + Order ready on + = pickup_time current_order_cycle + = render partial: "shop/details" + + - unless spree_current_user + .row + %section#checkout_login + .large-4.columns + = render partial: "shop/checkout/login" + %section#checkout_signup + .large-4.columns + = render partial: "shop/checkout/signup" + .large-2.columns + Cart bitches! + .row - %section#checkout_login - .large-4.columns - = render partial: "shop/checkout/login" - %section#checkout_signup - .large-4.columns - = render partial: "shop/checkout/signup" - .large-2.columns - Cart bitches! - - -.row - = render partial: "shop/checkout/form" + = render partial: "shop/checkout/form" diff --git a/app/views/shop/shop/_order_cycles.html.haml b/app/views/shop/shop/_order_cycles.html.haml index 22463e677b..52cc7f04c6 100644 --- a/app/views/shop/shop/_order_cycles.html.haml +++ b/app/views/shop/shop/_order_cycles.html.haml @@ -1,9 +1,7 @@ %ordercycle{"ng-controller" => "OrderCycleCtrl"} - :javascript angular.module('Shop').value('orderCycleData', #{render "shop/shop/order_cycle"}) - - if @order_cycles.empty? Orders are currently closed for this hub %p @@ -14,14 +12,4 @@ = render partial: "shop/shop/last_order_cycle" - else - %form.custom - %strong.avenir Ready for - %select.avenir#order_cycle_id{"ng-model" => "order_cycle.order_cycle_id", - "ng-change" => "changeOrderCycle()", - "ng-options" => "oc.id as oc.time for oc in #{@order_cycles.map {|oc| {time: pickup_time(oc), id: oc.id}}.to_json}"} - - %closing - -#%img{src: "/icon/goes/here"} - Orders close - %strong {{ order_cycle.orders_close_at | date_in_words }} - + = yield :order_cycle_form diff --git a/app/views/shop/shop/show.html.haml b/app/views/shop/shop/show.html.haml index 5063841152..924c68da91 100644 --- a/app/views/shop/shop/show.html.haml +++ b/app/views/shop/shop/show.html.haml @@ -1,17 +1,18 @@ -%shop{"ng-app" => "Shop"} - %navigation - %distributor.details.row - #distributor_title - %img.left{src: @distributor.logo.url(:thumb)} - %h4 - = @distributor.name - %location= @distributor.address.city - %small - %a{href: "/"} Change location +%shop.darkswarm{"ng-app" => "Shop"} - = render partial: "shop/shop/order_cycles" + - content_for :order_cycle_form do + %form.custom + %strong.avenir Ready for + %select.avenir#order_cycle_id{"ng-model" => "order_cycle.order_cycle_id", + "ng-change" => "changeOrderCycle()", + "ng-options" => "oc.id as oc.time for oc in #{@order_cycles.map {|oc| {time: pickup_time(oc), id: oc.id}}.to_json}"} + + %closing + -#%img{src: "/icon/goes/here"} + Orders close + %strong {{ order_cycle.orders_close_at | date_in_words }} + = render partial: "shop/details" - -#%description %tabs .row