Skip to content

Commit

Permalink
Disable comment submit buttons when not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
symkat committed Dec 1, 2021
1 parent adcf6a2 commit 289c838
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Web/templates/simple/blog/_comment.tx
Expand Up @@ -20,13 +20,17 @@
<textarea class="form-control" name="message" id="message" rows="3"></textarea>
</div>

%% if ( $person ) {
<button type="submit" class="btn btn-primary float-end">Post Message</button>
%% } else {
<button type="submit" disabled class="btn btn-primary float-end">Please login or register to reply</button>
%% }
</form>
</div>
</div>
%% for $comment.get_children -> $child_comment {
<div style="margin-left: 2em">
%% include "/default/blog/_comment.tx" { comment => $child_comment };
%% include "/simple/blog/_comment.tx" { comment => $child_comment };
</div>
%% }
</div>
Expand Down
5 changes: 5 additions & 0 deletions Web/templates/simple/blog/item.html.tx
Expand Up @@ -61,7 +61,12 @@
<label class="form-check-label" for="rev_neg">This is a negative review. I dislike this blog.</label>
</div>

%% if ( $person ) {
<button type="submit" class="btn btn-primary float-end">Post Review</button>
%% } else {
<button type="submit" disabled class="btn btn-primary float-end">Please login or register to post a review.</button>

%% }
</form>
</div>
<!-- End Review / Root Comment Form-->
Expand Down

0 comments on commit 289c838

Please sign in to comment.