From ef6a1a21ac11efa2298a98e017f5ba4a559046a0 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 15 Jun 2020 19:41:11 +0200 Subject: [PATCH] Even more fixes Signed-off-by: Thomas Citharel --- js/src/components/Event/EventListCard.vue | 61 +++++++++++++-------- js/src/graphql/actor.ts | 2 + js/src/graphql/report.ts | 5 ++ js/src/i18n/en_US.json | 18 +++--- js/src/i18n/fr_FR.json | 20 ++++--- js/src/types/report.model.ts | 1 + js/src/views/Admin/Users.vue | 7 ++- js/src/views/Event/Edit.vue | 2 +- js/src/views/Moderation/Logs.vue | 58 ++++++++++++++++---- lib/graphql/resolvers/admin.ex | 7 +++ lib/graphql/resolvers/event.ex | 23 ++++++++ lib/graphql/resolvers/user.ex | 17 ++++-- lib/graphql/schema/admin.ex | 5 ++ lib/graphql/schema/event.ex | 11 ++-- lib/graphql/schema/user.ex | 3 +- lib/mobilizon/events/events.ex | 15 ++++- test/graphql/resolvers/participant_test.exs | 25 ++++++++- 17 files changed, 213 insertions(+), 67 deletions(-) diff --git a/js/src/components/Event/EventListCard.vue b/js/src/components/Event/EventListCard.vue index 8a11d34f9..11b96bc1f 100644 --- a/js/src/components/Event/EventListCard.vue +++ b/js/src/components/Event/EventListCard.vue @@ -7,31 +7,11 @@ -

{{ participation.event.title }}

+

{{ participation.event.title }}

