Skip to content

Commit 289c838

Browse files
committed
Disable comment submit buttons when not logged in
1 parent adcf6a2 commit 289c838

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Web/templates/simple/blog/_comment.tx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@
2020
<textarea class="form-control" name="message" id="message" rows="3"></textarea>
2121
</div>
2222

23+
%% if ( $person ) {
2324
<button type="submit" class="btn btn-primary float-end">Post Message</button>
25+
%% } else {
26+
<button type="submit" disabled class="btn btn-primary float-end">Please login or register to reply</button>
27+
%% }
2428
</form>
2529
</div>
2630
</div>
2731
%% for $comment.get_children -> $child_comment {
2832
<div style="margin-left: 2em">
29-
%% include "/default/blog/_comment.tx" { comment => $child_comment };
33+
%% include "/simple/blog/_comment.tx" { comment => $child_comment };
3034
</div>
3135
%% }
3236
</div>

Web/templates/simple/blog/item.html.tx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@
6161
<label class="form-check-label" for="rev_neg">This is a negative review. I dislike this blog.</label>
6262
</div>
6363

64+
%% if ( $person ) {
6465
<button type="submit" class="btn btn-primary float-end">Post Review</button>
66+
%% } else {
67+
<button type="submit" disabled class="btn btn-primary float-end">Please login or register to post a review.</button>
68+
69+
%% }
6570
</form>
6671
</div>
6772
<!-- End Review / Root Comment Form-->

0 commit comments

Comments
 (0)