diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2012-11-07 22:22:58 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2012-11-07 22:22:58 -0500 |
| commit | d7e915f77c42f6d0c5a85e03d87106c27082ec99 (patch) | |
| tree | 41c5221cb470c6c0fc677c528f4b8deaec74922c /templates | |
| parent | e5ecbccd2aba5b7ce0c8ab363e2a5502f5c6b8c9 (diff) | |
| download | famille-flask-d7e915f77c42f6d0c5a85e03d87106c27082ec99.tar.gz | |
reworked the templates
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/layout.html | 4 | ||||
| -rw-r--r-- | templates/news/add.html | 33 | ||||
| -rw-r--r-- | templates/news/list.html | 16 | ||||
| -rw-r--r-- | templates/news/show.html | 2 |
4 files changed, 40 insertions, 15 deletions
diff --git a/templates/layout.html b/templates/layout.html index 39e00a8..dc9be11 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -11,8 +11,8 @@ <div class="container"> <div class="sheet"> <div class="top"> - {{session['user_name']}} - (<a href="/user/edit">Mon compte</a> | <a href="/logout">Se déconnecter</a>)</p> + <p><strong>{{session['user_name']}}</strong> + (<a href="/user/edit">Mon compte</a> | <a href="/logout">Se déconnecter</a>)</p> </div> <div class="main_menu"> <table> diff --git a/templates/news/add.html b/templates/news/add.html index 53fb682..91ee8ba 100644 --- a/templates/news/add.html +++ b/templates/news/add.html @@ -1,13 +1,32 @@ {% extends 'layout.html' %} {% block content %} +<h2>{% if news %}Modifier{% else %}Ajouter{% endif %} une actualité</h2> +<p class="info"> + Vous pouvez consulter la <a href="/home/help">page d'aide</a> pour obtenir de l'aide sur la syntaxe et les commandes de mise en forme disponibles. +</p> {% if news %} -<form action="{{ url_for('edit_news', news_id=news.id)}}" method="post"> -{% else %} -<form action="{{ url_for('add_news')}}" method="post"> -{% endif %} - <input type=text size=80 name=title value="{% if news %}{{news.title}}{% endif %}"/><br/> - <textarea name=content rows=20 cols=80>{% if news %}{{news.content}}{% endif %}</textarea> -<input type="submit" value="Submit" /> +<form class="news_add" action="{{ url_for('edit_news', news_id=news.id)}}" method="post"> + <p> + <label for="title">Titre :</label> + <input id="title" type="text" name="title" size="64" value="{{news.title}}"> + </p> + <label for="content">Contenu :</label> + <textarea rows="25" name="content">{{news.content}}</textarea> + <p class="submit"> + <input type="submit" value="Modifier"> + </p> + {% else %} +<form class="news_add" action="{{ url_for('add_news')}}" method="post"> + <p> + <label for="title">Titre :</label> + <input id="title" type="text" name="title" size="64"> + </p> + <label for="content">Contenu :</label> + <textarea rows="25" name="content"></textarea> + <p class="submit"> + <input type="submit" value="Ajouter"> + </p> + {% endif %} </form> {% endblock %} diff --git a/templates/news/list.html b/templates/news/list.html index a5a367a..c7ea740 100644 --- a/templates/news/list.html +++ b/templates/news/list.html @@ -1,15 +1,21 @@ {% extends 'layout.html' %} {% block content %} +<div class="second_menu"> + <a href="/news/add/">Ajouter une actualité</a> +</div> <div class="news"> {% for news in news %} <div class="news_head"> - <h2><a href="{{ url_for('show_news', news_id = news.id)}}"> - {{ news.title }}</a> - </h2> - <p>Posté par <a href="">{{ news.name }}</a> le {{news.date|format_date}}</p> + <h2><a href="{{url_for('show_news', news_id = news.id)}}">{{ news.title }}</a> + </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> + </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> </div> - <div class="news_content"> {{ news.content_cache|safe }} </div> diff --git a/templates/news/show.html b/templates/news/show.html index 7e03b5d..782b0a4 100644 --- a/templates/news/show.html +++ b/templates/news/show.html @@ -20,7 +20,7 @@ <h2 id="comments">Commentaires</h2> {% for comment in comments %} <h3 class="comment"> - Posté par <a href="">{{comment.name}}</a> le {{comment.date|format_date}} + Posté par <a href="{{url_for('view_user', comment.user_name)}}">{{comment.user_name}}</a> le {{comment.date|format_date}} </h3> <div class="comment_content"/> {{comment.content_cache|safe}} |