- {{ participation.event.physicalAddress.locality }} - - - {{ - $t("Organized by {name}", { - name: participation.event.organizerActor.displayName(), - }) - }} - - - {{ $t("Going as {name}", { name: participation.actor.displayName() }) }} - - -
-
- - + {{ participation.event.physicalAddress.locality }} - + + + + {{ participation.event.organizerActor.displayName() }} + + + + + {{ participation.actor.displayName() }} + + + +
+
+ {{ $t("{approved} / {total} seats", { @@ -176,6 +191,7 @@ import { CURRENT_ACTOR_CLIENT } from "../../graphql/actor"; import EventMixin from "../../mixins/event"; import RouteName from "../../router/name"; import { changeIdentity } from "../../utils/auth"; +import PopoverActorCard from "../Account/PopoverActorCard.vue"; const defaultOptions: IEventCardOptions = { hideDate: true, @@ -187,6 +203,7 @@ const defaultOptions: IEventCardOptions = { @Component({ components: { DateCalendarIcon, + PopoverActorCard, }, apollo: { currentActor: { diff --git a/js/src/graphql/actor.ts b/js/src/graphql/actor.ts index 7e184dd1a..fe00d8345 100644 --- a/js/src/graphql/actor.ts +++ b/js/src/graphql/actor.ts @@ -206,6 +206,7 @@ export const LOGGED_USER_PARTICIPATIONS = gql` preferredUsername name domain + summary avatar { url } @@ -226,6 +227,7 @@ export const LOGGED_USER_PARTICIPATIONS = gql` preferredUsername name domain + summary avatar { url } diff --git a/js/src/graphql/report.ts b/js/src/graphql/report.ts index 8a9169051..43784c855 100644 --- a/js/src/graphql/report.ts +++ b/js/src/graphql/report.ts @@ -184,6 +184,11 @@ export const LOGS = gql` domain name } + ... on User { + id + email + confirmedAt + } } insertedAt } diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 82bade9cd..c5fc3871d 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -256,7 +256,7 @@ "On {date} from {startTime} to {endTime}": "On {date} from {startTime} to {endTime}", "On {date} starting at {startTime}": "On {date} starting at {startTime}", "On {date}": "On {date}", - "Only accessible through link and search (private)": "Only accessible through link and search (private)", + "Only accessible through link (private)": "Only accessible through link (private)", "Only alphanumeric characters and underscores are supported.": "Only alphanumeric characters and underscores are supported.", "Open": "Open", "Opened reports": "Opened reports", @@ -581,12 +581,12 @@ "Every hour": "Every hour", "Every day": "Every day", "report #{report_number}": "report #{report_number}", - "{actor} closed {report}": "{actor} closed {report}", + "{moderator} closed {report}": "{moderator} closed {report}", "a non-existent report": "a non-existent report", - "{actor} reopened {report}": "{actor} reopened {report}", - "{actor} marked {report} as resolved": "{actor} marked {report} as resolved", - "{actor} added a note on {report}": "{actor} added a note on {report}", - "{actor} deleted an event named \"{title}\"": "{actor} deleted an event named \"{title}\"", + "{moderator} reopened {report}": "{moderator} reopened {report}", + "{moderator} marked {report} as resolved": "{moderator} marked {report} as resolved", + "{moderator} added a note on {report}": "{moderator} added a note on {report}", + "{moderator} deleted an event named \"{title}\"": "{moderator} deleted an event named \"{title}\"", "If the direction given by the development team does not suit you, you have the legal right to create your own version of the software, with your own governance choices.": "If the direction given by the development team does not suit you, you have the legal right to create your own version of the software, with your own governance choices.", "change the world, one byte at a time": "change the world, one byte at a time", "Concieved with care for humans": "Concieved with care for humans", @@ -623,7 +623,7 @@ "Participations": "Participations", "Nothing to see here": "Nothing to see here", "Not confirmed": "Not confirmed", - "{actor} suspended profile {profile}": "{actor} suspended profile {profile}", + "{moderator} suspended profile {profile}": "{moderator} suspended profile {profile}", "Suspend": "Suspend", "Unsuspend": "Unsuspend", "None": "None", @@ -642,5 +642,7 @@ "I agree to the {instanceRules} and {termsOfService}": "I agree to the {instanceRules} and {termsOfService}", "This email is already used.": "This email is already used.", "Powered by {mobilizon}. © 2018 - {date} The Mobilizon Contributors - Made with the financial support of {contributors}.": "Powered by {mobilizon}. © 2018 - {date} The Mobilizon Contributors - Made with the financial support of {contributors}.", - "more than 1360 contributors": "more than 1360 contributors" + "more than 1360 contributors": "more than 1360 contributors", + "{moderator} has unsuspended profile {profile}": "{moderator} has unsuspended profile {profile}", + "{moderator} has deleted user {user}": "{moderator} has deleted user {user}" } diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 9538c2387..f24878b2d 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -321,7 +321,7 @@ "On {date} starting at {startTime}": "Le {date} à partir de {startTime}", "One person is going": "Personne n'y va | Une personne y va | {approved} personnes y vont", "Ongoing tasks": "Tâches en cours", - "Only accessible through link and search (private)": "Uniquement accessibles par lien et la recherche (privé)", + "Only accessible through link (private)": "Uniquement accessible par lien (privé)", "Only alphanumeric characters and underscores are supported.": "Seuls les caractères alphanumériques et les tirets bas sont acceptés.", "Open": "Ouvert", "Opened reports": "Signalements ouverts", @@ -603,12 +603,12 @@ "Every hour": "À chaque heure", "Every day": "Chaque jour", "report #{report_number}": "le signalement #{report_number}", - "{actor} closed {report}": "{actor} a fermé {report}", + "{moderator} closed {report}": "{moderator} a fermé {report}", "a non-existent report": "un signalement non-existant", - "{actor} reopened {report}": "{actor} a réouvert {report}", - "{actor} marked {report} as resolved": "{actor} a marqué {report} comme résolu", - "{actor} added a note on {report}": "{actor} a ajouté une note sur {report}", - "{actor} deleted an event named \"{title}\"": "{actor} a supprimé un événement nommé \"{title}\"", + "{moderator} reopened {report}": "{moderator} a réouvert {report}", + "{moderator} marked {report} as resolved": "{moderator} a marqué {report} comme résolu", + "{moderator} added a note on {report}": "{moderator} a ajouté une note sur {report}", + "{moderator} deleted an event named \"{title}\"": "{moderator} a supprimé un événement nommé \"{title}\"", "If the direction given by the development team does not suit you, you have the legal right to create your own version of the software, with your own governance choices.": "Si la direction donnée par l’équipe de développement ne vous convient pas, vous avez légalement le droit de créer votre version du logiciel avec vos propres choix de gouvernance.", "change the world, one byte at a time": "changer le monde, un octet à la fois", "Concieved with care for humans": "Conçu avec soin pour les humains", @@ -621,7 +621,7 @@ "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 est en cours de développement, nous ajouterons de nouvelles fonctionnalités à ce site lors de mises à jour régulières, jusqu'à la publication de la version 1 du logiciel à l'automne 2020.", "To activate more notifications, head over to the notification settings.": "Pour activer plus de notifications, rendez-vous dans vos paramètres de notification.", "Manage my notifications": "Gérer mes notifications", - "We use your timezone to make sure you get notifications for an event at the correct time.": "Nous utilisons votre fuseau hoaire pour nous assurer que vous recevez les notifications pour un événement au bon moment.", + "We use your timezone to make sure you get notifications for an event at the correct time.": "Nous utilisons votre fuseau horaire pour nous assurer que vous recevez les notifications pour un événement au bon moment.", "Your timezone was detected as {timezone}.": "Votre fuseau horaire a été détecté en tant que {timezone}.", "Manage my settings": "Gérer mes paramètres", "Let's define a few settings": "Définissons quelques paramètres", @@ -646,7 +646,7 @@ "Participations": "Participations", "Nothing to see here": "Il n'y a rien à voir ici", "Not confirmed": "Non confirmé·e", - "{actor} suspended profile {profile}": "{actor} a suspendu le profil {profile}", + "{moderator} suspended profile {profile}": "{moderator} a suspendu le profil {profile}", "Suspend": "Suspendre", "Unsuspend": "Annuler la suspension", "None": "Aucun", @@ -665,5 +665,7 @@ "I agree to the {instanceRules} and {termsOfService}": "J'accepte les {instanceRules} et les {termsOfService}", "This email is already used.": "Cette adresse email est déjà utilisée.", "Powered by {mobilizon}. © 2018 - {date} The Mobilizon Contributors - Made with the financial support of {contributors}.": "Propulsé par {mobilizon}. © 2018 - {date} Les contributeur·ices Mobilizon - Fait avec le soutien financier de {contributors}.", - "more than 1360 contributors": "plus de 1360 contributeur·ices" + "more than 1360 contributors": "plus de 1360 contributeur·ices", + "{moderator} has unsuspended profile {profile}": "{moderator} a annulé la suspension de {profile}", + "{moderator} has deleted user {user}": "{moderator} a supprimé l'utilisateur·ice {user}" } diff --git a/js/src/types/report.model.ts b/js/src/types/report.model.ts index bf515819f..6abfdf3ac 100644 --- a/js/src/types/report.model.ts +++ b/js/src/types/report.model.ts @@ -41,6 +41,7 @@ export enum ActionLogAction { COMMENT_DELETION = "COMMENT_DELETION", ACTOR_SUSPENSION = "ACTOR_SUSPENSION", ACTOR_UNSUSPENSION = "ACTOR_UNSUSPENSION", + USER_DELETION = "USER_DELETION", } export interface IActionLog { diff --git a/js/src/views/Admin/Users.vue b/js/src/views/Admin/Users.vue index f34e3a681..27a1d8e08 100644 --- a/js/src/views/Admin/Users.vue +++ b/js/src/views/Admin/Users.vue @@ -35,7 +35,12 @@ - {{ props.row.confirmedAt | formatDateTimeString }} + + {{ props.row.locale }} diff --git a/js/src/views/Event/Edit.vue b/js/src/views/Event/Edit.vue index 6f7871ebf..8b0101f50 100644 --- a/js/src/views/Event/Edit.vue +++ b/js/src/views/Event/Edit.vue @@ -92,7 +92,7 @@ v-model="event.visibility" name="eventVisibility" :native-value="EventVisibility.UNLISTED" - >{{ $t("Only accessible through link and search (private)") }}{{ $t("Only accessible through link (private)") }}