From 3ac9c3e00d1932e35e6fe3bf45137a2a3df2a543 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Thu, 15 May 2014 14:01:31 +1000 Subject: [PATCH] Basics of producer modal in place --- app/views/home/_fat.html.haml | 3 +-- app/views/json/_hubs.rabl | 6 +++++- app/views/modals/_producer.html.haml | 13 +++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 app/views/modals/_producer.html.haml diff --git a/app/views/home/_fat.html.haml b/app/views/home/_fat.html.haml index 823e96a37e..67c83b73cb 100644 --- a/app/views/home/_fat.html.haml +++ b/app/views/home/_fat.html.haml @@ -12,8 +12,7 @@ %strong Our producers %ul %li{"ng-repeat" => "producer in hub.producers"} - %ofn-modal{title: "{{ producer.name }}"} - {{ producer || json }} + = render partial: "modals/producer" .row.active_table_row.link{"ng-show" => "open()", "ng-if" => "hub.active"} .columns.small-11 diff --git a/app/views/json/_hubs.rabl b/app/views/json/_hubs.rabl index a6958840bc..60cad8fbbf 100644 --- a/app/views/json/_hubs.rabl +++ b/app/views/json/_hubs.rabl @@ -6,7 +6,11 @@ child distributed_taxons: :taxons do end child suppliers: :producers do - attributes :name, :id + attributes :name, :id, :description, :long_description + + node :promo_image do |producer| + producer.promo_image.url + end end node :pickup do |hub| diff --git a/app/views/modals/_producer.html.haml b/app/views/modals/_producer.html.haml new file mode 100644 index 0000000000..691e9378d3 --- /dev/null +++ b/app/views/modals/_producer.html.haml @@ -0,0 +1,13 @@ +%ofn-modal{title: "{{ producer.name }}"} + #producer_modal{bindonce: true} + .row + .small-12.columns + %img{"bo-src" => "producer.promo_image"} + %h3 {{ producer.name }} + + .row + .small-6.columns + %p + {{ producer.description }} + .small-6.columns + Stay in touch with {{ producer.name }}