Add affiliate sales data to form

This commit is contained in:
David Cook
2024-07-15 17:15:42 +10:00
parent d3c5e2365a
commit 1742d2807f
4 changed files with 42 additions and 1 deletions

View File

@@ -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 }

View File

@@ -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"

View File

@@ -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;

View File

@@ -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: |
<p>
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.
</p>
<p>
<a href="https://apropos.coopcircuits.fr/"
target="_blank"><b>Learn more about this research project</b>
<i class="icon-external-link"></i></a>
</p>
discover_regen:
title: "Discover Regenerative"
tagline: "Allow Discover Regenerative to publish your enterprise information."