Merge branch 'improve-text' into 'master'

Improve text

See merge request framasoft/mobilizon!584
This commit is contained in:
Thomas Citharel 2020-10-07 08:28:45 +02:00
commit 9680f51d5c
7 changed files with 64 additions and 15 deletions

View File

@ -787,5 +787,7 @@
"Displayed nickname": "Displayed nickname", "Displayed nickname": "Displayed nickname",
"Short bio": "Short bio", "Short bio": "Short bio",
"Congratulations, your account is now created!": "Congratulations, your account is now created!", "Congratulations, your account is now created!": "Congratulations, your account is now created!",
"Now, create your first profile:": "Now, create your first profile:" "Now, create your first profile:": "Now, create your first profile:",
"If you have opted for manual validation of participants, Mobilizon will send you an email to inform you of new participations to be processed. You can choose the frequency of these notifications below.": "If you have opted for manual validation of participants, Mobilizon will send you an email to inform you of new participations to be processed. You can choose the frequency of these notifications below.",
"You will be able to add an avatar and set other options in your account settings.": "You will be able to add an avatar and set other options in your account settings."
} }

View File

@ -829,5 +829,7 @@
"Displayed nickname": "Pseudonyme affiché", "Displayed nickname": "Pseudonyme affiché",
"Short bio": "Courte biographie", "Short bio": "Courte biographie",
"Congratulations, your account is now created!": "Bravo, votre compte est dorénavant créé !", "Congratulations, your account is now created!": "Bravo, votre compte est dorénavant créé !",
"Now, create your first profile:": "Maintenant, créez votre premier profil :" "Now, create your first profile:": "Maintenant, créez votre premier profil :",
"If you have opted for manual validation of participants, Mobilizon will send you an email to inform you of new participations to be processed. You can choose the frequency of these notifications below.": "Si vous avez opté pour la validation manuelle des participantes, Mobilizon vous enverra un email pour vous informer des nouvelles participations à traiter. Vous pouvez choisir la fréquence de ces notifications ci-dessous.",
"You will be able to add an avatar and set other options in your account settings.": "Vous pourrez ajouter un avatar et définir d'autres options dans les paramètres de votre compte."
} }

View File

@ -44,6 +44,14 @@
<b-input type="textarea" maxlength="100" rows="2" v-model="identity.summary" /> <b-input type="textarea" maxlength="100" rows="2" v-model="identity.summary" />
</b-field> </b-field>
<p class="content">
{{
$t(
"You will be able to add an avatar and set other options in your account settings."
)
}}
</p>
<p class="control has-text-centered"> <p class="control has-text-centered">
<b-button <b-button
type="is-primary" type="is-primary"

View File

