From 510333288ce2d7d3f35a5c8462da632b348deaa4 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Sun, 2 Mar 2014 13:05:15 +1100 Subject: [PATCH 01/13] first steps of new design --- app/views/admin/enterprises/_form.html.haml | 89 +++++++-------------- 1 file changed, 31 insertions(+), 58 deletions(-) diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index 46e7494355..c6d4e3bfdb 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -5,63 +5,36 @@ %tr{"data-hook" => "name"} %td Name: %td= f.text_field :name - %tr{"data-hook" => "description"} - %td Description: - %td= f.text_field :description - %tr{'data-hook' => "long_description"} - %td Extended Description: - %td= f.text_area :long_description, :class => 'rich_text' - %tr{'data-hook' => "is_primary_producer"} - %td Primary Producer? - %td= f.check_box :is_primary_producer - %tr{'data-hook' => "is_distributor"} - %td Distributor? - %td= f.check_box :is_distributor - %tr{'data-hook' => "enterprise_group_ids"} - %td Groups - %td= f.collection_select :group_ids, EnterpriseGroup.all, :id, :name, {}, {class: "select2 fullwidth", multiple: true} - %tr{"data-hook" => "contact"} - %td Contact Person: - %td= f.text_field :contact - %tr{"data-hook" => "phone"} - %td Phone: - %td= f.text_field :phone - %tr{"data-hook" => "email"} - %td Email: - %td= f.text_field :email - %tr{"data-hook" => "website"} - %td Website: - %td= f.text_field :website - %tr{"data-hook" => "twitter"} - %td Twitter: - %td= f.text_field :twitter - %tr{"data-hook" => "abn"} - %td ABN: - %td= f.text_field :abn - %tr{"data-hook" => "acn"} - %td ACN: - %td= f.text_field :acn - %tr{"data-hook" => "logo"} - %td Logo: + %tr %td - = f.file_field :logo - = image_tag @object.logo.url - %tr{"data-hook" => "promo"} - %td Promo Image: %td - = f.file_field :promo_image - = image_tag @object.promo_image.url -%fieldset - %legend Address - %table - = f.fields_for :address do |address_form| - = render 'spree/admin/shared/address_form_simple', :f => address_form -%fieldset - %legend Pickup details - %table{"data-hook" => "distributors_pickup_details"} - %tr{"data-hook" => "next_collection_at"} - %td Next collection date/time: - %td= f.text_field :next_collection_at - %tr{"data-hook" => "pickup_times"} - %td Regular pickup times: - %td= f.text_field :pickup_times + / what about the data-hook? + / {'data-hook' => "is_primary_producer"} + = f.check_box :is_primary_producer + Producer + / %tr{'data-hook' => "is_distributor"} + / here should be a gap + = f.check_box :is_distributor + Distributor + / this should be at the right side + %a Tell me more? + %tr + %th Address + = f.fields_for :address do |af| + %tr + %td Address + %td= af.text_field :address1 + %td Address (cont.) + %td= af.text_field :address2 + %tr + %td Suburb + %td= af.text_field :city + %td Postcode + %td= af.text_field :zipcode + %tr + %td + %td + = af.collection_select(:state_id, af.object.country.states, :id, :name) + = af.collection_select(:country_id, available_countries, :id, :name) + + From 6f1d41e0200fdcf0f21dffe28ba6bd79d10c383b Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 4 Mar 2014 16:52:48 +1100 Subject: [PATCH 02/13] new selection of input fields for enterprises form, not all datafields working yet --- app/views/admin/enterprises/_form.html.haml | 47 +++++++++++++++++++++ app/views/admin/enterprises/new.html.erb | 1 + 2 files changed, 48 insertions(+) diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index c6d4e3bfdb..305ef8b2f8 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -36,5 +36,52 @@ %td = af.collection_select(:state_id, af.object.country.states, :id, :name) = af.collection_select(:country_id, available_countries, :id, :name) + %tr + %th Contact Details + %th + %th Enterprise Details + %th + %tr + %td Name + %td= f.text_field :contact + %td ABN / ACN + %td= f.text_field :abn + %tr + %td Email + %td= f.text_field :email + %td Website + %td= f.text_field :website + %tr + %td Phone + %td= f.text_field :phone + %td Facebook + %td= f.text_field :twitter + / TODO: facebook data field + %tr + %td + %td + %td Twitter + %td= f.text_field :twitter + %tr + %th About Us + %tr + %td Short Description + %td= f.text_field :description + %tr + %td About Us + %td= f.text_area :long_description, :class => 'rich_text' + %tr + %td How does it work? + %td= f.text_area :long_description, :class => 'rich_text' + / TODO: hub explanation data field + %tr + %td Logo + %td + = f.file_field :logo + = image_tag @object.logo.url + %td Promo + %td + = f.file_field :promo_image + = image_tag @object.promo_image.url diff --git a/app/views/admin/enterprises/new.html.erb b/app/views/admin/enterprises/new.html.erb index 92682f64d8..a78a75c81e 100644 --- a/app/views/admin/enterprises/new.html.erb +++ b/app/views/admin/enterprises/new.html.erb @@ -2,5 +2,6 @@ <%= form_for [main_app, :admin, @enterprise] do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> + <%= render :partial => 'spree/admin/shared/new_resource_links' %> <% end %> From 4c0885277d513414002aa475d330a6d5178d1d66 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 4 Mar 2014 19:15:03 +1100 Subject: [PATCH 03/13] started to redesign form with css --- app/views/admin/enterprises/_form.html.haml | 66 ++++++++++++++++----- app/views/admin/enterprises/new.html.erb | 2 +- 2 files changed, 51 insertions(+), 17 deletions(-) diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index 305ef8b2f8..5e105fdbaf 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -1,23 +1,57 @@ - content_for :head do = render 'shared/cms_elrte_head' +%style + div.enterprise-form { + border: 1px dashed grey; + margin-bottom: 1em; + padding: 1em; + } + fieldset { + font-size: 100%; + } + label { + text-transform:none; + margin-right: 1em; + } + input { + margin: 0.5em 0em; + } + label.leftcol { + display: inline-block; + width: 10em; + } + label.leftcol+input { + margin-right: 3em; + } + input#enterprise_is_primary_producer { + margin-left: 10em; + } + div.input-compound { + display: inline-block; + } + +%div.enterprise-form{data-hook: "distributors"} + %label.leftcol{for: "enterprise_name", 'data-hook' => "name"} Name + = f.text_field :name + %div + = f.check_box :is_primary_producer + %label{for: "enterprise_is_primary_producer", 'data-hook' => "is_primary_producer"} Producer + = f.check_box :is_distributor + %label{for: "enterprise_is_distributor", 'data-hook' => "is_distributor"} Hub + %a Tell me more? + = f.fields_for :address do |af| + %fieldset + %legend Address + %label.leftcol{for: "enterprise_address_attributes_address1"} Address + = af.text_field :address1 + %div.input-compound + %label.leftcol{for: "enterprise_address_attributes_address2"} Address (cont.) + = af.text_field :address2 + + + %table{"data-hook" => "distributors"} - %tr{"data-hook" => "name"} - %td Name: - %td= f.text_field :name - %tr - %td - %td - / what about the data-hook? - / {'data-hook' => "is_primary_producer"} - = f.check_box :is_primary_producer - Producer - / %tr{'data-hook' => "is_distributor"} - / here should be a gap - = f.check_box :is_distributor - Distributor - / this should be at the right side - %a Tell me more? %tr %th Address = f.fields_for :address do |af| diff --git a/app/views/admin/enterprises/new.html.erb b/app/views/admin/enterprises/new.html.erb index a78a75c81e..890c6009cd 100644 --- a/app/views/admin/enterprises/new.html.erb +++ b/app/views/admin/enterprises/new.html.erb @@ -2,6 +2,6 @@ <%= form_for [main_app, :admin, @enterprise] do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> - + <%= render :partial => 'spree/admin/shared/new_resource_links' %> <% end %> From e9506d1571300dbda0989258dc7d009db86bf421 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 5 Mar 2014 16:26:59 +1100 Subject: [PATCH 04/13] complete form with columns. two things to ask Kerstin. --- app/views/admin/enterprises/_form.html.haml | 241 +++++++++++--------- 1 file changed, 131 insertions(+), 110 deletions(-) diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index 5e105fdbaf..dcdedfe830 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -2,120 +2,141 @@ = render 'shared/cms_elrte_head' %style - div.enterprise-form { - border: 1px dashed grey; - margin-bottom: 1em; - padding: 1em; - } - fieldset { - font-size: 100%; - } - label { - text-transform:none; - margin-right: 1em; - } - input { - margin: 0.5em 0em; - } - label.leftcol { - display: inline-block; - width: 10em; - } - label.leftcol+input { - margin-right: 3em; - } - input#enterprise_is_primary_producer { - margin-left: 10em; - } - div.input-compound { - display: inline-block; + div.row input[type=text], div.row select { + width: 100%; } -%div.enterprise-form{data-hook: "distributors"} - %label.leftcol{for: "enterprise_name", 'data-hook' => "name"} Name - = f.text_field :name - %div - = f.check_box :is_primary_producer - %label{for: "enterprise_is_primary_producer", 'data-hook' => "is_primary_producer"} Producer - = f.check_box :is_distributor - %label{for: "enterprise_is_distributor", 'data-hook' => "is_distributor"} Hub - %a Tell me more? +.enterprise-form + .row + .alpha.six.columns + .two.columns.alpha + = f.label :name + .four.columns.omega + = f.text_field :name + .row + .alpha.two.columns   + .omega.ten.columns + .alpha.two.columns + = f.check_box :is_primary_producer + = f.label :is_primary_producer, 'Producer' + .omega.two.columns + = f.check_box :is_distributor + = f.label :is_distributor, 'Hub' + .omega.two.columns + %a Tell me more? + / TODO: link for Tell me more = f.fields_for :address do |af| %fieldset %legend Address - %label.leftcol{for: "enterprise_address_attributes_address1"} Address - = af.text_field :address1 - %div.input-compound - %label.leftcol{for: "enterprise_address_attributes_address2"} Address (cont.) - = af.text_field :address2 - + .row + .six.columns.alpha + .alpha.two.columns + = af.label :address1 + .omega.four.columns + = af.text_field :address1 + .six.columns.omega + .alpha.two.columns + = af.label :address2 + .omega.four.columns + = af.text_field :address2 + .row + .six.columns.alpha + .alpha.two.columns + = af.label :city, 'Suburb' + .omega.four.columns + = af.text_field :city + .six.columns.omega + .alpha.two.columns + = af.label :zipcode, 'Postcode' + .omega.four.columns + = af.text_field :zipcode + .row + .alpha.two.columns   + .omega.three.columns + = af.collection_select(:state_id, af.object.country.states, :id, :name) + .row + .alpha.two.columns   + .omega.three.columns + = af.collection_select(:country_id, available_countries, :id, :name) + .row + .alpha.six.columns + %fieldset + %legend Contact Details + .row + .alpha.two.columns + = f.label :contact, 'Name' + .omega.four.columns + = f.text_field :contact + .row + .alpha.two.columns + = f.label :email + .omega.four.columns + = f.text_field :email + .row + .alpha.two.columns + = f.label :phone + .omega.four.columns + = f.text_field :phone + .omega.six.columns + %fieldset + %legend Enterprise Details + .row + .alpha.two.columns + = f.label :abn, 'ABN / ACN' + / TODO: figure out how to work with one field for both + / ABN has 11 digits + / ACN has 9 digits + .omega.four.columns + = f.text_field :abn + .row + .alpha.two.columns + = f.label :website + .omega.four.columns + = f.text_field :website + /.row + / .alpha.two.columns + / = f.label :twitter, 'Facebook' + / / TODO: facebook data field + / .omega.four.columns + / = f.text_field :twitter + .row + .alpha.two.columns + = f.label :twitter + .omega.four.columns + = f.text_field :twitter + %fieldset + %legend About Us + .row + .alpha.two.columns + = f.label :description, 'Short Description' + .omega.four.columns + = f.text_field :description + .row + .alpha.two.columns + = f.label :long_description, 'About Us' + %br + Tell us about yourself. This information appears on your public profile (under "About Us") + .omega.eight.columns + = f.text_area :long_description, class: 'rich_text', placeholder: 'Tell us about yourself. This information appears on your public profile (under "About Us")' + .row + .alpha.two.columns + = f.label :distributor_info, 'How does it work?' + %br + Hub only: Explain your distribution offer/s - this is more detailed information that the user can access by clicking on "How does it work?" + .omega.eight.columns + = f.text_area :distributor_info, class: 'rich_text', placeholder: 'Hub only: Explain your distribution offer/s - this is more detailed information that the user can access by clicking on "How does it work?"' + / TODO: how to use placeholder with richt text? + / TODO: editor breaks scrolling with arrow keys + .row + .alpha.two.columns + = f.label :logo + .omega.four.columns + = image_tag @object.logo.url + = f.file_field :logo + .omega.two.columns + = f.label :promo_image + .omega.four.columns + = image_tag @object.promo_image.url + = f.file_field :pro_image -%table{"data-hook" => "distributors"} - %tr - %th Address - = f.fields_for :address do |af| - %tr - %td Address - %td= af.text_field :address1 - %td Address (cont.) - %td= af.text_field :address2 - %tr - %td Suburb - %td= af.text_field :city - %td Postcode - %td= af.text_field :zipcode - %tr - %td - %td - = af.collection_select(:state_id, af.object.country.states, :id, :name) - = af.collection_select(:country_id, available_countries, :id, :name) - %tr - %th Contact Details - %th - %th Enterprise Details - %th - %tr - %td Name - %td= f.text_field :contact - %td ABN / ACN - %td= f.text_field :abn - %tr - %td Email - %td= f.text_field :email - %td Website - %td= f.text_field :website - %tr - %td Phone - %td= f.text_field :phone - %td Facebook - %td= f.text_field :twitter - / TODO: facebook data field - %tr - %td - %td - %td Twitter - %td= f.text_field :twitter - %tr - %th About Us - %tr - %td Short Description - %td= f.text_field :description - %tr - %td About Us - %td= f.text_area :long_description, :class => 'rich_text' - %tr - %td How does it work? - %td= f.text_area :long_description, :class => 'rich_text' - / TODO: hub explanation data field - %tr - %td Logo - %td - = f.file_field :logo - = image_tag @object.logo.url - %td Promo - %td - = f.file_field :promo_image - = image_tag @object.promo_image.url - - From 052782678e9ada3db9e1a96be212fc61c2a7a8f7 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 5 Mar 2014 16:49:39 +1100 Subject: [PATCH 05/13] working design. TODOs are optional now --- app/views/admin/enterprises/_form.html.haml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index dcdedfe830..55bc499aa7 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -1,6 +1,7 @@ - content_for :head do = render 'shared/cms_elrte_head' +/ TODO move this CSS %style div.row input[type=text], div.row select { width: 100%; @@ -23,8 +24,8 @@ = f.check_box :is_distributor = f.label :is_distributor, 'Hub' .omega.two.columns - %a Tell me more? - / TODO: link for Tell me more + %span.with-tip{'data-powertip' => "Select 'Producer' if you are producing food like a farmer. And select 'Hub' if you are selling to end customers. You can do both."} + %a Tell me more? = f.fields_for :address do |af| %fieldset %legend Address @@ -82,12 +83,17 @@ %legend Enterprise Details .row .alpha.two.columns - = f.label :abn, 'ABN / ACN' + = f.label :abn, 'ABN' / TODO: figure out how to work with one field for both / ABN has 11 digits / ACN has 9 digits .omega.four.columns = f.text_field :abn + .row + .alpha.two.columns + = f.label :acn, 'ACN' + .omega.four.columns + = f.text_field :acn .row .alpha.two.columns = f.label :website From 6689b0d93f1f897f56d8f63a0542c2aac2d5b5b4 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 5 Mar 2014 17:06:44 +1100 Subject: [PATCH 06/13] more tooltips --- app/views/admin/enterprises/_form.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index 55bc499aa7..3c9e81e151 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -115,8 +115,8 @@ .row .alpha.two.columns = f.label :description, 'Short Description' - .omega.four.columns - = f.text_field :description + .omega.ten.columns + = f.text_field :description, placeholder: 'Just one or two sentences' .row .alpha.two.columns = f.label :long_description, 'About Us' @@ -140,7 +140,7 @@ = image_tag @object.logo.url = f.file_field :logo .omega.two.columns - = f.label :promo_image + = f.label :promo_image, class: 'with-tip', 'data-powertip' => 'This image is displayed in "About Us"' .omega.four.columns = image_tag @object.promo_image.url = f.file_field :pro_image From aa7211dc7f7464da59fc549610c00e5b5c6af621 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 5 Mar 2014 17:13:46 +1100 Subject: [PATCH 07/13] more tooltips --- app/views/admin/enterprises/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index 3c9e81e151..89f35902ee 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -24,7 +24,7 @@ = f.check_box :is_distributor = f.label :is_distributor, 'Hub' .omega.two.columns - %span.with-tip{'data-powertip' => "Select 'Producer' if you are producing food like a farmer. And select 'Hub' if you are selling to end customers. You can do both."} + %span.with-tip{'data-powertip' => "Select 'Producer' if you are a primary producer of food. And select 'Hub' if you are selling to end customers. You can do both."} %a Tell me more? = f.fields_for :address do |af| %fieldset From cc2ae2f464add119f268b77988a8e68b0e339cd0 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 5 Mar 2014 17:33:26 +1100 Subject: [PATCH 08/13] moved fullwidth form css --- .../stylesheets/admin/openfoodnetwork.css.scss | 7 +++++++ app/views/admin/enterprises/_form.html.haml | 12 +++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/assets/stylesheets/admin/openfoodnetwork.css.scss b/app/assets/stylesheets/admin/openfoodnetwork.css.scss index 2e03a9e2eb..14feebae0d 100644 --- a/app/assets/stylesheets/admin/openfoodnetwork.css.scss +++ b/app/assets/stylesheets/admin/openfoodnetwork.css.scss @@ -126,3 +126,10 @@ table#listing_enterprise_groups { text-align: left; } } + +.fullwidth_inputs { + input[type=text], select { + width: 100%; + } +} + diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index 89f35902ee..b1153aec2e 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -1,13 +1,7 @@ - content_for :head do = render 'shared/cms_elrte_head' -/ TODO move this CSS -%style - div.row input[type=text], div.row select { - width: 100%; - } - -.enterprise-form +.fullwidth_inputs .row .alpha.six.columns .two.columns.alpha @@ -30,12 +24,12 @@ %fieldset %legend Address .row - .six.columns.alpha + .alpha.six.columns .alpha.two.columns = af.label :address1 .omega.four.columns = af.text_field :address1 - .six.columns.omega + .omega.six.columns .alpha.two.columns = af.label :address2 .omega.four.columns From 9181f0243a2b1f501129400f6c59f8eba518301a Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 5 Mar 2014 18:15:01 +1100 Subject: [PATCH 09/13] added old input fields, enterprises test passing --- app/views/admin/enterprises/_form.html.haml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index b1153aec2e..b658636517 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -8,6 +8,11 @@ = f.label :name .four.columns.omega = f.text_field :name + .omega.six.columns + .two.columns.alpha + = f.label :group_ids, 'Groups' + .four.columns.omega + = f.collection_select :group_ids, EnterpriseGroup.all, :id, :name, {}, {class: "select2 fullwidth", multiple: true} .row .alpha.two.columns   .omega.ten.columns @@ -139,4 +144,19 @@ = image_tag @object.promo_image.url = f.file_field :pro_image + %fieldset + %legend Pickup details + .row + .alpha.six.columns + .alpha.two.columns + = f.label :next_collection_at, 'Next collection date/time' + .omega.four.columns + = f.text_field :next_collection_at + .omega.six.columns + .alpha.two.columns + = f.label :pickup_times, 'Regular pickup times' + .omega.four.columns + = f.text_field :pickup_times + + From 7d30d8e28fe06173f9d6e5e7b81d7815e1c17834 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 6 Mar 2014 18:35:14 +1100 Subject: [PATCH 10/13] old deface files deleted. spec for enterprise form updated --- .../enterprises/_form/add_distributor_info.html.haml.deface | 4 ---- .../_form/rename_extended_description.html.haml.deface | 3 --- .../enterprises_distributor_info_rich_text_feature_spec.rb | 4 ++-- 3 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 app/overrides/admin/enterprises/_form/add_distributor_info.html.haml.deface delete mode 100644 app/overrides/admin/enterprises/_form/rename_extended_description.html.haml.deface diff --git a/app/overrides/admin/enterprises/_form/add_distributor_info.html.haml.deface b/app/overrides/admin/enterprises/_form/add_distributor_info.html.haml.deface deleted file mode 100644 index 83ba814fdb..0000000000 --- a/app/overrides/admin/enterprises/_form/add_distributor_info.html.haml.deface +++ /dev/null @@ -1,4 +0,0 @@ -/ insert_after "[data-hook='long_description']" -%tr{"data-hook" => "distributor_info"} - %td Distributor Info: - %td= f.text_area :distributor_info, :class => 'rich_text' diff --git a/app/overrides/admin/enterprises/_form/rename_extended_description.html.haml.deface b/app/overrides/admin/enterprises/_form/rename_extended_description.html.haml.deface deleted file mode 100644 index 43c4db4b84..0000000000 --- a/app/overrides/admin/enterprises/_form/rename_extended_description.html.haml.deface +++ /dev/null @@ -1,3 +0,0 @@ -/ replace_contents "[data-hook='long_description']" -%td Profile Info: -%td= f.text_area :long_description, :class => 'rich_text' diff --git a/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb b/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb index 19ee905ae2..3855b80bee 100644 --- a/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb +++ b/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb @@ -32,8 +32,8 @@ feature "enterprises distributor info as rich text" do click_link 'New Enterprise' # Then I should see fields 'Profile Info' and 'Distributor Info' - page.should have_selector 'td', text: 'Profile Info:' - page.should have_selector 'td', text: 'Distributor Info:' + page.should have_content 'About Us' + page.should have_content 'How does it work' # When I fill out the form and create the enterprise fill_in 'enterprise_name', :with => 'Eaterprises' From f3789469b2fe0fe87695af8c50393f7a65053194 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Sun, 16 Mar 2014 17:32:22 +1100 Subject: [PATCH 11/13] Feedback from Kerstin. Resolved issue comments removed. Pickup details removed. --- app/views/admin/enterprises/_form.html.haml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index b658636517..a365ea4c73 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -83,9 +83,6 @@ .row .alpha.two.columns = f.label :abn, 'ABN' - / TODO: figure out how to work with one field for both - / ABN has 11 digits - / ACN has 9 digits .omega.four.columns = f.text_field :abn .row @@ -130,7 +127,6 @@ Hub only: Explain your distribution offer/s - this is more detailed information that the user can access by clicking on "How does it work?" .omega.eight.columns = f.text_area :distributor_info, class: 'rich_text', placeholder: 'Hub only: Explain your distribution offer/s - this is more detailed information that the user can access by clicking on "How does it work?"' - / TODO: how to use placeholder with richt text? / TODO: editor breaks scrolling with arrow keys .row .alpha.two.columns @@ -144,19 +140,3 @@ = image_tag @object.promo_image.url = f.file_field :pro_image - %fieldset - %legend Pickup details - .row - .alpha.six.columns - .alpha.two.columns - = f.label :next_collection_at, 'Next collection date/time' - .omega.four.columns - = f.text_field :next_collection_at - .omega.six.columns - .alpha.two.columns - = f.label :pickup_times, 'Regular pickup times' - .omega.four.columns - = f.text_field :pickup_times - - - From fcd9389fe396978767391373223130dc30ae4a57 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 18 Mar 2014 22:30:36 +1100 Subject: [PATCH 12/13] spec for pickup details in enterprise form removed --- spec/features/admin/enterprises_spec.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index e593166236..88c6dc8cb4 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -84,9 +84,6 @@ feature %q{ select('Australia', :from => 'enterprise_address_attributes_country_id') select('Victoria', :from => 'enterprise_address_attributes_state_id') - fill_in 'enterprise_pickup_times', :with => 'Thursday, 22nd Feb, 6 - 9 PM. Friday, 23nd Feb, 6 - 9 PM' - fill_in 'enterprise_next_collection_at', :with => 'Thursday, 22nd Feb, 6 - 9 PM' - click_button 'Create' flash_message.should == 'Enterprise "Eaterprises" has been successfully created!' end @@ -124,9 +121,6 @@ feature %q{ select('Australia', :from => 'enterprise_address_attributes_country_id') select('Victoria', :from => 'enterprise_address_attributes_state_id') - fill_in 'enterprise_pickup_times', :with => 'Thursday, 22nd Feb, 6 - 9 PM. Friday, 23nd Feb, 6 - 9 PM' - fill_in 'enterprise_next_collection_at', :with => 'Thursday, 22nd Feb, 6 - 9 PM' - click_button 'Update' flash_message.should == 'Enterprise "Eaterprises" has been successfully updated!' From 51fdf863299b94841aa464a3730186da288e492c Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 20 Mar 2014 15:18:21 +1100 Subject: [PATCH 13/13] Polish the new enterprise form --- app/views/admin/enterprises/_form.html.haml | 66 +++++++++++++-------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index a365ea4c73..2d3c728bf0 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -1,6 +1,13 @@ - content_for :head do = render 'shared/cms_elrte_head' +- content_for :page_title do + New Enterprise + +- content_for :page_actions do + %li= button_link_to "Back to enterprises list", main_app.admin_enterprises_path, icon: 'icon-arrow-left' + + .fullwidth_inputs .row .alpha.six.columns @@ -11,22 +18,25 @@ .omega.six.columns .two.columns.alpha = f.label :group_ids, 'Groups' + .with-tip{'data-powertip' => "Select any groups or regions that you are a member of. This will help customers find your enterprise."} + %a What's this? + .four.columns.omega = f.collection_select :group_ids, EnterpriseGroup.all, :id, :name, {}, {class: "select2 fullwidth", multiple: true} .row .alpha.two.columns   .omega.ten.columns - .alpha.two.columns - = f.check_box :is_primary_producer - = f.label :is_primary_producer, 'Producer' - .omega.two.columns - = f.check_box :is_distributor - = f.label :is_distributor, 'Hub' - .omega.two.columns - %span.with-tip{'data-powertip' => "Select 'Producer' if you are a primary producer of food. And select 'Hub' if you are selling to end customers. You can do both."} - %a Tell me more? + = f.check_box :is_primary_producer + = f.label :is_primary_producer, 'Producer' +   + = f.check_box :is_distributor + = f.label :is_distributor, 'Hub' + + .with-tip{'data-powertip' => "Select 'Producer' if you are a primary producer of food. Select 'Hub' if you want a shop-front. You can choose either or both."} + %a What's this? + = f.fields_for :address do |af| - %fieldset + %fieldset.no-border-bottom %legend Address .row .alpha.six.columns @@ -60,7 +70,7 @@ = af.collection_select(:country_id, available_countries, :id, :name) .row .alpha.six.columns - %fieldset + %fieldset.no-border-bottom %legend Contact Details .row .alpha.two.columns @@ -78,7 +88,7 @@ .omega.four.columns = f.text_field :phone .omega.six.columns - %fieldset + %fieldset.no-border-bottom %legend Enterprise Details .row .alpha.two.columns @@ -95,24 +105,24 @@ = f.label :website .omega.four.columns = f.text_field :website - /.row - / .alpha.two.columns - / = f.label :twitter, 'Facebook' - / / TODO: facebook data field - / .omega.four.columns - / = f.text_field :twitter + -# TODO: Facebook model field + -#.row + -# .alpha.two.columns + -# = f.label :facebook, 'Facebook' + -# .omega.four.columns + -# = f.text_field :facebook .row .alpha.two.columns = f.label :twitter .omega.four.columns = f.text_field :twitter - %fieldset + %fieldset.no-border-bottom %legend About Us .row .alpha.two.columns = f.label :description, 'Short Description' .omega.ten.columns - = f.text_field :description, placeholder: 'Just one or two sentences' + = f.text_field :description, placeholder: 'Tell us about your enterprise in one or two sentences' .row .alpha.two.columns = f.label :long_description, 'About Us' @@ -122,21 +132,27 @@ = f.text_area :long_description, class: 'rich_text', placeholder: 'Tell us about yourself. This information appears on your public profile (under "About Us")' .row .alpha.two.columns - = f.label :distributor_info, 'How does it work?' + = f.label :distributor_info, 'How does your hub work?' %br - Hub only: Explain your distribution offer/s - this is more detailed information that the user can access by clicking on "How does it work?" + %em (Hub only) + %br + Explain your distribution offer/s - this information appears on your public profile (under "How does it work?") .omega.eight.columns = f.text_area :distributor_info, class: 'rich_text', placeholder: 'Hub only: Explain your distribution offer/s - this is more detailed information that the user can access by clicking on "How does it work?"' / TODO: editor breaks scrolling with arrow keys .row .alpha.two.columns = f.label :logo + %br + 100 x 100 pixels .omega.four.columns - = image_tag @object.logo.url + = image_tag @object.logo.url if @object.logo.present? = f.file_field :logo .omega.two.columns = f.label :promo_image, class: 'with-tip', 'data-powertip' => 'This image is displayed in "About Us"' + .with-tip{'data-powertip' => 'This image is displayed on the right hand side of the "About Us" section of your public profile.'} + %a What's this? + .omega.four.columns - = image_tag @object.promo_image.url + = image_tag @object.promo_image.url if @object.promo_image.present? = f.file_field :pro_image -