diff --git a/app/views/admin/enterprises/form/_connected_apps.html.haml b/app/views/admin/enterprises/form/_connected_apps.html.haml index 27e3d5a567..1c7904b2ed 100644 --- a/app/views/admin/enterprises/form/_connected_apps.html.haml +++ b/app/views/admin/enterprises/form/_connected_apps.html.haml @@ -1,2 +1,4 @@ = render partial: "/admin/enterprises/form/connected_apps/discover_regen", locals: { enterprise:, connected_app: enterprise.connected_apps.discover_regen.first } += render partial: "/admin/enterprises/form/connected_apps/affiliate_sales_data", + locals: { enterprise:, connected_app: enterprise.connected_apps.affiliate_sales_data.first } diff --git a/app/views/admin/enterprises/form/connected_apps/_affiliate_sales_data.html.haml b/app/views/admin/enterprises/form/connected_apps/_affiliate_sales_data.html.haml new file mode 100644 index 0000000000..1674d00564 --- /dev/null +++ b/app/views/admin/enterprises/form/connected_apps/_affiliate_sales_data.html.haml @@ -0,0 +1,15 @@ +%section.connected_app + .connected-app__head + %div + %h3= t ".title" + %p= t ".tagline" + %div + - if connected_app.nil? + = button_to t(".enable"), admin_enterprise_connected_apps_path(enterprise.id), method: :post, disabled: !managed_by_user?(enterprise) + -# This is only seen by super-admins: + %em= t(".need_to_be_manager") unless managed_by_user?(enterprise) + - else + = button_to t(".disable"), admin_enterprise_connected_app_path(0, enterprise_id: enterprise.id), method: :delete + %hr + .connected-app__description + = t ".description_html" diff --git a/app/webpacker/css/admin/connected_apps.scss b/app/webpacker/css/admin/connected_apps.scss index c2cb2c9421..be3356009d 100644 --- a/app/webpacker/css/admin/connected_apps.scss +++ b/app/webpacker/css/admin/connected_apps.scss @@ -2,10 +2,18 @@ max-width: 615px; } +.connected_app { + margin-bottom: 2rem; + + &:not(:first-of-type) { + border-top: 1px solid $color-border; + } +} + .connected-app__head { display: flex; justify-content: space-between; - margin-bottom: 1em; + margin: 1em 0; h3 { margin-bottom: 1em; diff --git a/config/locales/en.yml b/config/locales/en.yml index de733596a3..7eb8c3dbf4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1358,6 +1358,22 @@ en: custom_tab_content: "Content for custom tab" connected_apps: legend: "Connected apps" + affiliate_sales_data: + title: "INRAE / UFC QUE CHOISIR Research" + tagline: "Allow this research project to access your orders data anonymously" + enable: "Allow data sharing" + disable: "Stop sharing" + loading: "Loading" + need_to_be_manager: "Only managers can connect apps." + description_html: | +
+ INRAE and UFC QUE CHOISIR are teaming up to study food prices in short food systems and compare them with prices in the supermarket, for a given set of products. The data that is used by INRAE is mixed with data coming from other short food chain platforms in France. No individual product prices will be publicly disclosed through this project. +
+ discover_regen: title: "Discover Regenerative" tagline: "Allow Discover Regenerative to publish your enterprise information."