diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2012-11-07 23:38:09 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2012-11-07 23:38:09 -0500 |
| commit | 9b2f907dfffd92b6f236d73cc5d0c3b9fb92cc53 (patch) | |
| tree | 00a0fdbd6506bad1eb9e2c12e90284e6e751504f /templates/news | |
| parent | d7e915f77c42f6d0c5a85e03d87106c27082ec99 (diff) | |
| download | famille-flask-9b2f907dfffd92b6f236d73cc5d0c3b9fb92cc53.tar.gz | |
fixed up the comment system
Diffstat (limited to 'templates/news')
| -rw-r--r-- | templates/news/list.html | 10 | ||||
| -rw-r--r-- | templates/news/show.html | 5 |
2 files changed, 11 insertions, 4 deletions
diff --git a/templates/news/list.html b/templates/news/list.html index c7ea740..b2bee8a 100644 --- a/templates/news/list.html +++ b/templates/news/list.html @@ -11,13 +11,17 @@ </h2> {% if news.user_name==session.user_name %} <div style="float:right"> - <a href="{{ url_for('edit_news', news_id = news.id)}}">Modifier cette actualité</a> + <a href="{{url_for('edit_news', news_id = news.id)}}">Modifier cette actualité</a> </div> {% endif %} - <p>Posté par <a href="{{ url_for('view_user', user_id = news.user_id)}}">{{ news.user_name }}</a> le {{news.date|format_date}}</p> + <p>Posté par <a href="{{url_for('view_user', user_id = news.user_id)}}">{{ news.user_name }}</a> le {{news.date|format_date}}</p> </div> + <p class="comments"> + <a href="{{url_for('show_news', news_id = news.id)}}#comments">{{news.ncomments|pluralize}}</a>| + <a href="{{url_for('show_news', news_id = news.id)}}#add">Ajouter un commentaire</a> +</p> <div class="news_content"> - {{ news.content_cache|safe }} + <p>{{ news.content_cache|safe }}</p> </div> {% endfor %} </div> diff --git a/templates/news/show.html b/templates/news/show.html index 782b0a4..dcc4e4a 100644 --- a/templates/news/show.html +++ b/templates/news/show.html @@ -18,9 +18,12 @@ <hr/> <h2 id="comments">Commentaires</h2> +{% if not comments %} +Pas de commentaires pour l'instant. +{% endif %} {% for comment in comments %} <h3 class="comment"> - Posté par <a href="{{url_for('view_user', comment.user_name)}}">{{comment.user_name}}</a> le {{comment.date|format_date}} + Posté par <a href="{{url_for('view_user', user_id=comment.user_id)}}">{{comment.user_name}}</a> le {{comment.date|format_date}} </h3> <div class="comment_content"/> {{comment.content_cache|safe}} |
