From c92e559c1eb326663cf19f0749769a14596239d4 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 | 1938 +++++++++++------------
14 files changed, 1032 insertions(+), 1013 deletions(-)
diff --git a/assets/locales/de.po b/assets/locales/de.po
index ca5495cfbda..26957a0e736 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 b9663ac9ad5..d03a62784e7 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 2f649a6b405..95317b92ab6 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 41aef7d8410..ec75ffff4af 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 b50b15b0727..e8a642b9927 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 e31d3d1d146..c418f6594dc 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 @@