Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated strings and rearrangement of admin settings #3422

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Model/Mail/NotificationMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function buildBody(): void {
private function evaluateDisplayName(Log $logItem): string {
if (!$logItem->getUserId() || $this->poll->getAnonymous() || $this->poll->getShowResults() !== Poll::SHOW_RESULTS_ALWAYS) {
// hide actor's name if poll is anonymous or results are hidden
return $this->l10n->t('A user');
return $this->l10n->t('A participant');
}

return $this->getUser($logItem->getUserId())->getDisplayName();
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/User/GenericUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(
parent::__construct($id, $type, $displayName, $emailAddress, $languageCode, $localeCode, $timeZoneName);

$this->icon = self::ICON_DEFAULT;
$this->description = $this->l10n->t('External user');
$this->description = $this->l10n->t('External participant');
$this->richObjectType = 'guest';

if ($type === UserBase::TYPE_PUBLIC) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Provider/ActivityProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected function setSubjects(IEvent $event, string $subject): void {
$parameters['actor'] = [
'type' => 'guest',
'id' => $event->getAuthor(),
'name' => 'An unknown user',
'name' => 'An unknown participant',
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Base/modules/FlexSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default {
}

.user_settings {
padding-top: 16px;
padding-top: 8px;

textarea {
width: 99%;
Expand Down
5 changes: 2 additions & 3 deletions src/js/components/Cards/modules/CardLimitedVotes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
-->

<template>
<CardDiv :heading="t('polls', 'Limited votes.')"
:type="cardType">
<CardDiv :heading="t('polls', 'Limited votes.')" :type="cardType">
<ul>
<li v-if="maxVotesPerOption">
{{ n('polls', '%n vote is allowed per option.', '%n votes are allowed per option.', maxVotesPerOption) }}
</li>
<li v-if="maxVotesPerUser">
{{ n('polls', '%n vote is allowed per user.', '%n votes are allowed per user.', maxVotesPerUser) }}
{{ n('polls', '%n vote is allowed per participant.', '%n votes are allowed per participant.', maxVotesPerUser) }}
{{ n('polls', 'You have %n vote left.', 'You have %n votes left.', votesLeft) }}
</li>
<div v-if="orphanedVotes && maxVotesPerUser">
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Configuration/ConfigVoteLimit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<template>
<div>
<NcCheckboxRadioSwitch :checked.sync="useVoteLimit" type="switch">
{{ t('polls', 'Limit "Yes" votes per user') }}
{{ t('polls', 'Limit "Yes" votes per participant') }}
</NcCheckboxRadioSwitch>

<InputDiv v-if="maxVotesPerUser"
Expand Down
6 changes: 2 additions & 4 deletions src/js/components/Options/OptionsDateShift.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@
<template>
<div>
<div v-if="proposalsExist">
{{ t('polls', 'Shifting dates is disabled to prevent shifting of other user\'s proposals.') }}
{{ t('polls', 'Shifting dates is disabled to prevent shifting of proposals of other participants.') }}
</div>
<div v-else class="select-unit">
<InputDiv v-model="shift.step"
:label="t('polls', 'Step width')"
use-num-modifiers />
<InputDiv v-model="shift.step" :label="t('polls', 'Step width')" use-num-modifiers />
<NcSelect v-model="shift.unit"
:input-label="t('polls', 'Step unit')"
:clearable="false"
Expand Down
8 changes: 4 additions & 4 deletions src/js/components/Public/PublicRegisterModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div class="modal__content">
<div class="modal__registration">
<div class="registration__registration">
<h2>{{ t('polls', 'Guest users') }}</h2>
<h2>{{ t('polls', 'Guest participants') }}</h2>
<InputDiv v-model="userName"
class="section__username"
:signaling-class="checkStatus.userName"
Expand Down Expand Up @@ -77,17 +77,17 @@
</div>

<div v-if="share.showLogin" class="registration__login">
<h2> {{ t('polls', 'Registered users') }} </h2>
<h2> {{ t('polls', 'Registered accounts') }} </h2>
<NcButton wide @click="login()">
<template #default>
{{ t('polls', 'Login') }}
</template>
</NcButton>
<div>
{{ t('polls', 'As a regular user of this site, you can participate with your internal identity after logging in.') }}
{{ t('polls', 'You can also log in and participate with your regular account.') }}
</div>
<div>
{{ t('polls', 'Otherwise participate as a guest user.') }}
{{ t('polls', 'Otherwise participate as a guest participant.') }}
</div>
</div>
</div>
Expand Down
62 changes: 62 additions & 0 deletions src/js/components/Settings/AdminSettings/AdminActivities.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!--
- @copyright Copyright (c) 2018 René Gieling <github@dartcafe.de>
-
- @author René Gieling <github@dartcafe.de>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->

<template>
<div class="user_settings">
<NcCheckboxRadioSwitch :checked.sync="useActivity" type="switch">
{{ t('polls', 'Enable the tracking of activities with the Activities app') }}
</NcCheckboxRadioSwitch>
</div>
</template>

<script>

import { mapState } from 'vuex'
import { NcCheckboxRadioSwitch } from '@nextcloud/vue'
import { writeValue } from '../../../mixins/adminSettingsMixin.js'

export default {
name: 'AdminActivities',

components: {
NcCheckboxRadioSwitch,
},

mixins: [writeValue],

computed: {
...mapState({
appSettings: (state) => state.appSettings,
}),

// Add bindings
useActivity: {
get() {
return this.appSettings.useActivity
},
set(value) {
this.writeValue({ useActivity: value })
},
},
},
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,17 @@
-->

<template>
<div>
<div class="user_settings">
<NcCheckboxRadioSwitch :checked.sync="useActivity" type="switch">
{{ t('polls', 'Track activities') }}
</NcCheckboxRadioSwitch>

<NcCheckboxRadioSwitch :checked.sync="hideLogin" type="switch">
{{ t('polls', 'Hide login option in public polls') }}
</NcCheckboxRadioSwitch>

<NcCheckboxRadioSwitch :checked.sync="autoArchive" type="switch">
{{ t('polls', 'Archive closed polls automatically') }}
</NcCheckboxRadioSwitch>
<InputDiv v-if="autoArchive"
v-model="autoArchiveOffset"
class="settings_details"
type="number"
inputmode="numeric"
use-num-modifiers
:label="t('polls', 'After how many days are closed polls to be archived:')" />
</div>
<div class="user_settings">
<NcCheckboxRadioSwitch :checked.sync="autoArchive" type="switch">
{{ t('polls', 'Enable the automatic poll archiving') }}
</NcCheckboxRadioSwitch>
<InputDiv v-if="autoArchive"
v-model="autoArchiveOffset"
class="settings_details"
type="number"
inputmode="numeric"
use-num-modifiers
:label="t('polls', 'Days after which polls should be archived after closing')" />
</div>
</template>

Expand All @@ -50,37 +40,24 @@
import { mapState } from 'vuex'
import { NcCheckboxRadioSwitch } from '@nextcloud/vue'
import { InputDiv } from '../../Base/index.js'
import { writeValue } from '../../../mixins/adminSettingsMixin.js'

export default {
name: 'AdminMisc',
name: 'AdminArchivePolls',

components: {
NcCheckboxRadioSwitch,
InputDiv,
},

mixins: [writeValue],

computed: {
...mapState({
appSettings: (state) => state.appSettings,
}),

// Add bindings
hideLogin: {
get() {
return !this.appSettings.showLogin
},
set(value) {
this.writeValue({ showLogin: !value })
},
},
useActivity: {
get() {
return this.appSettings.useActivity
},
set(value) {
this.writeValue({ useActivity: value })
},
},
autoArchive: {
get() {
return this.appSettings.autoArchive
Expand All @@ -99,12 +76,5 @@ export default {
},
},
},

methods: {
async writeValue(value) {
await this.$store.commit('appSettings/set', value)
this.$store.dispatch('appSettings/write')
},
},
}
</script>
16 changes: 8 additions & 8 deletions src/js/components/Settings/AdminSettings/AdminCombo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@

<template>
<div class="user_settings">
<NcCheckboxRadioSwitch :checked.sync="comboLimited" type="switch">
{{ t('polls', 'Deactivate combo view for all users') }}
<NcCheckboxRadioSwitch :checked.sync="allowCombo" type="switch">
{{ t('polls', 'Enable the usage of the combo view globally') }}
</NcCheckboxRadioSwitch>
<div v-if="comboLimited" class="settings_details">
<div v-if="!allowCombo" class="settings_details">
<NcSelect v-model="comboGroups"
:input-label="t('polls','Allow combo view for the following groups')"
:input-label="t('polls','Enable only for the following groups')"
label="displayName"
:options="groups"
:user-select="true"
:multiple="true"
:loading="isLoading"
:placeholder="t('polls', 'Leave empty to disallow for all.')"
:placeholder="t('polls', 'Leave empty to disable globally')"
@search="loadGroups" />
</div>
</div>
Expand All @@ -56,12 +56,12 @@ export default {

computed: {
// Add bindings
comboLimited: {
allowCombo: {
get() {
return !this.appSettings.allowCombo
return this.appSettings.allowCombo
},
set(value) {
this.writeValue({ allowCombo: !value })
this.writeValue({ allowCombo: value })
},
},
comboGroups: {
Expand Down
25 changes: 15 additions & 10 deletions src/js/components/Settings/AdminSettings/AdminEmail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
</NcCheckboxRadioSwitch>

<div class="disclaimer_group">
<span class="grow_title">{{ t('polls', 'Additional email disclaimer') }}</span>
<div class="grow_title">
<span>{{ t('polls', 'Additional email disclaimer') }}</span>
<LanguageMarkdownIcon />
</div>
<NcCheckboxRadioSwitch :checked.sync="preview" type="switch">
{{ t('polls', 'Preview') }}
</NcCheckboxRadioSwitch>
Expand All @@ -45,6 +48,8 @@ import { NcCheckboxRadioSwitch } from '@nextcloud/vue'
import { marked } from 'marked'
import { gfmHeadingId } from 'marked-gfm-heading-id'
import DOMPurify from 'dompurify'
import { writeValue } from '../../../mixins/adminSettingsMixin.js'
import LanguageMarkdownIcon from 'vue-material-design-icons/LanguageMarkdown.vue'

const markedPrefix = {
prefix: 'disclaimer-',
Expand All @@ -55,8 +60,11 @@ export default {

components: {
NcCheckboxRadioSwitch,
LanguageMarkdownIcon,
},

mixins: [writeValue],

data() {
return {
preview: false,
Expand Down Expand Up @@ -96,11 +104,6 @@ export default {
saveSettings() {
this.$store.dispatch('appSettings/write')
},

async writeValue(value) {
await this.$store.commit('appSettings/set', value)
this.$store.dispatch('appSettings/write')
},
},
}
</script>
Expand All @@ -110,12 +113,14 @@ export default {
display: flex;
align-items: center;

span {
margin-right: 12px;
}

.grow_title {
display: flex;
flex-grow: 1;
margin-right: 12px;

.material-design-icon {
margin-left: 4px;
}
}
}
</style>
5 changes: 2 additions & 3 deletions src/js/components/Settings/AdminSettings/AdminLegal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
<template>
<div class="user_settings">
<p class="settings-description">
{{ t('polls', 'The privacy link and the legal notice link are automatically added to the registration dialog of public polls.') }}
{{ t('polls', 'As a default the links configured in the theming app are used. For public polls these can be overriden by individual terms.') }}
{{ t('polls', 'If you use different legal terms and privacy policy for public polls, enter the links below. Leave empty to use your default terms.') }}
</p>

<InputDiv v-model="privacyUrl"
Expand All @@ -36,7 +35,7 @@
<InputDiv v-model="imprintUrl"
type="url"
inputmode="url"
:label="t('polls', 'Legal notice link:')"
:label="t('polls', 'Legal terms link:')"
:placeholder="placeholder.imprint"
@change="saveSettings()" />
</div>
Expand Down
Loading
Loading