File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff 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 },
Original file line number Diff line number Diff 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 },
You can’t perform that action at this time.
0 commit comments