Merge branch 'multiple-fixes' into 'master'

Multiples fixes

See merge request framasoft/mobilizon!471
This commit is contained in:
Thomas Citharel 2020-06-15 18:15:20 +02:00
commit 79fa092926
14 changed files with 108 additions and 85 deletions

View file

@ -34,10 +34,13 @@
<span class="column is-narrow"> <span class="column is-narrow">
<b-icon icon="earth" v-if="participation.event.visibility === EventVisibility.PUBLIC" /> <b-icon icon="earth" v-if="participation.event.visibility === EventVisibility.PUBLIC" />
<b-icon <b-icon
icon="lock-open" icon="link"
v-if="participation.event.visibility === EventVisibility.UNLISTED" v-else-if="participation.event.visibility === EventVisibility.UNLISTED"
/>
<b-icon
icon="lock"
v-else-if="participation.event.visibility === EventVisibility.PRIVATE"
/> />
<b-icon icon="lock" v-if="participation.event.visibility === EventVisibility.PRIVATE" />
</span> </span>
<span class="column is-narrow participant-stats"> <span class="column is-narrow participant-stats">
<span v-if="participation.event.options.maximumAttendeeCapacity !== 0"> <span v-if="participation.event.options.maximumAttendeeCapacity !== 0">

View file

@ -23,7 +23,7 @@
<div class="columns"> <div class="columns">
<span class="column is-narrow"> <span class="column is-narrow">
<b-icon icon="earth" v-if="event.visibility === EventVisibility.PUBLIC" /> <b-icon icon="earth" v-if="event.visibility === EventVisibility.PUBLIC" />
<b-icon icon="lock-open" v-if="event.visibility === EventVisibility.UNLISTED" /> <b-icon icon="link" v-if="event.visibility === EventVisibility.UNLISTED" />
<b-icon icon="lock" v-if="event.visibility === EventVisibility.PRIVATE" /> <b-icon icon="lock" v-if="event.visibility === EventVisibility.PRIVATE" />
</span> </span>
<span class="column is-narrow participant-stats"> <span class="column is-narrow participant-stats">

View file

