From a8d6e28ee9eb7362d129acbc58ef2c378512888c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 8 Oct 2020 15:54:43 +0200 Subject: [PATCH] WIP Signed-off-by: Thomas Citharel --- config/config.exs | 4 + js/src/App.vue | 33 +--- js/src/i18n/en_US.json | 10 +- js/src/i18n/fr_FR.json | 5 +- .../views/Account/children/EditIdentity.vue | 2 +- js/src/views/Settings/AccountSettings.vue | 42 +++- lib/graphql/resolvers/user.ex | 24 ++- lib/mix/tasks/mobilizon/demo.ex | 90 +++++++++ priv/gettext/errors.pot | 54 ++++-- test/graphql/resolvers/user_test.exs | 181 +++++++++++++----- 10 files changed, 336 insertions(+), 109 deletions(-) create mode 100644 lib/mix/tasks/mobilizon/demo.ex diff --git a/config/config.exs b/config/config.exs index d833be2f1..f166ce96d 100644 --- a/config/config.exs +++ b/config/config.exs @@ -34,6 +34,10 @@ config :mobilizon, :groups, enabled: true config :mobilizon, :events, creation: true +config :mobilizon, :demo_mode, + email: "demo@mobilizon.org", + password: "mobilizon" + # Configures the endpoint config :mobilizon, Mobilizon.Web.Endpoint, http: [ diff --git a/js/src/App.vue b/js/src/App.vue index 5761b33c0..934939c54 100644 --- a/js/src/App.vue +++ b/js/src/App.vue @@ -2,41 +2,14 @@
- +

-

- - - {{ $t("on our blog") }} - -

diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 99c424e1a..86e671780 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -169,7 +169,6 @@ "If an account with this email exists, we just sent another confirmation email to {email}": "If an account with this email exists, we just sent another confirmation email to {email}", "If this identity is the only administrator of some groups, you need to delete them before being able to delete this identity.": "If this identity is the only administrator of some groups, you need to delete them before being able to delete this identity.", "If you want, you may send a message to the event organizer here.": "If you want, you may send a message to the event organizer here.", - "In the meantime, please consider that the software is not (yet) finished. More information {onBlog}.": "In the meantime, please consider that the software is not (yet) finished. More information {onBlog}.", "Installing Mobilizon will allow communities to free themselves from the services of tech giants by creating their own event platform.": "Installing Mobilizon will allow communities to free themselves from the services of tech giants by creating their own event platform.", "Instance Name": "Instance Name", "Instance Terms Source": "Instance Terms Source", @@ -355,7 +354,6 @@ "This Mobilizon instance and this event organizer allows anonymous participations, but requires validation through email confirmation.": "This Mobilizon instance and this event organizer allows anonymous participations, but requires validation through email confirmation.", "This information is saved only on your computer. Click for details": "This information is saved only on your computer. Click for details", "This instance isn't opened to registrations, but you can register on other instances.": "This instance isn't opened to registrations, but you can register on other instances.", - "This is a demonstration site to test the beta version of Mobilizon.": "This is a demonstration site to test the beta version of Mobilizon.", "This will delete / anonymize all content (events, comments, messages, participations…) created from this identity.": "This will delete / anonymize all content (events, comments, messages, participations…) created from this identity.", "Title": "Title", "To change the world, change the software": "To change the world, change the software", @@ -383,7 +381,6 @@ "View page on {hostname} (in a new window)": "View page on {hostname} (in a new window)", "Visible everywhere on the web (public)": "Visible everywhere on the web (public)", "Waiting for organization team approval.": "Waiting for organization team approval.", - "Warning": "Warning", "We just sent an email to {email}": "We just sent an email to {email}", "We will redirect you to your instance in order to interact with this event": "We will redirect you to your instance in order to interact with this event", "Website / URL": "Website / URL", @@ -432,7 +429,6 @@ "iCal Feed": "iCal Feed", "interconnect with others like it": "interconnect with others like it", "its source code is public": "its source code is public", - "on our blog": "on our blog", "profile@instance": "profile@instance", "respect of the fundamental freedoms": "respect of the fundamental freedoms", "with another identity…": "with another identity…", @@ -536,7 +532,6 @@ "Register on this instance": "Register on this instance", "Mobilizon is not developed by a secretive start-up, but by a group of friends who strive to {change_world}. So while we do work slower, we remain attentive and in touch with our users.": "Mobilizon is not developed by a secretive start-up, but by a group of friends who strive to {change_world}. So while we do work slower, we remain attentive and in touch with our users.", "fit the needs and uses of the people": "fit the needs and uses of the people", - "Mobilizon is under development, we will add new features to this site during regular updates, until the release of version 1 of the software in the fall of 2020.": "Mobilizon is under development, we will add new features to this site during regular updates, until the release of version 1 of the software in the fall of 2020.", "To activate more notifications, head over to the notification settings.": "To activate more notifications, head over to the notification settings.", "Manage my notifications": "Manage my notifications", "We use your timezone to make sure you get notifications for an event at the correct time.": "We use your timezone to make sure you get notifications for an event at the correct time.", @@ -798,5 +793,8 @@ "Go to the event page": "Go to the event page", "Request for participation confirmation sent": "Request for participation confirmation sent", "Check your inbox (and your junk mail folder).": "Check your inbox (and your junk mail folder).", - "You may now close this window.": "You may now close this window." + "You may now close this window.": "You may now close this window.", + "Demo mode": "Demo mode", + "This is a demonstration website to test Mobilizon.": "This is a demonstration website to test Mobilizon.", + "Close notification": "Close notification" } diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 2b1a32685..407df2eaf 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -841,5 +841,8 @@ "Go to the event page": "Aller à la page de l'événement", "Request for participation confirmation sent": "Demande de confirmation de participation envoyée", "Check your inbox (and your junk mail folder).": "Vérifiez votre boîte de réception (et votre dossier des indésirables)", - "You may now close this window.": "Vous pouvez maintenant fermer cette fenêtre." + "You may now close this window.": "Vous pouvez maintenant fermer cette fenêtre.", + "Demo mode": "Mode de démonstration", + "This is a demonstration website to test Mobilizon.": "Ceci est un site de démonstration pour tester Mobilizon.", + "Close notification": "Fermer la notification" } diff --git a/js/src/views/Account/children/EditIdentity.vue b/js/src/views/Account/children/EditIdentity.vue index 2ab01d65b..56a5bb70d 100644 --- a/js/src/views/Account/children/EditIdentity.vue +++ b/js/src/views/Account/children/EditIdentity.vue @@ -68,7 +68,7 @@ -
+
+ + {{ $t("You can't change these settings in demo mode.") }} +

{{ $t("Email") }}

@@ -34,7 +37,7 @@
- +

{{ $t("You'll receive a confirmation email.") }}

{{ $t("Delete account") }}

{{ $t("Deleting my account will delete all of my identities.") }}

- + {{ $t("Delete my account") }} @@ -156,6 +168,15 @@ :placeholder="$t('Password')" /> + {{ error }} {{ $t("Delete everything") }} @@ -176,6 +197,8 @@