Skip to content

Commit e65d1ca

Browse files
committed
Fix anonyomous text
Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com>
1 parent a0efe7d commit e65d1ca

4 files changed

Lines changed: 21 additions & 3 deletions

File tree

lib/Controller/PageController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ public function gotoForm(string $hash): Response {
178178
// Main Template to fill the form
179179
Util::addScript($this->appName, 'forms-submit');
180180
$this->initialStateService->provideInitialState($this->appName, 'form', $this->formsService->getPublicForm($form->getId()));
181+
$this->initialStateService->provideInitialState($this->appName, 'isLoggedIn', $this->userSession->isLoggedIn());
181182
$this->initialStateService->provideInitialState($this->appName, 'maxStringLengths', $this->maxStringLengths);
182183
return $this->provideTemplate(self::TEMPLATE_MAIN, $form);
183184
}

src/FormsSubmit.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
<Content app-name="forms">
2525
<Submit
2626
:form="form"
27-
:public-view="true" />
27+
:public-view="true"
28+
:is-logged-in="isLoggedIn" />
2829
</Content>
2930
</template>
3031

@@ -44,6 +45,7 @@ export default {
4445
data() {
4546
return {
4647
form: loadState('forms', 'form'),
48+
isLoggedIn: loadState('forms', 'isLoggedIn'),
4749
}
4850
},
4951
}

src/views/Create.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,17 @@ export default {
211211
let message = ''
212212
if (this.form.isAnonymous) {
213213
message += t('forms', 'Responses are anonymous.')
214-
} else {
214+
}
215+
216+
// On Submit, this is dependent on `isLoggedIn`. Create-view is always logged in and the variable isLoggedIn does not exist.
217+
if (!this.form.isAnonymous && true) {
215218
message += t('forms', 'Responses are connected to your Nextcloud account.')
216219
}
220+
217221
if (this.isMandatoryUsed) {
218222
message += ' ' + t('forms', 'An asterisk (*) indicates mandatory questions.')
219223
}
224+
220225
return message
221226
},
222227
},

src/views/Submit.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ export default {
107107
108108
mixins: [ViewsMixin],
109109
110+
props: {
111+
isLoggedIn: {
112+
type: Boolean,
113+
required: false,
114+
default: true,
115+
},
116+
},
117+
110118
data() {
111119
return {
112120
maxStringLengths: loadState('forms', 'maxStringLengths'),
@@ -152,12 +160,14 @@ export default {
152160
let message = ''
153161
if (this.form.isAnonymous) {
154162
message += t('forms', 'Responses are anonymous.')
155-
} else {
163+
}
164+
if (!this.form.isAnonymous && this.isLoggedIn) {
156165
message += t('forms', 'Responses are connected to your Nextcloud account.')
157166
}
158167
if (this.isMandatoryUsed) {
159168
message += ' ' + t('forms', 'An asterisk (*) indicates mandatory questions.')
160169
}
170+
161171
return message
162172
},
163173
},

0 commit comments

Comments
 (0)