From 420c74c84686a424ff766fc670a2581f1ea44d04 Mon Sep 17 00:00:00 2001
From: hom3mad3 <8156337+hom3mad3@users.noreply.github.com>
Date: Tue, 17 Dec 2024 08:49:06 +0100
Subject: [PATCH] polls: PollDetail/PollQuestions.jsx: clean up isReadOnly
---
.../polls/static/PollDetail/PollQuestions.jsx | 43 ++++++++++---------
1 file changed, 22 insertions(+), 21 deletions(-)
diff --git a/adhocracy4/polls/static/PollDetail/PollQuestions.jsx b/adhocracy4/polls/static/PollDetail/PollQuestions.jsx
index 9ec88c944..79186a0d2 100644
--- a/adhocracy4/polls/static/PollDetail/PollQuestions.jsx
+++ b/adhocracy4/polls/static/PollDetail/PollQuestions.jsx
@@ -437,32 +437,33 @@ class PollQuestions extends React.Component {
)
: (
<>
- {this.state.useTermsOfUse &&
- this.state.agreedTermsOfUse === false && (
-
-
- this.setState({ checkedTermsOfUse: val })}
- orgTermsUrl={this.state.orgTermsUrl}
- />
-
+ {/* Terms of Use Section */}
+ {this.state.useTermsOfUse && !this.state.agreedTermsOfUse && (
+
+ this.setState({ checkedTermsOfUse: val })}
+ orgTermsUrl={this.state.orgTermsUrl}
+ />
+
)}
+
+ {/* Captcha Section */}
{this.state.allowUnregisteredUsers &&
- this.state.questions.length > 0 &&
- !this.state.questions[0].authenticated && (
- this.setState({ captcha: val })}
- apiUrl={this.props.captchaUrl}
- name="id_captcheck"
- refresh={this.state.refreshCaptcha}
- />
+ this.state.questions.length > 0 &&
+ !this.state.questions[0].authenticated && (
+ this.setState({ captcha: val })}
+ apiUrl={this.props.captchaUrl}
+ name="id_captcheck"
+ refresh={this.state.refreshCaptcha}
+ />
)}
+
+ {/* Button Wrapper */}
{this.buttonVote}
- {!this.state.loading
- ? this.linkShowResults()
- : this.loadingIndicator}
+ {!this.state.loading ? this.linkShowResults() : this.loadingIndicator}
>
)}