Skip to content
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
1 change: 1 addition & 0 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public function gotoForm(string $hash): Response {
// 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);
}
Expand Down
4 changes: 3 additions & 1 deletion src/FormsSubmit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<Content app-name="forms">
<Submit
:form="form"
:public-view="true" />
:public-view="true"
:is-logged-in="isLoggedIn" />
</Content>
</template>

Expand All @@ -44,6 +45,7 @@ export default {
data() {
return {
form: loadState('forms', 'form'),
isLoggedIn: loadState('forms', 'isLoggedIn'),
}
},
}
Expand Down
7 changes: 6 additions & 1 deletion src/views/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
},
Expand Down
12 changes: 11 additions & 1 deletion src/views/Submit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ export default {

mixins: [ViewsMixin],

props: {
isLoggedIn: {
type: Boolean,
required: false,
default: true,
},
},

data() {
return {
maxStringLengths: loadState('forms', 'maxStringLengths'),
Expand Down Expand Up @@ -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
},
},
Expand Down