diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2012-11-12 19:22:56 +0100 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2012-11-12 19:22:56 +0100 |
| commit | 92cb8cbe8d516d6b14d38ff45a1781ff1d90663c (patch) | |
| tree | 5896d3c0ec443fa344e9d91c718de62c04c3fd8c | |
| parent | 186d07ce6d7d099e2e036dfc74d4e21898f249b0 (diff) | |
| download | famille-flask-92cb8cbe8d516d6b14d38ff45a1781ff1d90663c.tar.gz | |
Make the locale encoding explicit to work even when the system's config is weird
| -rw-r--r-- | famille.py | 2 | ||||
| -rw-r--r-- | templates/news/list.html | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -13,7 +13,7 @@ from datetime import datetime from bs4 import BeautifulSoup from flask_mail import Mail, Message import locale -locale.setlocale(locale.LC_ALL, 'fr_FR') +locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8') def rstify(string): w = Writer() diff --git a/templates/news/list.html b/templates/news/list.html index 99d1571..c0d7e0a 100644 --- a/templates/news/list.html +++ b/templates/news/list.html @@ -17,10 +17,10 @@ </table> <h2>Derniers commentaires</h2> -<ul> +<ul id="last-comments"> {% for comment in comments %} - <li><a href="{{url_for('view_user', user_id=comment.user_id)}}">{{comment.username}}</a> - {{comment.date|format_date}}<br/> + <li><a href="{{url_for('view_user', user_id=comment.user_id)}}">{{comment.user_name}}</a> + {{comment.date|format_date('%a %d %b à %Hh%M')}}<br/> {{comment.content_cache|shortify|safe}} <a href="{{url_for('show_news', news_id=comment.news_id)}}#comments">[…]</a> </li> {% else %} |