@ -1,10 +1,10 @@
<template> <template>
<footer class="footer" ref="footer"> <footer class="footer" ref="footer">
<mobilizon-logo :invert="true" class="logo" /> <mobilizon-logo :invert="true" class="logo" />
<img src="../assets/footer.png" :alt="$t('World map')" /> <!-- <img src="../assets/footer.png" :alt="$t('World map')" /> -->
<ul> <ul>
<li> <li>
<a href="https://joinmobilizon.org">{{ $t("About") }}</a> <router-link :to="{ name: RouteName.ABOUT }">{{ $t("About") }}</router-link>
</li> </li>
<li> <li>
<router-link :to="{ name: RouteName.TERMS }">{{ $t("Terms") }}</router-link> <router-link :to="{ name: RouteName.TERMS }">{{ $t("Terms") }}</router-link>
@ -16,14 +16,16 @@
</li> </li>
</ul> </ul>
<div class="content has-text-centered"> <div class="content has-text-centered">
<span> <i18n
{{ tag="span"
$t( path="Powered by {mobilizon}. © 2018 - {date} The Mobilizon Contributors - Made with the financial support of {contributors}."
"© The Mobilizon Contributors {date} - Made with Elixir, Phoenix, VueJS & with some love and some weeks", >
{ date: new Date().getFullYear() } <a slot="mobilizon" href="https://joinmobilizon.org">{{ $t("Mobilizon") }}</a>
) <span slot="date">{{ new Date().getFullYear() }}</span>
}} <a href="https://joinmobilizon.org/hall-of-fame" slot="contributors">{{
</span> $t("more than 1360 contributors")
}}</a>
</i18n>
</div> </div>
</footer> </footer>
</template> </template>
@ -49,11 +51,13 @@ footer.footer {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
font-size: 14px;
.logo { .logo {
fill: $secondary; fill: $secondary;
flex: 1; flex: 1;
max-width: 300px; max-width: 300px;
margin-bottom: 2rem;
} }
div.content { div.content {
@ -63,13 +67,15 @@ footer.footer {
ul li { ul li {
display: inline-flex; display: inline-flex;
margin: auto 5px; margin: auto 5px;
a { a {
color: #eee; font-size: 1.1rem;
font-size: 1.5rem;
text-decoration: underline;
text-decoration-color: $secondary;
} }
} }
a {
color: $white;
text-decoration: underline;
text-decoration-color: $secondary;
}
} }
</style> </style>

View file

@ -219,8 +219,14 @@ export default class NavBar extends Vue {
@import "../variables.scss"; @import "../variables.scss";
nav { nav {
.navbar-item svg { .navbar-item {
height: 1.75rem; a.button.is-success {
background: #1e7d97;
}
svg {
height: 1.75rem;
}
} }
.navbar-dropdown .navbar-item { .navbar-dropdown .navbar-item {

View file

@ -23,9 +23,12 @@ export const FETCH_PERSON = gql`
token token
} }
organizedEvents { organizedEvents {
uuid total
title elements {
beginsOn uuid
title
beginsOn
}
} }
} }
} }

View file

@ -96,7 +96,6 @@ export const FETCH_EVENT = gql`
name name
}, },
publishAt, publishAt,
category,
onlineAddress, onlineAddress,
phoneAddress, phoneAddress,
physicalAddress { physicalAddress {

View file

@ -484,7 +484,6 @@
"{count} participants": "No participants yet | One participant | {count} participants", "{count} participants": "No participants yet | One participant | {count} participants",
"{count} requests waiting": "{count} requests waiting", "{count} requests waiting": "{count} requests waiting",
"{license} guarantees {respect} of the people who will use it. Since {source}, anyone can audit it, which guarantees its transparency.": "{license} guarantees {respect} of the people who will use it. Since {source}, anyone can audit it, which guarantees its transparency.", "{license} guarantees {respect} of the people who will use it. Since {source}, anyone can audit it, which guarantees its transparency.": "{license} guarantees {respect} of the people who will use it. Since {source}, anyone can audit it, which guarantees its transparency.",
"© The Mobilizon Contributors {date} - Made with Elixir, Phoenix, VueJS & with some love and some weeks": "© The Mobilizon Contributors {date} - Made with Elixir, Phoenix, VueJS & with some love and some weeks",
"© The OpenStreetMap Contributors": "© The OpenStreetMap Contributors", "© The OpenStreetMap Contributors": "© The OpenStreetMap Contributors",
"@{username} ({role})": "@{username} ({role})", "@{username} ({role})": "@{username} ({role})",
"@{username}": "@{username}", "@{username}": "@{username}",
@ -641,5 +640,7 @@
"terms of service": "terms of service", "terms of service": "terms of service",
"Please read the instance's {fullRules}": "Please read the instance's {fullRules}", "Please read the instance's {fullRules}": "Please read the instance's {fullRules}",
"I agree to the {instanceRules} and {termsOfService}": "I agree to the {instanceRules} and {termsOfService}", "I agree to the {instanceRules} and {termsOfService}": "I agree to the {instanceRules} and {termsOfService}",
"This email is already used.": "This email is already used." "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"
} }

View file

@ -591,7 +591,6 @@
"{going}/{capacity} available places": "Pas de places restantes|{going}/{capacity} places restantes", "{going}/{capacity} available places": "Pas de places restantes|{going}/{capacity} places restantes",
"{license} guarantees {respect} of the people who will use it. Since {source}, anyone can audit it, which guarantees its transparency.": "{license} garantit {respect} des personnes qui l'utiliseront. Puisque {source}, il est publiquement auditable, ce qui garantit sa transparence.", "{license} guarantees {respect} of the people who will use it. Since {source}, anyone can audit it, which guarantees its transparency.": "{license} garantit {respect} des personnes qui l'utiliseront. Puisque {source}, il est publiquement auditable, ce qui garantit sa transparence.",
"{title} ({count} todos)": "{title} ({count} todos)", "{title} ({count} todos)": "{title} ({count} todos)",
"© The Mobilizon Contributors {date} - Made with Elixir, Phoenix, VueJS & with some love and some weeks": "© Les contributeurs de Mobilizon {date} - Fait avec Elixir, Phoenix, VueJS & et de l'amour et des semaines",
"© The OpenStreetMap Contributors": "© Les Contributeur⋅ices OpenStreetMap", "© The OpenStreetMap Contributors": "© Les Contributeur⋅ices OpenStreetMap",
"Participation notifications": "Notifications de participation", "Participation notifications": "Notifications de participation",
"We'll always send you emails to notify about important event updates": "Nous vous enverrons toujours des emails pour vous notifier à propos des mises à jour importantes des événements", "We'll always send you emails to notify about important event updates": "Nous vous enverrons toujours des emails pour vous notifier à propos des mises à jour importantes des événements",
@ -664,5 +663,7 @@
"terms of service": "conditions générales d'utilisation", "terms of service": "conditions générales d'utilisation",
"Please read the instance's {fullRules}": "Merci de lire les {fullRules} de l'instance", "Please read the instance's {fullRules}": "Merci de lire les {fullRules} de l'instance",
"I agree to the {instanceRules} and {termsOfService}": "J'accepte les {instanceRules} et les {termsOfService}", "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." "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"
} }

View file

@ -41,8 +41,9 @@ export default class EventMixin extends mixins(Vue) {
console.error("Cannot update participation cache, because of null value."); console.error("Cannot update participation cache, because of null value.");
return; return;
} }
[participation] = person.participations; [participation] = person.participations.elements;
person.participations = []; person.participations.elements = [];
person.participations.total = 0;
store.writeQuery({ store.writeQuery({
query: EVENT_PERSON_PARTICIPATION, query: EVENT_PERSON_PARTICIPATION,
variables: { eventId: event.id, actorId }, variables: { eventId: event.id, actorId },
@ -89,7 +90,7 @@ export default class EventMixin extends mixins(Vue) {
protected async openDeleteEventModal(event: IEvent, currentActor: IPerson) { protected async openDeleteEventModal(event: IEvent, currentActor: IPerson) {
function escapeRegExp(string: string) { function escapeRegExp(string: string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
} }
const participantsLength = event.participantStats.participant; const participantsLength = event.participantStats.participant;
const prefix = participantsLength const prefix = participantsLength

View file

@ -13,7 +13,7 @@ export interface IFeedToken {
export interface IPerson extends IActor { export interface IPerson extends IActor {
feedTokens: IFeedToken[]; feedTokens: IFeedToken[];
goingToEvents: IEvent[]; goingToEvents: IEvent[];
participations: IParticipant[]; participations: Paginate<IParticipant>;
memberships: Paginate<IMember>; memberships: Paginate<IMember>;
user?: ICurrentUser; user?: ICurrentUser;
} }
@ -23,7 +23,7 @@ export class Person extends Actor implements IPerson {
goingToEvents: IEvent[] = []; goingToEvents: IEvent[] = [];
participations: IParticipant[] = []; participations!: Paginate<IParticipant>;
memberships!: Paginate<IMember>; memberships!: Paginate<IMember>;

View file

@ -127,7 +127,6 @@ export interface IEvent {
title: string; title: string;
slug: string; slug: string;
description: string; description: string;
category: Category | null;
beginsOn: Date; beginsOn: Date;
endsOn: Date | null; endsOn: Date | null;
publishAt: Date; publishAt: Date;
@ -229,8 +228,6 @@ export class EventModel implements IEvent {
visibility = EventVisibility.PUBLIC; visibility = EventVisibility.PUBLIC;
category: Category | null = Category.MEETING;
joinOptions = EventJoinOptions.FREE; joinOptions = EventJoinOptions.FREE;
status = EventStatus.CONFIRMED; status = EventStatus.CONFIRMED;
@ -319,7 +316,6 @@ export class EventModel implements IEvent {
picture: this.picture, picture: this.picture,
onlineAddress: this.onlineAddress, onlineAddress: this.onlineAddress,
phoneAddress: this.phoneAddress, phoneAddress: this.phoneAddress,
category: this.category,
physicalAddress: this.physicalAddress, physicalAddress: this.physicalAddress,
options: this.options, options: this.options,
// organizerActorId: this.organizerActor && this.organizerActor.id ? this.organizerActor.id : null, // organizerActorId: this.organizerActor && this.organizerActor.id ? this.organizerActor.id : null,

View file

@ -6,30 +6,38 @@ $primary-invert: findColorInvert($primary);
$secondary: #ffd599; $secondary: #ffd599;
$secondary-invert: findColorInvert($secondary); $secondary-invert: findColorInvert($secondary);
$success: #1E7D97; $success: #0eccaf;
$success-invert: findColorInvert($success); $success-invert: findColorInvert($success);
$info: #36bcd4; $info: #36bcd4;
$info-invert: findColorInvert($info); $info-invert: findColorInvert($info);
$danger: #ff7061; $danger: #ff7061;
$danger-invert: findColorInvert($danger); $danger-invert: findColorInvert($danger);
$colors: map-merge($colors, $colors: map-merge(
("primary": ($primary, $colors,
(
"primary": (
$primary,
$primary-invert, $primary-invert,
), ),
"secondary": ($secondary, "secondary": (
$secondary,
$secondary-invert, $secondary-invert,
), ),
"success": ($success, "success": (
$success,
$success-invert, $success-invert,
), ),
"info": ($info, "info": (
$info,
$info-invert, $info-invert,
), ),
"danger": ($danger, "danger": (
$danger,
$danger-invert, $danger-invert,
), ),
)); )
);
// Navbar // Navbar
$navbar-background-color: $secondary; $navbar-background-color: $secondary;
@ -37,41 +45,32 @@ $navbar-item-color: $primary;
$navbar-height: 4rem; $navbar-height: 4rem;
// Footer // Footer
$footer-padding: 3rem 1.5rem 4rem; $footer-padding: 3rem 1.5rem 1rem;
$footer-background-color: $primary; $footer-background-color: $primary;
$body-background-color: #efeef4; $body-background-color: #efeef4;
$fullhd-enabled: false; $fullhd-enabled: false;
$hero-body-padding-medium: 6rem 1.5rem; $hero-body-padding-medium: 6rem 1.5rem;
main>.container { main > .container {
background: $body-background-color; background: $body-background-color;
} }
$title-color: #3c376e; $title-color: #3c376e;
$title-family: "Liberation Sans", $title-family: "Liberation Sans", "Helvetica Neue", Roboto, Helvetica, Arial,
"Helvetica Neue", serif;
Roboto,
Helvetica,
Arial,
serif;
$title-weight: 700; $title-weight: 700;
$title-size: 40px; $title-size: 40px;
$title-sub-size: 45px; $title-sub-size: 45px;
$title-sup-size: 30px; $title-sup-size: 30px;
$subtitle-color: #3a384c; $subtitle-color: #3a384c;
$subtitle-family: "Liberation Sans", $subtitle-family: "Liberation Sans", "Helvetica Neue", Roboto, Helvetica, Arial,
"Helvetica Neue", serif;
Roboto,
Helvetica,
Arial,
serif;
$subtitle-weight: 400; $subtitle-weight: 400;
$subtitle-size: 32px; $subtitle-size: 32px;
$subtitle-sub-size: 30px; $subtitle-sub-size: 30px;
$subtitle-sup-size: 15px; $subtitle-sup-size: 15px;
.title { .title {
margin: 30px auto 45px; margin: 30px auto 45px;
} }

View file

@ -444,11 +444,6 @@ export default class EditEvent extends Vue {
endsOnNull = false; endsOnNull = false;
created() {
this.initializeEvent();
this.unmodifiedEvent = JSON.parse(JSON.stringify(this.event.toEditJSON()));
}
@Watch("eventId", { immediate: true }) @Watch("eventId", { immediate: true })
resetFormForCreation(eventId: string) { resetFormForCreation(eventId: string) {
if (eventId === undefined) { if (eventId === undefined) {
@ -486,10 +481,12 @@ export default class EditEvent extends Vue {
} }
); );
this.observer.observe(this.$refs.bottomObserver as Element); this.observer.observe(this.$refs.bottomObserver as Element);
this.unmodifiedEvent = JSON.parse(JSON.stringify(this.event.toEditJSON()));
this.pictureFile = await buildFileFromIPicture(this.event.picture); this.pictureFile = await buildFileFromIPicture(this.event.picture);
this.limitedPlaces = this.event.options.maximumAttendeeCapacity > 0; this.limitedPlaces = this.event.options.maximumAttendeeCapacity > 0;
if (!(this.isUpdate || this.isDuplicate)) {
this.initializeEvent();
}
} }
createOrUpdateDraft(e: Event) { createOrUpdateDraft(e: Event) {
@ -513,6 +510,13 @@ export default class EditEvent extends Vue {
this.event.organizerActor = this.currentActor; this.event.organizerActor = this.currentActor;
} }
@Watch("event")
setInitialData() {
if (this.isUpdate && this.unmodifiedEvent === undefined && this.event && this.event.uuid) {
this.unmodifiedEvent = JSON.parse(JSON.stringify(this.event.toEditJSON()));
}
}
resetAttributedToOnOrganizerChange() { resetAttributedToOnOrganizerChange() {
this.event.attributedTo = new Group(); this.event.attributedTo = new Group();
} }
@ -621,21 +625,24 @@ export default class EditEvent extends Vue {
person: { person: {
__typename: "Person", __typename: "Person",
id: organizerActor.id, id: organizerActor.id,
participations: [ participations: {
{ total: 1,
__typename: "Participant", elements: [
id: "unknown", {
role: ParticipantRole.CREATOR, __typename: "Participant",
actor: { id: "unknown",
__typename: "Actor", role: ParticipantRole.CREATOR,
id: organizerActor.id, actor: {
__typename: "Actor",
id: organizerActor.id,
},
event: {
__typename: "Event",
id: updateEvent.id,
},
}, },
event: { ],
__typename: "Event", },
id: updateEvent.id,
},
},
],
}, },
}, },
}); });

View file

@ -592,7 +592,7 @@ import PopoverActorCard from "../../components/Account/PopoverActorCard.vue";
}, },
}, },
update: (data) => { update: (data) => {
if (data && data.person) return data.person.participations; if (data && data.person) return data.person.participations.elements;
return []; return [];
}, },
skip() { skip() {
@ -809,7 +809,8 @@ export default class Event extends EventMixin {
console.error("Cannot update participation cache, because of null value."); console.error("Cannot update participation cache, because of null value.");
return; return;
} }
person.participations.push(data.joinEvent); person.participations.elements.push(data.joinEvent);
person.participations.total += 1;
store.writeQuery({ store.writeQuery({
query: EVENT_PERSON_PARTICIPATION, query: EVENT_PERSON_PARTICIPATION,
variables: { eventId: this.event.id, actorId: identity.id }, variables: { eventId: this.event.id, actorId: identity.id },