45 lines
2.5 KiB
Twig
45 lines
2.5 KiB
Twig
<form id="add_comment" action="{{ self_url() }}" method="post" accept-charset="UTF-8">
|
|
{% if visitor.logged_in %}
|
|
<label for="comment_body_field">{{ "%s's comment" | translate | format(visitor.full_name | oneof(visitor.login)) }}</label>
|
|
{% else %}
|
|
<label for="comment_author_field">{{ "Your name" | translate }}</label>
|
|
<input type="text" name="author" value="{{ posted('author') | fix(true) }}" id="comment_author_field" class="text" maxlength="250">
|
|
<label for="comment_author_email_field">{{ "Your email" | translate }}</label>
|
|
<input type="email" name="author_email" value="{{ posted('author_email') | fix(true) }}" id="comment_author_email_field" class="text" maxlength="128">
|
|
<label for="comment_author_url_field">{{ "Your website" | translate }}</label>
|
|
<input type="url" name="author_url" value="{{ posted('author_url') | fix(true) }}" id="comment_author_url_field" class="text" maxlength="2048">
|
|
<label for="comment_remember_me">{{ "Remember me" | translate }}</label>
|
|
<input type="checkbox" name="remember_me" id="comment_remember_me"{% if POST.remember_me is defined %} checked{% endif %}>
|
|
{{ generate_captcha() }}
|
|
<label for="comment_body_field">{{ "Your comment" | translate }}</label>
|
|
{% endif %}
|
|
<textarea name="body" id="comment_body_field">{{ posted("body") | fix(false, true) }}</textarea>
|
|
<small>
|
|
{% if visitor.group.can("code_in_comments") and site.module_comments.allowed_comment_html is not empty %}
|
|
{% if site.enable_markdown %}
|
|
{{ "Markdown is allowed." | translate }}
|
|
{% endif %}
|
|
{{ "HTML tags allowed:" | translate }}
|
|
{{ "<%s>" | format(site.module_comments.allowed_comment_html | join("> <") | fix ) }}
|
|
{% else %}
|
|
{{ "HTML is not allowed." | translate }}
|
|
{% endif %}
|
|
</small>
|
|
{% if visitor.logged_in and site.email_correspondence %}
|
|
<label for="comment_notify_field">{{ "Notify me when others comment" | translate }}</label>
|
|
<input type="checkbox" name="notify" id="comment_notify_field">
|
|
{% endif %}
|
|
<div class="doaction speak">
|
|
{% if visitor.logged_in %}
|
|
<input type="hidden" name="author" value="{{ visitor.full_name | oneof(visitor.login) | fix(true) }}">
|
|
<input type="hidden" name="author_email" value="{{ visitor.email | fix(true) }}">
|
|
<input type="hidden" name="author_url" value="{{ visitor.website | fix(true) }}">
|
|
{% endif %}
|
|
<input type="hidden" name="parent_id" value="0">
|
|
<input type="hidden" name="post_id" value="{{ post.id }}">
|
|
<input type="hidden" name="hash" value="{{ authenticate() }}">
|
|
<input type="hidden" name="action" value="add_comment">
|
|
<button type="submit">{{ "Speak" | translate }}</button>
|
|
</div>
|
|
</form>
|