Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com>
This commit is contained in:
Jonas Rittershofer 2021-02-24 23:58:20 +01:00
Родитель f21bb63d1e
Коммит 8053917cf7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: A865740F334316E0
4 изменённых файлов: 21 добавлений и 3 удалений

Просмотреть файл

@ -178,6 +178,7 @@ class PageController extends Controller {
// Main Template to fill the form
Util::addScript($this->appName, 'forms-submit');
$this->initialStateService->provideInitialState($this->appName, 'form', $this->formsService->getPublicForm($form->getId()));
$this->initialStateService->provideInitialState($this->appName, 'isLoggedIn', $this->userSession->isLoggedIn());
$this->initialStateService->provideInitialState($this->appName, 'maxStringLengths', $this->maxStringLengths);
return $this->provideTemplate(self::TEMPLATE_MAIN, $form);
}

Просмотреть файл

@ -24,7 +24,8 @@
<Content app-name="forms">
<Submit
:form="form"
:public-view="true" />
:public-view="true"
:is-logged-in="isLoggedIn" />
</Content>
</template>
@ -44,6 +45,7 @@ export default {
data() {
return {
form: loadState('forms', 'form'),
isLoggedIn: loadState('forms', 'isLoggedIn'),
}
},
}

Просмотреть файл

@ -212,12 +212,17 @@ export default {
let message = ''
if (this.form.isAnonymous) {
message += t('forms', 'Responses are anonymous.')
} else {
}
// On Submit, this is dependent on `isLoggedIn`. Create-view is always logged in and the variable isLoggedIn does not exist.
if (!this.form.isAnonymous && true) {
message += t('forms', 'Responses are connected to your Nextcloud account.')
}
if (this.isMandatoryUsed) {
message += ' ' + t('forms', 'An asterisk (*) indicates mandatory questions.')
}
return message
},
},

Просмотреть файл

@ -107,6 +107,14 @@ export default {
mixins: [ViewsMixin],
props: {
isLoggedIn: {
type: Boolean,
required: false,
default: true,
},
},
data() {
return {
maxStringLengths: loadState('forms', 'maxStringLengths'),
@ -152,12 +160,14 @@ export default {
let message = ''
if (this.form.isAnonymous) {
message += t('forms', 'Responses are anonymous.')
} else {
}
if (!this.form.isAnonymous && this.isLoggedIn) {
message += t('forms', 'Responses are connected to your Nextcloud account.')
}
if (this.isMandatoryUsed) {
message += ' ' + t('forms', 'An asterisk (*) indicates mandatory questions.')
}
return message
},
},