diff --git a/app/assets/images/logo-black2.png b/app/assets/images/logo-black2.png deleted file mode 100644 index 6229ae2d9e..0000000000 Binary files a/app/assets/images/logo-black2.png and /dev/null differ diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 80b4a5d4d1..15c20dfd55 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -25,8 +25,4 @@ module ApplicationHelper super end end - - def image_url(file) - request.protocol + request.host_with_port + path_to_image(file) - end end diff --git a/app/serializers/api/admin/exchange_serializer.rb b/app/serializers/api/admin/exchange_serializer.rb index 64c2c08cd4..cb49d94fc8 100644 --- a/app/serializers/api/admin/exchange_serializer.rb +++ b/app/serializers/api/admin/exchange_serializer.rb @@ -1,5 +1,5 @@ class Api::Admin::ExchangeSerializer < ActiveModel::Serializer - attributes :id, :sender_id, :receiver_id, :incoming, :variants, :pickup_time, :pickup_instructions + attributes :id, :sender_id, :receiver_id, :incoming, :variants, :receival_instructions, :pickup_time, :pickup_instructions has_many :enterprise_fees, serializer: Api::Admin::BasicEnterpriseFeeSerializer diff --git a/app/views/enterprises/shop.html.haml b/app/views/enterprises/shop.html.haml index d3169647e0..f2063494b4 100644 --- a/app/views/enterprises/shop.html.haml +++ b/app/views/enterprises/shop.html.haml @@ -3,7 +3,7 @@ - content_for(:description) do = current_distributor.description - content_for(:image) do - = current_distributor.logo + = current_distributor.logo.url = inject_enterprises diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index d2d5a7bf55..74588176b9 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -3,7 +3,7 @@ - content_for(:description) do = @group.description - content_for(:image) do - = @group.logo + = @group.logo.url -# inject all enterprises as "enterprises" -# it could be more efficient to inject only the enterprises that are related to the group diff --git a/app/views/layouts/darkswarm.html.haml b/app/views/layouts/darkswarm.html.haml index 016af8d30d..0788286394 100644 --- a/app/views/layouts/darkswarm.html.haml +++ b/app/views/layouts/darkswarm.html.haml @@ -2,9 +2,9 @@ %head %meta{charset: 'utf-8'}/ %meta{name: 'viewport', content: "width=device-width,initial-scale=1.0"}/ - %meta{:content => yield(:title).empty? ? "#{t(:title)}" : yield(:title), :property => "og:title"}/ - %meta{:content => yield(:description).empty? ? "#{t(:og_description)}" : yield(:description), :property => "og:description"}/ - %meta{:content => yield(:image).empty? ? image_url("logo-black2.png") : image_url(yield(:image)), :property => "og:image"}/ + %meta{property: "og:title", content: content_for?(:title) ? yield(:title) : t(:title)} + %meta{property: "og:description", content: content_for?(:description) ? yield(:description) : t(:description)} + %meta{property: "og:image", content: content_for?(:image) ? yield(:image) : ContentConfig.logo.url} %title= content_for?(:title) ? "#{yield(:title)} - #{t(:title)}".html_safe : "#{t(:welcome_to)} #{t(:title)}" - if Rails.env.production? = favicon_link_tag diff --git a/config/locales/en.yml b/config/locales/en.yml index 0baa381810..ea8cb4cb19 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -29,6 +29,7 @@ en: home: "OFN" title: Open Food Network welcome_to: 'Welcome to ' + description: "We begin from the ground up. With farmers and growers ready to tell their stories proudly and truly. With distributors ready to connect people with products fairly and honestly. With buyers who believe that better weekly shopping decisions can…" search_by_name: Search by name or suburb... producers: Aussie Producers producers_join: Australian producers are now welcome to join the Open Food Network. @@ -675,5 +676,3 @@ Please follow the instructions there to make your enterprise visible on the Open price_graph: "Price graph" included_tax: "Included tax" remove_tax: "Remove tax" - og_description: "We begin from the ground up. With farmers and growers ready to tell their stories proudly and truly. With distributors ready to connect people with products fairly and honestly. With buyers who believe that better weekly shopping decisions can…" - diff --git a/spec/features/admin/order_cycles_spec.rb b/spec/features/admin/order_cycles_spec.rb index 2aba4f1a71..aafaa5ee77 100644 --- a/spec/features/admin/order_cycles_spec.rb +++ b/spec/features/admin/order_cycles_spec.rb @@ -102,6 +102,7 @@ feature %q{ # And I add a supplier and some products select 'My supplier', from: 'new_supplier_id' click_button 'Add supplier' + fill_in 'order_cycle_incoming_exchange_0_receival_instructions', with: 'receival instructions' page.find('table.exchanges tr.supplier td.products input').click check "order_cycle_incoming_exchange_0_variants_#{v1.id}" check "order_cycle_incoming_exchange_0_variants_#{v2.id}" @@ -157,8 +158,11 @@ feature %q{ oc.exchanges.first.variants.count.should == 2 oc.exchanges.last.variants.count.should == 2 - # And my pickup time and instructions should have been saved - exchange = oc.exchanges.where(:sender_id => oc.coordinator_id).first + # And my receival and pickup time and instructions should have been saved + exchange = oc.exchanges.incoming.first + exchange.receival_instructions.should == 'receival instructions' + + exchange = oc.exchanges.outgoing.first exchange.pickup_time.should == 'pickup time' exchange.pickup_instructions.should == 'pickup instructions' end @@ -188,6 +192,9 @@ feature %q{ page.should have_selector 'td.supplier_name', :text => oc.suppliers.first.name page.should have_selector 'td.supplier_name', :text => oc.suppliers.last.name + page.should have_field 'order_cycle_incoming_exchange_0_receival_instructions', with: 'instructions 0' + page.should have_field 'order_cycle_incoming_exchange_1_receival_instructions', with: 'instructions 1' + # And the suppliers should have products page.all('table.exchanges tbody tr.supplier').each do |row| row.find('td.products input').click