From 2bbd586a40dee5ab00ae3e3cf5a5a4121cde9904 Mon Sep 17 00:00:00 2001
From: Bruno Michel
Date: Thu, 12 Dec 2024 17:52:57 +0100
Subject: [PATCH] Split the path for accepting a sharing
When a user has received an email for a sharing, they can go to the
preview page. From here, there are two possibilities for accepting the
sharing: just creating a shortcut, or the full synchronization.
Before this commit, the user was first asked their Cozy URL, and on the
OAuth authorize page, they have a checkbox for the synchronize option.
Now, the choice is made on the preview page (Drive will add a
`shortcut=true` parameter in the query string on the
`GET /sharings/:id/discovery` endpoint if needed). And if it is just a
shortcut, we will skip the OAuth authorize page.
---
assets/locales/de.po | 3 +
assets/locales/en.po | 3 +
assets/locales/es.po | 3 +
assets/locales/fr.po | 3 +
assets/locales/ja.po | 3 +
assets/locales/nl_NL.po | 3 +
assets/templates/authorize_sharing.html | 10 -
assets/templates/sharing_discovery.html | 5 +
docs/sharing.md | 22 +-
model/sharing/member.go | 5 +-
model/sharing/oauth.go | 5 +-
web/auth/oauth.go | 23 +-
web/sharings/sharings.go | 19 +-
web/statik/statik.go | 1926 +++++++++++------------
14 files changed, 1026 insertions(+), 1007 deletions(-)
diff --git a/assets/locales/de.po b/assets/locales/de.po
index 8f93d080dba..cbecea2b22d 100644
--- a/assets/locales/de.po
+++ b/assets/locales/de.po
@@ -826,6 +826,9 @@ msgstr "Die Cozy URL ist nicht deine E-Mail-Adresse"
msgid "Sharing Discovery Submit"
msgstr "In mein Cozy synchronisieren"
+msgid "Sharing Discovery Shortcut Submit"
+msgstr "In mein Cozy synchronisieren"
+
msgid "Sharing No Cozy"
msgstr "Hast du noch kein Cozy?"
diff --git a/assets/locales/en.po b/assets/locales/en.po
index a78f0c20c92..87816a30f97 100644
--- a/assets/locales/en.po
+++ b/assets/locales/en.po
@@ -1139,6 +1139,9 @@ msgstr "The Cozy URL is not your email address."
msgid "Sharing Discovery Submit"
msgstr "Synchronize into my Cozy"
+msgid "Sharing Discovery Shortcut Submit"
+msgstr "Add to my Cozy"
+
msgid "Sharing No Cozy"
msgstr "Don't have a Cozy yet?"
diff --git a/assets/locales/es.po b/assets/locales/es.po
index b259fe934fc..bca3bd2ec95 100644
--- a/assets/locales/es.po
+++ b/assets/locales/es.po
@@ -840,6 +840,9 @@ msgstr "La URL de su Cozy no es la dirección de su correo electrónico"
msgid "Sharing Discovery Submit"
msgstr "Sincronizar en mi Cozy"
+msgid "Sharing Discovery Shortcut Submit"
+msgstr "Sincronizar en mi Cozy"
+
msgid "Sharing No Cozy"
msgstr "¿Todavía no tiene una Cozy?"
diff --git a/assets/locales/fr.po b/assets/locales/fr.po
index 6a6cb261894..aa55e620f70 100644
--- a/assets/locales/fr.po
+++ b/assets/locales/fr.po
@@ -1244,6 +1244,9 @@ msgstr "L'URL de votre Cozy n'est pas votre adresse email."
msgid "Sharing Discovery Submit"
msgstr "Synchroniser dans mon Cozy"
+msgid "Sharing Discovery Shortcut Submit"
+msgstr "Ajouter à mon Cozy"
+
msgid "Sharing No Cozy"
msgstr "Pas encore de Cozy ?"
diff --git a/assets/locales/ja.po b/assets/locales/ja.po
index 4d9a2d95ac1..6f5db46c88f 100644
--- a/assets/locales/ja.po
+++ b/assets/locales/ja.po
@@ -648,6 +648,9 @@ msgstr "Cozy の URL はメールアドレスではありません。"
msgid "Sharing Discovery Submit"
msgstr "送信"
+msgid "Sharing Discovery Shortcut Submit"
+msgstr "送信"
+
msgid "Sharing No Cozy"
msgstr "まだ Cozy をお持ちではありませんか?"
diff --git a/assets/locales/nl_NL.po b/assets/locales/nl_NL.po
index af599d6a977..e4b9f6b56ef 100644
--- a/assets/locales/nl_NL.po
+++ b/assets/locales/nl_NL.po
@@ -1024,6 +1024,9 @@ msgstr "De Cozy-url is niet je e-mailadres."
msgid "Sharing Discovery Submit"
msgstr "Synchroniseren naar mijn Cozy"
+msgid "Sharing Discovery Shortcut Submit"
+msgstr "Synchroniseren naar mijn Cozy"
+
msgid "Sharing No Cozy"
msgstr "Heb je nog geen Cozy?"
diff --git a/assets/templates/authorize_sharing.html b/assets/templates/authorize_sharing.html
index 6d0053d43f5..3b42bea645f 100644
--- a/assets/templates/authorize_sharing.html
+++ b/assets/templates/authorize_sharing.html
@@ -46,16 +46,6 @@