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">
<b-icon icon="earth" v-if="participation.event.visibility === EventVisibility.PUBLIC" />
<b-icon
icon="lock-open"
v-if="participation.event.visibility === EventVisibility.UNLISTED"
icon="link"
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 class="column is-narrow participant-stats">
<span v-if="participation.event.options.maximumAttendeeCapacity !== 0">

View File

@ -23,7 +23,7 @@
<div class="columns">
<span class="column is-narrow">
<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" />
</span>
<span class="column is-narrow participant-stats">

View File

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

View File

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

View File

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

View File

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

View File

@ -484,7 +484,6 @@
"{count} participants": "No participants yet | One participant | {count} participants",
"{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.",
"© 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",
"@{username} ({role})": "@{username} ({role})",
"@{username}": "@{username}",
@ -641,5 +640,7 @@
"terms of service": "terms of service",
"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}",
"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",
"{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)",
"© 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",
"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",
@ -664,5 +663,7 @@
"terms of service": "conditions générales d'utilisation",
"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}",
"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.");
return;
}
[participation] = person.participations;
person.participations = [];
[participation] = person.participations.elements;
person.participations.elements = [];
person.participations.total = 0;
store.writeQuery({
query: EVENT_PERSON_PARTICIPATION,
variables: { eventId: event.id, actorId },
@ -89,8 +90,8 @@ export default class EventMixin extends mixins(Vue) {
protected async openDeleteEventModal(event: IEvent, currentActor: IPerson) {
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 prefix = participantsLength
? this.$tc("There are {participants} participants.", event.participantStats.participant, {

View File

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

View File

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

View File

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

View File

@ -444,11 +444,6 @@ export default class EditEvent extends Vue {
endsOnNull = false;
created() {
this.initializeEvent();
this.unmodifiedEvent = JSON.parse(JSON.stringify(this.event.toEditJSON()));
}
@Watch("eventId", { immediate: true })
resetFormForCreation(eventId: string) {
if (eventId === undefined) {
@ -486,10 +481,12 @@ export default class EditEvent extends Vue {
}
);
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.limitedPlaces = this.event.options.maximumAttendeeCapacity > 0;
if (!(this.isUpdate || this.isDuplicate)) {
this.initializeEvent();
}
}
createOrUpdateDraft(e: Event) {
@ -513,6 +510,13 @@ export default class EditEvent extends Vue {
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() {
this.event.attributedTo = new Group();
}
@ -621,21 +625,24 @@ export default class EditEvent extends Vue {
person: {
__typename: "Person",
id: organizerActor.id,
participations: [
{
__typename: "Participant",
id: "unknown",
role: ParticipantRole.CREATOR,
actor: {
__typename: "Actor",
id: organizerActor.id,
participations: {
total: 1,
elements: [
{
__typename: "Participant",
id: "unknown",
role: ParticipantRole.CREATOR,
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) => {
if (data && data.person) return data.person.participations;
if (data && data.person) return data.person.participations.elements;
return [];
},
skip() {
@ -809,7 +809,8 @@ export default class Event extends EventMixin {
console.error("Cannot update participation cache, because of null value.");
return;
}
person.participations.push(data.joinEvent);
person.participations.elements.push(data.joinEvent);
person.participations.total += 1;
store.writeQuery({
query: EVENT_PERSON_PARTICIPATION,
variables: { eventId: this.event.id, actorId: identity.id },