From 97a401a3072128b5d97c8a61f1137f98bb577e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Turbelin?= Date: Wed, 3 Jul 2019 18:10:59 +0200 Subject: [PATCH 1/5] Display enterprise ID in profile --- .../admin/enterprises/form/_primary_details.html.haml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/views/admin/enterprises/form/_primary_details.html.haml b/app/views/admin/enterprises/form/_primary_details.html.haml index dd83c4d2c2..22214d5690 100644 --- a/app/views/admin/enterprises/form/_primary_details.html.haml +++ b/app/views/admin/enterprises/form/_primary_details.html.haml @@ -63,6 +63,13 @@ %span{ ng: { class: 'availability.toLowerCase()', hide: "checking" } } {{ availability }} %i{ ng: { class: "{'icon-ok-sign': availability == 'Available', 'icon-remove-sign': availability == 'Unavailable'}" } } + .row{ ng: { show: "Enterprise.sells == 'own' || Enterprise.sells == 'any'" } } + .three.columns.alpha + = f.label :permalink, t('.ofn_uid') + %div{'ofn-with-tip' => t('.ofn_uid_tip', link: spree.root_url)} + %a= t('admin.whats_this') + .six.columns + = f.text_field :id, { 'ng-model' => "Enterprise.id", 'ng-model-options' => "{ updateOn: 'default blur', debounce: {'default': 300, 'blur': 0} }", 'ng-disabled' => true } .row{ ng: { show: "Enterprise.sells == 'own' || Enterprise.sells == 'any'" } } .three.columns.alpha %label= t('.link_to_front') From 5ce2af454ed0f1e18ab0f4afb1491026054b76ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Turbelin?= Date: Wed, 3 Jul 2019 23:00:36 +0200 Subject: [PATCH 2/5] Clean id field --- .../admin/enterprises/form/_primary_details.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/admin/enterprises/form/_primary_details.html.haml b/app/views/admin/enterprises/form/_primary_details.html.haml index 22214d5690..0564303efd 100644 --- a/app/views/admin/enterprises/form/_primary_details.html.haml +++ b/app/views/admin/enterprises/form/_primary_details.html.haml @@ -63,13 +63,13 @@ %span{ ng: { class: 'availability.toLowerCase()', hide: "checking" } } {{ availability }} %i{ ng: { class: "{'icon-ok-sign': availability == 'Available', 'icon-remove-sign': availability == 'Unavailable'}" } } - .row{ ng: { show: "Enterprise.sells == 'own' || Enterprise.sells == 'any'" } } + .row .three.columns.alpha - = f.label :permalink, t('.ofn_uid') - %div{'ofn-with-tip' => t('.ofn_uid_tip', link: spree.root_url)} + = f.label :id, t('.ofn_uid') + %div{'ofn-with-tip' => t('.ofn_uid_tip')} %a= t('admin.whats_this') .six.columns - = f.text_field :id, { 'ng-model' => "Enterprise.id", 'ng-model-options' => "{ updateOn: 'default blur', debounce: {'default': 300, 'blur': 0} }", 'ng-disabled' => true } + = f.text_field :id, value: f.object.id, disabled: true .row{ ng: { show: "Enterprise.sells == 'own' || Enterprise.sells == 'any'" } } .three.columns.alpha %label= t('.link_to_front') From 101cff02c67e0a181698da0cb9b346b241fc859c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Turbelin?= Date: Wed, 3 Jul 2019 23:06:50 +0200 Subject: [PATCH 3/5] Add locale keys --- config/locales/en.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/locales/en.yml b/config/locales/en.yml index 75cc648e70..7c94f1f7b7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -705,6 +705,8 @@ en: permalink_tip: "This permalink is used to create the url to your shop: %{link}your-shop-name/shop" link_to_front: Link to shop front link_to_front_tip: A direct link to your shopfront on the Open Food Network. + ofn_uid: OFN UID + ofn_uid_tip: The uniq id used to identify the enterprise on Open Food Network. shipping_methods: name: Name applies: Applies? From d12a7c2c7625b98f5783c0b87ad47508b3def668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Turbelin?= Date: Thu, 4 Jul 2019 09:43:35 +0200 Subject: [PATCH 4/5] Apply last suggestions --- app/views/admin/enterprises/form/_primary_details.html.haml | 2 +- config/locales/en.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/enterprises/form/_primary_details.html.haml b/app/views/admin/enterprises/form/_primary_details.html.haml index 0564303efd..d72089154b 100644 --- a/app/views/admin/enterprises/form/_primary_details.html.haml +++ b/app/views/admin/enterprises/form/_primary_details.html.haml @@ -69,7 +69,7 @@ %div{'ofn-with-tip' => t('.ofn_uid_tip')} %a= t('admin.whats_this') .six.columns - = f.text_field :id, value: f.object.id, disabled: true + {{Enterprise.id}} .row{ ng: { show: "Enterprise.sells == 'own' || Enterprise.sells == 'any'" } } .three.columns.alpha %label= t('.link_to_front') diff --git a/config/locales/en.yml b/config/locales/en.yml index 7c94f1f7b7..fe94c0fda4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -706,7 +706,7 @@ en: link_to_front: Link to shop front link_to_front_tip: A direct link to your shopfront on the Open Food Network. ofn_uid: OFN UID - ofn_uid_tip: The uniq id used to identify the enterprise on Open Food Network. + ofn_uid_tip: The unique id used to identify the enterprise on Open Food Network. shipping_methods: name: Name applies: Applies? From 912483660f9f409aa3a57aeb4da2f4e62297b1b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Turbelin?= Date: Thu, 4 Jul 2019 09:51:32 +0200 Subject: [PATCH 5/5] Put the uid under the permalink --- .../enterprises/form/_primary_details.html.haml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/admin/enterprises/form/_primary_details.html.haml b/app/views/admin/enterprises/form/_primary_details.html.haml index d72089154b..6dd9c8207f 100644 --- a/app/views/admin/enterprises/form/_primary_details.html.haml +++ b/app/views/admin/enterprises/form/_primary_details.html.haml @@ -63,13 +63,6 @@ %span{ ng: { class: 'availability.toLowerCase()', hide: "checking" } } {{ availability }} %i{ ng: { class: "{'icon-ok-sign': availability == 'Available', 'icon-remove-sign': availability == 'Unavailable'}" } } - .row - .three.columns.alpha - = f.label :id, t('.ofn_uid') - %div{'ofn-with-tip' => t('.ofn_uid_tip')} - %a= t('admin.whats_this') - .six.columns - {{Enterprise.id}} .row{ ng: { show: "Enterprise.sells == 'own' || Enterprise.sells == 'any'" } } .three.columns.alpha %label= t('.link_to_front') @@ -78,3 +71,10 @@ .eight.columns.omega = surround spree.root_url, "/shop" do {{Enterprise.permalink}} + .row + .three.columns.alpha + = f.label :id, t('.ofn_uid') + %div{'ofn-with-tip' => t('.ofn_uid_tip')} + %a= t('admin.whats_this') + .six.columns + {{Enterprise.id}}