Files
kasu/templates/comments/form.html
Christian Berg 86a0db050d Diverse Code Cleanups
*Code wurde PEP-8 gerecht formatiert
* Kleine Fehler die der PyCharm Inspector beanstandet wurden korrigiert
2014-11-26 16:04:52 +01:00

44 lines
2.0 KiB
HTML

{% load comments i18n %}
<form action="{% comment_form_target %}" method="post" id='comment_form'>
{% csrf_token %}
<fieldset class="grid_12">
<legend>{% trans "New Comment" %}</legend>
{% if user.is_authenticated %}
<p style="display:none">
{{form.honeypot}} {{form.honeypot.label}}
{% for field in form.hidden_fields %}{{ field }}{% endfor %}
{% if next %}
<input type="hidden" name="next" value="{{ next }}" />
{% else %}
<input type="hidden" name="next" value="{{ request.path_info }}" />
</p>
{% endif %}
<label class="field_name" for="id_comment">
{{user}}<br/>
<time class="submit_date" datetime='{% now "c" %}'>{% now "d. M. Y. H:i" %}</time>
{% if user.get_profile.thumbnail %}<img src="{{user.get_profile.thumbnail.url}}" alt=""/>{% else %}<img src="{{STATIC_URL}}img/unknown_thumbnail.png" alt=""/>{% endif %}
</label>
{{form.comment}}
<p class="buttonbar">
<button type="submit" name="preview"><img src="{{ STATIC_URL }}icons/comment_edit.png" alt="{% trans 'Preview' %}" /> {% trans "Preview" %}</button>
<button type="submit" name="submit"><img src="{{ STATIC_URL }}icons/comment_add.png" alt="{% trans 'Post' %}" /> {% trans "Post" %}</button>
</p>
{% else %}
<label class="field_name" for="id_comment">
{% trans "not logged in" %}<br/>
<time class="submit_date" datetime='{% now "c" %}'>{% now "d. M. Y. H:i" %}</time>
<img src="{{STATIC_URL}}img/unknown_thumbnail.png" alt=""/>
</label>
<span>
{% url "membership-register" as register %}
{% url "login" as login %}
{% blocktrans with request.path_info as next %}<a href="{{ register }}">Register</a> now, or <a href="{{ login }}?next={{ next }}">Login</a> to leave a comment here.{% endblocktrans %}
</span>
<p class="buttonbar">
<a href="{{ register }}" class="button"><img src="{{STATIC_URL}}icons/user_add.png" />{% trans 'register' %}</a>
<a href="{{ login }}" class="button"><img src="{{STATIC_URL}}icons/lock_break.png" />{% trans 'login' %}</a>
</p>
{% endif %}
</fieldset>
<p>&nbsp;</p>
</form>