@ -142,19 +142,22 @@
<b-table-column field="actions" :label="$t('Actions')" v-slot="props"> <b-table-column field="actions" :label="$t('Actions')" v-slot="props">
<div class="buttons" v-if="props.row.actor.id !== currentActor.id"> <div class="buttons" v-if="props.row.actor.id !== currentActor.id">
<b-button <b-button
v-if="props.row.role === MemberRole.MEMBER" v-if="[MemberRole.MEMBER, MemberRole.MODERATOR].includes(props.row.role)"
@click="promoteMember(props.row.id)" @click="promoteMember(props.row)"
icon-left="chevron-double-up"
>{{ $t("Promote") }}</b-button >{{ $t("Promote") }}</b-button
> >
<b-button <b-button
v-if="props.row.role === MemberRole.ADMINISTRATOR" v-if="[MemberRole.ADMINISTRATOR, MemberRole.MODERATOR].includes(props.row.role)"
@click="demoteMember(props.row.id)" @click="demoteMember(props.row)"
icon-left="chevron-double-down"
>{{ $t("Demote") }}</b-button >{{ $t("Demote") }}</b-button
> >
<b-button <b-button
v-if="props.row.role === MemberRole.MEMBER" v-if="props.row.role === MemberRole.MEMBER"
@click="removeMember(props.row.id)" @click="removeMember(props.row.id)"
type="is-danger" type="is-danger"
icon-left="exit-to-app"
>{{ $t("Remove") }}</b-button >{{ $t("Remove") }}</b-button
> >
</div> </div>
@ -329,12 +332,24 @@ export default class GroupMembers extends Vue {
}); });
} }
promoteMember(memberId: string): Promise<void> { promoteMember(member: IMember): void {
return this.updateMember(memberId, MemberRole.ADMINISTRATOR); if (!member.id) return;
if (member.role === MemberRole.MODERATOR) {
this.updateMember(member.id, MemberRole.ADMINISTRATOR);
}
if (member.role === MemberRole.MEMBER) {
this.updateMember(member.id, MemberRole.MODERATOR);
}
} }
demoteMember(memberId: string): Promise<void> { demoteMember(member: IMember): void {
return this.updateMember(memberId, MemberRole.MEMBER); if (!member.id) return;
if (member.role === MemberRole.MODERATOR) {
this.updateMember(member.id, MemberRole.MEMBER);
}
if (member.role === MemberRole.ADMINISTRATOR) {
this.updateMember(member.id, MemberRole.MODERATOR);
}
} }
async updateMember(memberId: string, role: MemberRole): Promise<void> { async updateMember(memberId: string, role: MemberRole): Promise<void> {

View File

@ -77,6 +77,13 @@
</div> </div>
<div class="field is-primary"> <div class="field is-primary">
<strong>{{ $t("Notifications for manually approved participations to an event") }}</strong> <strong>{{ $t("Notifications for manually approved participations to an event") }}</strong>
<p>
{{
$t(
"If you have opted for manual validation of participants, Mobilizon will send you an email to inform you of new participations to be processed. You can choose the frequency of these notifications below."
)
}}
</p>
<b-select <b-select
v-model="notificationPendingParticipation" v-model="notificationPendingParticipation"
@input="updateSetting({ notificationPendingParticipation })" @input="updateSetting({ notificationPendingParticipation })"
@ -115,11 +122,11 @@ export default class Notifications extends Vue {
notificationPendingParticipation = INotificationPendingParticipationEnum.NONE; notificationPendingParticipation = INotificationPendingParticipationEnum.NONE;
notificationPendingParticipationValues: object = {}; notificationPendingParticipationValues: Record<string, unknown> = {};
RouteName = RouteName; RouteName = RouteName;
mounted() { mounted(): void {
this.notificationPendingParticipationValues = { this.notificationPendingParticipationValues = {
[INotificationPendingParticipationEnum.NONE]: this.$t("Do not receive any mail"), [INotificationPendingParticipationEnum.NONE]: this.$t("Do not receive any mail"),
[INotificationPendingParticipationEnum.DIRECT]: this.$t("Receive one email per request"), [INotificationPendingParticipationEnum.DIRECT]: this.$t("Receive one email per request"),
@ -129,7 +136,7 @@ export default class Notifications extends Vue {
} }
@Watch("loggedUser") @Watch("loggedUser")
setSettings() { setSettings(): void {
if (this.loggedUser && this.loggedUser.settings) { if (this.loggedUser && this.loggedUser.settings) {
this.notificationOnDay = this.loggedUser.settings.notificationOnDay; this.notificationOnDay = this.loggedUser.settings.notificationOnDay;
this.notificationEachWeek = this.loggedUser.settings.notificationEachWeek; this.notificationEachWeek = this.loggedUser.settings.notificationEachWeek;
@ -138,7 +145,7 @@ export default class Notifications extends Vue {
} }
} }
async updateSetting(variables: object) { async updateSetting(variables: Record<string, unknown>): Promise<void> {
await this.$apollo.mutate<{ setUserSettings: string }>({ await this.$apollo.mutate<{ setUserSettings: string }>({
mutation: SET_USER_SETTINGS, mutation: SET_USER_SETTINGS,
variables, variables,

View File

@ -36,7 +36,7 @@ defmodule Mobilizon.Users.Setting do
field(:notification_before_event, :boolean) field(:notification_before_event, :boolean)
field(:notification_pending_participation, NotificationPendingNotificationDelay, field(:notification_pending_participation, NotificationPendingNotificationDelay,
default: :none default: :one_day
) )
belongs_to(:user, User, primary_key: true, type: :id, foreign_key: :id, define_field: false) belongs_to(:user, User, primary_key: true, type: :id, foreign_key: :id, define_field: false)

View File

@ -0,0 +1,15 @@
defmodule Mobilizon.Storage.Repo.Migrations.ChangeDefaultNotificationPendingParticipation do
use Ecto.Migration
def up do
alter table(:user_settings) do
modify(:notification_pending_participation, :integer, default: 10)
end
end
def down do
alter table(:user_settings) do
modify(:notification_pending_participation, :integer, default: 5)
end
end
end