Anfänglicher Commit: Producion Version Stand: Oktober 2014
This commit is contained in:
44
templates/comments/form.html
Normal file
44
templates/comments/form.html
Normal file
@@ -0,0 +1,44 @@
|
||||
{% 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> </p>
|
||||
</form>
|
||||
15
templates/comments/list.html
Normal file
15
templates/comments/list.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% load i18n django_markdown %}
|
||||
<table id="comments" class="layout">
|
||||
{% for comment in comment_list %}
|
||||
<tr id="c{{ comment.id }}">
|
||||
<td class="avatar">
|
||||
{% if comment.user.get_profile.thumbnail %}<img src="{{comment.user.get_profile.thumbnail.url}}" alt=""/>{% else %}<img src="{{STATIC_URL}}img/unknown_thumbnail.png" alt=""/>{% endif %}
|
||||
</td>
|
||||
<td class="userinfo">
|
||||
<a href="{{ comment.user.get_profile.get_absolute_url }}" class="user">{{comment.user}}</a>
|
||||
<div class="submit_date"><time time="{{comment.submit_date|time:'c'}}">{{comment.submit_date|timesince}}</time></div>
|
||||
</td>
|
||||
<td class="content">{{comment.comment|markdown_safe}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
8
templates/comments/posted.html
Normal file
8
templates/comments/posted.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Thank you for your comment" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% trans "Thank you for your comment" %}!</h1>
|
||||
{% endblock %}
|
||||
26
templates/comments/preview.html
Normal file
26
templates/comments/preview.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends "base.html" %}
|
||||
{% load i18n django_markdown %}
|
||||
|
||||
{% block title %}{% trans "Preview your comment" %}{% endblock %}
|
||||
|
||||
{% block maincontent %}
|
||||
{% if form.errors %}
|
||||
<h2>{% blocktrans count form.errors|length as counter %}Please correct the error below{% plural %}Please correct the errors below{% endblocktrans %}</h2>
|
||||
{% else %}
|
||||
<h2>{% trans "Preview your comment" %}</h2>
|
||||
<table id="comments" class="layout">
|
||||
<tr id="c{{ comment.id }}">
|
||||
<td class="avatar">
|
||||
{% if user.get_profile.thumbnail %}<img src="{{user.get_profile.thumbnail.url}}" alt=""/>{% else %}<img src="{{STATIC_URL}}img/unknown_thumbnail.png" alt=""/>{% endif %}
|
||||
</td>
|
||||
<td class="userinfo">
|
||||
<div class="user">{{user}}</div>
|
||||
<time class="submit_date" datetime='{% now "c" %}'>{% now "d. m. Y. h:i" %}</time>
|
||||
</td>
|
||||
<td class="content">{{comment|markdown_safe}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endif %}
|
||||
<br class="clear" />
|
||||
{% include "comments/form.html" %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user